/* ============================================================
   SYNAPSE — Design System
   Brain games without the BS. Warm paper, Fraunces, electric blue.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --paper:      #F6F1E7;
  --paper-2:    #F0E9DA;
  --paper-3:    #EAE1CF;
  --card:       #FCFAF4;
  --ink:        #1B1712;
  --ink-soft:   #4B453A;
  --ink-faint:  #8C8472;
  --line:       rgba(27, 23, 18, 0.12);
  --line-soft:  rgba(27, 23, 18, 0.07);

  /* Brand */
  --blue:       #1F3BFF;
  --blue-deep:  #1A30D6;
  --blue-tint:  rgba(31, 59, 255, 0.10);
  --blue-tint2: rgba(31, 59, 255, 0.18);

  /* Game accents */
  --c-pulse:  #1F3BFF;
  --c-echo:   #6C4CFF;
  --c-stroop: #FF5A3C;
  --c-math:   #0FA968;
  --c-nback:  #E8920C;
  --c-search: #0C8F9C;

  /* Type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  /* Geometry */
  --r:    18px;
  --r-sm: 12px;
  --r-lg: 28px;
  --maxw: 1120px;

  /* Shadow (warm) */
  --sh-1: 0 1px 2px rgba(60, 45, 20, 0.06), 0 2px 6px rgba(60, 45, 20, 0.05);
  --sh-2: 0 4px 14px rgba(60, 45, 20, 0.08), 0 12px 30px rgba(60, 45, 20, 0.07);
  --sh-3: 0 10px 40px rgba(60, 45, 20, 0.13), 0 30px 60px rgba(60, 45, 20, 0.10);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 600; font-optical-sizing: auto; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.display-xl { font-size: clamp(3rem, 8vw, 6rem); font-weight: 600; }
.serif-italic { font-style: italic; font-variation-settings: "SOFT" 60, "WONK" 1; }

.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 500;
}
.lead { font-size: clamp(1.1rem, 1.6vw, 1.32rem); color: var(--ink-soft); line-height: 1.55; }
.muted { color: var(--ink-faint); }
.center { text-align: center; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; }
section { padding: clamp(56px, 9vw, 110px) 0; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; }
.grid { display: grid; gap: 22px; }
.stack > * + * { margin-top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-weight: 600; font-size: 1rem;
  padding: 0.85em 1.5em; border-radius: 999px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 20px var(--blue-tint2); }
.btn-primary:hover { background: var(--blue-deep); transform: translateY(-2px); box-shadow: 0 10px 28px var(--blue-tint2); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.btn-lg { font-size: 1.08rem; padding: 1em 1.8em; }
.btn-arrow { transition: transform .25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- Chips / data ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.02em;
  padding: 0.38em 0.8em; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-soft);
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.data {
  font-family: var(--mono); font-weight: 500;
  background: var(--blue-tint); color: var(--blue-deep);
  padding: 0.15em 0.5em; border-radius: 6px; font-size: 0.9em;
}

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(246, 241, 231, 0.82);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 0.95rem; font-weight: 500; color: var(--ink-soft); transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; }
.nav-mobile { display: none; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(40px, 6vw, 70px); position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { margin: 18px 0 22px; }
.hero h1 em { color: var(--blue); font-style: italic; font-variation-settings: "SOFT" 50, "WONK" 1; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.hero-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 34px; }
.hero-meta .stat { display: flex; flex-direction: column; }
.hero-meta .stat b { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.hero-meta .stat span { font-size: 0.82rem; color: var(--ink-faint); }
.hero-canvas-wrap {
  position: relative; aspect-ratio: 1/1; border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--card) 0%, var(--paper-2) 100%);
  border: 1px solid var(--line); box-shadow: var(--sh-3); overflow: hidden;
}
#synapseCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-badge {
  position: absolute; bottom: 18px; left: 18px; right: 18px;
  display: flex; align-items: center; gap: 12px;
  background: rgba(252, 250, 244, 0.92); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px;
}
.hero-badge .pulse-ring { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--blue-tint); display: grid; place-items: center; }
.hero-badge .pulse-ring i { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); animation: blip 1.8s var(--ease) infinite; }
@keyframes blip { 0%,100%{ box-shadow: 0 0 0 0 var(--blue-tint2);} 50%{ box-shadow: 0 0 0 9px transparent;} }

