/* ==========================================================================
   ASJ Leadership Growth Assessment — design system
   ========================================================================== */

:root {
  color-scheme: light;

  /* Colour */
  --navy: #14243A;
  --navy-2: #1F3452;
  --navy-3: #2C4568;
  --ivory: #F8F6F0;
  --ivory-2: #F1EDE3;
  --sage: #A7B8A0;
  --sage-soft: #E6ECE3;
  --sage-ink: #4A6143;
  --gold: #D9B56D;
  --gold-soft: #F6ECD7;
  --gold-ink: #7A5A1A;
  --charcoal: #252A31;
  --muted: #5A6170;
  --line: #E2DDD1;
  --line-strong: #CFC8B8;
  --white: #FFFFFF;
  --error: #A3382B;
  --error-soft: #FBEDEA;
  --focus: #2C6BD6;

  /* Type */
  --font-serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.3125rem;
  --fs-h3: 1.375rem;
  --fs-h2: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
  --fs-h1: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
  --fs-q: clamp(1.5rem, 1.15rem + 1.6vw, 2.25rem);
  --fs-display: clamp(2.6rem, 1.6rem + 4.4vw, 5rem);

  /* Spacing (4px base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

  /* Shape & depth */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20, 36, 58, 0.06);
  --shadow-md: 0 1px 2px rgba(20, 36, 58, 0.05), 0 8px 24px -12px rgba(20, 36, 58, 0.18);
  --shadow-lg: 0 2px 4px rgba(20, 36, 58, 0.05), 0 24px 48px -20px rgba(20, 36, 58, 0.28);

  /* Motion */
  --dur-fast: 150ms;
  --dur: 280ms;
  --dur-slow: 700ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  /* Layout */
  --w-page: 1180px;
  --w-narrow: 780px;
  --gutter: 20px;
  --topbar-h: 64px;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; --topbar-h: 72px; }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
em { font-style: italic; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }

.sr-only, .vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--s-4); top: -60px; z-index: 100;
  background: var(--navy); color: var(--ivory); padding: var(--s-2) var(--s-4); border-radius: var(--r-sm);
  text-decoration: none; font-weight: 600; transition: top var(--dur-fast);
}
.skip-link:focus { top: var(--s-3); }

.container { width: 100%; max-width: var(--w-page); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { width: 100%; max-width: var(--w-narrow); margin: 0 auto; padding: 0 var(--gutter); }

.noscript { max-width: 560px; margin: var(--s-16) auto; padding: var(--s-6); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); }

/* ---------- Typography ---------- */

.eyebrow {
  display: flex; align-items: center; gap: var(--s-3);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sage-ink);
}
.eyebrow-rule { display: inline-block; width: 28px; height: 1.5px; background: var(--gold); flex: none; }
.eyebrow-light { color: var(--gold); }

.display {
  font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-display);
  line-height: 1.02; letter-spacing: -0.025em; color: var(--navy);
  font-variation-settings: 'opsz' 144;
}
.display em { font-style: italic; color: var(--navy-3); position: relative; white-space: nowrap; }
.display em::after {
  content: ''; position: absolute; left: 0.04em; right: 0.1em; bottom: 0.06em; height: 0.09em;
  background: var(--gold); border-radius: 2px; transform-origin: left; transform: scaleX(0);
  animation: underline 900ms var(--ease) 500ms forwards;
}
.display-sm { font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem); }
.h1 { font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-h1); line-height: 1.12; letter-spacing: -0.02em; color: var(--navy); }
.h2 { font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-h2); line-height: 1.2; letter-spacing: -0.015em; color: var(--navy); }
.h3 { font-family: var(--font-serif); font-weight: 500; font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -0.01em; color: var(--navy); }
.lede { font-size: var(--fs-md); line-height: 1.65; color: var(--muted); max-width: 38em; }
.muted { color: var(--muted); }
.fine { font-size: var(--fs-sm); color: var(--muted); line-height: 1.55; }

kbd {
  display: inline-block; min-width: 1.6em; padding: 0 0.4em; border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 4px; background: var(--white);
  font-family: var(--font-sans); font-size: 0.8em; font-weight: 600; text-align: center; line-height: 1.6;
}

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: transparent; --btn-fg: var(--navy); --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-6);
  background: var(--btn-bg); color: var(--btn-fg); border: 1.5px solid var(--btn-bd); border-radius: var(--r-pill);
  font-weight: 600; font-size: var(--fs-base); letter-spacing: 0.005em; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast);
}
.btn svg { flex: none; transition: transform var(--dur) var(--ease); }
.btn:hover svg:last-child { transform: translateX(2px); }
.btn[data-action="back"]:hover svg { transform: translateX(-2px); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.6; cursor: progress; }

