.csp {
  --csp-ink: #f4efe4;
  --csp-muted: #bbb3c8;
  --csp-gold: #d9b96e;
  --csp-gold-soft: rgba(217, 185, 110, .17);
  --csp-violet: #a995d6;
  --csp-panel: #0d0c15;
  --csp-panel-2: #14111d;
  --csp-line: rgba(228, 211, 173, .18);
  --csp-sigil: #d9b96e;
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 1.25rem auto 2rem;
  overflow: hidden;
  border: 1px solid rgba(218, 190, 126, .26);
  border-radius: 24px;
  color: var(--csp-ink);
  background:
    radial-gradient(circle at 16% 12%, rgba(78, 55, 119, .13), transparent 31rem),
    linear-gradient(180deg, #090811 0%, #0c0a13 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .32);
  isolation: isolate;
}

.csp *, .csp *::before, .csp *::after { box-sizing: border-box; }
.csp button, .csp textarea { font: inherit; }
.csp button { -webkit-tap-highlight-color: transparent; }
.csp [hidden] { display: none !important; }

.csp::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .22;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.18) 0 1px, transparent 1.3px),
    radial-gradient(circle, rgba(217,185,110,.15) 0 1px, transparent 1.4px);
  background-position: 0 0, 27px 39px;
  background-size: 83px 83px, 111px 111px;
}

.csp-kicker {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--csp-gold);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.csp-kicker::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
  opacity: .75;
}

.csp-hero {
  position: relative;
  min-height: 570px;
  overflow: hidden;
  display: grid;
  align-items: end;
}

.csp-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.csp-hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 5, 11, .94) 0%, rgba(5, 5, 11, .76) 38%, rgba(5, 5, 11, .17) 72%),
    linear-gradient(0deg, #0b0912 0%, transparent 33%, rgba(3, 3, 8, .15) 100%);
}

.csp-hero-copy {
  position: relative;
  z-index: 1;
  width: min(610px, 64%);
  padding: clamp(2.4rem, 6vw, 5.5rem);
  padding-right: 1rem;
}

.csp-hero-copy h2,
.csp-intro h2,
.csp-opening h2,
.csp-result-head h2,
.csp-guide h3 {
  margin: .7rem 0 .85rem;
  color: #faf5eb;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.03;
}

.csp-hero-copy h2 { font-size: clamp(2.55rem, 5.3vw, 4.85rem); }
.csp-hero-copy > p {
  max-width: 54ch;
  margin: 0;
  color: #d8d2df;
  font-size: clamp(1rem, 1.7vw, 1.16rem);
  line-height: 1.65;
}

.csp-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.45rem;
}

.csp-hero-points span {
  padding: .55rem .78rem;
  border: 1px solid rgba(227, 201, 142, .3);
  border-radius: 999px;
  color: #ede3ca;
  background: rgba(7, 7, 13, .58);
  backdrop-filter: blur(8px);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .035em;
}

.csp-body { padding: clamp(1rem, 3vw, 2.1rem); }

.csp-form-panel,
.csp-opening,
.csp-result {
  width: min(940px, 100%);
  margin: 0 auto;
  border: 1px solid var(--csp-line);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(28, 22, 37, .93), rgba(10, 9, 16, .97));
  box-shadow: inset 0 1px rgba(255, 255, 255, .025), 0 22px 60px rgba(0,0,0,.22);
}

.csp-form-panel { padding: clamp(1.35rem, 4vw, 3.1rem); }
.csp-intro { max-width: 720px; margin: 0 auto 1.8rem; text-align: center; }
.csp-intro h2,
.csp-opening h2,
.csp-result-head h2 { font-size: clamp(2rem, 4.4vw, 3.35rem); }
.csp-intro > p,
.csp-result-head > p {
  max-width: 62ch;
  margin: 0 auto;
  color: var(--csp-muted);
  line-height: 1.65;
}

