/* ============================================================
   MARVELOUS CO — Brand Magic
   Shared stylesheet for all pages. Edit colors/fonts here once
   and every page updates. Palette + fonts from 2026 Brand Guide.
   ============================================================ */

/* ---------- Brand tokens (change these to retheme) ---------- */
:root {
  --black:      #000000;
  --charcoal:   #1A1A1A;   /* body text on light, dark section bg */
  --ink:        #0d0d0f;   /* near-black hero bg */
  --deep-gold:  #8A6820;   /* shadow / depth */
  --gold:       #CDA34D;   /* primary brand color */
  --gold-light: #E8C070;   /* highlights */
  --bronze:     #5A4520;   /* secondary text */
  --cream:      #F8F5F0;   /* light background */
  --white:      #FFFFFF;

  --font-display: 'Cinzel', Georgia, serif;       /* headers, nav, labels */
  --font-body:    'Cormorant Garamond', Georgia, serif; /* body copy */
  --font-script:  'Great Vibes', cursive;          /* magic accent words */

  --maxw: 1140px;
  --gold-grad: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--deep-gold));
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-x: hidden; max-width: 100%; }

/* visually hidden but still readable by screen readers / crawlers —
   used to keep heading hierarchy correct (h1 > h2 > h3...) without
   forcing a visible heading where the design doesn't want one */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body {
  font-family: var(--font-body);
  font-size: 1.25rem;          /* Cormorant runs small; bump up */
  line-height: 1.7;
  color: var(--charcoal);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--deep-gold); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold); }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5.5rem 0; }
.section--tight { padding: 3.5rem 0; }
.center { text-align: center; }

/* Dark sections (the "night sky" — subtle star texture) */
.section--dark {
  background-color: var(--ink);
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(232,192,112,.55), transparent),
    radial-gradient(1px 1px at 70% 65%, rgba(205,163,77,.5), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(232,192,112,.4), transparent),
    radial-gradient(1.5px 1.5px at 85% 20%, rgba(205,163,77,.45), transparent),
    radial-gradient(1px 1px at 55% 15%, rgba(232,192,112,.35), transparent),
    radial-gradient(1px 1px at 10% 75%, rgba(205,163,77,.4), transparent);
  color: var(--cream);
}
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--white); }
.section--charcoal { background: var(--charcoal); color: var(--cream); }
.section--charcoal h2, .section--charcoal h3 { color: var(--white); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.18;
  color: var(--charcoal);
  letter-spacing: .02em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.7rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
p { margin-bottom: 1.1rem; }
.lead { font-size: 1.5rem; line-height: 1.6; }

/* accent word in the brand script font */
.script {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 1.35em;
  color: var(--gold);
  letter-spacing: .01em;
}
.section--dark .script { color: var(--gold-light); }

/* gold gradient text for emphasis inside headings */
.shimmer {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}

/* small uppercase label above headings (Cinzel) */
.eyebrow {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: .8rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--deep-gold); /* darker gold on light sections — passes WCAG AA (4.73:1 on cream) */
  display: inline-block;
  margin-bottom: 1rem;
}
.section--dark .eyebrow { color: var(--gold-light); }

/* gold hairline divider with a centered star */
.rule {
  border: 0;
  height: 1px;
  width: 120px;
  margin: 1.4rem auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  position: relative;
}
.rule::after {
  content: "✦";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--gold);
  background: inherit;
  font-size: .85rem;
}
.section--dark .rule::after,
.hero .rule::after { background: transparent; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .95rem 2rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all .25s ease;
  border: 1px solid var(--gold);
}
.btn--primary {
  background: var(--gold-grad);
  color: var(--black);
  box-shadow: 0 4px 24px rgba(205,163,77,.25);
}
.btn--primary:hover {
  color: var(--black);
  box-shadow: 0 6px 34px rgba(232,192,112,.55);
  transform: translateY(-2px);
}
.btn--ghost { background: transparent; color: var(--gold); }
.btn--ghost:hover { background: rgba(205,163,77,.12); color: var(--gold-light); }
.btn + .btn { margin-left: .8rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,12,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(205,163,77,.2);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.nav__logo img { height: 38px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 1.8rem; list-style: none; }
.nav__links a {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream);
}
.nav__links a:hover,
.nav__links a.active { color: var(--gold-light); }
.nav__cta { padding: .55rem 1.2rem !important; font-size: .72rem !important; }
.nav__toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  color: var(--gold); font-size: 1.6rem;
}