/* ---------- Honesty strip ---------- */
.strip { background: var(--ink); color: var(--paper); }
.strip .wrap { display: flex; align-items: center; gap: 28px; padding-top: 26px; padding-bottom: 26px; flex-wrap: wrap; }
.strip .eyebrow { color: #9db0ff; }
.strip p { color: rgba(246,241,231,0.82); max-width: 640px; }
.strip a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cards / game grid ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px; box-shadow: var(--sh-1); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }

.game-card {
  position: relative; display: flex; flex-direction: column; min-height: 230px;
  overflow: hidden; --accent: var(--blue);
}
.game-card::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.game-card:hover::after { transform: scaleX(1); }
.game-ico {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); margin-bottom: 18px;
}
.game-ico svg { width: 26px; height: 26px; }
.game-card h3 { margin-bottom: 6px; }
.game-card .skill { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px; }
.game-card p { font-size: 0.95rem; color: var(--ink-soft); flex: 1; }
.game-card .go { margin-top: 18px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); font-size: 0.95rem; }
.game-card .best { position: absolute; top: 22px; right: 22px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); text-align: right; }
.game-card .best b { display:block; color: var(--ink); font-size: 0.95rem; }

/* ---------- Feature row ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.feature .f-ico { width: 44px; height: 44px; color: var(--blue); margin-bottom: 16px; }
.feature h3 { font-size: 1.25rem; margin-bottom: 8px; }
.feature p { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- Dashboard / progress ---------- */
.dash { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 40px); }
.dash-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 18px 20px; }
.tile .k { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.tile .v { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; line-height: 1.1; margin-top: 4px; }
.tile .v small { font-size: 0.9rem; color: var(--ink-faint); font-family: var(--mono); font-weight: 400; }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.chart-head { display:flex; justify-content: space-between; align-items:center; margin-bottom: 8px; }
#progressChart { width: 100%; height: 220px; display: block; }
.empty-note { color: var(--ink-faint); font-size: 0.95rem; text-align: center; padding: 30px 0; }

/* ---------- Ad slot ---------- */
.ad-slot {
  margin: 12px auto; max-width: var(--maxw); padding: 0 24px; width: 100%;
}
.ad-inner {
  border: 1px dashed var(--line); border-radius: var(--r-sm);
  background: var(--paper-2); min-height: 100px;
  display: grid; place-items: center; color: var(--ink-faint);
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  overflow: hidden;
}

/* ---------- Game shell ---------- */
.game-page { --accent: var(--blue); }
.game-hero { padding: 36px 0 14px; }
.game-hero .crumb { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-faint); margin-bottom: 14px; }
.game-hero .crumb a:hover { color: var(--accent); }
.game-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.game-hero h1 .accent { color: var(--accent); }
.game-hero .lead { margin-top: 14px; max-width: 620px; }
.game-tags { display:flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.stage {
  position: relative; margin: 26px 0; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-2);
  min-height: 460px; display: flex; flex-direction: column; overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
.stage-hud {
  position: relative; z-index: 5; flex: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 22px; font-family: var(--mono); font-size: 0.82rem;
  border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.hud-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hud-item .k { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.hud-item .v { font-size: 1.05rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.hud-item .v.accent { color: var(--accent); }

.stage-body { width: 100%; flex: 1; min-height: 0; display: grid; place-items: center; padding: 32px 28px; text-align: center; }
.screen { display: none; width: 100%; max-width: 640px; }
.screen.active { display: block; animation: fadeUp .4s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px);} to {opacity:1; transform:none;} }

.big-num { font-family: var(--mono); font-weight: 700; font-size: clamp(2.6rem, 9vw, 5rem); line-height: 1; }
.start-icon { width: 92px; height: 92px; border-radius: 28px; margin: 0 auto 24px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.start-icon svg { width: 46px; height: 46px; }

/* result screen */
.result-score { font-family: var(--display); font-size: clamp(3rem, 10vw, 5.5rem); font-weight: 600; color: var(--accent); line-height: 1; }
.result-unit { font-family: var(--mono); color: var(--ink-faint); font-size: 1rem; }
.result-row { display: flex; justify-content: center; gap: 30px; margin: 24px 0; flex-wrap: wrap; }
.result-row .ri .k { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.result-row .ri .v { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; }
.verdict { display: inline-block; font-family: var(--mono); font-size: 0.82rem; padding: 0.4em 1em; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); margin-bottom: 18px; }

.game-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* Pulse target */
.pulse-zone { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; transition: background .12s; }
.pulse-zone.wait { background: #B6402E; color: #fff; }
.pulse-zone.go { background: var(--c-math); color: #fff; }
.pulse-zone .pz-txt { font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 600; }
.pulse-zone .pz-sub { font-family: var(--mono); font-size: 0.85rem; opacity: 0.85; margin-top: 8px; }

/* Echo grid */
.pad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 360px; margin: 0 auto; }
.pad { aspect-ratio: 1; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--line); transition: transform .1s, background .15s, box-shadow .15s; cursor: pointer; }
.pad:active { transform: scale(0.96); }
.pad.lit { background: var(--c-echo); box-shadow: 0 0 30px color-mix(in srgb, var(--c-echo) 60%, transparent); }

/* Stroop options */
.stroop-word { font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 12vw, 6rem); margin: 10px 0 30px; }
.opt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 420px; margin: 0 auto; }
.opt { padding: 1em; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); font-weight: 600; font-size: 1.05rem; transition: transform .12s, border-color .15s; }
.opt:hover { border-color: var(--accent); transform: translateY(-2px); }
.opt.right { border-color: var(--c-math); background: color-mix(in srgb, var(--c-math) 12%, transparent); }
.opt.wrong { border-color: var(--c-stroop); background: color-mix(in srgb, var(--c-stroop) 12%, transparent); }