.btn-primary { --btn-bg: var(--navy); --btn-fg: var(--ivory); --btn-bd: var(--navy); box-shadow: var(--shadow-sm); }
.btn-primary:hover { --btn-bg: var(--navy-2); --btn-bd: var(--navy-2); box-shadow: var(--shadow-md); }
.btn-secondary { --btn-bg: var(--white); --btn-fg: var(--navy); --btn-bd: var(--line-strong); }
.btn-secondary:hover { --btn-bd: var(--navy); }
.btn-ghost { --btn-fg: var(--navy); --btn-bd: transparent; padding: 0 var(--s-4); }
.btn-ghost:hover { --btn-bg: rgba(20, 36, 58, 0.06); }
.btn-quiet { --btn-fg: var(--muted); padding: 0 var(--s-3); }
.btn-quiet:hover { --btn-fg: var(--navy); --btn-bg: rgba(20, 36, 58, 0.05); }
.btn-link {
  min-height: 44px; padding: 0 var(--s-1); border-radius: var(--r-sm);
  --btn-fg: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; text-decoration-thickness: 1.5px;
}
.btn-link:hover { text-decoration-color: var(--navy); }
.btn-lg { min-height: 56px; padding: 0 var(--s-8); font-size: var(--fs-md); }
.btn-sm { min-height: 40px; font-size: var(--fs-sm); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(248, 246, 240, 0.88);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color var(--dur);
}
.app[data-view="assess"] .topbar, .app[data-view="results"] .topbar { border-bottom-color: var(--line); }
.topbar-inner {
  max-width: var(--w-page); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
}
.brand { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--navy); text-decoration: none; border-radius: var(--r-sm); }
.brand-crown { width: 34px; height: auto; }
.brand-word { width: 150px; height: auto; }
@media (max-width: 400px) { .brand-word { width: 120px; } .brand-crown { width: 28px; } }
.brand-text { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em; }
.brand-sub { font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-left: 4px; }
.topbar-right { display: flex; align-items: center; gap: var(--s-2); }
@media (max-width: 479px) {
  .brand-sub { display: none; }
  .topbar-right .btn span { display: none; }
  .topbar-right .btn { width: 44px; padding: 0; }
}