/* ---------- Hero ---------- */
.hero {
  background-color: var(--ink);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(205,163,77,.16), transparent 60%),
    radial-gradient(1px 1px at 15% 40%, rgba(232,192,112,.6), transparent),
    radial-gradient(1px 1px at 80% 30%, rgba(205,163,77,.5), transparent),
    radial-gradient(1.5px 1.5px at 65% 70%, rgba(232,192,112,.5), transparent),
    radial-gradient(1px 1px at 30% 75%, rgba(205,163,77,.45), transparent),
    radial-gradient(1px 1px at 90% 60%, rgba(232,192,112,.4), transparent),
    radial-gradient(1px 1px at 8% 80%, rgba(205,163,77,.4), transparent);
  color: var(--cream);
  text-align: center;
  padding: 7rem 0 6rem;
}
.hero h1 { color: var(--white); margin-bottom: 1.4rem; }
.hero .lead { color: var(--cream); max-width: 720px; margin: 0 auto 2rem; opacity: .92; }
.hero__actions { margin-top: 2.2rem; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.6rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white);
  border: 1px solid rgba(138,104,32,.18);
  border-radius: 4px;
  padding: 2rem;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(138,104,32,.16);
  border-color: var(--gold);
}
.card h3 { margin-bottom: .6rem; }
.card .eyebrow { margin-bottom: .5rem; }
.card__link {
  font-family: var(--font-display);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* cards on actual dark sections (kept for any future .card used inside
   .section--dark — currently no page relies on this variant) */
.section--dark .card {
  background: rgba(255,255,255,.07);
  border-color: rgba(205,163,77,.4);
  color: var(--cream);
}
.section--dark .card h3 { color: var(--white); }

/* .card--dark: the gold-accented card variant actually used site-wide —
   every current usage (mpe, diagnostic, excalibur, beacon pages) sits on a
   light/cream section, so this needs dark text, not near-white. */
.card--dark {
  background: var(--white);
  border-color: rgba(205,163,77,.5);
  color: var(--charcoal);
}
.card--dark h3 { color: var(--ink); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: center; }
.stat__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: var(--gold);
  line-height: 1.1;
}
.stat__label { font-size: 1.05rem; letter-spacing: .04em; opacity: .85; }
.stats__note { font-size: .95rem; opacity: .6; margin-top: 2rem; font-style: italic; }

/* ---------- Phase steps (MPE) ---------- */
.phase {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.4rem;
  align-items: start;
  padding: 1.6rem 0;
  border-bottom: 1px solid rgba(205,163,77,.2);
}
.phase:last-child { border-bottom: 0; }
.phase__no {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
  opacity: .7;
}
.phase__no small { display:block; font-size:.62rem; letter-spacing:.25em; text-transform:uppercase; opacity:.8;}

/* ---------- Tiers ---------- */
.tier { display: flex; flex-direction: column; }
.tier__badge {
  font-family: var(--font-display); font-size:.8rem; letter-spacing:.18em;
  text-transform: uppercase; color: var(--deep-gold); margin-bottom:.4rem; /* was gold-light: 1.58:1 on the white card, failed WCAG AA */
}
.tier__price { font-family: var(--font-display); font-size:1.9rem; color: var(--ink); margin:.3rem 0; }
.tier__price span { color: var(--bronze); }
.tier__meta { font-size: 1.05rem; color: var(--bronze); margin-bottom: 1rem; }
.tier p { color: var(--charcoal); }
.tier--feature { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 10px 40px rgba(205,163,77,.2); }
.tier .btn { margin-top: auto; }

/* ---------- Archetypes (Excalibur) ---------- */
.knights { display:flex; flex-wrap:wrap; justify-content:center; gap:1rem; margin-top:2rem; }
.knight {
  width: 96px; height: 96px; border-radius: 50%;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  border: 1px solid rgba(205,163,77,.45);
  background: rgba(205,163,77,.06);
  transition: all .25s ease;
}
.knight:hover { border-color: var(--gold-light); box-shadow: 0 0 24px rgba(232,192,112,.4); transform: translateY(-3px);}
.knight__letter { font-family: var(--font-display); font-size:1.7rem; color: var(--gold-light); }
.knight__name { font-family: var(--font-display); font-size:.62rem; letter-spacing:.12em; text-transform:uppercase; color: var(--cream); opacity:.8;}

