/* ===== Fonts (self-hosted, no third-party requests) ===== */
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: italic; font-display: swap; src: url('../fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 300; font-style: normal; font-display: swap; src: url('../fonts/jost-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/jost-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/jost-latin-500-normal.woff2') format('woff2'); }

/* ===== Brand tokens ===== */
:root {
  --plum: #271C27;
  --amethyst: #49305F;
  --rose: #67374D;
  --lavender: #D9B7E8;
  --blush: #F2D8E3;
  --ivory: #FFF4FA;
  --gold: #D9B77D;

  --ink: var(--ivory);
  --ink-soft: rgba(255, 244, 250, .82);
  --ink-mute: rgba(242, 216, 227, .66);
  --line: rgba(217, 183, 232, .22);
  --panel: rgba(73, 48, 95, .28);
  --panel-strong: rgba(73, 48, 95, .45);

  --serif: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
  --sans: 'Jost', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;

  --radius: 22px;
  --max: 640px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--plum);
  color: var(--ink);
  font: 300 1.0625rem/1.7 var(--sans);
  letter-spacing: .005em;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--lavender); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ivory); color: var(--plum); padding: 8px 14px; border-radius: 99px; z-index: 10; }
.skip:focus { left: 12px; }

/* ===== Background glow ===== */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sky__glow {
  position: absolute; inset: -20%;
  background:
    radial-gradient(60% 45% at 50% 8%, rgba(73, 48, 95, .95) 0%, transparent 70%),
    radial-gradient(50% 40% at 85% 70%, rgba(103, 55, 77, .55) 0%, transparent 70%),
    radial-gradient(45% 35% at 10% 85%, rgba(73, 48, 95, .6) 0%, transparent 70%),
    var(--plum);
}