.csp-form { width: min(690px, 100%); margin: 0 auto; }
.csp-form > label {
  display: block;
  margin-bottom: .55rem;
  color: #eee4cd;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.csp-input-wrap { position: relative; }
.csp-intent {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: 1.05rem 1.05rem 2rem;
  border: 1px solid rgba(211, 186, 132, .3);
  border-radius: 14px;
  outline: none;
  color: #fbf6ec;
  background: rgba(5, 5, 10, .65);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  line-height: 1.55;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.csp-intent::placeholder { color: #81798a; }
.csp-intent:focus {
  border-color: rgba(217, 185, 110, .72);
  background: rgba(5, 5, 10, .86);
  box-shadow: 0 0 0 4px rgba(217, 185, 110, .08);
}

.csp-counter {
  position: absolute;
  right: .85rem;
  bottom: .6rem;
  color: #928a9b;
  font-size: .7rem;
}

.csp-examples,
.csp-style-picker,
.csp-color-picker {
  min-width: 0;
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
}

.csp-examples legend,
.csp-style-picker legend,
.csp-color-picker legend {
  margin-bottom: .6rem;
  color: #aaa2b2;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.csp-examples > div { display: flex; flex-wrap: wrap; gap: .5rem; }
.csp-examples button {
  padding: .55rem .72rem;
  border: 1px solid rgba(169, 149, 214, .24);
  border-radius: 999px;
  color: #cfc5db;
  background: rgba(35, 27, 51, .44);
  cursor: pointer;
  font-size: .76rem;
  transition: color .18s ease, border-color .18s ease, transform .18s ease;
}

.csp-examples button:hover,
.csp-examples button:focus-visible {
  color: #fff8e9;
  border-color: rgba(217, 185, 110, .55);
  transform: translateY(-1px);
}

.csp-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  min-height: 54px;
  margin-top: 1.25rem;
  padding: .85rem 1.2rem;
  border: 1px solid #e0c57f;
  border-radius: 12px;
  color: #100d14;
  background: linear-gradient(135deg, #f0d996, #c89d45);
  box-shadow: 0 12px 30px rgba(186, 139, 55, .2);
  cursor: pointer;
  font-weight: 850;
  letter-spacing: .035em;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.csp-create:hover,
.csp-create:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(186, 139, 55, .27);
}

.csp-form-error {
  min-height: 1.25rem;
  margin: .65rem 0 0;
  color: #f0a2a8;
  font-size: .8rem;
  text-align: center;
}

.csp-local-note {
  display: block;
  margin-top: .15rem;
  color: #7f7887;
  font-size: .7rem;
  text-align: center;
}

.csp-opening {
  min-height: 520px;
  padding: clamp(2.2rem, 6vw, 4.3rem) 1.2rem;
  text-align: center;
}

.csp-opening header { max-width: 700px; margin: 0 auto; }
.csp-opening-seal {
  position: relative;
  width: 230px;
  aspect-ratio: 1;
  margin: 2.25rem auto 1.6rem;
  border: 1px solid rgba(217, 185, 110, .34);
  border-radius: 50%;
  box-shadow: 0 0 55px rgba(119, 82, 169, .12), inset 0 0 42px rgba(217,185,110,.04);
  animation: csp-breathe 2s ease-in-out infinite;
}

.csp-opening-seal::before,
.csp-opening-seal::after,
.csp-opening-seal span,
.csp-opening-seal i,
.csp-opening-seal b {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 58%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--csp-gold), transparent);
  transform-origin: center;
  box-shadow: 0 0 8px rgba(217,185,110,.5);
}

.csp-opening-seal::before { transform: translate(-50%, -50%) rotate(18deg); }
.csp-opening-seal::after { transform: translate(-50%, -50%) rotate(91deg); }
.csp-opening-seal span { transform: translate(-50%, -50%) rotate(145deg); }
.csp-opening-seal i { transform: translate(-50%, -50%) rotate(218deg); }
.csp-opening-seal b { transform: translate(-50%, -50%) rotate(292deg); }
.csp-opening-status { margin: 0; color: #e9ddc2; font-family: Georgia, serif; font-size: 1.08rem; }
.csp-opening-count { display: block; margin-top: .35rem; color: #8f8798; }
.csp-progress {
  width: min(410px, 82%);
  height: 3px;
  margin: 1.1rem auto 0;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.07);
}
.csp-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8c6bb9, #e1bf72);
  transition: width .55s ease;
}

.csp-result { padding: clamp(1.25rem, 4vw, 3rem); }
.csp-result-head { max-width: 760px; margin: 0 auto 1.8rem; text-align: center; }
.csp-result-main {
  display: grid;
  grid-template-columns: minmax(310px, 1.12fr) minmax(250px, .88fr);
  gap: clamp(1.1rem, 3vw, 2rem);
  align-items: center;
}

.csp-sigil-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(217, 185, 110, .26);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(65, 50, 89, .3), transparent 48%),
    radial-gradient(circle, #12101b 0 58%, #090810 72%);
  box-shadow: inset 0 0 55px rgba(0,0,0,.64), 0 20px 45px rgba(0,0,0,.3);
}

.csp-stage-ring {
  position: absolute;
  inset: 5.8%;
  border: 1px solid rgba(217,185,110,.24);
  border-radius: 50%;
}

.csp-stage-ring::before,
.csp-stage-ring::after {
  content: "";
  position: absolute;
  inset: 5%;
  border: 1px solid rgba(169,149,214,.12);
  border-radius: 50%;
}
.csp-stage-ring::after { inset: 13%; border-color: rgba(217,185,110,.08); }

.csp-sigil {
  position: relative;
  z-index: 1;
  width: 91%;
  height: 91%;
  overflow: visible;
  color: var(--csp-sigil);
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--csp-sigil) 45%, transparent));
}