/* ---------- Excalibur interactive assessment ---------- */
.exq-intro { max-width: 760px; margin: 2rem auto 0; text-align: center; }
.exq-intro .lead { margin-bottom: 1.6rem; }

#excalibur-app { max-width: 760px; margin: 0 auto; }

.exq {
  background: var(--white);
  border: 1px solid rgba(138,104,32,.2);
  border-radius: 6px;
  padding: 2rem;
  box-shadow: 0 14px 44px rgba(138,104,32,.12);
}
.exq__bar { height: 4px; border-radius: 4px; background: rgba(138,104,32,.18); overflow: hidden; margin-bottom: 1.4rem; }
.exq__bar-fill { display: block; height: 100%; background: var(--gold-grad); transition: width .4s ease; }
.exq__meta { font-family: var(--font-display); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--bronze); margin-bottom: .8rem; }
.exq__meta em { font-style: italic; text-transform: none; letter-spacing: .02em; color: var(--deep-gold); }
.exq__q { font-size: clamp(1.25rem, 2.4vw, 1.55rem); line-height: 1.3; margin-bottom: 1.4rem; }
.exq__opts { display: grid; gap: .7rem; }
.exq__opt {
  display: flex; align-items: flex-start; gap: .9rem;
  width: 100%; text-align: left; cursor: pointer;
  font-family: var(--font-body); font-size: 1.12rem; line-height: 1.4; color: var(--charcoal);
  background: var(--cream);
  border: 1px solid rgba(138,104,32,.22);
  border-radius: 4px;
  padding: .9rem 1rem;
  transition: border-color .18s ease, background .18s ease, transform .12s ease, box-shadow .18s ease;
}
.exq__opt:hover, .exq__opt:focus-visible {
  border-color: var(--gold);
  background: rgba(205,163,77,.08);
  box-shadow: 0 6px 18px rgba(138,104,32,.14);
  transform: translateY(-1px);
  outline: none;
}
.exq__opt-key {
  flex: 0 0 auto;
  font-family: var(--font-display); font-weight: 600; font-size: .82rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--deep-gold); background: rgba(205,163,77,.14); border: 1px solid rgba(205,163,77,.4);
}
.exq__opt:hover .exq__opt-key, .exq__opt:focus-visible .exq__opt-key { color: var(--ink); background: var(--gold-grad); }
.exq__nav { margin-top: 1.2rem; }
.exq__back {
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-display); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--bronze);
}
.exq__back:hover { color: var(--gold); }

/* ---- Results ---- */
.exr { background: var(--white); border: 1px solid rgba(138,104,32,.2); border-radius: 6px; padding: 2.4rem; box-shadow: 0 14px 44px rgba(138,104,32,.12); }
.exr > .eyebrow { display:block; }
.exr h2 { margin-top: .2rem; }
.exr__sub { color: var(--deep-gold); font-weight: 400; }
.exr__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.8rem; }
.exr__card { border: 1px solid rgba(138,104,32,.22); border-radius: 5px; padding: 1.3rem; background: var(--cream); }
.exr__card:first-child { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.exr__tag { font-family: var(--font-display); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--deep-gold); display:block; margin-bottom:.3rem; }
.exr__card h3 { margin-bottom: .3rem; }
.exr__line { font-size: 1.05rem; margin-bottom: 0; opacity: .88; }
.exr__gap { margin-top: 1.4rem; padding: 1rem 1.2rem; border-radius: 5px; font-size: 1.08rem; border-left: 4px solid var(--gold); background: rgba(205,163,77,.08); }
.exr__gap.is-match { border-left-color: #4f7d4f; background: rgba(79,125,79,.08); }
.exr__gap.is-gap { border-left-color: var(--deep-gold); }

.exr__dist { margin-top: 1.8rem; }
.exr__dist h4, .exr__col h4, .exr__pairs h4 { font-family: var(--font-display); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--bronze); margin-bottom: .9rem; }
.exr__row { display: grid; grid-template-columns: 96px 1fr 42px; align-items: center; gap: .8rem; margin-bottom: .55rem; }
.exr__row-name { font-family: var(--font-display); font-size: .82rem; }
.exr__row-track { background: rgba(138,104,32,.14); height: 12px; border-radius: 6px; overflow: hidden; }
.exr__row-fill { display:block; height: 100%; background: rgba(138,104,32,.45); border-radius: 6px; transition: width .6s ease; }
.exr__row-fill.is-primary { background: var(--gold-grad); }
.exr__row-num { font-family: var(--font-display); font-size: .8rem; color: var(--bronze); text-align: right; }

