/* Nanonetes — instrument-panel design
   Page surface = light instrument grey. The only colours that ever
   appear are the four Stroop stimulus inks, used only where they mean
   something (stimuli, response keys, trial data). */

:root {
  --paper: #ECECE8;
  --panel: #7C7C78;
  --panel-deep: #6E6E6A;
  --ink: #1D1D1B;
  --soft: #57574F;
  --rule: #C8C8C0;
  --white: #F5F5F1;
  --stim-red: #C6392E;
  --stim-green: #237A46;
  --stim-blue: #2D5DA8;
  --stim-yellow: #D99C15;
  --sans: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --mark: #A9A9A0;
  --hover: rgba(29,29,27,.055);
  --note-bg: #F4EFE2;
}

html[data-theme="dark"] {
  --paper: #17171B;
  --panel: #232327;
  --panel-deep: #151518;
  --ink: #ECECE8;
  --soft: #B3B3AB;
  --rule: #3A3A41;
  --mark: #4A4A52;
  --hover: rgba(255,255,255,.07);
  --note-bg: #2A2620;
  color-scheme: dark;
}
html { color-scheme: light; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--paper); }

.wrap, .site-head, .site-foot > span:first-child { max-width: 1120px; }

main > section, .site-head, .site-foot {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.panel :focus-visible { outline-color: var(--white); }

/* ---------- header ---------- */

.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 26px;
  padding-bottom: 22px;
}

.wordmark {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav { display: flex; gap: 30px; margin-left: auto; order: 2; }
.theme-toggle { order: 3; }
.nav-toggle { order: 4; }
.site-nav a {
  color: var(--soft);
  text-decoration: none;
  font-size: 15.5px;
  font-weight: 500;
}
.site-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
  padding-top: 44px;
  padding-bottom: 96px;
}

h1 {
  font-size: clamp(48px, 7.2vw, 84px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: 26px;
}

.lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--soft);
  max-width: 46ch;
  margin-bottom: 34px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 5px;
  border: 1px solid var(--ink);
  transition: background-color 140ms ease, color 140ms ease;
}
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: #000; }
.btn.ghost { color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

.fineprint { font-size: 13.5px; color: var(--soft); max-width: 44ch; }

/* ---------- the instrument panel ---------- */

.panel {
  background:
    radial-gradient(90% 60% at 50% 30%, rgba(255,255,255,.07), transparent 70%),
    linear-gradient(180deg, #232327 0%, #1B1B1E 100%);
  border: 1px solid #0E0E10;
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.16) inset,
    0 1px 2px rgba(0,0,0,.5),
    0 30px 60px -28px rgba(20,20,24,.85);
  color: var(--white);
  display: flex;
  flex-direction: column;
  user-select: none;
  overflow: hidden;
}

.panel-ticks {
  display: flex;
  gap: 3px;
  padding: 12px 18px 0;
}
.panel-ticks i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(245,245,241,.14);
  transition: background-color 160ms ease;
}
.panel-ticks i.done { background: rgba(245,245,241,.75); }
.panel-ticks i.now  { background: var(--stim-yellow); }

.panel-chrome {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(245,245,241,.16);
  font-family: var(--mono);
  font-size: 12.5px;
  color: rgba(245,245,241,.75);
}

.panel-stage {
  min-height: 372px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px 20px;
}

.state-idle .stage-note,
.state-summary .stage-note {
  font-size: 16.5px;
  line-height: 1.5;
  color: rgba(245,245,241,.92);
  margin-bottom: 22px;
}
.state-idle strong { color: var(--white); }

.stage-hint {
  font-size: 13px;
  color: rgba(245,245,241,.62);
  margin-top: 16px;
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid rgba(245,245,241,.35);
  border-radius: 4px;
  padding: 1px 6px;
  color: rgba(245,245,241,.8);
}

.pbtn {
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(245,245,241,.65);
  border-radius: 6px;
  padding: 11px 26px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}
.pbtn:hover { background: var(--white); color: var(--panel-deep); }

.fixation {
  font-size: 52px;
  font-weight: 400;
  color: rgba(245,245,241,.9);
  line-height: 1;
}