/* ===== Layout ===== */
main { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.stage { min-height: 100vh; min-height: 100svh; padding: 56px 0 40px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.stage.is-entering { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.stage--arrival { justify-content: center; }

/* ===== Type ===== */
.eyebrow { font: 500 .78rem/1.4 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
.display { font: 500 clamp(2.6rem, 11vw, 4.2rem)/1.02 var(--serif); margin: 0 0 16px; letter-spacing: -.01em; color: var(--ivory); text-wrap: balance; }
.display--sm { font-size: clamp(2.1rem, 9vw, 3.1rem); }
.display .kicker { display: block; font: 500 .78rem/1.4 var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 8px; }
.title { font: 500 clamp(1.9rem, 7.5vw, 2.6rem)/1.1 var(--serif); margin: 0 0 22px; text-wrap: balance; }
.title--script { font-style: italic; color: var(--blush); }
.title--sm { font-size: clamp(1.6rem, 6.5vw, 2.1rem); }
.subtitle { font: 500 italic clamp(1.25rem, 5vw, 1.5rem)/1.35 var(--serif); color: var(--blush); margin: 0 0 18px; text-wrap: balance; }
.lede { color: var(--ink-soft); max-width: 34ch; margin: 0 auto 32px; font-size: 1.08rem; }
.fineprint { font-size: .82rem; color: var(--ink-mute); margin-top: 18px; letter-spacing: .02em; }

.ornament { display: flex; align-items: center; gap: 12px; color: var(--gold); font-size: .9rem; margin: 6px auto 22px; justify-content: center; }
.ornament span { width: 54px; height: 1px; background: linear-gradient(90deg, transparent, rgba(217, 183, 125, .8)); }
.ornament span:last-child { transform: scaleX(-1); }

/* ===== Moon ===== */
.moon { width: 132px; height: 132px; margin-bottom: 18px; }
.moon__svg { width: 100%; height: 100%; overflow: visible; }
.moon__halo { animation: breathe 6s ease-in-out infinite; transform-origin: center; }
@keyframes breathe { 0%, 100% { opacity: .65; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }

/* ===== Buttons ===== */
.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 14px 30px; border-radius: 999px;
  font: 500 1rem/1.2 var(--sans); letter-spacing: .06em;
  transition: transform .2s ease, box-shadow .3s ease, background .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn--primary {
  color: var(--plum);
  background: linear-gradient(135deg, var(--blush) 0%, var(--lavender) 100%);
  box-shadow: 0 8px 30px -8px rgba(217, 183, 232, .55), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.btn--primary:hover { box-shadow: 0 10px 38px -6px rgba(217, 183, 232, .75), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn--ghost { color: var(--blush); background: transparent; box-shadow: inset 0 0 0 1px rgba(242, 216, 227, .45); }
.btn--ghost:hover { background: rgba(242, 216, 227, .08); }
.btn--gold { text-align: center; line-height: 1.3; color: var(--plum); background: linear-gradient(135deg, #EBD3A6, var(--gold)); box-shadow: 0 8px 28px -10px rgba(217, 183, 125, .7); }
.btn--link { background: none; color: var(--ink-mute); min-height: 44px; margin-top: 18px; font-weight: 400; letter-spacing: .04em; }
.btn--back { align-self: flex-start; background: none; color: var(--blush); min-height: 44px; padding: 8px 4px; font-weight: 400; letter-spacing: .04em; margin: -16px 0 8px; }
.btn--back:hover { color: var(--ivory); }
.btn--wide { width: 100%; margin-top: 8px; }

/* ===== Form ===== */
.panel {
  width: 100%; text-align: left;
  background: rgba(52, 35, 62, .9); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 20px 24px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.panel > .btn { width: 100%; margin-top: 6px; }
.label { display: block; font: 500 .78rem/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--lavender); margin-bottom: 10px; }
.optional { text-transform: none; letter-spacing: .02em; color: var(--ink-mute); font-weight: 300; }
.choice { border: 0; padding: 0; margin: 0 0 22px; }
.choice__row { display: grid; gap: 10px; }
.pill { position: relative; display: block; cursor: pointer; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pill span {
  display: block; padding: 15px 18px; border-radius: 16px;
  border: 1px solid var(--line); background: rgba(39, 28, 39, .5);
  color: var(--ink-soft); transition: all .25s ease;
}
.pill input:checked + span { border-color: var(--lavender); background: rgba(217, 183, 232, .14); color: var(--ivory); box-shadow: 0 0 0 1px var(--lavender) inset; }
.pill input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.field { margin-bottom: 20px; }
.input {
  width: 100%; min-height: 64px; padding: 12px 18px;
  border-radius: 16px; border: 1px solid rgba(217, 183, 232, .4);
  background: rgba(39, 28, 39, .65); color: var(--ivory);
  font: 500 2rem/1 var(--serif); letter-spacing: .08em; text-align: center;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input::placeholder { color: rgba(242, 216, 227, .3); }
.input:focus { outline: none; border-color: var(--lavender); box-shadow: 0 0 0 4px rgba(217, 183, 232, .16); }
.input[aria-invalid="true"] { border-color: #E9A2B6; }
.hint { font-size: .86rem; color: var(--ink-mute); margin: 8px 2px 0; line-height: 1.5; }
.error { font-size: .9rem; color: #F4B7C7; margin: 6px 2px 0; min-height: 0; }
.error:empty { display: none; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: .93rem; color: var(--ink-soft); margin: -4px 0 20px; cursor: pointer; line-height: 1.5; }
.check input { width: 22px; height: 22px; accent-color: var(--lavender); flex: none; margin-top: 1px; }

.convention { margin: 0 0 22px; font-size: .93rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 14px; }
.convention summary, details summary { cursor: pointer; color: var(--blush); list-style: none; display: flex; align-items: center; gap: 8px; min-height: 32px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '✧'; color: var(--gold); transition: transform .3s ease; display: inline-block; }
details[open] > summary::before { transform: rotate(45deg); }
.convention p { margin: 10px 0 0; }

/* ===== Reveal ===== */
.stage--reveal { padding-top: 40px; }
.reveal-head { margin-bottom: 26px; }
.orb {
  position: relative; width: 220px; height: 220px; margin: 6px auto 22px;
  display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(242, 216, 227, .3) 0%, rgba(103, 55, 77, .45) 40%, rgba(73, 48, 95, .25) 68%, transparent 72%);
}
.orb::before {
  content: ''; position: absolute; inset: 18%; border-radius: 50%;
  box-shadow: 0 0 60px 10px rgba(217, 183, 232, .35), 0 0 120px 30px rgba(103, 55, 77, .35);
  animation: pulse 5s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
.orb__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 80s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.orb__num {
  position: relative; display: block; font: 500 7.5rem/1 var(--serif); color: var(--ivory);
  text-shadow: 0 0 30px rgba(242, 216, 227, .55);
  font-variant-numeric: lining-nums; font-feature-settings: 'lnum' 1; /* every digit the same height */
  transform: translateY(var(--num-shift, 0));
}
.orb__master { position: absolute; bottom: 40px; font: 500 .78rem/1 var(--sans); letter-spacing: .22em; color: var(--gold); text-transform: uppercase; }
.stage--reveal.is-entering .orb { animation: bloom 1.1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes bloom { from { opacity: 0; transform: scale(.7); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

.keywords { font: 500 .8rem/1.6 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--lavender); margin: 0 0 8px; }
.steps { font-size: .88rem; color: var(--ink-mute); margin: 0; }
.karmic { max-width: 40ch; margin: 14px auto 0; font-size: .86rem; line-height: 1.6; color: var(--ink-mute); font-style: italic; }

/* ===== Reading cards ===== */
.reading { width: 100%; text-align: left; }
.reading__head { text-align: center; margin: 26px 0 8px; }
.reading__key { max-width: 38ch; margin: -8px auto 22px; font-size: .9rem; line-height: 1.6; color: var(--ink-mute); font-style: italic; }
.card {
  position: relative; width: 100%;
  background: linear-gradient(180deg, rgba(58, 38, 72, .92), rgba(45, 31, 50, .9));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 20px 22px; margin: 0 0 16px; text-align: left;
}
.card::after {
  content: ''; position: absolute; left: 22px; right: 22px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 183, 125, .55), transparent);
}
.card h3 { font: 500 1.65rem/1.15 var(--serif); margin: 0 0 12px; color: var(--ivory); }
.card p { margin: 0 0 14px; color: var(--ink-soft); font-weight: 400; }
.card li { font-weight: 400; }
.card p:last-child { margin-bottom: 0; }
.card__num { font: 500 italic 1rem/1 var(--serif) !important; color: var(--gold) !important; margin: 0 0 6px !important; letter-spacing: .1em; }
.card__note { font-size: .9rem; color: var(--ink-mute) !important; font-style: italic; }
.card--soft { background: rgba(39, 28, 39, .9); }
.card--soft h3, .card--master h3 { font-size: 1.35rem; }
.card--master { border-color: rgba(217, 183, 125, .45); background: linear-gradient(180deg, rgba(85, 47, 70, .94), rgba(55, 36, 66, .92)); }
.tag { display: inline-block; font: 500 .7rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }

.prompts, .plan, .ritual { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: item; }
.prompts li, .plan li, .ritual li { position: relative; padding-left: 40px; margin-bottom: 16px; color: var(--ink-soft); counter-increment: item; }
.prompts li::before, .plan li::before, .ritual li::before {
  content: counter(item); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(217, 183, 125, .6); color: var(--gold);
  font: 500 .95rem/1 var(--serif);
}
.prompts li:last-child, .plan li:last-child, .ritual li:last-child { margin-bottom: 0; }
.plan strong, .prompts strong { color: var(--ivory); font-weight: 500; }

.goals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.goal {
  appearance: none; cursor: pointer; min-height: 64px; padding: 12px 10px;
  border-radius: 16px; border: 1px solid var(--line); background: rgba(39, 28, 39, .5);
  color: var(--ink-soft); font: 400 1rem/1.2 var(--sans); letter-spacing: .03em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: all .25s ease;
}
.goal span { font-size: 1.15rem; color: var(--gold); }
.goal[aria-checked="true"] { border-color: var(--lavender); background: rgba(217, 183, 232, .16); color: var(--ivory); box-shadow: 0 0 0 1px var(--lavender) inset, 0 6px 24px -10px rgba(217, 183, 232, .6); }
.goal:last-child:nth-child(odd) { grid-column: 1 / -1; }

.swatches { display: flex; gap: 8px; margin: 4px 0 14px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255, 244, 250, .35); }
.adjust-math { font: 500 1.9rem/1.2 var(--serif); color: var(--ivory); text-align: center; margin: 10px 0 16px !important; letter-spacing: .04em; }
.adjust-math em { color: var(--gold); font-style: normal; }
.honesty { border-left: 2px solid rgba(217, 183, 125, .55); padding-left: 14px; font-size: .92rem; }

.ritual-title { font: 500 italic 1.3rem/1.3 var(--serif) !important; color: var(--blush) !important; }
.ritual-close { text-wrap: balance; font: 500 italic 1.2rem/1.4 var(--serif) !important; color: var(--ivory) !important; margin-top: 18px !important; text-align: center; }
.ritual-close::before, .ritual-close::after { content: '✧'; color: var(--gold); font-style: normal; font-size: .8rem; margin: 0 10px; vertical-align: middle; }

.card--affirm { text-align: center; background: radial-gradient(120% 90% at 50% 0%, rgba(103, 55, 77, .95), rgba(52, 35, 62, .94)); }
.card--affirm h3 { text-align: center; }
.card--affirm .card__num { text-align: center; }
.card blockquote { margin: 8px 0 22px; font: 500 italic clamp(1.45rem, 6vw, 1.8rem)/1.3 var(--serif); color: var(--ivory); text-wrap: balance; }
.reflection { border-top: 1px solid var(--line); padding-top: 16px; }
.reflection span { display: block; font: 500 .72rem/1.4 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--lavender); margin-bottom: 6px; }
.reflection em { display: block; text-wrap: balance; font: 500 italic 1.2rem/1.4 var(--serif); color: var(--blush); }

.share-preview { margin: 16px auto; max-width: 280px; border-radius: 18px; overflow: hidden; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .7), 0 0 0 1px var(--line); aspect-ratio: 9 / 16; background: var(--amethyst); }
.share-preview img { width: 100%; height: 100%; object-fit: cover; }
.share-actions { display: grid; gap: 10px; }
.share-actions .btn { width: 100%; }
.toast { text-align: center; font-size: .9rem; color: var(--gold) !important; min-height: 1.4em; margin-top: 10px !important; }

.card--evidence summary { font: 500 1.2rem/1.3 var(--serif); color: var(--blush); }
.card--evidence .card__note { margin-top: 12px; }
.evidence { padding: 12px 0; border-top: 1px solid var(--line); }
.evidence h4 { margin: 0 0 4px; font: 500 .8rem/1.4 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--lavender); }
.evidence p { font-size: .95rem; margin-bottom: 4px; }
.evidence small { color: var(--ink-mute); font-size: .8rem; }

.invite {
  width: 100%; margin: 36px 0 10px; padding: 34px 22px; text-align: center;
  border-radius: var(--radius); border: 1px solid rgba(217, 183, 125, .35);
  background: radial-gradient(100% 80% at 50% 0%, rgba(217, 183, 125, .1), transparent 70%), rgba(39, 28, 39, .5);
}
.invite p { color: var(--ink-soft); max-width: 36ch; margin: 0 auto 22px; }

/* ===== Footer ===== */
.footer { max-width: var(--max); margin: 0 auto; padding: 28px 16px 48px; text-align: center; color: var(--ink-mute); font-size: .82rem; line-height: 1.6; }
.footer__brand { font: 500 1.1rem/1.4 var(--serif); color: var(--blush); letter-spacing: .04em; }
.footer__brand a { color: var(--lavender); text-decoration: none; }
.footer__disclaimer { max-width: 52ch; margin: 10px auto 14px; }
.footer__sources { text-align: left; max-width: 52ch; margin: 0 auto; }
.footer__sources summary { justify-content: center; font-size: .85rem; }
.footer__sources ul { padding-left: 18px; }
.footer__sources li { margin-bottom: 6px; }

/* ===== Larger screens ===== */
@media (min-width: 640px) {
  .stage { padding-top: 80px; }
  .card { padding: 32px 30px 28px; }
  .panel { padding: 32px 30px; }
  .choice__row { grid-template-columns: 1fr 1fr; }
  .goals { grid-template-columns: repeat(5, 1fr); }
  .goal:last-child:nth-child(odd) { grid-column: auto; }
  .share-actions { grid-template-columns: 1fr 1fr 1fr; }
  .share-actions .btn { padding: 14px 16px; }
  .orb { width: 250px; height: 250px; }
  .orb__num { font-size: 8.5rem; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