.exr__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-top: 1.8rem; }
.exr__tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.exr__chip { font-family: var(--font-display); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--deep-gold); border: 1px solid rgba(205,163,77,.45); background: rgba(205,163,77,.07); padding: .35rem .7rem; border-radius: 20px; }
.exr__watch { list-style: none; }
.exr__watch li { position: relative; padding-left: 1.2rem; margin-bottom: .4rem; font-size: 1.05rem; }
.exr__watch li::before { content: "−"; position: absolute; left: 0; color: var(--deep-gold); font-weight: 700; }

.exr__pairs { margin-top: 1.8rem; }
.exr__pairrow { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; align-items: baseline; padding: .6rem 0; border-top: 1px solid rgba(138,104,32,.14); }
.exr__pairrow:first-of-type { border-top: 0; }
.exr__pairname { font-family: var(--font-display); color: var(--deep-gold); font-size: 1.05rem; }
.exr__pairwhy { font-size: 1.05rem; opacity: .9; }

.exr__cta { margin-top: 2rem; padding-top: 1.6rem; border-top: 1px solid rgba(138,104,32,.18); }
.exr__cta-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.2rem 0; }
.exr__cta-actions .btn + .btn { margin-left: 0; }
.exr__seat { font-family: var(--font-display); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--bronze); opacity: .8; margin-bottom: 0; }

@media (max-width: 640px) {
  .exr__pair, .exr__grid { grid-template-columns: 1fr; }
  .exr__pairrow { grid-template-columns: 1fr; gap: .2rem; }
  .exq, .exr { padding: 1.4rem; }
}

/* ---------- Contact ---------- */
.contact-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.field { margin-bottom: 1.1rem; }
.field label {
  display:block; font-family: var(--font-display); font-size:.72rem;
  letter-spacing:.14em; text-transform:uppercase; margin-bottom:.4rem; color: var(--bronze);
}
.field input, .field textarea {
  width:100%; padding:.85rem 1rem; font-family: var(--font-body); font-size:1.1rem;
  border:1px solid rgba(138,104,32,.35); border-radius:3px; background: var(--white); color: var(--charcoal);
}
.field input:focus, .field textarea:focus { outline:none; border-color: var(--gold); box-shadow:0 0 0 3px rgba(205,163,77,.18); }
.contact-detail { display:flex; gap:1rem; align-items:flex-start; margin-bottom:1.4rem; }
.contact-detail .ico { color: var(--gold); font-size:1.3rem; line-height:1.6; }
.hp { position:absolute; left:-9999px; }  /* honeypot */

/* ---------- Footer ---------- */
.site-footer {
  background: var(--black);
  color: var(--cream);
  padding: 3.5rem 0 2rem;
  border-top: 1px solid rgba(205,163,77,.25);
}
.footer-grid { display:grid; grid-template-columns: 1.5fr 1fr 1fr; gap:2rem; margin-bottom:2.5rem; }
.site-footer img { height:42px; margin-bottom:1rem; }
.site-footer h3 { font-size:.8rem; letter-spacing:.18em; text-transform:uppercase; color: var(--gold); margin-bottom:1rem; }
.site-footer ul { list-style:none; }
.site-footer ul li { margin-bottom:.5rem; }
.site-footer a { color: var(--cream); font-size:1.05rem; }
.site-footer a:hover { color: var(--gold-light); }
.footer-tag { font-family: var(--font-script); font-size:1.8rem; color: var(--gold); }
.footer-bottom { text-align:center; font-size:.9rem; opacity:.6; border-top:1px solid rgba(255,255,255,.1); padding-top:1.5rem; }

