/* Human Lab – bright "lab notebook" theme */
:root {
  --paper: #F6F3EE;
  --paper-2: #FFFFFF;
  --ink: #1B1B1F;
  --ink-2: #45454F;
  --muted: #5F5F6B;
  --line: #DEDAD2;
  --blue: #2F5BFF;
  --tomato: #FF6A4D;
  --lime: #C6F432;
  --red: #E5383B;
  --green: #138A45;
  --violet: #6A4DFF;
  --pink: #FF5FAE;
  --amber: #FFB800;
  --radius: 22px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 400 1.05rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(rgba(27, 27, 31, .07) 1px, transparent 1px);
  background-size: 22px 22px;
}
h1, h2 { font-family: var(--display); font-weight: 800; margin: 0; line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ol, ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--blue); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 16px; }

.top, main, .foot { width: min(100% - 40px, 1040px); margin-inline: auto; }
.top { padding-top: 18px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: .92rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 8px; }
.crumbs a { color: var(--ink-2); display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* Hero */
.hero { padding: clamp(28px, 7vw, 72px) 0 24px; display: grid; gap: 20px; }
.tag { justify-self: start; padding: 6px 14px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 700; font-size: .88rem; background: var(--paper-2); }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); }
.hero h1 em { font-style: italic; }
.hl { background: linear-gradient(transparent 58%, var(--lime) 58% 92%, transparent 92%); padding: 0 .1em; }
.lead { font-size: clamp(1.08rem, 1.8vw, 1.25rem); color: var(--ink-2); max-width: 60ch; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.step { display: grid; gap: 2px; padding: 16px 18px; border-radius: 18px; border: 2px solid var(--ink); background: var(--paper-2); color: var(--ink); text-decoration: none; box-shadow: 4px 4px 0 var(--ink); transition: transform .15s, box-shadow .15s; }
.step:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.step-num { font-weight: 800; font-size: .85rem; }
.s-ears .step-num { color: var(--blue); }
.s-reflex .step-num { color: #C23A1E; }
.s-eyes .step-num { color: #4A6B00; }
.s-clock .step-num { color: #5233E0; }
.s-rhythm .step-num { color: #B0186A; }
.s-memory .step-num { color: #8A5A00; }
.step-name { font-family: var(--display); font-weight: 800; font-size: 1.35rem; }
.step-best { color: var(--muted); font-size: .9rem; }
.step-best.done { color: var(--ink); font-weight: 700; }

/* Tests */
.test { margin-top: 72px; display: grid; gap: 18px; scroll-margin-top: 20px; }
.test-head { display: flex; gap: 18px; align-items: flex-start; }
.test-num { flex-shrink: 0; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; font-family: var(--display); font-weight: 800; font-size: 1.3rem; border: 2px solid var(--ink); }
.test-ears .test-num { background: var(--blue); color: #fff; }
.test-reflex .test-num { background: var(--tomato); }
.test-eyes .test-num { background: var(--lime); }
.test-clock .test-num { background: var(--violet); color: #fff; }
.test-rhythm .test-num { background: var(--pink); }
.test-memory .test-num { background: var(--amber); }
.test-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.test-head p { color: var(--ink-2); margin-top: 6px; }

.card { padding: clamp(18px, 3vw, 28px); border-radius: var(--radius); background: var(--paper-2); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); display: grid; gap: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.small { font-size: .9rem; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: 14px; border: 2px solid var(--ink); cursor: pointer; font-weight: 700; background: var(--paper-2); transition: transform .12s, box-shadow .12s; box-shadow: 3px 3px 0 var(--ink); }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn-ears { background: var(--blue); color: #fff; }
.btn-eyes { background: var(--lime); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-clock { background: var(--violet); color: #fff; }
.btn-memory { background: var(--amber); }
.btn-xl { min-height: 72px; font-size: 1.4rem; padding: 0 40px; border-radius: 18px; }
.btn-ghost { background: var(--paper-2); }
.btn-link { border: 0; box-shadow: none; background: none; text-decoration: underline; padding: 0 8px; min-height: 44px; }
.btn-link:hover { transform: none; box-shadow: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Hearing */
.warn { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: #FFF4D6; border: 1px solid #E9C766; color: #5A4300; }
.warn svg { flex-shrink: 0; margin-top: 2px; }
.ears-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: center; }
.ears-visual { aspect-ratio: 16 / 10; border-radius: 18px; background: #0E1430; display: grid; place-items: center; overflow: hidden; position: relative; }
.wave { width: 86%; height: 50%; background:
  repeating-linear-gradient(90deg, transparent 0 3px, rgba(47, 91, 255, .0) 3px 6px),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 30 Q 12.5 0 25 30 T 50 30 T 75 30 T 100 30 T 125 30 T 150 30 T 175 30 T 200 30' fill='none' stroke='%237E9BFF' stroke-width='3'/%3E%3C/svg%3E") repeat-x center / var(--ww, 50px) 100%;
  opacity: .35; transition: opacity .3s; }
.wave.on { opacity: 1; animation: slide .6s linear infinite; }
@keyframes slide { to { background-position: var(--ww, 50px) center; } }
.ears-visual { grid-row: 1 / span 2; }
.ears-ui, .ears-stage .result { grid-column: 2; }
.ears-ui { display: grid; gap: 14px; }
.vol-label { font-weight: 700; display: flex; justify-content: space-between; }
input[type="range"] { width: 100%; accent-color: var(--blue); min-height: 32px; }
.freq { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.freq small { font-size: 1.2rem; color: var(--muted); }
.q { font-weight: 700; font-size: 1.15rem; }

/* Reaction */
.pad { width: 100%; min-height: 280px; border-radius: 18px; border: 2px solid var(--ink); display: grid; place-content: center; gap: 8px; text-align: center; cursor: pointer; padding: 24px; user-select: none; -webkit-user-select: none; touch-action: manipulation; transition: background .08s; }
.pad-big { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1; }
.pad-small { font-weight: 600; }
.pad[data-state="idle"], .pad[data-state="done"] { background: #EDEAFF; }
.pad[data-state="wait"] { background: var(--red); color: #fff; }
.pad[data-state="go"] { background: #1FBF5F; color: #0B2914; }
.pad[data-state="early"] { background: #FFD43B; }
.pad[data-state="shown"] { background: #EDEAFF; }
.rounds { display: flex; flex-wrap: wrap; gap: 8px; }
.rounds li { padding: 6px 12px; border-radius: 999px; border: 2px solid var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; background: var(--paper); }

/* Color */
.eyes-bar { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.eyes-bar p { font-weight: 700; font-size: 1.1rem; }
.lives { color: var(--red); }
.eyes-bar .btn { margin-left: auto; }
.grid { --n: 2; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; width: min(100%, 460px); aspect-ratio: 1; margin-inline: auto; }
.grid:empty { display: grid; place-items: center; background: var(--paper); border-radius: 18px; border: 2px dashed var(--line); }
.grid:empty::after { content: "Press Start"; color: var(--muted); font-weight: 700; }
.tile { border: 0; border-radius: 12%; cursor: pointer; min-width: 0; min-height: 0; transition: transform .1s; }
.tile:hover { transform: scale(.96); }
.tile.wrong { animation: shake .3s; }
.tile.hint { outline: 4px solid var(--ink); outline-offset: -4px; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Inner clock */
.clock-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: center; }
.orb-wrap { aspect-ratio: 16 / 10; border-radius: 18px; background: #1E1650; display: grid; place-items: center; overflow: hidden; }
.orb { width: 38%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #CFC4FF, var(--violet) 60%, #2B1A9E); box-shadow: 0 0 0 0 rgba(106, 77, 255, .5); }
.orb.run { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); box-shadow: 0 0 0 26px rgba(106, 77, 255, 0); } }
.clock-ui { display: grid; gap: 14px; justify-items: start; }
.clock-try { font-family: var(--display); font-weight: 800; font-size: 1.6rem; }

/* Rhythm */
.rpad { position: relative; overflow: hidden; }
.rpad[data-state="idle"], .rpad[data-state="done"] { background: #FFE5F2; }
.rpad[data-state="guide"] { background: #FFD1E8; }
.rpad[data-state="solo"] { background: #2A1530; color: #fff; }
.beat { justify-self: center; width: 70px; height: 70px; border-radius: 50%; background: var(--pink); border: 3px solid var(--ink); opacity: .35; }
.beat.hit { animation: hit .25s ease-out; }
@keyframes hit { 0% { transform: scale(1.35); opacity: 1; } 100% { transform: scale(1); opacity: .35; } }
.taps { display: flex; align-items: flex-end; gap: 4px; height: 70px; padding: 0 4px; border-bottom: 2px solid var(--ink); }
.taps i { flex: 1; max-width: 26px; border-radius: 6px 6px 0 0; background: var(--pink); border: 2px solid var(--ink); border-bottom: 0; }
.taps i.solo { background: #8E2C5E; }

/* Memory */
.mem-bar { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.mem-bar p { font-weight: 700; font-size: 1.1rem; }
.mem-bar .btn { margin-left: auto; }
.mem-screen { position: relative; min-height: 170px; border-radius: 18px; background: #FFF2CC; border: 2px solid var(--ink); display: grid; place-items: center; padding: 24px; overflow: hidden; }
.mem-num { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 7vw, 4rem); letter-spacing: .12em; font-variant-numeric: tabular-nums; text-align: center; overflow-wrap: anywhere; }
.mem-num.hidden-num { color: var(--muted); letter-spacing: normal; font-size: clamp(1.3rem, 3vw, 1.8rem); }
.mem-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; }
.mem-timer span { display: block; height: 100%; width: 0; background: var(--ink); }
.mem-form { display: grid; gap: 10px; }
.mem-form label { font-weight: 700; font-size: 1.1rem; }
#mem-input { flex: 1 1 220px; min-height: 56px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--ink); font: 800 1.6rem var(--font); letter-spacing: .12em; background: var(--paper-2); }
#mem-input:focus-visible { outline-offset: 2px; }

/* Results */
.result { padding: 20px 22px; border-radius: 18px; background: var(--paper); border: 2px solid var(--ink); display: grid; gap: 6px; }
.result .big { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.05; }
.result .note { color: var(--ink-2); }
.meter { position: relative; height: 14px; border-radius: 999px; background: linear-gradient(90deg, #1FBF5F, #FFD43B, var(--tomato)); margin: 10px 0 4px; }
.meter i { position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--paper-2); border: 3px solid var(--ink); transform: translate(-50%, -50%); }
.meter-labels { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); }

/* Report */
.report { margin-top: 88px; display: grid; gap: 18px; }
.report h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
.report-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: 6px 6px 0 var(--ink); background: var(--paper-2); }
.r-item { padding: 22px; display: grid; gap: 4px; border-right: 2px solid var(--ink); }
.r-item:nth-child(3n) { border-right: 0; }
.r-item:nth-child(-n+3) { border-bottom: 2px solid var(--ink); }
.r-ears { background: #E7ECFF; }
.r-reflex { background: #FFE6DF; }
.r-eyes { background: #F1FCD0; }
.r-clock { background: #ECE8FF; }
.r-rhythm { background: #FFE5F2; }
.r-memory { background: #FFF2CC; }
.r-label { font-weight: 700; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.r-item strong { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.1; }
.r-sub { color: var(--ink-2); font-size: .95rem; }
.share-text { padding: 18px 20px; border-radius: 16px; border: 2px dashed var(--ink); background: var(--paper-2); white-space: pre-line; }

/* FAQ */
.faq { margin-top: 88px; display: grid; gap: 12px; }
.faq h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 6px; }
.faq details { border: 2px solid var(--ink); border-radius: 16px; background: var(--paper-2); }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 700; font-size: 1.08rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--display); font-weight: 800; font-size: 1.5rem; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 20px 18px; color: var(--ink-2); }
.foot { padding: 64px 0 36px; color: var(--muted); font-size: .95rem; }

@media (max-width: 820px) {
  .ears-stage { grid-template-columns: 1fr; }
  .ears-visual { grid-row: auto; }
  .ears-ui, .ears-stage .result { grid-column: auto; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clock-stage { grid-template-columns: 1fr; }
  .report-card { grid-template-columns: 1fr; }
  .r-item, .r-item:nth-child(-n+3) { border-right: 0; border-bottom: 2px solid var(--ink); }
  .r-item:last-child { border-bottom: 0; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
  .mem-bar .btn { margin-left: 0; }
  .btn { width: 100%; }
  .btn-link { width: auto; }
  .eyes-bar .btn { margin-left: 0; }
  .test-head { flex-direction: column; gap: 10px; }
  .pad { min-height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
