:root {
  color-scheme: light;
  --paper: #f4f0e8;
  --paper-deep: #e8e1d5;
  --ink: #14213d;
  --ink-soft: #526079;
  --line: rgba(20, 33, 61, 0.19);
  --signal: #f05a3c;
  --signal-dark: #c83f25;
  --acid: #dff33d;
  --white: #fffdf8;
  --shadow: 0 22px 70px rgba(20, 33, 61, 0.12);
  --radius: 26px;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --sans: 'Noto Sans CJK SC', 'Microsoft YaHei', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--paper);
  background-size: 64px 64px;
  font-family: var(--sans);
}

button, input { font: inherit; }

button { color: inherit; }

button:focus-visible, a:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 4px;
}

.site-shell {
  display: flex;
  width: min(1240px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  flex-direction: column;
}

.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-header { border-bottom: 1px solid var(--line); }
.site-footer { margin-top: auto; border-top: 1px solid var(--line); color: var(--ink-soft); }

.wordmark { display: inline-flex; align-items: center; gap: 12px; color: inherit; font-weight: 700; text-decoration: none; }
.wordmark-mark { width: 18px; height: 18px; background: var(--signal); box-shadow: 8px 8px 0 var(--ink); }
.header-meta { display: flex; align-items: center; gap: 24px; }
.privacy-badge { padding: 7px 10px; border: 1px solid var(--ink); border-radius: 100px; }

main { flex: 1; }
.screen { display: none; animation: screen-in 420ms cubic-bezier(.2,.75,.25,1) both; }
.screen.is-active { display: block; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-screen { position: relative; min-height: 720px; padding: clamp(70px, 9vw, 122px) 0 64px; }
.hero-copy { position: relative; z-index: 2; width: min(650px, 60%); }
.eyebrow, .section-label { margin: 0 0 22px; font: 500 12px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { display: inline-block; width: 36px; height: 2px; margin: 0 12px 3px 0; background: var(--signal); content: ''; }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 28px; font-size: clamp(48px, 6vw, 84px); line-height: 1.1; letter-spacing: -.055em; }
.hero-lede { width: min(580px, 100%); margin-bottom: 34px; color: var(--ink-soft); font-size: 18px; line-height: 1.9; }

.primary-button, .secondary-button, .compact-button {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.primary-button {
  display: inline-flex;
  min-width: 206px;
  min-height: 58px;
  padding: 0 22px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 7px 7px 0 var(--signal);
  font-weight: 700;
}
.primary-button:hover { transform: translate(-2px, -2px); box-shadow: 10px 10px 0 var(--signal); }
.microcopy { margin: 24px 0 0; color: var(--ink-soft); font: 12px/1.7 var(--mono); }

.hero-object {
  position: absolute;
  z-index: 1;
  top: 72px;
  right: -12px;
  display: grid;
  width: clamp(330px, 38vw, 480px);
  aspect-ratio: 1;
  place-items: center;
}
.hero-object::after { position: absolute; width: 76%; height: 76%; border-radius: 50%; background: var(--acid); content: ''; }
.orbit { position: absolute; z-index: 2; border: 1px solid var(--ink); border-radius: 50%; }
.orbit-large { width: 100%; height: 64%; transform: rotate(-18deg); }
.orbit-small { width: 66%; height: 100%; transform: rotate(32deg); }
.memory-core { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(2, 72px); gap: 5px; transform: rotate(-4deg); }
.memory-core span { display: grid; aspect-ratio: 1; place-items: center; background: var(--ink); color: var(--white); font: 500 26px var(--mono); }
.memory-core span:nth-child(2), .memory-core span:nth-child(3) { background: var(--signal); }
.hero-object p { position: absolute; z-index: 3; right: 24px; bottom: 62px; margin: 0; font: 11px var(--mono); letter-spacing: .12em; }

.test-map { position: relative; z-index: 4; display: grid; width: min(820px, 72%); margin-top: 92px; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: rgba(244, 240, 232, .82); backdrop-filter: blur(8px); }
.test-map article { display: grid; padding: 22px 20px; grid-template-columns: 48px 1fr; gap: 14px; }
.test-map article + article { border-left: 1px solid var(--ink); }
.map-index { color: var(--signal); font: 13px var(--mono); }
.test-map h2 { margin-bottom: 5px; font-size: 17px; }
.test-map p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }

.brief-screen { padding: 58px 0 100px; }
.brief-layout { display: grid; grid-template-columns: 1fr minmax(390px, .78fr); gap: clamp(48px, 8vw, 120px); align-items: start; }
.brief-layout h1 { font-size: clamp(54px, 7vw, 88px); }
.brief-card { padding: clamp(28px, 4vw, 44px); background: var(--ink); color: var(--white); box-shadow: 12px 12px 0 var(--signal); }
.brief-card > p { color: rgba(255, 253, 248, .78); font-size: 17px; line-height: 1.9; }
.example-row { display: flex; min-height: 84px; margin: 28px 0; padding: 18px; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid rgba(255,255,255,.24); font: 18px var(--mono); }
.example-row strong { color: var(--acid); }
.brief-list { display: grid; margin: 0 0 30px; padding: 0; gap: 11px; color: rgba(255, 253, 248, .72); list-style: none; font-size: 13px; }
.brief-list li::before { margin-right: 10px; color: var(--signal); content: '＋'; }
.full-button { width: 100%; background: var(--white); color: var(--ink); box-shadow: 6px 6px 0 var(--signal); }

.task-screen { padding: 52px 0 80px; }
.task-topline { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.task-topline h1 { margin: 0; font-size: clamp(34px, 4.6vw, 58px); }
.task-topline .section-label { margin-bottom: 10px; }
.round-counter { font: 20px var(--mono); }
.progress-track { height: 4px; margin: 26px 0 30px; overflow: hidden; background: var(--paper-deep); }
.progress-track span { display: block; width: 12.5%; height: 100%; background: var(--signal); transition: width 300ms ease; }
.task-stage { position: relative; display: grid; min-height: 510px; padding: clamp(30px, 5vw, 64px); place-items: center; border: 1px solid var(--ink); background: rgba(255, 253, 248, .72); box-shadow: var(--shadow); }
.stage-prompt { position: absolute; top: 28px; left: 0; width: 100%; color: var(--ink-soft); text-align: center; font: 12px var(--mono); letter-spacing: .06em; }
.digit-display { font: 500 clamp(80px, 13vw, 148px)/1 var(--mono); }
.answer-panel { width: min(440px, 100%); text-align: center; }
.answer-panel > p { color: var(--ink-soft); font-size: 13px; }
.digit-answer { min-height: 64px; margin-bottom: 24px; overflow-wrap: anywhere; color: var(--ink); font: 500 clamp(27px, 5vw, 42px)/1.3 var(--mono); letter-spacing: .14em; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { min-height: 54px; border: 1px solid var(--ink); background: var(--white); cursor: pointer; font: 18px var(--mono); transition: background 120ms ease, color 120ms ease, transform 120ms ease; }
.keypad button:hover { background: var(--acid); transform: translateY(-1px); }
.keypad .key-muted { color: var(--ink-soft); font: 12px var(--sans); }
.keypad .key-accent { border-color: var(--signal); background: var(--signal); color: var(--white); font: 700 13px var(--sans); }
.trial-feedback { display: grid; min-height: 180px; place-items: center; text-align: center; }
.feedback-mark { display: block; margin-bottom: 18px; font: 500 68px/1 var(--mono); }
.feedback-correct .feedback-mark { color: #16825f; }
.feedback-wrong .feedback-mark { color: var(--signal); }
.trial-feedback strong { display: block; margin-bottom: 8px; font-size: 22px; }
.trial-feedback p { margin: 0; color: var(--ink-soft); }

.spatial-stage { align-content: center; gap: 26px; }
.spatial-grid { display: grid; width: min(420px, 80vw); grid-template-columns: repeat(4, 1fr); gap: 10px; }
.spatial-cell { position: relative; aspect-ratio: 1; border: 1px solid var(--ink); background: var(--paper); cursor: pointer; transition: background 140ms ease, transform 140ms ease, box-shadow 140ms ease; }
.spatial-cell:disabled { cursor: default; }
.spatial-cell.is-flashing { z-index: 2; border-color: var(--signal); background: var(--signal); box-shadow: 0 0 0 7px rgba(240, 90, 60, .18); transform: scale(.92); }
.spatial-cell.is-selected { background: var(--ink); color: var(--white); }
.spatial-cell.is-selected::after { position: absolute; inset: 0; display: grid; place-items: center; content: attr(data-order); font: 18px var(--mono); }
.spatial-actions { display: flex; width: min(540px, 100%); align-items: center; justify-content: space-between; gap: 18px; color: var(--ink-soft); font: 12px var(--mono); }
.spatial-actions > div { display: flex; gap: 12px; }
.text-button { border: 0; border-bottom: 1px solid var(--ink); background: transparent; cursor: pointer; }
.compact-button { min-height: 42px; padding: 0 18px; background: var(--ink); color: var(--white); font-weight: 700; }
.compact-button:disabled { cursor: not-allowed; opacity: .35; }

.result-screen { padding: 62px 0 90px; }
.result-heading { display: grid; margin-bottom: 42px; grid-template-columns: 1.3fr .7fr; gap: 72px; align-items: end; }
.result-heading h1 { margin: 0; font-size: clamp(48px, 6vw, 76px); }
.result-heading > p { margin-bottom: 8px; color: var(--ink-soft); line-height: 1.8; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.result-card { min-height: 370px; padding: clamp(28px, 4vw, 42px); border: 1px solid var(--ink); background: var(--white); }
.result-verbal { box-shadow: 8px 8px 0 var(--signal); }
.result-spatial { box-shadow: 8px 8px 0 var(--acid); }
.result-card-head { display: flex; align-items: center; gap: 14px; }
.result-card-head span { color: var(--signal); font: 12px var(--mono); }
.result-card-head h2 { margin: 0; font-size: 19px; }
.span-metric { display: flex; margin: 28px 0 20px; align-items: end; gap: 15px; }
.span-metric strong { font: 500 clamp(70px, 9vw, 104px)/.85 var(--mono); letter-spacing: -.08em; }
.span-metric span { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.result-card > p { min-height: 52px; color: var(--ink-soft); line-height: 1.75; }
.trial-track { display: flex; margin-top: 24px; gap: 7px; }
.trial-pill { flex: 1; min-width: 0; padding-top: 9px; border-top: 4px solid var(--paper-deep); color: var(--ink-soft); font: 10px var(--mono); text-align: center; }
.trial-pill.is-correct { border-color: #16825f; }
.trial-pill.is-wrong { border-color: var(--signal); }
.result-notes { display: flex; margin-top: 34px; padding: 26px 0 0; align-items: center; justify-content: space-between; gap: 32px; border-top: 1px solid var(--line); }
.result-notes > div { display: flex; max-width: 720px; gap: 16px; }
.result-notes p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.75; }
.result-notes p strong { color: var(--ink); }
.note-mark { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font: 12px var(--mono); }
.secondary-button { min-height: 48px; padding: 0 20px; border: 1px solid var(--ink); background: transparent; font-weight: 700; white-space: nowrap; }
.secondary-button:hover { background: var(--ink); color: var(--white); }

@media (max-width: 820px) {
  .site-shell { width: min(100% - 28px, 680px); }
  .site-header { min-height: 66px; }
  .header-meta > span:first-child { display: none; }
  .hero-screen { min-height: auto; padding-top: 54px; }
  .hero-copy { width: 100%; }
  .hero-object { position: relative; top: auto; right: auto; width: min(370px, 90vw); margin: 40px auto 10px; }
  .test-map { width: 100%; margin-top: 38px; }
  .brief-layout, .result-heading { grid-template-columns: 1fr; gap: 26px; }
  .brief-layout { max-width: 620px; margin: 0 auto; }
  .result-grid { grid-template-columns: 1fr; }
  .task-stage { min-height: 490px; padding-inline: 20px; }
}

@media (max-width: 560px) {
  body { background-size: 42px 42px; }
  .site-footer { min-height: 70px; gap: 16px; font-size: 9px; }
  .privacy-badge { padding: 6px 8px; font-size: 9px; }
  h1 { font-size: clamp(42px, 13vw, 60px); }
  .hero-lede { font-size: 16px; }
  .hero-object { width: min(310px, 86vw); }
  .memory-core { grid-template-columns: repeat(2, 58px); }
  .test-map { grid-template-columns: 1fr; }
  .test-map article + article { border-top: 1px solid var(--ink); border-left: 0; }
  .brief-screen, .task-screen, .result-screen { padding-top: 36px; }
  .brief-card { box-shadow: 7px 7px 0 var(--signal); }
  .task-topline { align-items: start; }
  .task-topline h1 { font-size: 31px; }
  .round-counter { font-size: 15px; }
  .spatial-grid { width: min(330px, 84vw); gap: 7px; }
  .spatial-actions { align-items: start; flex-direction: column; }
  .spatial-actions > div { width: 100%; justify-content: space-between; }
  .result-notes { align-items: stretch; flex-direction: column; }
  .secondary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