/* ---------- Candlelit study hero ---------- */
.study-hero {
  position: relative;
  width: 100%;
  background: #000;
  overflow: hidden;
  line-height: 0;
}
.study-hero__img {
  width: 100%;
  display: block;
}

/* soft flicker over the candle flame — fades in as the fog clears, then loops */
.study-hero__flame {
  position: absolute;
  left: 21.5%;
  top: 18%;
  width: 7.5%;
  height: 22%;
  background: radial-gradient(50% 48% at 50% 46%, rgba(255,216,140,.5), rgba(232,150,60,.2) 55%, transparent 78%);
  mix-blend-mode: screen;
  filter: blur(6px);
  opacity: 0;
  animation: heroFlameIn .8s ease-out 2.3s both, candleFlicker 3.2s ease-in-out 3.1s infinite;
  pointer-events: none;
}
@keyframes heroFlameIn { from { opacity: 0; } to { opacity: .85; } }
@keyframes candleFlicker {
  0%, 100% { opacity: .85; transform: scale(1); }
  13%      { opacity: .55; }
  26%      { opacity: .95; transform: scale(1.07, 1.12); }
  40%      { opacity: .68; }
  57%      { opacity: 1;   transform: scale(1.03, 1.06); }
  72%      { opacity: .6;  }
  86%      { opacity: .9;  }
}

/* Entrance fog: a dense bank covers the whole scene, then parts and rolls
   away to either side to reveal the desk beneath — like curtains of fog
   drawing back, not sparkle/ambient wisps. Decorative + pointer-events:none,
   so it never interferes with clicking the books beneath it. */
.study-hero__mist {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
}
.fog-bank {
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 68%;
  background:
    radial-gradient(ellipse 80% 70% at 50% 40%, rgba(238,234,224,.95), rgba(226,220,206,.85) 45%, rgba(226,220,206,.5) 68%, transparent 85%);
  filter: blur(22px);
  mix-blend-mode: screen;
  opacity: 1;
}
.fog-bank--l { left: -18%; animation: fogPartLeft  3.2s ease-in-out .15s both; }
.fog-bank--r { right: -18%; animation: fogPartRight 3.2s ease-in-out .15s both; }
@keyframes fogPartLeft {
  0%   { transform: translateX(0)    scale(1);    opacity: 1; }
  100% { transform: translateX(-95%) scale(1.25); opacity: 0; }
}
@keyframes fogPartRight {
  0%   { transform: translateX(0)   scale(1);    opacity: 1; }
  100% { transform: translateX(95%) scale(1.25); opacity: 0; }
}
/* A thin trailing wisp drifting up through the middle as the banks clear,
   for a little lingering atmosphere once the reveal finishes. */
.fog-wisp {
  position: absolute;
  bottom: 15%;
  left: 50%;
  width: 55%;
  height: 45%;
  background: radial-gradient(ellipse 60% 55% at 50% 60%, rgba(230,225,213,.55), transparent 75%);
  filter: blur(20px);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translateX(-50%);
  animation: fogWispRise 4.5s ease-out 2.2s both;
}
@keyframes fogWispRise {
  0%   { opacity: 0;  transform: translate(-50%, 0)     scale(1); }
  20%  { opacity: .5; }
  100% { opacity: 0;  transform: translate(-50%, -120px) scale(1.3); }
}

/* Entrance tagline: "Start Your Story" fades in with a slow pulsing glow,
   timed to appear right as the fog finishes clearing. Decorative overlay —
   pointer-events:none so it can never block the book hotspots below it. */
.study-hero__intro {
  position: absolute;
  left: 50%;
  top: 7%;
  transform: translateX(-50%);
  z-index: 5;
  text-align: center;
  pointer-events: none;
}
.study-hero__tagline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(.85rem, 1.8vw, 1.15rem);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: 0;
  animation: heroTextIn .9s ease-out 2.6s both, brandPulse 3.8s ease-in-out 3.5s infinite;
}
@keyframes heroTextIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes brandPulse {
  0%, 100% { text-shadow: 0 0 9px rgba(232,192,112,.5),  0 0 22px rgba(205,163,77,.32); }
  50%      { text-shadow: 0 0 15px rgba(232,192,112,.8), 0 0 32px rgba(205,163,77,.5); }
}

/* Book hotspots, positioned with unitless CSS vars (percent of the hero box):
   --l left, --t top, --w width, --h height. */