.stimulus {
  font-size: clamp(52px, 7vw, 84px);
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.05;
  text-shadow: 0 0 34px rgba(255,255,255,.22);
  animation: stim-in 140ms cubic-bezier(.2,.9,.3,1.2);
}
@keyframes stim-in {
  from { transform: scale(.86); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.fixation {
  animation: fix-pulse 1.6s ease-in-out infinite;
}
@keyframes fix-pulse {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: .95; transform: scale(1.12); }
}
.ink-red    { color: var(--stim-red); }
.ink-green  { color: var(--stim-green); }
.ink-blue   { color: var(--stim-blue); }
.ink-yellow { color: var(--stim-yellow); }

.state-summary .cost {
  font-family: var(--mono);
  font-size: clamp(38px, 6vw, 52px);
  font-weight: 500;
  color: var(--white);
  margin-bottom: 20px;
  animation: cost-pop 260ms cubic-bezier(.2,.9,.3,1.3);
}
@keyframes cost-pop {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.summary-rows {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px 34px;
  justify-content: center;
  margin-bottom: 8px;
}
.summary-rows dt { font-size: 12.5px; color: rgba(245,245,241,.6); }
.summary-rows dd { font-family: var(--mono); font-size: 15.5px; color: var(--white); }

.panel-readout {
  display: flex;
  align-items: flex-end;
  gap: 26px;
  padding: 14px 20px;
  border-top: 1px solid rgba(245,245,241,.16);
}

.readout { display: flex; flex-direction: column; gap: 2px; min-width: 74px; }
.ro-label { font-size: 11.5px; color: rgba(245,245,241,.55); }
.ro-value { font-family: var(--mono); font-size: 21px; color: var(--white); }

.spark {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 34px;
}
.spark i {
  flex: 1;
  height: 3px;
  min-width: 2px;
  background: rgba(245,245,241,.2);
  border-radius: 1px;
  transition: height 120ms ease;
}
.spark i.miss { height: 100%; background: transparent; border: 1px solid rgba(245,245,241,.45); }

.panel-responses {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px 20px 20px;
  border-top: 1px solid rgba(245,245,241,.16);
}

@media (min-width: 721px) {
  .panel-responses { grid-template-columns: repeat(4, 1fr); }
}

/* response pads: the colour IS the button */
.rbtn {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 68px;
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--white);
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  background-image: linear-gradient(160deg, rgba(255,255,255,.24), rgba(255,255,255,0) 46%), linear-gradient(0deg, rgba(0,0,0,.14), rgba(0,0,0,0) 60%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.4) inset,
    0 -8px 16px rgba(0,0,0,.16) inset,
    0 12px 22px -12px rgba(0,0,0,.6);
  transition: transform 90ms cubic-bezier(.2,.9,.3,1.2), filter 90ms ease, opacity 120ms ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.rbtn[data-ink="yellow"] { color: var(--ink); }
.rbtn span { text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.rbtn[data-ink="yellow"] span { text-shadow: none; }
.rbtn kbd {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.18);
  border-radius: 4px;
  padding: 1px 6px;
}
.rbtn[data-ink="yellow"] kbd { border-color: rgba(29,29,27,.35); background: rgba(255,255,255,.3); }
.rbtn:hover:not(:disabled) { filter: brightness(1.08); }
.rbtn:active:not(:disabled) { transform: scale(.965); }
.rbtn:disabled { opacity: .38; cursor: default; }
.rbtn:focus-visible { outline: 3px solid var(--white); outline-offset: 2px; }
.rbtn.flash-ok::after,
.rbtn.flash-err::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  animation: padflash 200ms ease;
}
.rbtn.flash-ok::after { box-shadow: inset 0 0 0 3px rgba(255,255,255,.95); }
.rbtn.flash-err::after { box-shadow: inset 0 0 0 3px rgba(20,20,20,.85); }
@keyframes padflash { from { opacity: 1; } to { opacity: 0; } }

.howto {
  text-align: center;
  font-size: 14.5px;
  line-height: 1.5;
  color: rgba(245,245,241,.85);
  max-width: 34ch;
  margin: 0 auto 6px;
  display: grid;
  gap: 6px;
}
.example-word {
  font-weight: 700;
  color: var(--stim-green);
  letter-spacing: .04em;
}

/* ---------- sections ---------- */

.prose-section, .battery-section, .network-section, .contact-section {
  border-top: 1px solid var(--rule);
  padding-top: 76px;
  padding-bottom: 88px;
}

h2 {
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 34px;
}

.promises, .ways {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px;
}

.promise h3, .way h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 10px;
}
.promise p, .way p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--soft);
  max-width: 34ch;
}