.csp-sigil .csp-draw-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 4.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.csp-sigil .csp-frame,
.csp-sigil .csp-ornament {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  opacity: .38;
}
.csp-sigil .csp-frame { stroke-width: 1.25; }
.csp-sigil .csp-ornament { stroke-width: 1.7; }
.csp-sigil .csp-start { fill: #0c0a13; stroke: currentColor; stroke-width: 3; }
.csp-sigil .csp-end { stroke: currentColor; stroke-width: 4; stroke-linecap: round; }
.csp-sigil.is-drawing .csp-draw-path { animation: csp-draw 1.25s cubic-bezier(.55,0,.25,1) both; }
.csp-sigil.is-drawing .csp-start,
.csp-sigil.is-drawing .csp-end,
.csp-sigil.is-drawing .csp-frame,
.csp-sigil.is-drawing .csp-ornament { animation: csp-appear .55s .9s both; }

.csp-result-copy { min-width: 0; }
.csp-intention-card,
.csp-letters-card {
  padding: 1rem 1.05rem;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 14px;
  background: rgba(4, 4, 9, .44);
}
.csp-letters-card { margin-top: .65rem; }
.csp-intention-card small,
.csp-letters-card small {
  display: block;
  color: var(--csp-gold);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.csp-intention-card blockquote {
  margin: .55rem 0 0;
  color: #f8f0df;
  font-family: Georgia, serif;
  font-size: clamp(1.1rem, 2.5vw, 1.38rem);
  font-style: italic;
  line-height: 1.42;
  overflow-wrap: anywhere;
}
.csp-letters-card strong {
  display: block;
  margin-top: .48rem;
  color: #eee5d3;
  font-size: 1.05rem;
  letter-spacing: .22em;
  overflow-wrap: anywhere;
}

.csp-style-picker > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: .42rem; }
.csp-style-picker button {
  min-height: 40px;
  padding: .55rem .45rem;
  border: 1px solid rgba(217,185,110,.18);
  border-radius: 9px;
  color: #aaa2b2;
  background: rgba(0,0,0,.2);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 750;
}
.csp-style-picker button[aria-pressed="true"] {
  color: #120f16;
  border-color: #d9b96e;
  background: #d9b96e;
}

.csp-color-picker > div { display: flex; gap: .65rem; }
.csp-color-picker button {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 3px #121019;
  cursor: pointer;
}
.csp-color-picker button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid var(--swatch);
  border-radius: 50%;
}