.study__book {
  position: absolute;
  left:   calc(var(--l) * 1%);
  top:    calc(var(--t) * 1%);
  width:  calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 8px;
}
.study__book--marvelous { z-index: 3; }
.study__book--client { z-index: 2; }
.study__book::after {
  content: "";
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(40% 38% at 50% 50%, rgba(255,226,168,.95), transparent 68%),
    radial-gradient(65% 60% at 50% 50%, rgba(232,192,112,.75), transparent 78%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}
.study__book:hover::after,
.study__book:focus-visible::after { opacity: 1; }
.study__book:focus-visible { outline: 2px solid rgba(232,192,112,.7); outline-offset: 4px; }

/* ---------- Book flight: lift -> float to center -> open ----------
   Built by main.js on click. Geometry comes from CSS vars set inline:
   --bw/--bh/--bt  book width/height/thickness (px)
   --dx/--dy/--s   start offset from viewport center + start scale
   Two modes: --menu opens to the table-of-contents page (site navigation);
   --story is the client book, opening to a blank first page. */
.book-flight {
  position: fixed;
  inset: 0;
  z-index: 200;   /* above the site header (100) — the flight owns the screen */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 2, 1, 0);
  transition: background .6s ease;
}
.book-flight.dim { background: rgba(2, 2, 1, .9); }

/* warm light spilling out once the cover opens */
.book-flight__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(42% 60% at 50% 48%, rgba(232,192,112,.5), rgba(138,104,32,.18) 55%, transparent 75%);
  opacity: 0;
  transition: opacity .7s ease;
}
.book-flight.open .book-flight__glow { opacity: 1; }

/* final fade to ink, then main.js navigates */
.book-flight__fade {
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: 0;
  transition: opacity .45s ease;
}
.book-flight.fade .book-flight__fade { opacity: 1; }

.book-flight__scene {
  perspective: 1500px;
  opacity: 0;
  transition: opacity .3s ease;
}
.book-flight.fly .book-flight__scene { opacity: 1; }

.book-flight__book {
  position: relative;
  width: var(--bw);
  height: var(--bh);
  transform-style: preserve-3d;
  transform: translate(var(--dx), var(--dy)) scale(var(--s)) rotateY(90deg);
  transition: transform .9s cubic-bezier(.22,.85,.3,1);
}
.book-flight.fly .book-flight__book { transform: translate(0, 0) scale(1) rotateY(-14deg); }
/* once the cover swings open to the left, re-center the composition */
.book-flight.open .book-flight__book { transform: translate(calc(var(--bw) * .22), 0) scale(1) rotateY(-7deg); }
/* phones: keep the page fully on screen; the open cover may clip off the left edge */
@media (max-width: 520px) {
  .book-flight.open .book-flight__book { transform: translate(calc(var(--bw) * .07), 0) scale(1) rotateY(-4deg); }
}

/* spine = left face of the box: dark leather with gold head/tail bands */
.book-flight__spine {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--bt);
  height: 100%;
  transform: rotateY(-90deg) translateZ(calc(var(--bt) / 2));
  backface-visibility: hidden;
  background: linear-gradient(90deg, #1a120b, #261a10 50%, #120d08);
  box-shadow:
    inset 0 calc(var(--bh) * .045) 0 -2px rgba(205,163,77,.35),
    inset 0 calc(var(--bh) * -.045) 0 -2px rgba(205,163,77,.35),
    inset 0 0 24px rgba(0,0,0,.6);
  border-radius: 3px;
}
.book-flight--story .book-flight__spine {
  background: linear-gradient(90deg, #332012, #45291a 50%, #241408);
  box-shadow: inset 0 0 24px rgba(0,0,0,.55);
}

/* back cover / base the page rests on */
.book-flight__back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg) translateZ(calc(var(--bt) / 2));
  background: linear-gradient(200deg, #1c130c, #0b0805);
  border-radius: 10px 3px 3px 10px;
}