.mini-map { display: flex; align-items: center; gap: var(--s-2); padding-right: var(--s-2); }
.mini-poly { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.mini-dot { fill: var(--ivory); stroke: var(--line-strong); stroke-width: 1.2; transition: fill var(--dur) var(--ease), stroke var(--dur); }
.mini-dot.is-on { fill: var(--gold); stroke: var(--gold-ink); animation: pop 500ms var(--ease-spring); transform-box: fill-box; transform-origin: center; }
.mini-text { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.mini-text b { color: var(--navy); font-weight: 700; }
@media (max-width: 380px) { .mini-text { display: none; } }

/* ---------- Constellation graphic ---------- */

.cst { width: 100%; height: auto; overflow: visible; }
.cst-halo { fill: var(--white); opacity: 0.55; }
.cst-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.cst-ring-outer { stroke: var(--line-strong); stroke-dasharray: 3 5; }
.cst-axis { stroke: var(--line); stroke-width: 1; }
.cst-shape { fill: rgba(167, 184, 160, 0.42); stroke: var(--navy); stroke-width: 1.75; stroke-linejoin: round; }
.cst-vertex { fill: var(--navy); }
.cst-node-halo { fill: var(--ivory); stroke: var(--line-strong); stroke-width: 1; }
.cst-node-dot { fill: var(--line-strong); }
.cst-node.is-on .cst-node-dot { fill: var(--gold); }
.cst-node.is-on .cst-node-halo { stroke: var(--gold); }
.cst-label { font-family: var(--font-sans); font-size: 15px; font-weight: 600; fill: var(--navy); letter-spacing: 0.01em; }
.cst-score { font-family: var(--font-serif); font-size: 19px; font-weight: 500; fill: var(--sage-ink); }

.cst-shape-g { transform-origin: 200px 200px; transform-box: view-box; }
.cst-hero .cst-shape-g { animation: grow 1400ms var(--ease) 300ms both, breathe 7s ease-in-out 1.8s infinite; }
.cst-hero .cst-ring { animation: fadeIn 800ms var(--ease) both; animation-delay: var(--d); }
.cst-hero .cst-node, .cst-complete .cst-node { animation: nodeIn 600ms var(--ease-spring) both; animation-delay: calc(700ms + var(--i) * 120ms); transform-box: fill-box; transform-origin: center; }
.cst-complete .cst-shape-g { animation: grow 1600ms var(--ease) 500ms both; }
.cst-complete .cst-node-dot { animation: light 400ms var(--ease) both; animation-delay: calc(400ms + var(--i) * 220ms); }
.cst-results .cst-shape-g { transform: scale(0); }
.radar-card.is-in .cst-results .cst-shape-g { animation: grow 1200ms var(--ease) 150ms both; }
.cst-mid .cst-shape-g { animation: grow 1000ms var(--ease) 200ms both; }

/* ---------- Welcome ---------- */

.welcome-hero {
  display: grid; gap: var(--s-12); align-items: center;
  padding-top: var(--s-10); padding-bottom: var(--s-16);
}
.welcome-copy { display: flex; flex-direction: column; gap: var(--s-6); }
.welcome-copy .display { margin-top: var(--s-1); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); }
.resume {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-4) var(--s-5); background: var(--gold-soft); border-left: 3px solid var(--gold); border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--fs-sm); max-width: 34rem;
}
.resume-actions { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-6);
  padding-top: var(--s-6); border-top: 1px solid var(--line); max-width: 34rem;
}
.facts li { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); font-weight: 500; color: var(--charcoal); }
.facts svg { color: var(--sage-ink); }
.reassure { font-family: var(--font-serif); font-style: italic; color: var(--muted); font-size: var(--fs-base); }
.welcome-art { position: relative; max-width: 520px; width: 100%; margin: 0 auto; }
.art-caption { text-align: center; font-size: var(--fs-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: var(--s-2); }

@media (min-width: 960px) {
  .welcome-hero { grid-template-columns: 1.08fr 0.92fr; gap: var(--s-16); padding-top: var(--s-16); padding-bottom: var(--s-24); min-height: calc(88vh - var(--topbar-h)); }
}
@media (max-width: 959px) {
  .welcome-art { max-width: 380px; }
  .welcome-hero { padding-top: var(--s-6); }
  .art-caption { display: none; }
}
@media (max-width: 420px) {
  .facts { grid-template-columns: 1fr; }
}

.welcome-band { background: var(--navy); color: var(--ivory); padding: var(--s-16) 0; }
.band-inner { display: grid; gap: var(--s-10); }
.band-quote { font-family: var(--font-serif); font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.4rem); line-height: 1.25; letter-spacing: -0.015em; max-width: 20em; }
.band-quote em { color: var(--gold); }
.band-dims-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sage); margin-bottom: var(--s-4); }
.band-dims ol { display: grid; gap: 0; }
.band-dims li { display: flex; gap: var(--s-4); align-items: baseline; padding: var(--s-3) 0; border-top: 1px solid rgba(248, 246, 240, 0.14); font-size: var(--fs-base); }
.band-dims li span { font-family: var(--font-serif); color: var(--gold); font-size: var(--fs-sm); }
@media (min-width: 960px) { .band-inner { grid-template-columns: 1.1fr 0.9fr; align-items: center; } }

/* ---------- Assessment shell ---------- */

.assess { padding-top: var(--s-6); padding-bottom: var(--s-16); }
.progress-wrap { margin-bottom: var(--s-8); }
.progress-meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); margin-bottom: var(--s-3); font-size: var(--fs-sm); }
.section-tag { font-weight: 700; color: var(--navy); letter-spacing: 0.02em; }
.progress-count { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress { position: relative; height: 4px; background: var(--line); border-radius: var(--r-pill); overflow: hidden; }
.progress-fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--navy));
  transition: width 600ms var(--ease);
}
.ticks { display: grid; grid-template-columns: repeat(10, 1fr) 6px repeat(7, 1fr); gap: 3px; margin-top: var(--s-2); }
.tick { height: 6px; border-radius: 2px; background: transparent; border: 1px solid var(--line); transition: background var(--dur) var(--ease), border-color var(--dur), transform var(--dur) var(--ease); }
.tick:nth-child(11) { grid-column: 12; }
.tick.is-done.s1 { background: var(--sage); border-color: var(--sage); }
.tick.is-done.s2 { background: var(--gold); border-color: var(--gold); }
.tick.is-current { border-color: var(--navy); transform: scaleY(1.5); }