/* Math */
.math-q { font-family: var(--display); font-weight: 600; font-size: clamp(2.6rem, 9vw, 4.4rem); margin-bottom: 24px; }
.math-input { font-family: var(--mono); font-size: 2rem; text-align: center; width: 200px; padding: 0.3em; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
.math-input:focus { outline: none; border-color: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 22px auto 0; }
.keypad button { padding: 0.8em; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-family: var(--mono); font-size: 1.3rem; font-weight: 600; transition: transform .1s, background .15s; }
.keypad button:active { transform: scale(0.95); background: var(--paper-2); }

/* N-back */
.nback-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 280px; margin: 0 auto 26px; }
.nb-cell { aspect-ratio: 1; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); transition: background .12s, transform .12s; }
.nb-cell.lit { background: var(--c-nback); transform: scale(1.04); box-shadow: 0 0 24px color-mix(in srgb, var(--c-nback) 50%, transparent); }

/* Visual search */
.search-field { position: relative; width: 100%; max-width: 560px; height: 360px; margin: 0 auto; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.s-item { position: absolute; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; transition: transform .1s; }
.s-item:active { transform: scale(0.85); }

/* How-to / prose */
.prose { max-width: 720px; }
.prose p { margin-bottom: 1.1em; color: var(--ink-soft); }
.prose h2 { margin: 1.6em 0 0.5em; }
.prose h3 { margin: 1.4em 0 0.4em; }
.prose ul { margin: 0 0 1.2em 1.2em; color: var(--ink-soft); }
.prose li { margin-bottom: 0.5em; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--ink); }
.callout { background: var(--blue-tint); border-left: 3px solid var(--blue); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 18px 22px; margin: 1.5em 0; }
.callout p { color: var(--ink-soft); margin: 0; }

/* faq */
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { font-family: var(--display); font-size: 1.15rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--blue); font-size: 1.4rem; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 12px; color: var(--ink-soft); }

