/* Shared with every stage of the association test. The homepage's three
   voices: editorial serif, restrained sans, and measured mono labels. */
:root {
  --paper: #fbf5ea;
  --ink: #17191b;
  --ink-mid: #4b4e51;
  --ink-light: #565a60;
  --sea: #283853;
  --bone: #fbf7ee;
  --red: #b5402f;
  --red-hover: #9c3526;
  --line: #ccc6bb;
  --display: "Instrument Serif", Georgia, serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--body); font-size: 17px; line-height: 1.66; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; }
h1 { font-size: clamp(3.5rem, 6.6vw, 6.5rem); line-height: .96; letter-spacing: -.028em; }
h2 { font-size: clamp(2.5rem, 4.4vw, 3.5rem); line-height: 1.08; letter-spacing: -.018em; }
h3 { font-size: 2rem; line-height: 1.15; }
a { color: inherit; text-underline-offset: 4px; }
button, input { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 6px; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.eyebrow, .trust-line, .nav-link, .adaptation-note, .button, .progress-indicator, .threshold-instruction, .test-meta, .submit-btn, .text-button { font-family: var(--mono); font-size: 12px; font-weight: 400; line-height: 1.6; letter-spacing: .08em; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; }
.eyebrow::before { content: ""; display: inline-block; width: 24px; height: 1px; background: currentColor; margin-right: 12px; vertical-align: middle; opacity: .6; }
.site-nav { position: relative; z-index: 2; max-width: 1200px; width: 84%; margin: auto; min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { display: inline-flex; align-items: center; gap: .42em; font-family: var(--display); font-size: 2rem; line-height: 1; text-decoration: none; min-height: 44px; }
.wordmark img { width: .98em; height: .98em; }
.nav-link { min-height: 44px; display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.nav-link:hover, .text-link:hover, .version-link:hover { text-decoration: underline; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 30; background: var(--paper); padding: 12px; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.landing-page { background: linear-gradient(180deg, #283853 0%, #17233a 62%, #000 100%); }
.landing-page .site-nav { color: var(--ink); }
.landing-page .site-nav::before { content: ""; position: absolute; top: 0; left: 50%; width: 100vw; height: 108px; transform: translateX(-50%); background: var(--paper); z-index: -1; }
.landing-hero { position: relative; padding: 28px 0 44px; color: var(--ink); }
.hero-paint { position: absolute; inset: -108px 0 0; background: linear-gradient(180deg, rgba(251,245,234,.90), rgba(251,245,234,.80) 42%, rgba(251,245,234,.84)), url("/paint/storm_wave_yellow_sky.avif") center 58% / cover; }
.hero-inner, .content-width { position: relative; width: 84%; max-width: 1200px; margin: auto; }
.hero-lede { max-width: 54ch; color: #34383d; }
.trust-line { margin: 24px 0 18px; }
.button, .submit-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 24px; padding: 18px 24px; min-height: 54px; border: 0; border-radius: 0; background: var(--red); color: var(--bone); text-decoration: none; transition: background 180ms ease; }
.button::before { content: ""; position: absolute; inset: -5px; pointer-events: none; border: 1px solid var(--red); clip-path: polygon(0 0, 8px 0, 8px 1px, calc(100% - 8px) 1px, calc(100% - 8px) 0, 100% 0, 100% 8px, calc(100% - 1px) 8px, calc(100% - 1px) calc(100% - 8px), 100% calc(100% - 8px), 100% 100%, calc(100% - 8px) 100%, calc(100% - 8px) calc(100% - 1px), 8px calc(100% - 1px), 8px 100%, 0 100%, 0 calc(100% - 8px), 1px calc(100% - 8px), 1px 8px, 0 8px); }
.button:hover, .submit-btn:hover { background: var(--red-hover); }
.text-link { font-size: 14px; display: inline-flex; align-items: center; min-height: 44px; }
.version-section { margin-top: 28px; scroll-margin-top: 24px; }
.version-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 0; }
.version-card { padding: 24px; border: 1px solid #a5a198; background: rgba(251,245,234,.72); display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.version-card h3 { margin: 12px 0 10px; }
.version-card p:not(.eyebrow) { font-size: 16px; color: var(--ink-mid); max-width: 45ch; }
.version-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; text-decoration: none; color: var(--red-hover); }
.adaptation-note { color: var(--ink-mid); font-size: 11px; letter-spacing: .01em; margin-top: 16px; }
.source-link { display: inline-block; margin-top: 24px; font-size: 14px; }
.site-footer { width: 84%; max-width: 1200px; margin: auto; padding: 36px 0; border-top: 1px solid #616673; color: var(--bone); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-footer .wordmark { font-size: 1.6rem; }
.landing-page .site-footer img { filter: invert(1); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; font-size: 14px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer > p { flex-basis: 100%; font-size: 13px; color: #c6c9d0; }
/* Test screens stay quiet and readable: paper on open sea. */
.test-page { min-height: 100dvh; background: linear-gradient(180deg, #283853, #17233a 55%, #0a1322); }
.test-page .site-nav { color: var(--bone); min-height: 88px; }
.test-page .wordmark img { filter: invert(1); }
.test-meta { color: #dedfe4; text-align: center; margin: 8px 24px 24px; text-transform: uppercase; }
.stage { width: min(820px, 90%); min-height: min(600px, calc(100dvh - 220px)); margin: auto auto 32px; padding: clamp(28px, 5vw, 64px); background: var(--paper); position: relative; }
.screen { display: none; opacity: 0; transition: opacity 220ms ease; }
.screen.active { display: block; }
.screen.visible { opacity: 1; }
#screen-2.active { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20px 0; }
.stimulus-word { font-family: var(--display); font-size: clamp(3.75rem, 10vw, 7rem); line-height: 1.1; letter-spacing: -.02em; opacity: 0; margin: 24px 0; transition: opacity 120ms ease; overflow-wrap: anywhere; max-width: 100%; }
.stimulus-word.visible, .response-input-wrap.visible { opacity: 1; }
.word-prompt { font-size: 16px; color: var(--ink-mid); margin-bottom: 24px; }
.response-input-wrap { opacity: 0; width: min(350px, 100%); transition: opacity 120ms ease; }
.response-input { width: 100%; min-height: 64px; padding: 12px; border: 0; border-bottom: 1px solid #666b71; border-radius: 0; font-family: var(--display); font-size: 2.5rem; text-align: center; color: var(--ink); background: transparent; caret-color: var(--red); }
.response-input:focus-visible { outline-offset: 4px; }
.submit-btn { margin-top: 24px; visibility: hidden; }
.submit-btn.visible { visibility: visible; }
.test-help { margin-top: 16px; color: var(--ink-mid); font-size: 13px; }
.progress-indicator { position: relative; color: var(--bone); text-align: center; opacity: 0; margin: 16px 0 28px; font-variant-numeric: tabular-nums; }
.progress-indicator.visible { opacity: 1; }
.exp-progress-wrap { width: min(820px, 90%); margin: 0 auto 28px; opacity: 0; }
.exp-progress-wrap.visible { opacity: 1; }
.exp-progress-track { height: 3px; background: #67728a; }
.exp-progress-fill { height: 100%; width: 0; background: #fbf5ea; transition: width 180ms ease; }
.waiting-bar-wrap { display: none; margin: 24px 0; }
.waiting-bar-wrap.visible { display: block; }
.waiting-bar-track { height: 3px; background: var(--line); }
.waiting-bar-fill { height: 100%; background: var(--red); transition: width 180ms ease; }
.waiting-bar-label { font-family: var(--mono); font-size: 12px; margin-top: 12px; }
.finding-heading { margin: 24px 0 16px; }
.finding-description { font-size: 15px; color: var(--ink-mid); margin-bottom: 24px; }
.finding-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.finding-row { opacity: 0; border-top: 1px solid var(--line); padding-top: 16px; }
.finding-row.visible { opacity: 1; }
.finding-stim { display: block; font-family: var(--display); font-size: 2rem; overflow-wrap: anywhere; }
.finding-sep { display: none; }
.finding-ms { font-family: var(--mono); font-size: 14px; }
.finding-ms .unit { font-size: 11px; margin-left: 5px; }
.finding-rule { height: 1px; background: var(--line); opacity: 0; margin: 28px 0; }
.finding-rule.visible { opacity: 1; }
.finding-paragraph { opacity: 0; overflow-wrap: anywhere; }
.finding-paragraph.visible { opacity: 1; }
.finding-paragraph p { margin-bottom: 20px; }
.finding-paragraph h2, .finding-paragraph h3 { margin: 24px 0 16px; font-size: 2rem; }
.finding-paragraph .deepen, .finding-paragraph .close { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 24px; }
.finding-paragraph blockquote { font-family: var(--display); font-size: 1.75rem; margin: 24px 0; }
.finding-retry { display: none; margin-top: 24px; }
.finding-retry.visible { display: block; }
.text-button { min-height: 44px; padding: 12px 16px; color: var(--ink); background: transparent; border: 1px solid #666b71; }
.result-next { margin-top: 36px; padding: 32px; background: var(--sea); color: var(--bone); }
.result-next h3 { margin: 16px 0; }
.result-next > p:not(.eyebrow):not(.result-terms) { margin-bottom: 24px; color: #e0e3e8; }
.reading-caveat { margin-top: 24px; font-size: 13px; color: var(--ink-mid); }
#screen-5 { text-align: center; }
.threshold-heading { margin: 24px 0; }
.threshold-body { color: var(--ink-mid); margin: 24px 0; }
.threshold-instruction { margin-bottom: 28px; }
.test-page .site-footer { margin-top: 40px; }
.noscript-note { width: 90%; max-width: 820px; margin: 24px auto; padding: 24px; background: var(--paper); }
@media (max-width: 800px) {
  .site-nav, .hero-inner, .content-width, .site-footer { width: 88%; }
  .site-nav { min-height: 88px; }
  .landing-page .site-nav::before { height: 88px; }
  .hero-paint { top: -88px; }
  .landing-hero { padding-top: 28px; }
  h1 { font-size: clamp(3.5rem, 10vw, 5rem); }
  .version-card { padding: 20px; }
}
@media (max-width: 560px) {
  .wordmark { font-size: 1.65rem; }
  .nav-link { font-size: 10px; gap: 6px; letter-spacing: .03em; }
  .version-grid { grid-template-columns: 1fr; }
  .version-section { margin-top: 36px; }
  .site-footer nav { margin-left: 0; gap: 16px; }
  .site-footer { align-items: flex-start; }
  .test-page .site-nav { min-height: 80px; }
  .test-page .site-nav { gap: 12px; }
  .test-page .site-nav .wordmark { font-size: 1.5rem; white-space: nowrap; }
  .test-page .site-nav .nav-link { white-space: nowrap; }
  .test-meta { font-size: 10px; margin-bottom: 18px; }
  .stage { padding: 28px 22px; min-height: 0; }
  .finding-top { gap: 10px; }
  .finding-stim { font-size: 1.6rem; }
  .finding-ms { font-size: 12px; }
  .finding-ms .unit { font-size: 10px; }
}

/* A quiet landing: one introduction, two doors, supporting reference text. */
.landing-page .hero-inner { max-width: 800px; text-align: center; }
.landing-hero h1 { max-width: 16ch; margin: 20px auto 24px; font-size: clamp(3.3rem, 6vw, 5.5rem); }
.landing-hero .hero-lede { margin: auto; }
.version-card { align-items: center; text-align: center; gap: 20px; }
.version-card h2 { font-size: 2rem; }
.version-card .eyebrow { font-size: 11px; letter-spacing: .06em; }
.version-card .eyebrow::before { display: none; }
.version-card .button { padding: 16px 20px; gap: 16px; letter-spacing: .04em; }
.button-secondary { color: var(--red-hover); border: 1px solid var(--red); background: transparent; }
.button-secondary::before { display: none; }
.button-secondary:hover { color: var(--bone); background: var(--red-hover); }
.test-explanation { width: 84%; max-width: 760px; margin: 48px auto; padding: 40px 48px; background: var(--paper); font-size: 14px; line-height: 1.8; color: var(--ink-mid); }
.test-explanation section + section { margin-top: 32px; }
.test-explanation h2 { font-size: 1.6rem; font-style: italic; line-height: 1.2; margin-bottom: 14px; color: var(--ink); }
.test-explanation p + p { margin-top: 12px; }
.test-explanation ul { padding-left: 20px; margin: 12px 0; }
.test-explanation li { margin: 4px 0; }
.test-explanation .reference { font-style: italic; }
.test-explanation .source-link { font-size: 13px; }
.result-next h3 { font-size: clamp(2.25rem, 5vw, 2.75rem); }
.result-terms { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; line-height: 1.7; margin: 20px 0 0; color: #e0e3e8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 560px) {
  .landing-hero { padding-top: 24px; padding-bottom: 32px; }
  .landing-hero .eyebrow { font-size: 10px; letter-spacing: .08em; }
  .landing-hero .eyebrow::before { display: none; }
  .landing-hero h1 { font-size: 3.3rem; }
  .landing-hero .trust-line { font-size: 11px; letter-spacing: .025em; }
  .version-section { margin-top: 24px; }
  .version-card { gap: 16px; }
  .adaptation-note { max-width: 42ch; margin: 20px auto 0; }
  .test-explanation { width: 90%; padding: 28px 24px; margin-top: 28px; margin-bottom: 32px; }
  .result-next { padding: 24px 20px; }
  .result-next .button { width: 100%; padding: 16px 12px; gap: 12px; letter-spacing: .03em; }
}

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