/* parchment page revealed when the cover opens */
.book-flight__page {
  position: absolute;
  inset: 2% 2% 2% 0;
  transform: translateZ(calc(var(--bt) / 2 - 2px));
  background: radial-gradient(90% 80% at 50% 40%, #f8f0dc, #eadfc2 68%, #d9c9a6);
  border-radius: 2px 8px 8px 2px;
  box-shadow: inset -14px 0 26px rgba(90,69,32,.28), inset 3px 0 8px rgba(90,69,32,.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10%;
}
.book-flight__page .script {
  font-family: var(--font-script);
  font-size: calc(var(--bh) * .11);
  color: var(--deep-gold);
  line-height: 1.1;
}
.book-flight__page small {
  font-family: var(--font-display);
  font-size: calc(var(--bh) * .028);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-top: .8em;
}

/* menu mode: the page is the site's table of contents */
.book-flight--menu .book-flight__page {
  justify-content: flex-start;
  padding: 7% 9% 6%;
}
.book-flight__page .toc-head {
  font-family: var(--font-script);
  font-size: calc(var(--bh) * .07);
  color: var(--deep-gold);
  line-height: 1.1;
}
.book-flight__page .toc-sub {
  font-family: var(--font-display);
  font-size: calc(var(--bh) * .022);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: .6em 0 1.2em;
}
.book-flight__toc {
  list-style: none;
  width: 100%;
  margin: 0;
  padding: 0;
  line-height: 1.35;
}
.book-flight__toc a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .8em;
  font-family: var(--font-display);
  font-size: calc(var(--bh) * .031);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #4a3a1c;
  padding: calc(var(--bh) * .015) 0;
  border-bottom: 1px solid rgba(90,69,32,.28);
  transition: color .2s ease, padding-left .2s ease;
}
.book-flight__toc li:last-child a { border-bottom: 0; }
.book-flight__toc a small {
  font-family: var(--font-body);
  font-size: calc(var(--bh) * .026);
  letter-spacing: .02em;
  text-transform: none;
  color: rgba(90,69,32,.8);
  font-style: italic;
  margin: 0;
}
.book-flight__toc a:hover,
.book-flight__toc a:focus-visible {
  color: var(--deep-gold);
  padding-left: .4em;
}

/* a blank leaf that turns over the page when a chapter is chosen */
.book-flight__leaf {
  position: absolute;
  inset: 2% 2% 2% 0;
  transform-origin: left center;
  transform: translateZ(calc(var(--bt) / 2 - 1px));
  background: linear-gradient(200deg, #f3ead2, #e2d5b4);
  border-radius: 2px 8px 8px 2px;
  backface-visibility: hidden;
  transition: transform .55s cubic-bezier(.55,.08,.35,1);
}
.book-flight.turn .book-flight__leaf {
  transform: translateZ(calc(var(--bt) / 2 - 1px)) rotateY(-150deg);
}

/* front cover — CSS-designed leather, hinges open on the left edge */
.book-flight__cover {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: translateZ(calc(var(--bt) / 2));
  transition: transform .8s cubic-bezier(.6,.05,.3,1);
  backface-visibility: visible;
  background: linear-gradient(160deg, #26190f, #150f09 55%, #0b0704);
  border-radius: 3px 10px 10px 3px;
  transform-style: preserve-3d;
}
.book-flight.open .book-flight__cover {
  transform: translateZ(calc(var(--bt) / 2)) rotateY(-155deg);
}
/* outside of the cover: gold-framed leather with the title */
.book-flight__cover-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background:
    radial-gradient(120% 90% at 30% 18%, rgba(232,192,112,.12), transparent 60%),
    linear-gradient(160deg, #26190f, #150f09 55%, #0b0704);
  border-radius: 3px 10px 10px 3px;
  box-shadow: inset 0 0 0 1px rgba(205,163,77,.3), inset 0 0 46px rgba(0,0,0,.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9% 12%;
}
.book-flight__cover-front::before {
  content: "";
  position: absolute;
  inset: 5%;
  border: 1px solid rgba(205,163,77,.45);
  outline: 1px solid rgba(205,163,77,.2);
  outline-offset: 3px;
  border-radius: 2px;
  pointer-events: none;
}
/* inside of the cover: plain dark endpaper (no mirrored text) */
.book-flight__cover-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  backface-visibility: hidden;
  background: linear-gradient(200deg, #1d1610, #100c08);
  box-shadow: inset 0 0 30px rgba(0,0,0,.7), inset 0 0 0 1px rgba(205,163,77,.12);
  border-radius: 10px 3px 3px 10px;
}
/* the script wordmark on the Marvelous cover — same flat warm gold as the
   photographed book and the site's script accents (no gradient) */
.book-flight__cover .wordmark {
  font-family: var(--font-script);
  font-size: calc(var(--bh) * .11);
  line-height: 1.1;
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(0,0,0,.65);
}

/* story mode: the client's book — plain warm leather, unmarked */
.book-flight--story .book-flight__cover-front {
  background:
    radial-gradient(120% 90% at 30% 18%, rgba(232,192,112,.08), transparent 60%),
    linear-gradient(160deg, #4a2d1a, #33200f 55%, #1d1108);
  box-shadow: inset 0 0 40px rgba(0,0,0,.55);
}
.book-flight--story .book-flight__cover-front::before { border-color: transparent; outline-color: transparent; }
.book-flight--story .book-flight__cover-back { background: linear-gradient(200deg, #2b1c10, #180f08); }
.book-flight--story .book-flight__back { background: linear-gradient(200deg, #33200f, #1a0f07); }
.book-flight--story .book-flight__page .script { font-size: calc(var(--bh) * .085); }

/* closing (menu dismissed): fade the whole flight away */
.book-flight.closing {
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}

/* reduced motion: skip every transition, jump straight to the open book */
.book-flight.instant,
.book-flight.instant * { transition: none !important; }

/* destination page fades in after a book flight */
body.page-arrive { animation: pageArrive .7s ease both; }
@keyframes pageArrive { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .study-hero__flame { animation: none; opacity: .85; }
  .study-hero__mist { display: none; }
  .study-hero__tagline { animation: none; opacity: 1; transform: none; }
  body.page-arrive { animation: none; }
}
/* hint caption under the shelf */
.shelf-hint {
  text-align: center;
  background: var(--black);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding: 1rem 1rem 1.3rem;
}
.shelf-hint { color: rgba(232,192,112,.62); }
.shelf-hint .hint-strong {
  color: var(--gold-light);
  font-size: 1.05em;
  text-shadow: 0 0 6px rgba(232,192,112,.5), 0 0 16px rgba(205,163,77,.3);
}

/* On phones the two books remain the tap targets — the table-of-contents book
   covers navigation, so the old mobile button list is gone. The hint stays. */
@media (max-width: 760px) {
  .shelf-hint { padding: .8rem 1rem 1rem; }
  .shelf-hint .script { font-size: 1.3rem; }
}

/* ---------- Contact form: branded on-page confirmation ---------- */
.form-success {
  border: 1px solid rgba(205,163,77,.5);
  background: rgba(205,163,77,.08);
  border-radius: 4px;
  padding: 2.4rem 2rem;
  text-align: center;
}
.form-success__script {
  display: block;
  font-family: var(--font-script);
  font-size: 2.3rem;
  line-height: 1.15;
  color: var(--deep-gold);
  margin-bottom: .8rem;
}
.form-success p { max-width: 420px; margin: 0 auto 1.6rem; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity:0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity:1; transform: none; }

/* ---------- Responsive ---------- */
/* Nav collapses to the hamburger earlier than the layout grids, because the
   full horizontal menu (8 items + CTA) needs ~1025px to sit on one line. */
@media (max-width: 1024px) {
  .nav__links {
    position: absolute; top: 70px; left:0; right:0;
    background: rgba(10,10,12,.98); flex-direction: column; gap:0;
    border-bottom:1px solid rgba(205,163,77,.25);
    max-height:0; overflow:hidden; transition:max-height .3s ease;
  }
  .nav__links.open { max-height: 560px; }
  .nav__links li { width:100%; text-align:center; }
  .nav__links li a { display:block; padding:1rem; border-top:1px solid rgba(205,163,77,.12); }
  .nav__cta { display:block; margin:.6rem auto; max-width:220px; }
  .nav__toggle { display:block; }
}

@media (max-width: 860px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap:2rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap:1.5rem; }
  .btn + .btn { margin-left:0; margin-top:.8rem; }
  .hero__actions .btn { display:block; max-width:280px; margin-left:auto; margin-right:auto; }
}
@media (max-width: 520px) {
  .phase { grid-template-columns: 1fr; }
  .phase__no { font-size:1.5rem; }
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       