.stage { position: relative; }
.step-in-fwd { animation: inFwd 420ms var(--ease) both; }
.step-in-back { animation: inBack 420ms var(--ease) both; }
.step-out-fwd { animation: outFwd 170ms ease-in both; }
.step-out-back { animation: outBack 170ms ease-in both; }

/* Section intros */
.section-intro { display: flex; flex-direction: column; gap: var(--s-5); }
.section-num {
  font-family: var(--font-serif); font-size: clamp(4rem, 3rem + 5vw, 7rem); line-height: 0.9; color: transparent;
  -webkit-text-stroke: 1.25px var(--gold); letter-spacing: -0.03em;
}
.howto { display: grid; gap: var(--s-3); margin-top: var(--s-2); counter-reset: none; }
.howto li {
  display: flex; gap: var(--s-4); align-items: flex-start; padding: var(--s-4) var(--s-5);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
}
.howto li div { display: flex; flex-direction: column; }
.howto li strong { color: var(--navy); font-weight: 700; }
.howto li span:not(.howto-num) { color: var(--muted); font-size: var(--fs-sm); }
.howto-num {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); color: var(--ivory); font-family: var(--font-serif); font-size: var(--fs-base);
}
@media (min-width: 720px) { .howto { grid-template-columns: repeat(3, 1fr); } .howto li { flex-direction: column; } }
.tips { display: grid; gap: var(--s-2); font-size: var(--fs-sm); color: var(--muted); }
.tips li { position: relative; padding-left: var(--s-6); }
.tips li::before { content: ''; position: absolute; left: 4px; top: 0.6em; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--sage); }

.midpoint { display: grid; gap: var(--s-6); align-items: center; }
.midpoint > div:last-child { display: flex; flex-direction: column; gap: var(--s-4); }
.midpoint-art { max-width: 220px; }
.midpoint-note { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); background: var(--sage-soft); border-radius: var(--r-md); color: var(--sage-ink); font-weight: 600; font-size: var(--fs-sm); }
.midpoint-note svg { flex: none; margin-top: 3px; }
.section-detail { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
@media (min-width: 720px) { .midpoint { grid-template-columns: 220px 1fr; gap: var(--s-10); } }

/* Question */
.question { display: flex; flex-direction: column; gap: var(--s-6); }
.q-head { display: grid; grid-template-columns: auto 1fr; gap: var(--s-5); align-items: start; }
.q-head > div { display: flex; flex-direction: column; gap: var(--s-3); }
.q-num { font-family: var(--font-serif); font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem); line-height: 1; color: var(--gold); padding-top: 0.2em; font-variant-numeric: lining-nums; }
.q-title { font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-q); line-height: 1.2; letter-spacing: -0.015em; color: var(--navy); }
.q-hint { color: var(--muted); font-size: var(--fs-base); }
@media (max-width: 559px) {
  .q-head { grid-template-columns: 1fr; gap: var(--s-2); }
  .q-num { font-size: var(--fs-md); padding: 0; }
}
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Rating scale */
.rating { display: grid; gap: var(--s-2); }
.rate { display: grid; position: relative; animation: rise 420ms var(--ease) both; animation-delay: calc(80ms + var(--i) * 45ms); }
.rate-card {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: var(--s-4);
  min-height: 60px; padding: var(--s-3) var(--s-4);
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur) var(--ease), box-shadow var(--dur);
}
.rate-meter { display: none; }
.rate-num {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  font-family: var(--font-serif); font-size: var(--fs-md); color: var(--navy); transition: all var(--dur-fast);
}
.rate-label { font-weight: 600; color: var(--charcoal); line-height: 1.3; }
.rate-check {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: var(--navy); transform: scale(0); transition: transform var(--dur) var(--ease-spring);
}
.rate:hover .rate-card { border-color: var(--navy-3); box-shadow: var(--shadow-md); }
.rate input:focus-visible + .rate-card { outline: 3px solid var(--focus); outline-offset: 2px; }
.rate input:checked + .rate-card { background: var(--navy); border-color: var(--navy); box-shadow: var(--shadow-lg); }
.rate input:checked + .rate-card .rate-label { color: var(--ivory); }
.rate input:checked + .rate-card .rate-num { background: var(--ivory); border-color: var(--ivory); color: var(--navy); }
.rate input:checked + .rate-card .rate-check { transform: scale(1); }

