:root {
  --bg: #080808;
  --surface: #0d0d0d;
  --surface-2: #121212;
  --text: #f2f2ee;
  --muted: #989892;
  --faint: #6d6d68;
  --line: rgba(255, 255, 255, 0.18);
  --line-soft: rgba(255, 255, 255, 0.09);
  --accent: #ccff00;
  --accent-ink: #080808;
  --danger: #ff7b72;
  --font-sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --header-h: 66px;
  --rail-w: 356px;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--font-sans); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .8rem 1rem; background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; }
.skip-link:focus { top: 1rem; }
.mono { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }

.site-header { height: var(--header-h); position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(8, 8, 8, .94); backdrop-filter: blur(12px); padding: 0 clamp(1rem, 3vw, 2.5rem); }
.wordmark { display: inline-flex; align-items: center; gap: .8rem; color: var(--text); text-decoration: none; font-family: var(--font-mono); font-size: .9rem; letter-spacing: .18em; text-transform: uppercase; }
.wordmark__mark { width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid var(--accent); color: var(--accent); font-weight: 600; letter-spacing: 0; }
.header-title { color: var(--accent); font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; }

.welcome { min-height: calc(100svh - var(--header-h)); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); border-bottom: 1px solid var(--line); }
.welcome__copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: calc(100svh - var(--header-h)); padding: clamp(3rem, 7vw, 7rem); background: linear-gradient(90deg, rgba(8,8,8,.97), rgba(8,8,8,.86)); border-right: 1px solid var(--line); }
.welcome h1 { margin: 0; font-size: clamp(3.5rem, 7vw, 7.8rem); line-height: .84; letter-spacing: -.055em; font-weight: 500; text-transform: uppercase; }
.welcome h1 span { color: var(--accent); }
.welcome__lead { margin: clamp(2rem, 4vw, 3.5rem) 0 .8rem; padding-top: 1.5rem; border-top: 2px solid var(--accent); font-family: var(--font-mono); font-size: clamp(1rem, 1.6vw, 1.35rem); }
.welcome__body { max-width: 760px; margin: 0; color: #cecec8; font-family: var(--font-mono); font-size: clamp(.9rem, 1.1vw, 1.05rem); line-height: 1.75; }
.welcome__meta { display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; margin-top: 2rem; color: var(--text); font-family: var(--font-mono); font-size: .83rem; }
.welcome__meta span { display: inline-flex; align-items: center; gap: .65rem; }
.welcome__meta svg { width: 22px; color: var(--accent); }

.button { min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 1rem; border: 1px solid var(--line); padding: .9rem 1.25rem; background: transparent; color: var(--text); font-family: var(--font-mono); font-size: .82rem; letter-spacing: .035em; cursor: pointer; text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.button:hover:not(:disabled) { border-color: var(--accent); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .38; }
.button svg { width: 20px; }
.button--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.button--primary:hover:not(:disabled) { background: #d7ff36; }
.button--secondary { background: var(--bg); }
.welcome__start { width: min(100%, 540px); justify-content: space-between; margin-top: 2rem; min-height: 74px; padding-inline: 1.7rem; font-size: 1rem; }
.text-button { margin: 1rem auto 0; border: 0; border-bottom: 1px solid var(--accent); padding: .35rem 0; background: none; color: var(--accent); font-family: var(--font-mono); font-size: .76rem; cursor: pointer; }

.welcome__path { display: grid; place-items: center; padding: clamp(2rem, 5vw, 5rem); background: rgba(8, 8, 8, .68); }
.welcome__path ol { width: min(100%, 440px); margin: 0; padding: clamp(1.5rem, 4vw, 3rem); list-style: none; border: 1px solid rgba(255,255,255,.44); background: rgba(10,10,10,.86); box-shadow: 24px 24px 0 -1px #080808, 24px 24px 0 0 var(--line), 48px 48px 0 -1px #080808, 48px 48px 0 0 var(--line); }
.welcome__path li { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 1.3rem; min-height: 94px; }
.welcome__path li:not(:last-child)::after { content: ""; position: absolute; left: 23px; top: 48px; bottom: 0; border-left: 1px solid var(--line); }
.welcome__path li > span { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); font-family: var(--font-mono); font-size: 1.05rem; }
.welcome__path li.is-active > span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.welcome__path strong, .welcome__path small { display: block; font-family: var(--font-mono); }
.welcome__path strong { padding-top: .15rem; color: #c9c9c4; font-size: .82rem; font-weight: 500; }
.welcome__path li.is-active strong { color: var(--accent); }
.welcome__path small { margin-top: .45rem; color: var(--muted); font-size: .7rem; line-height: 1.5; }

.assessment { min-height: calc(100svh - var(--header-h)); display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); }
/* after submit the rail is hidden — collapse to one full-width column */
.assessment--complete { grid-template-columns: minmax(0, 1fr); }
.assessment--complete .success { margin-inline: auto; width: 100%; }
.step-rail { position: sticky; top: var(--header-h); height: calc(100svh - var(--header-h)); border-right: 1px solid var(--line); padding: 2.25rem 2rem; overflow-y: auto; }
.step-rail__intro { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.step-rail__intro span { color: var(--muted); }
.step-rail__intro strong { color: var(--accent); font-family: var(--font-mono); font-size: .78rem; font-weight: 500; }
.step-rail ol { margin: 1.7rem 0 0; padding: 0; list-style: none; }
.step-rail li { position: relative; }
.step-rail li:not(:last-child)::after { content: ""; position: absolute; left: 22px; top: 48px; bottom: 0; border-left: 1px dotted var(--line); }
.step-rail button { width: 100%; min-height: 94px; display: grid; grid-template-columns: 46px 1fr; gap: 1rem; align-items: start; padding: 0; border: 0; background: none; text-align: left; cursor: default; }
.step-rail li.is-complete button { cursor: pointer; }
.step-rail button > span { width: 46px; height: 46px; display: grid; place-items: center; z-index: 1; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--muted); font-family: var(--font-mono); font-size: .85rem; }
.step-rail li.is-active button > span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step-rail li.is-complete:not(.is-active) button > span { border-color: var(--accent); color: var(--accent); }
.step-rail strong, .step-rail small { display: block; font-family: var(--font-mono); }
.step-rail strong { padding-top: .2rem; color: #d8d8d2; font-size: .72rem; letter-spacing: .025em; text-transform: uppercase; }
.step-rail li.is-active strong { color: var(--accent); }
.step-rail small { margin-top: .55rem; color: var(--faint); font-size: .68rem; }

.assessment__workspace { min-width: 0; }
.mobile-progress { display: none; }
#assessment-form { min-height: calc(100svh - var(--header-h)); display: flex; flex-direction: column; }
.form-step { flex: 1; min-width: 0; margin: 0; padding: clamp(2rem, 5vw, 4.5rem); border: 0; }
.step-heading { display: block; width: 100%; margin: 0 0 2.5rem; padding: 0 0 1.8rem; border-bottom: 1px solid var(--line); }
.step-heading > span { display: block; margin-bottom: .6rem; color: var(--accent); font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
.step-heading > strong { display: block; font-size: clamp(2rem, 4vw, 4rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.05; }
.step-heading > small { display: block; max-width: 800px; margin-top: .8rem; color: #b5b5af; font-family: var(--font-mono); font-size: .82rem; line-height: 1.65; }

.field-grid { display: grid; gap: 1.8rem 2.2rem; }
.field-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field--full, .choice-group--full { grid-column: 1 / -1; }
.field { position: relative; display: flex; flex-direction: column; min-width: 0; }
.field > span, .choice-group > legend { display: block; margin-bottom: .55rem; color: #e3e3dc; font-family: var(--font-mono); font-size: .75rem; line-height: 1.45; }
.field em, .choice-group em, .consent em { color: var(--accent); font-style: normal; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; background: #0b0b0b; color: var(--text); padding: .9rem 1rem; font-family: var(--font-mono); font-size: .82rem; transition: border-color .2s, background .2s; }
.field input, .field select { min-height: 50px; }
.field textarea { min-height: 116px; resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: #686864; opacity: 1; }
.field select { appearance: none; padding-right: 2.8rem; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(255,255,255,.34); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--accent); background: #0e0e0e; box-shadow: 0 0 0 1px var(--accent); }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea, .choice-group.is-invalid .choice-list { border-color: var(--danger); }
.field__count { position: absolute; right: .7rem; bottom: .55rem; color: var(--faint); font-family: var(--font-mono); font-size: .63rem; pointer-events: none; }

.choice-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-group > legend { width: 100%; }
.choice-group > legend small { display: block; margin-top: .25rem; color: var(--muted); font-size: .68rem; }
.choice-list { display: grid; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.choice-list label { min-height: 58px; display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; background: var(--bg); cursor: pointer; transition: background .18s, color .18s; }
.choice-list label:hover { background: var(--surface-2); }
.choice-list label:has(input:checked) { background: #131700; box-shadow: inset 0 0 0 1px var(--accent); }
.choice-list input { width: 19px; height: 19px; flex: 0 0 auto; margin: 0; accent-color: var(--accent); }
.choice-list span { font-family: var(--font-mono); font-size: .76rem; }
.choice-list span strong, .choice-list span small { display: block; }
.choice-list span strong { font-weight: 500; }
.choice-list span small { margin-top: .2rem; color: var(--muted); font-size: .66rem; }
.choice-list--compact label { min-height: 43px; padding-block: .55rem; }

.scale-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.scale-options label { min-height: 76px; display: grid; place-items: center; background: var(--bg); cursor: pointer; }
.scale-options input { position: absolute; opacity: 0; pointer-events: none; }
.scale-options span { text-align: center; color: var(--muted); font-family: var(--font-mono); font-size: 1rem; }
.scale-options small { display: block; margin-top: .25rem; color: var(--faint); font-size: .58rem; text-transform: uppercase; }
.scale-options label:has(input:checked) { background: var(--accent); }
.scale-options label:has(input:checked) span, .scale-options label:has(input:checked) small { color: var(--accent-ink); }

.consent { display: flex; gap: .85rem; align-items: flex-start; padding: 1.2rem; border: 1px solid var(--line); color: #c9c9c3; font-family: var(--font-mono); font-size: .72rem; cursor: pointer; }
.consent:has(input:checked) { border-color: var(--accent); }
.consent input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: .1rem; accent-color: var(--accent); }

.form-actions { position: sticky; bottom: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; padding: 1.1rem clamp(1rem, 3vw, 2.5rem); border-top: 1px solid var(--line); background: rgba(8,8,8,.95); backdrop-filter: blur(12px); }
.form-actions .button:first-child { justify-self: start; }
.form-actions .button:last-child { justify-self: end; min-width: 220px; justify-content: space-between; }
.save-button { justify-self: center; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.validation-summary { margin: 0 clamp(2rem, 5vw, 4.5rem) 1rem; border: 1px solid var(--danger); padding: 1rem 1.2rem; color: #ffd7d3; background: #1d0d0d; font-family: var(--font-mono); font-size: .76rem; }
.review { margin-top: 2rem; }
.review__heading { padding: 2.2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.review__heading > span { color: var(--accent); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.review__heading h2 { margin: .6rem 0; font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 500; letter-spacing: -.04em; }
.review__heading p { margin: 0; color: var(--muted); font-family: var(--font-mono); font-size: .78rem; }
.review__content { display: grid; gap: 1px; margin: 2rem 0; background: var(--line); border: 1px solid var(--line); }
.review-section { background: var(--bg); padding: 1.4rem; }
.review-section h3 { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; color: var(--accent); font-family: var(--font-mono); font-size: .75rem; font-weight: 500; text-transform: uppercase; }
.review-section h3 button { border: 0; border-bottom: 1px solid var(--muted); background: none; color: var(--muted); font-family: var(--font-mono); font-size: .68rem; cursor: pointer; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem 2rem; }
.review-item span, .review-item strong { display: block; }
.review-item span { margin-bottom: .25rem; color: var(--faint); font-family: var(--font-mono); font-size: .64rem; text-transform: uppercase; }
.review-item strong { white-space: pre-wrap; color: #d8d8d2; font-family: var(--font-mono); font-size: .75rem; font-weight: 400; }
.review__actions { display: flex; justify-content: flex-end; gap: 1rem; }
.privacy-note { color: var(--faint); font-family: var(--font-mono); font-size: .66rem; text-align: right; }
.privacy-note a { color: var(--text); }

.success { min-height: calc(100svh - var(--header-h)); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; max-width: 960px; padding: clamp(2rem, 8vw, 7rem); }
.success__number { width: 74px; height: 74px; display: grid; place-items: center; margin-bottom: 2rem; background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono); font-size: 2rem; }
.success .mono { color: var(--accent); }
.success h2 { margin: .7rem 0 1rem; font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1; letter-spacing: -.05em; font-weight: 500; }
.success > p:not(.mono) { max-width: 720px; color: #bebeb8; font-family: var(--font-mono); font-size: .9rem; line-height: 1.7; }
.success__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

@media (max-width: 1100px) {
  :root { --rail-w: 286px; }
  .welcome { grid-template-columns: 1fr; }
  .welcome__copy { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .welcome__path { min-height: 620px; }
  .field-grid--2 { grid-template-columns: 1fr; }
  .field--full, .choice-group--full { grid-column: auto; }
}

@media (max-width: 760px) {
  :root { --header-h: 58px; }
  .site-header { padding-inline: 1rem; }
  .wordmark { font-size: .72rem; gap: .6rem; }
  .wordmark__mark { width: 28px; height: 28px; }
  .header-title { display: none; }
  .welcome__copy { padding: 3.5rem 1.25rem; }
  .welcome h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .welcome__body { font-size: .8rem; }
  .welcome__meta { flex-direction: column; gap: 1rem; }
  .welcome__path { min-height: 560px; padding: 2rem 1.25rem 4rem; overflow: hidden; }
  .welcome__path ol { padding: 1.4rem; box-shadow: 14px 14px 0 -1px #080808, 14px 14px 0 0 var(--line), 28px 28px 0 -1px #080808, 28px 28px 0 0 var(--line); }
  .welcome__path li { grid-template-columns: 42px 1fr; gap: 1rem; min-height: 88px; }
  .welcome__path li > span { width: 42px; height: 42px; }
  .welcome__path li:not(:last-child)::after { left: 20px; top: 42px; }

  .assessment { display: block; }
  .step-rail { display: none; }
  .mobile-progress { position: sticky; top: var(--header-h); z-index: 30; display: block; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: rgba(8,8,8,.96); }
  .mobile-progress > span { display: block; margin-bottom: .55rem; color: var(--accent); font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; }
  .mobile-progress > div { height: 2px; background: var(--line); }
  .mobile-progress > div span { display: block; height: 100%; width: 20%; background: var(--accent); transition: width .25s; }
  .form-step { padding: 2.2rem 1rem 1.5rem; }
  .step-heading { margin-bottom: 1.7rem; }
  .step-heading > strong { font-size: 2.35rem; }
  .field-grid { gap: 1.35rem; }
  .scale-options { grid-template-columns: repeat(5, minmax(52px, 1fr)); overflow-x: auto; }
  .form-actions { grid-template-columns: 1fr 1fr; padding: .8rem 1rem; }
  .save-button { display: none; }
  .form-actions .button:last-child { min-width: 0; }
  .review-grid { grid-template-columns: 1fr; }
  .review__actions { flex-direction: column; }
  .review__actions .button { width: 100%; }
  .privacy-note { text-align: left; }
  .success { padding: 3rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; }
}

@media print {
  .site-header, .welcome, .step-rail, .mobile-progress, .form-actions, .validation-summary, .review__actions, .privacy-note { display: none !important; }
  body { background: #fff; color: #111; }
  .assessment { display: block !important; }
  .assessment__workspace { width: 100%; }
  .form-step { display: none !important; }
  .form-step[data-step="5"], .review { display: block !important; padding: 0; }
  #goals-fields, .step-heading { display: none !important; }
  .review__heading, .review-section, .review__content { border-color: #bbb; background: #fff; color: #111; }
  .review__heading h2, .review-item strong { color: #111; }
  .review-item span { color: #555; }
}