/* ---------- battery table ---------- */

.battery-head p {
  color: var(--soft);
  max-width: 62ch;
  margin: -10px 0 36px;
}

.battery-section { overflow-x: auto; }

.battery-table { border-collapse: collapse; min-width: 680px; }
.battery-table th, .battery-table td {
  text-align: left;
  padding: 11px 40px 11px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}
.battery-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--soft);
  border-bottom: 1px solid var(--ink);
  padding-top: 0;
}
.battery-table td:first-child { font-weight: 500; font-size: 16px; white-space: nowrap; }
.battery-table td { font-size: 15.5px; color: var(--soft); }
.battery-table td:last-child { font-size: 14.5px; white-space: nowrap; }
.battery-table tr.group th {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--mark);
  padding-top: 30px;
}
.battery-table a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.battery-foot {
  margin-top: 30px;
  font-size: 15px;
  color: var(--soft);
  max-width: 70ch;
}

/* ---------- network roster ---------- */

.network-head p { color: var(--soft); max-width: 62ch; margin: -10px 0 36px; }
.network-head em { font-style: italic; }

.roster {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 64px;
}
.roster li { border-bottom: 1px solid var(--rule); }
.roster a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: 13px 0;
}
.r-top { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; }
.r-name { font-size: 16.5px; font-weight: 600; }
.roster a:hover .r-name { text-decoration: underline; text-underline-offset: 3px; }
.r-url { font-family: var(--mono); font-size: 12.5px; color: var(--soft); white-space: nowrap; }
.r-sub { font-size: 14px; color: var(--soft); margin-top: 1px; }

/* ---------- contact & footer ---------- */

.contact-section .btn { margin-top: 42px; }

.site-foot {
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 26px;
  padding-bottom: 44px;
  font-size: 13.5px;
  color: var(--soft);
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding-bottom: 72px; }
  .panel { max-width: 540px; }
  .promises, .ways { grid-template-columns: 1fr; gap: 34px; }
  .roster { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  main > section, .site-head, .site-foot { padding-left: 20px; padding-right: 20px; }
  .site-nav { gap: 18px; }
  .panel-responses { grid-template-columns: 1fr 1fr; }
  .summary-rows { gap: 8px 20px; }
}

/* Mobile-first header: wordmark + hamburger; nav collapses into a panel. */
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .site-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
    position: relative;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--ink);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
  }
  .nav-toggle .lines,
  .nav-toggle .lines::before,
  .nav-toggle .lines::after {
    content: "";
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 140ms ease, opacity 140ms ease;
  }
  .nav-toggle .lines { position: relative; }
  .nav-toggle .lines::before,
  .nav-toggle .lines::after { position: absolute; left: 0; }
  .nav-toggle .lines::before { top: -6px; }
  .nav-toggle .lines::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .lines { transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .lines::before { transform: rotate(-90deg) translateX(0); top: 0; }
  .nav-toggle[aria-expanded="true"] .lines::after { opacity: 0; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border: 1px solid var(--ink);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 18px 40px -18px rgba(29,29,27,.4);
    display: none;
    z-index: 30;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding-inline: 14px;
    font-size: 16.5px;
    border-radius: 6px;
  }
  .site-nav a:hover { background: rgba(29,29,27,.06); text-decoration: none; }
}

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

/* ---------- theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  transition: transform 200ms ease, border-color 140ms ease;
}
.theme-toggle:hover { border-color: var(--soft); transform: rotate(18deg); }
html[data-theme="dark"] .ic-sun { display: none; }
html[data-theme="dark"] .ic-moon { display: inline; }
html[data-theme="light"] .ic-moon { display: none; }
html .ic-moon { display: none; }
@media (max-width: 720px) {
  .theme-toggle { margin-right: 10px; }
  .site-head { gap: 10px; }
}