@media (min-width: 720px) {
  .rating { grid-template-columns: repeat(5, 1fr); gap: var(--s-3); }
  .rate-card {
    grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; justify-items: center; text-align: center;
    min-height: 176px; padding: var(--s-5) var(--s-3) var(--s-4); gap: var(--s-3);
  }
  .rate-meter { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
  .rate-meter i { display: block; width: 5px; height: var(--h); border-radius: 2px; background: var(--line); transition: background var(--dur); }
  .rate-meter i.on { background: var(--sage); }
  .rate input:checked + .rate-card .rate-meter i.on { background: var(--gold); }
  .rate input:checked + .rate-card .rate-meter i:not(.on) { background: rgba(248, 246, 240, 0.2); }
  .rate-num { width: 44px; height: 44px; font-size: var(--fs-lg); }
  .rate-label { font-size: var(--fs-sm); align-self: start; }
  .rate-check { position: absolute; top: var(--s-2); right: var(--s-2); }
  .rate:hover .rate-card { transform: translateY(-3px); }
  .rate input:checked + .rate-card { transform: translateY(-4px); }
}

/* Single-select */
.choices { display: grid; gap: var(--s-2); }
@media (min-width: 720px) { .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); } }
.choice { display: grid; animation: rise 420ms var(--ease) both; animation-delay: calc(60ms + var(--i) * 35ms); }
.choice-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-4); height: 100%;
  min-height: 60px; padding: var(--s-3) var(--s-4);
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur), transform var(--dur) var(--ease);
}
.choice-key {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line-strong); font-size: var(--fs-xs); font-weight: 700; color: var(--muted);
  transition: all var(--dur-fast);
}
.choice-label { font-weight: 600; line-height: 1.35; }
.choice-check { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: var(--navy); transform: scale(0); transition: transform var(--dur) var(--ease-spring); }
.choice:hover .choice-card { border-color: var(--navy-3); box-shadow: var(--shadow-md); transform: translateX(2px); }
.choice input:focus-visible + .choice-card { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice input:checked + .choice-card { background: var(--navy); border-color: var(--navy); color: var(--ivory); box-shadow: var(--shadow-lg); }
.choice input:checked + .choice-card .choice-key { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.choice input:checked + .choice-card .choice-check { transform: scale(1); }

/* Fields */
.field-label { display: block; font-weight: 700; color: var(--navy); margin-bottom: var(--s-2); font-size: var(--fs-sm); }
.optional { font-weight: 500; color: var(--muted); }
.input, .textarea {
  width: 100%; padding: var(--s-3) var(--s-4); min-height: 52px;
  background: var(--white); border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  font-size: var(--fs-base); line-height: 1.5; color: var(--charcoal);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.textarea { min-height: 160px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #8A8F99; }
.input:hover, .textarea:hover { border-color: var(--navy-3); }
.input:focus, .textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(44, 107, 214, 0.18); }
[aria-invalid="true"].input, [aria-invalid="true"].textarea { border-color: var(--error); }
.other-field { animation: rise 300ms var(--ease) both; }
.char-count { text-align: right; font-size: var(--fs-xs); color: var(--muted); margin-top: var(--s-2); font-variant-numeric: tabular-nums; }

.email-q { display: flex; flex-direction: column; gap: var(--s-4); }
.email-q .field-label { margin-bottom: calc(var(--s-2) * -1); }
.why { padding: var(--s-4) var(--s-5); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); font-size: var(--fs-sm); color: var(--muted); }
.why strong { color: var(--navy); }
.consent { display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3); align-items: start; cursor: pointer; font-size: var(--fs-base); line-height: 1.45; position: relative; }
.consent input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
.consent-box {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line-strong); background: var(--white); color: transparent; transition: all var(--dur-fast);
}
.consent:hover .consent-box { border-color: var(--navy); }
.consent input:checked + .consent-box { background: var(--navy); border-color: var(--navy); color: var(--gold); }
.consent input:focus-visible + .consent-box { outline: 3px solid var(--focus); outline-offset: 2px; }
.privacy { font-size: var(--fs-sm); color: var(--muted); }