/* blog */
.post-card { display: flex; flex-direction: column; }
.post-card .tag { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); margin-bottom: 12px; }
.post-card h3 { margin-bottom: 10px; }
.post-card p { font-size: 0.95rem; color: var(--ink-soft); flex: 1; }
.post-card .meta { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-faint); margin-top: 16px; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(135deg, var(--blue) 0%, #4865ff 100%); color: #fff; border-radius: var(--r-lg); padding: clamp(40px, 6vw, 70px); text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.86); max-width: 520px; margin: 14px auto 28px; }
.cta-band .btn-primary { background: #fff; color: var(--blue); }
.cta-band .btn-primary:hover { background: var(--paper); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: rgba(246,241,231,0.7); padding: 64px 0 32px; }
.footer a { color: rgba(246,241,231,0.7); transition: color .2s; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 44px; }
.footer .brand { color: var(--paper); margin-bottom: 14px; }
.footer .fcol h4 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(246,241,231,0.45); margin-bottom: 16px; font-weight: 500; }
.footer .fcol a { display: block; margin-bottom: 10px; font-size: 0.95rem; }
.footer-bottom { border-top: 1px solid rgba(246,241,231,0.12); padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; }
.footer-disclaimer { max-width: 560px; font-size: 0.82rem; line-height: 1.55; color: rgba(246,241,231,0.5); }

/* ---------- Utility ---------- */
.tag-pill { display:inline-flex; align-items:center; gap:6px; font-family: var(--mono); font-size:0.72rem; padding:0.35em 0.75em; border-radius:999px; background: var(--card); border:1px solid var(--line); color: var(--ink-soft); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.hidden { display: none !important; }
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-sm { gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-canvas-wrap { max-width: 460px; margin: 0 auto; }
  .features { grid-template-columns: 1fr; gap: 24px; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .nav-toggle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); }
  .nav-mobile { display: none; }
  .nav-mobile.open { display: flex; flex-direction: column; gap: 4px; padding: 12px 0 20px; border-top: 1px solid var(--line-soft); }
  .nav-mobile a { padding: 10px 4px; font-weight: 500; }
}
@media (max-width: 540px) {
  body { font-size: 16px; }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .stage { min-height: 420px; }
  section { padding: 48px 0; }
}

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

/* ============================================================
   DARK THEME
   ============================================================ */
[data-theme="dark"] {
  --paper:#15130F; --paper-2:#1C1916; --paper-3:#242019; --card:#1E1B15;
  --ink:#F3EEE3; --ink-soft:#C6BEAD; --ink-faint:#928975;
  --line:rgba(243,238,227,0.14); --line-soft:rgba(243,238,227,0.07);
  --blue:#6E84FF; --blue-deep:#566EF5; --blue-tint:rgba(110,132,255,0.16); --blue-tint2:rgba(110,132,255,0.30);
}
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: 0.05; }
[data-theme="dark"] .nav { background: rgba(21,19,15,0.82); }
[data-theme="dark"] .strip, [data-theme="dark"] .footer { background: #100E0A; }
/* footer/strip stay dark in both themes */
.footer { background: #14110D; }
.strip { background: #14110D; }

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--ink-soft); background: var(--card);
  transition: border-color .2s, color .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }

/* ============================================================
   GAME COMPONENTS (engine v2)
   ============================================================ */
.play-hint { margin-top: 18px; color: var(--ink-faint); font-size: 0.85rem; }
.pad.err { background: color-mix(in srgb, var(--c-stroop) 35%, transparent) !important; }

/* Pulse tap panel */
.tap-panel {
  width: 100%; max-width: 560px; min-height: 300px; margin: 0 auto; border-radius: var(--r-lg);
  display: grid; place-items: center; text-align: center; cursor: pointer; color: #fff;
  transition: background .12s; background: var(--ink);
}
.tap-panel.wait { background: #B6402E; }
.tap-panel.go   { background: var(--c-math); }
.tap-panel.early{ background: #8A4B12; }
.tap-panel.done { background: var(--blue); }
.tap-panel .tp-txt { font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 5vw, 2.8rem); }
.tap-panel .tp-sub { font-size: 0.9rem; opacity: 0.88; margin-top: 10px; }

/* Aim trainer */
.aim-field { position: relative; width: 100%; max-width: 600px; height: 380px; margin: 0 auto; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: crosshair; }
.aim-target { position: absolute; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: pointer; }
.aim-target::after { content:""; position:absolute; inset:14px; border-radius:50%; background: rgba(255,255,255,.7); }

/* Number memory */
.number-show { letter-spacing: 0.08em; color: var(--accent); }
.memo-bar { width: 220px; height: 6px; border-radius: 99px; background: var(--paper-3); margin: 26px auto 0; overflow: hidden; }
.memo-bar i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 99px; }

/* Verbal memory */
.verbal-word { font-family: var(--display); font-weight: 600; font-size: clamp(2.4rem, 8vw, 4rem); margin: 6px 0 30px; }
.opt-grid.two { grid-template-columns: 1fr 1fr; max-width: 360px; }

/* Chimp test */
.chimp-field { position: relative; width: 100%; max-width: 600px; height: 380px; margin: 0 auto; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); }
.chimp-tile { position: absolute; width: 54px; height: 54px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--accent); color: var(--ink); font-family: var(--mono); font-size: 1.4rem; font-weight: 700; cursor: pointer; transition: transform .1s; }
.chimp-tile:active { transform: scale(0.94); }
.chimp-tile.blank { color: transparent; background: var(--accent); border-color: var(--accent); }