.csp-method {
  margin-top: 1.35rem;
  border: 1px solid rgba(217,185,110,.14);
  border-radius: 14px;
  background: rgba(4,4,9,.34);
}
.csp-method summary {
  padding: .95rem 1.05rem;
  color: #ddd3be;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 800;
}
.csp-method-body { padding: 0 1.05rem 1.1rem; border-top: 1px solid rgba(255,255,255,.06); }
.csp-method-body h3 { margin: 1rem 0 .6rem; color: #f2e9d7; font-family: Georgia, serif; font-size: 1.35rem; }
.csp-method-body ol { margin: .6rem 0 1rem; padding-left: 1.25rem; color: #bcb4c5; line-height: 1.65; }
.csp-method-body li + li { margin-top: .28rem; }
.csp-method-body dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin: 0; }
.csp-method-body dl > div { min-width: 0; padding: .75rem; border-radius: 10px; background: rgba(255,255,255,.035); }
.csp-method-body dt { color: #908899; font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.csp-method-body dd { margin: .4rem 0 0; color: #eadfc8; font-weight: 750; letter-spacing: .08em; overflow-wrap: anywhere; }

.csp-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin-top: 1rem;
}
.csp-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 46px;
  padding: .65rem .55rem;
  border: 1px solid rgba(217,185,110,.25);
  border-radius: 10px;
  color: #ded4c1;
  background: rgba(21,17,29,.78);
  cursor: pointer;
  font-size: .75rem;
  font-weight: 800;
  transition: transform .16s ease, border-color .16s ease, color .16s ease;
}
.csp-actions button:hover,
.csp-actions button:focus-visible { color: #fff6df; border-color: rgba(217,185,110,.65); transform: translateY(-1px); }
.csp-actions .csp-share { color: #130f16; border-color: #d9b96e; background: linear-gradient(135deg, #ead28e, #c79c44); }
.csp-share-status { min-height: 1.2rem; margin: .7rem 0 0; color: #cfc3dd; font-size: .76rem; text-align: center; }
.csp-disclaimer { margin: .2rem 0 0; color: #77717f; font-size: .67rem; text-align: center; }

.csp-guide {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: clamp(1.25rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(2rem, 5vw, 4rem);
  border-top: 1px solid rgba(217,185,110,.13);
  background: linear-gradient(135deg, rgba(32,24,44,.64), rgba(8,8,13,.68));
}
.csp-guide h3 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); }
.csp-guide-copy > p { margin: 0; color: #aaa3b2; line-height: 1.65; }
.csp-guide ol { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.csp-guide li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: .8rem;
  align-items: center;
  padding: .8rem;
  border: 1px solid rgba(217,185,110,.12);
  border-radius: 12px;
  background: rgba(3,3,8,.24);
}
.csp-guide li b {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(217,185,110,.42);
  border-radius: 50%;
  color: var(--csp-gold);
  font-family: Georgia, serif;
  font-weight: 500;
}
.csp-guide li span { min-width: 0; }
.csp-guide li strong { display: block; color: #ede5d4; font-size: .88rem; }
.csp-guide li small { display: block; margin-top: .2rem; color: #97909f; line-height: 1.45; }

@keyframes csp-breathe {
  0%, 100% { transform: scale(.96) rotate(-2deg); opacity: .72; }
  50% { transform: scale(1.02) rotate(2deg); opacity: 1; }
}
@keyframes csp-draw { from { stroke-dashoffset: var(--path-length, 1200); } to { stroke-dashoffset: 0; } }
@keyframes csp-appear { from { opacity: 0; } to { opacity: .72; } }

@media (max-width: 860px) {
  .csp-hero { min-height: 540px; align-items: end; }
  .csp-hero-veil {
    background:
      linear-gradient(0deg, #0a0911 0%, rgba(5,5,11,.78) 48%, rgba(4,4,9,.12) 100%),
      linear-gradient(90deg, rgba(5,5,10,.28), transparent);
  }
  .csp-hero-copy { width: 100%; padding: 2rem 1.35rem 2.2rem; }
  .csp-hero-copy > p { max-width: 60ch; }
  .csp-result-main { grid-template-columns: 1fr; }
  .csp-sigil-stage { width: min(520px, 100%); margin: 0 auto; }
  .csp-result-copy { width: min(620px, 100%); margin: 0 auto; }
  .csp-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .csp { margin-top: .75rem; border-radius: 18px; }
  .csp-hero { min-height: 500px; }
  .csp-hero > img { object-position: 57% center; }
  .csp-hero-copy h2 { font-size: clamp(2.25rem, 11vw, 3.25rem); }
  .csp-hero-points { gap: .4rem; }
  .csp-hero-points span { padding: .45rem .6rem; font-size: .65rem; }
  .csp-body { padding: .7rem; }
  .csp-form-panel, .csp-result { padding: 1.2rem .85rem; border-radius: 15px; }
  .csp-intro { margin-bottom: 1.2rem; }
  .csp-intro h2, .csp-opening h2, .csp-result-head h2 { font-size: 2.05rem; }
  .csp-intent { min-height: 108px; font-size: 1.04rem; }
  .csp-examples > div { display: grid; grid-template-columns: 1fr; }
  .csp-examples button { text-align: left; }
  .csp-opening { min-height: 480px; padding: 2rem .85rem; }
  .csp-opening-seal { width: 190px; }
  .csp-result-head { margin-bottom: 1.15rem; }
  .csp-result-main { gap: 1rem; }
  .csp-sigil-stage { width: min(100%, 430px); }
  .csp-method-body dl { grid-template-columns: 1fr; }
  .csp-actions { grid-template-columns: 1fr; }
  .csp-actions button { min-height: 48px; }
  .csp-guide { grid-template-columns: 1fr; padding: 2rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .csp *, .csp *::before, .csp *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