/* Feedback */
.q-affirm {
  min-height: 1.6em; font-family: var(--font-serif); font-style: italic; color: var(--sage-ink); font-size: var(--fs-base);
  opacity: 0;
}
.q-affirm.is-in { animation: affirm 500ms var(--ease) both; }
.q-error {
  display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4);
  background: var(--error-soft); color: var(--error); border-radius: var(--r-md); font-weight: 600; font-size: var(--fs-sm);
}
.q-error::before { content: '!'; display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--error); color: var(--white); font-size: 12px; font-weight: 800; }
.q-error[hidden] { display: none; }
.shake { animation: shake 360ms ease-in-out; }

/* Navigation */
.q-nav {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding-top: var(--s-5); margin-top: var(--s-2); border-top: 1px solid var(--line);
}
.kbd-hint { font-size: var(--fs-xs); color: var(--muted); display: none; }
@media (hover: hover) and (min-width: 720px) { .kbd-hint { display: block; } }
@media (max-width: 559px) {
  .q-nav {
    position: sticky; bottom: 0; z-index: 5; margin: 0 calc(var(--gutter) * -1);
    padding: var(--s-3) var(--gutter) calc(var(--s-3) + env(safe-area-inset-bottom));
    background: rgba(248, 246, 240, 0.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .q-nav .btn-primary { flex: 1; }
}

/* ---------- Completion ---------- */

.complete { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-5); padding-top: var(--s-12); padding-bottom: var(--s-20); }
.complete-art { width: min(300px, 75vw); margin-bottom: var(--s-2); }
.complete .lede { margin: 0 auto; }

/* ---------- Results ---------- */

.results { padding-bottom: var(--s-20); }
.results-hero { display: flex; flex-direction: column; gap: var(--s-5); padding-top: var(--s-12); padding-bottom: var(--s-10); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chips li { padding: var(--s-1) var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; color: var(--navy); background: var(--white); }
.results-body { display: flex; flex-direction: column; gap: var(--s-6); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-sm); }
@media (min-width: 768px) { .card { padding: var(--s-8); } }
.card-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sage-ink); }
.card-head { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-6); }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

.overview { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .overview { grid-template-columns: 0.85fr 1.15fr; } }
.score-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-4); }
.score-ring { position: relative; width: 196px; height: 196px; margin: var(--s-2) 0; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--ivory-2); stroke-width: 8; }
.ring-fill {
  fill: none; stroke: var(--navy); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: var(--c); stroke-dashoffset: var(--c);
  transition: stroke-dashoffset 1400ms var(--ease) 200ms;
}
.score-card.is-in .ring-fill { stroke-dashoffset: var(--o); }
.score-num { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 68px; gap: 4px; }
.score-val { font-family: var(--font-serif); font-size: 3.5rem; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.score-of { font-size: var(--fs-md); color: var(--muted); font-weight: 600; }
.band-label { font-family: var(--font-serif); font-size: var(--fs-lg); color: var(--navy); }
.band-text { color: var(--muted); max-width: 26em; }
.score-card .fine { padding-top: var(--s-4); border-top: 1px solid var(--line); width: 100%; }
.radar-card { display: flex; flex-direction: column; gap: var(--s-2); }
.radar-card .cst { max-width: 520px; margin: 0 auto; }

.dims { display: flex; flex-direction: column; gap: var(--s-5); }
.dim-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-2); }
.dim-name { font-weight: 700; color: var(--charcoal); }
.dim-val { margin-left: auto; font-family: var(--font-serif); font-size: var(--fs-lg); color: var(--navy); font-variant-numeric: tabular-nums; }
.dim-val small { font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--muted); }
.tag { font-size: var(--fs-xs); font-weight: 700; padding: 2px var(--s-2); border-radius: var(--r-pill); letter-spacing: 0.02em; }
.tag-strength { background: var(--gold-soft); color: var(--gold-ink); }
.tag-growth { background: var(--sage-soft); color: var(--sage-ink); }
.dim-track { position: relative; height: 12px; background: var(--ivory-2); border-radius: var(--r-pill); overflow: hidden; }
.dim-fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--navy));
  transition: width 1100ms var(--ease); transition-delay: calc(150ms + var(--i) * 110ms);
}
.dims-card.is-in .dim-fill { width: var(--w); }
.dim-ticks { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(5, 1fr); pointer-events: none; }
.dim-ticks i { border-right: 2px solid var(--white); opacity: 0.7; }