/* Visual memory */
.vm-grid { display: grid; gap: 8px; margin: 0 auto; }
.vm-cell { aspect-ratio: 1; border-radius: 10px; background: var(--paper-3); border: 1px solid var(--line); cursor: pointer; transition: background .12s, transform .1s; }
.vm-cell.show { background: #fff; box-shadow: 0 0 18px rgba(255,255,255,.5); }
.vm-cell.done { background: var(--accent); }
.vm-cell.miss { background: var(--c-stroop); }

/* Typing */
.type-text { font-family: var(--mono); font-size: 1.15rem; line-height: 1.9; max-width: 620px; margin: 0 auto 20px; text-align: left; color: var(--ink-faint); letter-spacing: 0.01em; }
.type-text .ok { color: var(--c-math); }
.type-text .err { color: #fff; background: var(--c-stroop); border-radius: 3px; }
.type-text .cur { background: var(--blue-tint2); border-radius: 3px; box-shadow: inset 0 -2px 0 var(--accent); }
.type-input { width: 100%; max-width: 620px; font-family: var(--mono); font-size: 1.05rem; padding: 14px 16px; border-radius: var(--r-sm); border: 2px solid var(--line); background: var(--card); color: var(--ink); resize: none; }
.type-input:focus { outline: none; border-color: var(--accent); }

/* Schulte */
.schulte-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; max-width: 380px; margin: 0 auto; }
.schulte-cell { aspect-ratio: 1; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-family: var(--mono); font-size: 1.3rem; font-weight: 700; color: var(--ink); cursor: pointer; transition: transform .1s, background .15s; }
.schulte-cell:hover { background: var(--paper-2); }
.schulte-cell:active { transform: scale(0.95); }
.schulte-cell.done { background: var(--accent); color: #fff; border-color: var(--accent); }
.schulte-cell.wrongflash { background: var(--c-stroop); color: #fff; }

/* ============================================================
   STATS PAGE
   ============================================================ */
.brain-hero { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px,4vw,44px); }
.brain-dial { position: relative; width: 180px; height: 180px; flex: none; }
.brain-dial .bd-num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.brain-dial .bd-num b { font-family: var(--display); font-size: 2.8rem; font-weight: 600; line-height: 1; }
.brain-dial .bd-num span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.skill-bars { display: grid; gap: 14px; }
.skill-bar { display: grid; grid-template-columns: 140px 1fr 54px; align-items: center; gap: 14px; }
.skill-bar .lbl { font-size: 0.9rem; font-weight: 500; }
.skill-bar .track { height: 10px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.skill-bar .track i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.skill-bar .pct { font-family: var(--mono); font-size: 0.85rem; text-align: right; color: var(--ink-soft); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 14px; }
.ach { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); opacity: 0.5; }
.ach.got { opacity: 1; border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); }
.ach .medal { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-3); flex: none; }
.ach.got .medal { background: var(--blue-tint); color: var(--blue); }
.ach .a-name { font-weight: 600; font-size: 0.92rem; }
.ach .a-desc { font-size: 0.78rem; color: var(--ink-faint); }
.game-stat-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.game-stat-row .gs-name { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.game-stat-row .gs-name .dot { width: 10px; height: 10px; border-radius: 50%; }
.game-stat-row .gs-val { font-family: var(--mono); font-size: 0.9rem; }
.game-stat-row .gs-val small { color: var(--ink-faint); }

/* Daily workout */
.daily-track { display: flex; gap: 8px; margin: 22px 0; flex-wrap: wrap; }
.daily-step { flex: 1; min-width: 60px; height: 6px; border-radius: 99px; background: var(--paper-3); }
.daily-step.done { background: var(--c-math); }
.daily-step.current { background: var(--blue); }
.daily-list { display: grid; gap: 10px; }
.daily-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); }
.daily-item .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 0.8rem; background: var(--paper-3); flex: none; }
.daily-item.done .num { background: var(--c-math); color: #fff; }
.daily-item .di-skill { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); }

/* category filter */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filter-btn { font-family: var(--mono); font-size: 0.78rem; padding: 0.5em 1em; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer; transition: all .15s; }
.filter-btn:hover { border-color: var(--ink); }
.filter-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

@media (max-width: 700px) {
  .brain-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .skill-bar { grid-template-columns: 96px 1fr 44px; }
  .game-stat-row { grid-template-columns: 1fr auto; }
  .game-stat-row .gs-pct { display: none; }
}

/* ---- added games (flanker, rotation, sequence, pairs, anagram) ---- */
.flanker-row{ font-size:clamp(2.4rem,9vw,4.4rem); letter-spacing:.12em; margin-bottom:30px; font-weight:700; color:var(--ink-faint); }
.flanker-row .fk.mid{ color:var(--accent); }
.rot-wrap{ display:flex; align-items:center; justify-content:center; gap:22px; margin-bottom:28px; }
.rot-shape{ font-family:var(--display); font-weight:700; font-size:clamp(2.6rem,11vw,4.6rem); width:1.5em; height:1.5em; display:grid; place-items:center; background:var(--paper-2); border:1px solid var(--line); border-radius:16px; color:var(--accent); }
.rot-vs{ font-family:var(--mono); color:var(--ink-faint); font-size:.9rem; }
.seq-q{ font-family:var(--display); font-weight:600; font-size:clamp(1.7rem,6vw,2.8rem); margin-bottom:26px; letter-spacing:.02em; }
.seq-q b{ color:var(--accent); }
.pairs-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; max-width:340px; margin:0 auto; }
.pair-card{ aspect-ratio:1; border-radius:12px; border:1px solid var(--line); background:var(--accent); cursor:pointer; display:grid; place-items:center; font-size:1.6rem; transition:background .2s; }
.pair-card .pc-sym{ opacity:0; transition:opacity .15s; color:var(--ink); }
.pair-card.flip,.pair-card.matched{ background:var(--card); }
.pair-card.flip .pc-sym,.pair-card.matched .pc-sym{ opacity:1; }
.pair-card.matched{ border-color:var(--accent); background:color-mix(in srgb, var(--accent) 16%, transparent); }
.anagram-letters{ font-family:var(--mono); font-weight:700; font-size:clamp(2rem,8vw,3.4rem); letter-spacing:.32em; margin-bottom:22px; color:var(--accent); }