.insights { display: grid; gap: var(--s-6); }
@media (min-width: 860px) { .insights { grid-template-columns: 1fr 1fr; } .insight-even { grid-column: 1 / -1; } }
.insight { display: flex; flex-direction: column; gap: var(--s-4); position: relative; overflow: hidden; }
.insight::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.insight-strength::before { background: var(--gold); }
.insight-growth::before { background: var(--sage); }
.insight-even::before { background: linear-gradient(var(--gold), var(--sage)); }
.insight-kicker { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.kicker-dot { width: 8px; height: 8px; border-radius: 50%; }
.insight-strength .kicker-dot { background: var(--gold); }
.insight-growth .kicker-dot { background: var(--sage); }
.insight-item { display: flex; flex-direction: column; gap: var(--s-1); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.insight-name { font-weight: 700; color: var(--navy); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.pill { font-size: var(--fs-xs); font-weight: 700; padding: 1px var(--s-2); border-radius: var(--r-pill); background: var(--ivory-2); color: var(--navy); }

.low-list { display: flex; flex-direction: column; }
.low-list li { display: grid; grid-template-columns: auto 1fr; gap: var(--s-5); padding: var(--s-5) 0; border-top: 1px solid var(--line); }
.low-list li:first-child { border-top: 0; padding-top: 0; }
.low-score {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--sage-soft); color: var(--sage-ink); font-family: var(--font-serif); font-size: var(--fs-lg); line-height: 1;
}
.low-score small { font-family: var(--font-sans); font-size: 0.6rem; font-weight: 700; margin-top: -10px; }
.low-text { font-family: var(--font-serif); font-size: var(--fs-md); color: var(--navy); line-height: 1.4; margin-bottom: var(--s-2); }
.low-tip { color: var(--muted); font-size: var(--fs-sm); }
.low-tip strong { color: var(--sage-ink); }

.pathways { display: flex; flex-direction: column; gap: var(--s-6); padding: var(--s-10) 0 var(--s-4); }
.section-head { display: flex; flex-direction: column; gap: var(--s-3); max-width: 44rem; }
.path-grid { display: grid; gap: var(--s-5); }
@media (min-width: 900px) { .path-grid { grid-template-columns: repeat(3, 1fr); } }
.path { display: flex; flex-direction: column; gap: var(--s-3); transition-delay: calc(var(--i) * 90ms); }
.path:hover { box-shadow: var(--shadow-md); }
.path-num { font-family: var(--font-serif); font-size: 2.25rem; color: var(--gold); line-height: 1; }
.why-label { margin-top: auto; padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage-ink); }
.why-list { display: flex; flex-direction: column; gap: var(--s-2); font-size: var(--fs-sm); color: var(--muted); }
.why-list li { position: relative; padding-left: var(--s-5); }
.why-list li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 8px; height: 8px; border-radius: 2px; background: var(--sage); transform: rotate(45deg); }
.format-note { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4) var(--s-5); background: var(--gold-soft); border-radius: var(--r-md); color: var(--charcoal); font-size: var(--fs-sm); }
.format-note svg { flex: none; color: var(--gold-ink); margin-top: 2px; }

.next-step {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: var(--s-4);
  background: var(--navy); color: var(--ivory); border-radius: var(--r-lg); padding: var(--s-10) var(--s-6);
}
@media (min-width: 768px) { .next-step { padding: var(--s-12) var(--s-12); } }
.next-step::after {
  content: ''; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
  border: 1px solid rgba(217, 181, 109, 0.35); box-shadow: 0 0 0 40px rgba(217, 181, 109, 0.04), 0 0 0 80px rgba(217, 181, 109, 0.03);
  pointer-events: none;
}
.next-step .h1 { color: var(--ivory); }
.next-main { font-family: var(--font-serif); font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.65rem); line-height: 1.4; max-width: 32em; position: relative; z-index: 1; }
.next-more { display: flex; flex-direction: column; gap: var(--s-2); color: rgba(248, 246, 240, 0.82); font-size: var(--fs-base); max-width: 40em; }
.next-more span { color: var(--gold); font-weight: 600; }
.reflection { margin-top: var(--s-4); padding-top: var(--s-5); border-top: 1px solid rgba(248, 246, 240, 0.16); }
.reflection figcaption { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sage); margin-bottom: var(--s-2); }
.reflection blockquote { font-family: var(--font-serif); font-style: italic; font-size: var(--fs-md); color: rgba(248, 246, 240, 0.9); overflow-wrap: anywhere; }