/* ---------- Research / "why & who benefits" (added) ---------- */
.research-sec{ padding:22px 0 4px; }
.research-inner{ max-width:840px; }
.rs-kicker{ color:var(--blue); letter-spacing:.09em; text-transform:uppercase; font-size:12px; font-weight:700; }
.rs-why{ font-size:1.06rem; line-height:1.65; color:var(--ink-soft); margin:.45em 0 0; }
.rs-limit{ background:var(--blue-tint); border-left:3px solid var(--blue); padding:12px 16px; border-radius:10px; margin:18px 0 0; font-size:.94rem; color:var(--ink-soft); }
.rs-wbh{ margin:26px 0 0; font-size:1.18rem; }
.rs-wbh-sub{ font-weight:400; color:var(--ink-faint); font-size:.82rem; }
.wb-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:12px; margin-top:14px; }
.wb-card{ background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
.wb-tag{ font-weight:700; color:var(--ink); margin-bottom:5px; font-size:.92rem; }
.wb-card p{ margin:0; font-size:.875rem; color:var(--ink-soft); line-height:1.5; }
.rs-refs{ margin-top:20px; font-size:.78rem; color:var(--ink-faint); display:flex; flex-wrap:wrap; gap:5px 14px; align-items:baseline; }
.rs-refs .mono{ text-transform:uppercase; letter-spacing:.06em; }
.rs-refs a{ color:var(--ink-faint); text-decoration:underline; text-underline-offset:2px; }
.rs-refs a:hover{ color:var(--blue); }

/* ---------- Hero neuroplasticity line + Personas + Disclaimer (added) ---------- */
.hero-neuro{ font-family:var(--display); font-size:1.32rem; font-style:italic; color:var(--ink); line-height:1.42; margin:2px 0 16px; max-width:30ch; }
.hero-neuro em{ color:var(--blue); font-style:italic; }
.personas .section-head{ margin-bottom:6px; }
.persona-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(245px,1fr)); gap:16px; margin-top:22px; }
.persona{ background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:22px 22px 24px; transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.persona:hover{ transform:translateY(-3px); box-shadow:0 12px 32px rgba(27,23,18,.09); border-color:var(--blue-tint2); }
.persona .p-ico{ width:30px; height:30px; color:var(--blue); margin-bottom:12px; display:block; }
.persona h3{ font-size:1.06rem; margin:0 0 7px; }
.persona p{ margin:0; color:var(--ink-soft); font-size:.92rem; line-height:1.56; }
.disc-band{ display:flex; gap:16px; align-items:flex-start; background:var(--blue-tint); border:1px solid var(--blue-tint2); border-radius:var(--r); padding:22px 26px; max-width:900px; margin:0 auto; }
.disc-ico{ color:var(--blue); flex-shrink:0; margin-top:2px; }
.disc-band p{ margin:0; color:var(--ink-soft); font-size:.95rem; line-height:1.62; }
.disc-band strong{ color:var(--ink); }

/* ---------- Buy me a coffee supporter button (added) ---------- */
.coffee-btn{ display:inline-flex; align-items:center; gap:6px; margin-top:16px; padding:9px 16px; background:#FFDD00; color:#1B1712 !important; font-weight:700; font-size:.86rem; border-radius:10px; text-decoration:none; box-shadow:0 2px 0 rgba(0,0,0,.14); transition:transform .15s ease, box-shadow .15s ease; }
.coffee-btn:hover{ transform:translateY(-2px); box-shadow:0 6px 16px rgba(0,0,0,.2); }

/* ---------- Difficulty selector (added) ---------- */
.diff-select{ margin:6px auto 18px; display:flex; flex-direction:column; align-items:center; gap:8px; }
.diff-label{ font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-faint); }
.diff-btns{ display:inline-flex; background:var(--paper-2); border:1px solid var(--line); border-radius:12px; padding:4px; gap:4px; }
.diff-btn{ border:none; background:transparent; color:var(--ink-soft); font:inherit; font-size:.9rem; font-weight:600; padding:7px 16px; border-radius:9px; cursor:pointer; transition:background .15s ease, color .15s ease; }
.diff-btn:hover{ color:var(--ink); }
.diff-btn.active{ background:var(--accent,var(--blue)); color:#fff; }
.diff-note{ font-size:11px; color:var(--ink-faint); }