.stay { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .stay { grid-template-columns: 0.9fr 1.1fr; align-items: start; } }
.stay-copy { display: flex; flex-direction: column; gap: var(--s-3); }
.stay-form { display: flex; flex-direction: column; gap: var(--s-4); align-items: flex-start; }
.stay-form .email-q { width: 100%; }
.stay-form .why { display: none; }
.stay-done { display: flex; gap: var(--s-4); align-items: flex-start; grid-column: 1 / -1; }
.stay-done > svg { flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--gold); color: var(--navy); }

.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); padding: var(--s-6); background: var(--ivory-2); border-radius: var(--r-lg); }
@media (max-width: 599px) { .actions .btn { flex: 1 1 100%; } }
.disclaimer { font-size: var(--fs-xs); color: var(--muted); text-align: center; max-width: 44rem; margin: 0 auto; }

/* ---------- Toast, dialog, confetti ---------- */

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: var(--s-3);
  max-width: calc(100vw - 32px); padding: var(--s-3) var(--s-5);
  background: var(--navy); color: var(--ivory); border-radius: var(--r-pill); box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm); font-weight: 600;
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(217, 181, 109, 0.25); flex: none; }
@media (max-width: 559px) { .app[data-view="assess"] ~ .toast { bottom: calc(88px + env(safe-area-inset-bottom)); } }

.dialog {
  border: 0; padding: 0; border-radius: var(--r-lg); max-width: min(440px, calc(100vw - 32px)); width: 100%;
  background: var(--white); color: var(--charcoal); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(20, 36, 58, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog[open] { animation: dialogIn 260ms var(--ease) both; }
.dialog-body { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-8); }
.dialog-title { font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-h2); color: var(--navy); }
.dialog-text { color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-3); margin-top: var(--s-2); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.cf { position: absolute; top: -20px; display: block; animation: fall var(--t) cubic-bezier(0.25, 0.6, 0.4, 1) var(--d) both; }
.cf-dot { width: 8px; height: 8px; border-radius: 50%; }
.cf-bar { width: 4px; height: 12px; border-radius: 2px; }
.cf-leaf { width: 10px; height: 10px; border-radius: 0 60% 0 60%; }

.view-in { animation: viewIn 520ms var(--ease) both; }

/* ---------- Keyframes ---------- */

@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes inFwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes inBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes outFwd { to { opacity: 0; transform: translateX(-20px); } }
@keyframes outBack { to { opacity: 0; transform: translateX(20px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes nodeIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes light { from { fill: var(--line-strong); } to { fill: var(--gold); } }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes underline { to { transform: scaleX(1); } }
@keyframes affirm { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fall {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx), 85vh, 0) rotate(var(--r)); }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .confetti { display: none; }
}

/* ---------- Print ---------- */

@media print {
  @page { margin: 16mm; }
  body { background: #fff; font-size: 11pt; }
  .topbar, .skip-link, .actions, .stay, .toast, .confetti, .dialog, #live { display: none !important; }
  .container, .container-narrow { max-width: none; padding: 0; }
  .results-hero { padding: 0 0 12pt; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; padding: 14pt; }
  .results-body { gap: 12pt; }
  .overview, .insights, .path-grid { grid-template-columns: 1fr 1fr; }
  .path-grid { grid-template-columns: 1fr; }
  .dim-fill { width: var(--w) !important; transition: none !important; }
  .ring-fill { stroke-dashoffset: var(--o) !important; transition: none !important; }
  .cst-results .cst-shape-g { transform: none !important; animation: none !important; }
  .next-step { background: #fff; color: var(--charcoal); border: 2px solid var(--navy); break-inside: avoid; }
  .next-step .h1, .next-main { color: var(--navy); }
  .next-more, .reflection blockquote { color: var(--charcoal); }
  .next-step::after { display: none; }
  .pathways { padding: 0; }
  .path, .low-list li { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
