/* ============================================================
   RAWINPUT — low latency PC club
   LAYOUT: D — split-rail (left rail 80px w/ latency labels, content 1120px)
   SPACING SCALE: regular (96px / 56px sections; 48px mobile)
   Tokens only, 8px step. No box-shadow. Border 1px solid currentColor.
   ============================================================ */

:root {
  /* colors */
  --c-bg: #f2f4f3;
  --c-bg-dark: #101312;
  --c-ink: #101312;
  --c-ink-inv: #f2f4f3;
  --c-a1: #10b981;   /* signal green */
  --c-a2: #f43f5e;   /* peak red */
  --c-muted: rgba(242,244,243,.55);
  --c-muted-ink: rgba(16,19,18,.6);
  --c-line-dark: rgba(242,244,243,.18);
  --c-line-ink: rgba(16,19,18,.18);

  /* fonts */
  --f-display: "Michroma", sans-serif;
  --f-alt: "Instrument Sans", sans-serif;
  --f-body: "Azeret Mono", ui-monospace, monospace;

  /* radius / geometry */
  --r-card: 2px;
  --rail-w: 80px;
  --w-container: 1120px;

  /* spacing scale (8px step) */
  --s-1: 8px; --s-2: 16px; --s-3: 24px; --s-4: 32px; --s-5: 40px; --s-6: 56px;
  --sec: 96px;      /* regular vertical section */
  --sec-inner: 56px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ---------- shell offset for rail ---------- */
.shell { margin-left: var(--rail-w); }

/* ---------- split rail ---------- */
.rail {
  position: fixed; left: 0; top: 0; z-index: 40;
  width: var(--rail-w); height: 100vh;
  background: var(--c-bg-dark); color: var(--c-ink-inv);
  border-right: 1px solid var(--c-line-dark);
  display: flex; flex-direction: column; align-items: center;
  padding: var(--s-3) 0;
}
.rail__unit { font-size: 10px; letter-spacing: .18em; color: var(--c-muted); text-transform: uppercase; }
.rail__scale {
  list-style: none; margin: var(--s-4) 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 0;
  flex: 1; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--c-muted); width: 100%;
}
.rail__scale li { position: relative; width: 100%; text-align: center; padding: 2px 0; transition: color .3s; }
.rail__scale li b { font-weight: 600; }
.rail__scale li.is-active { color: var(--c-a1); }
.rail__marker {
  position: absolute; left: 6px; width: 10px; height: 10px;
  border: 1px solid var(--c-a1); border-radius: 50%;
  background: rgba(16,185,129,.25);
  transition: top .4s cubic-bezier(.4,0,.2,1);
  top: 80px; will-change: top;
}

/* ---------- container ---------- */
.s-hero__inner, .s-block__head, .rigs__grid, .bench__grid,
.numbers__wrap, .s-wired__inner, .diary__list, .gallery__grid,
.faq, .book__grid, .nav {
  max-width: var(--w-container); margin-inline: auto;
  padding-inline: var(--s-4);
}

/* ---------- kicker / channel marks ---------- */
.kicker {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--c-a1); margin: 0 0 var(--s-2);
}
.s-block--dark .kicker, .s-block--band .kicker { color: var(--c-a1); }

/* ---------- typography ---------- */
h1 { font-family: var(--f-display); font-weight: 400;
  font-size: clamp(30px, 4.5vw, 56px); line-height: 1.08; margin: 0 0 var(--s-3); letter-spacing: .01em; }
h2 { font-family: var(--f-display); font-weight: 400;
  font-size: clamp(24px, 3.5vw, 40px); line-height: 1.15; margin: 0 0 var(--s-3); }
h3 { font-family: var(--f-alt); font-weight: 700; font-size: 18px; margin: 0 0 var(--s-2);
  display: flex; align-items: center; gap: var(--s-1); }
p { margin: 0 0 var(--s-3); }
.unit { color: currentColor; opacity: .5; font-size: .55em; margin-left: 4px; text-transform: uppercase; letter-spacing: .05em; }

/* oscilloscope motif */
.scope { display: block; width: 240px; max-width: 60%; height: 22px; margin: 0 0 var(--s-3);
  fill: none; stroke: var(--c-a1); stroke-width: 1.5; }
.footer .scope, .s-hero .scope, .book__aside .scope { margin-inline: auto; }
.scope--ink { stroke: var(--c-a1); }

/* icons */
.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; }
.ic--a1 { color: var(--c-a1); }
.ic--a2 { color: var(--c-a2); }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: var(--s-1);
  font-family: var(--f-body); font-size: 14px; font-weight: 500;
  padding: 12px 20px; border: 1px solid currentColor; border-radius: var(--r-card);
  text-decoration: none; cursor: pointer; background: none; color: inherit;
  transition: background .2s, color .2s, transform .2s;
}
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--primary { background: var(--c-a1); color: var(--c-bg-dark); border-color: var(--c-a1); }
.btn--primary:hover { background: #0ea271; }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: rgba(16,185,129,.12); color: var(--c-a1); border-color: var(--c-a1); }
/* hover: oscilloscope "beat" underline on primary */
.btn--primary::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 6px;
  background: linear-gradient(90deg, transparent 40%, var(--c-bg-dark) 40%, var(--c-bg-dark) 44%, transparent 44%, transparent 52%, var(--c-bg-dark) 52%, var(--c-bg-dark) 60%, transparent 60%);
  opacity: 0; transition: opacity .2s;
}
.btn--primary:hover::after { opacity: .35; }

/* ---------- measurement frame + probes ---------- */
.frame { position: relative; border: 1px solid var(--c-line-ink); border-radius: var(--r-card); }
.s-block--dark .frame, .frame--dark { border-color: var(--c-line-dark); }
.probe { position: absolute; width: 8px; height: 8px; pointer-events: none; opacity: 0;
  transition: opacity .5s, transform .5s; }
.reveal .probe { opacity: 0; }
.reveal.is-in .probe { opacity: 1; }
.probe--tl { top: -1px; left: -1px; border-top: 1px solid var(--c-a1); border-left: 1px solid var(--c-a1);
  transform: translate(4px,4px); }
.probe--tr { top: -1px; right: -1px; border-top: 1px solid var(--c-a1); border-right: 1px solid var(--c-a1);
  transform: translate(-4px,4px); }
.probe--bl { bottom: -1px; left: -1px; border-bottom: 1px solid var(--c-a1); border-left: 1px solid var(--c-a1);
  transform: translate(4px,-4px); }
.probe--br { bottom: -1px; right: -1px; border-bottom: 1px solid var(--c-a1); border-right: 1px solid var(--c-a1);
  transform: translate(-4px,-4px); }
.is-in .probe { transform: translate(0,0); }
.frame:not(.reveal) .probe { opacity: 1; }
.probe--tl, .probe--tr, .probe--bl, .probe--br { width: 9px; height: 9px; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--s-4);
  padding-block: var(--s-3); background: var(--c-bg-dark); color: var(--c-ink-inv);
  border-bottom: 1px solid var(--c-line-dark);
  transition: padding .25s;
}
.nav.is-scrolled { padding-block: var(--s-2); }
.nav__logo { display: flex; align-items: center; gap: var(--s-1);
  font-family: var(--f-display); font-size: 16px; text-decoration: none; letter-spacing: .04em; }
.nav__mark { width: 40px; height: 16px; fill: none; stroke: var(--c-a1); stroke-width: 1.5; }
.nav__links { display: flex; gap: var(--s-4); margin-left: auto; }
.nav__links a { position: relative; text-decoration: none; font-size: 14px; padding-bottom: 3px; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1.5px;
  background: var(--c-a1); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); }
.nav__cta { padding: 9px 16px; }

/* ---------- HERO ---------- */
.s-hero { position: relative; background: var(--c-bg-dark); color: var(--c-ink-inv);
  padding-block: var(--sec) var(--sec); overflow: hidden; text-align: center; }
.s-hero__trace { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .9; }
.s-hero__inner { position: relative; z-index: 1; }
.s-hero .scope { margin-bottom: var(--s-3); }
.s-hero__lead { max-width: 640px; margin-inline: auto; color: var(--c-muted); font-size: 16px; }
.s-hero__actions { display: flex; gap: var(--s-2); justify-content: center; flex-wrap: wrap; margin-bottom: var(--s-6); }
.s-hero__mockup { position: relative; max-width: 940px; margin-inline: auto;
  border: 1px solid var(--c-line-dark); border-radius: 6px; padding: 8px; }
.s-hero__mockup img { border-radius: 3px; }
.s-hero__tag { position: absolute; left: 16px; bottom: 16px; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; background: rgba(16,19,18,.7); color: var(--c-a1);
  border: 1px solid var(--c-a1); padding: 4px 10px; border-radius: 2px; }

/* ---------- section blocks ---------- */
.s-block { padding-block: var(--sec); }
.s-block--dark { background: var(--c-bg-dark); color: var(--c-ink-inv); }
.s-block--light { background: var(--c-bg); color: var(--c-ink);
  background-image: linear-gradient(var(--c-line-ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-line-ink) 1px, transparent 1px);
  background-size: 32px 32px; background-position: center; }
.s-block--light > * { position: relative; }
.s-block__head { text-align: center; margin-bottom: var(--sec-inner); }
.s-block__head .kicker { }
.s-block__intro { max-width: 620px; margin-inline: auto; color: inherit; opacity: .8; }
.s-block--dark .s-block__intro { color: var(--c-muted); opacity: 1; }

/* display value */
.card__display, .bench__big { font-family: var(--f-body); font-weight: 600; }
.num, .num-static { font-variant-numeric: tabular-nums; }

/* ---------- RIGS ---------- */
.rigs__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.card { padding: var(--s-4); background: rgba(242,244,243,.02); display: flex; flex-direction: column; }
.card__display { display: flex; align-items: baseline;
  background: #0a0c0b; border: 1px solid var(--c-line-dark); border-radius: 2px;
  color: var(--c-a1); font-size: 34px; padding: 10px 16px; margin-bottom: var(--s-3);
  width: fit-content; letter-spacing: .02em; }
.card__display--muted { color: var(--c-ink-inv); font-size: 20px; }
.card__display--muted .num-static { color: var(--c-a2); font-size: 26px; margin-right: 6px; }
.card__media { border: 1px solid var(--c-line-dark); border-radius: 2px; overflow: hidden; margin-bottom: var(--s-3); }
.card__media img { filter: saturate(.92) contrast(1.02); }
.card p { color: var(--c-muted); flex: 1; }
.spec { list-style: none; margin: var(--s-2) 0 0; padding: var(--s-3) 0 0; border-top: 1px dashed var(--c-line-dark);
  font-size: 12px; letter-spacing: .03em; }
.spec li { color: var(--c-ink-inv); opacity: .75; padding: 3px 0; }
.spec li::first-line { }

/* ---------- BENCH ---------- */
.bench__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s-6); align-items: center; }
.bench__display { text-align: center; padding: var(--s-6) var(--s-4);
  background: var(--c-bg-dark); color: var(--c-ink-inv); }
.bench__label { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--c-muted); margin-bottom: var(--s-2); }
.bench__big { font-size: clamp(48px, 8vw, 84px); color: var(--c-a1); margin: 0 0 var(--s-2); line-height: 1; }
.bench__sub { font-size: 12px; color: var(--c-muted); margin: 0; }

/* ---------- NUMBERS TABLE ---------- */
.numbers__wrap { overflow-x: auto; }
.numbers { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--c-bg); }
.numbers th, .numbers td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--c-line-ink); }
.numbers thead th { font-family: var(--f-alt); font-weight: 700; font-size: 12px;
  letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--c-ink); }
.numbers .ms { font-weight: 600; font-variant-numeric: tabular-nums; }
.ms--good { color: var(--c-a1); }
.ms--bad { color: var(--c-a2); }
.numbers tr.is-best { position: relative; background: rgba(16,185,129,.06); }
.numbers tr.is-worst { background: rgba(244,63,94,.05); }
.numbers__foot { margin-top: var(--s-3); font-size: 13px; color: var(--c-muted-ink); }

/* ---------- WIRED BAND ---------- */
.s-wired { position: relative; color: var(--c-ink-inv); overflow: hidden;
  background: var(--c-bg-dark) url("images/band-1.jpg") center/cover no-repeat; }
.s-wired__overlay { position: absolute; inset: 0; background: linear-gradient(rgba(16,19,18,.86), rgba(16,19,18,.9)); }
.s-wired__inner { position: relative; z-index: 1; text-align: center; }
.wired__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin-top: var(--sec-inner); text-align: left; }
.wired__col { border-top: 1px solid var(--c-a1); padding-top: var(--s-3); }
.wired__col p { color: var(--c-muted); margin: 0; }

/* ---------- DIARY ---------- */
.diary__list { list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.diary__item { padding: var(--s-4); }
.diary__date { font-size: 12px; color: var(--c-a1); letter-spacing: .06em; margin-bottom: var(--s-2); }
.diary__item p:last-child { color: var(--c-muted); margin: 0; }

/* ---------- GALLERY ---------- */
.gallery__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.gallery__grid figure { margin: 0; padding: 8px; overflow: hidden; }
.gallery__grid img { border-radius: 2px; filter: saturate(.92) contrast(1.03); }
.gallery__grid figcaption { font-size: 13px; margin-top: var(--s-2); color: var(--c-muted-ink); }
.gallery__grid .ms { font-weight: 600; }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; }
.faq__item { border-bottom: 1px solid var(--c-line-ink); }
.faq__item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; gap: var(--s-2); padding: var(--s-3) 0; font-family: var(--f-alt); font-weight: 600; font-size: 16px; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__ic { transition: transform .25s; color: var(--c-a1); }
.faq__item[open] .faq__ic { transform: rotate(45deg); }
.faq__item p { padding: 0 0 var(--s-3); color: var(--c-muted-ink); margin: 0; max-width: 660px; }

/* ---------- BOOK FORM ---------- */
.book__grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: var(--s-6); align-items: start; }
.book__aside p { color: var(--c-muted); }
.book__form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field:nth-child(1), .book__submit, #formStatus { grid-column: 1 / -1; }
.field label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--c-a1); }
.field input, .field select {
  font-family: var(--f-body); font-size: 14px; color: var(--c-ink-inv);
  background: #0a0c0b; border: 1px solid var(--c-line-dark); border-radius: 2px; padding: 11px 12px;
  transition: border-color .2s; }
.field input:focus, .field select:focus { outline: none; border-color: var(--c-a1); }
.field input::placeholder { color: rgba(242,244,243,.4); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.book__submit { justify-self: start; }
#formStatus { margin: 0; font-size: 14px; min-height: 1.2em; }
#formStatus.success { color: var(--c-a1); }
#formStatus.error { color: var(--c-a2); }

/* ---------- FOOTER ---------- */
.footer { background: var(--c-bg-dark); color: var(--c-ink-inv);
  text-align: center; padding: var(--sec) var(--s-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
  border-top: 1px solid var(--c-line-dark); }
.footer__logo { font-family: var(--f-display); font-size: 20px; text-decoration: none; letter-spacing: .04em; }
.footer__slogan { color: var(--c-a1); font-size: 13px; letter-spacing: .04em; margin: 0; }
.footer__nav, .footer__legal { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; font-size: 14px; }
.footer__nav a, .footer__legal a { text-decoration: none; color: var(--c-muted); transition: color .2s; }
.footer__nav a:hover, .footer__legal a:hover { color: var(--c-a1); }
.footer__contact { list-style: none; padding: 0; margin: var(--s-2) 0; display: flex; flex-direction: column;
  gap: var(--s-1); align-items: center; font-size: 14px; }
.footer__contact li { display: flex; align-items: center; gap: var(--s-1); color: var(--c-muted); }
.footer__contact a { color: var(--c-ink-inv); text-decoration: none; }
.footer__contact a:hover { color: var(--c-a1); }
.footer__legal { border-top: 1px solid var(--c-line-dark); padding-top: var(--s-3); width: 100%; max-width: 400px; }
.footer__disclaimer { color: var(--c-ink-inv); font-weight: 500; border: 1px solid var(--c-a1);
  border-radius: 2px; padding: 8px 16px; font-size: 13px; margin: var(--s-2) 0 0; }
.footer__copy { color: var(--c-muted); font-size: 12px; margin: 0; }

/* ---------- COOKIE ---------- */
.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--c-bg-dark); color: var(--c-ink-inv); border-top: 1px solid var(--c-a1);
  display: flex; align-items: center; gap: var(--s-4); justify-content: center; flex-wrap: wrap;
  padding: var(--s-3) var(--s-4); }
.cookie[hidden] { display: none; }
.cookie__text { margin: 0; font-size: 13px; max-width: 620px; color: var(--c-muted); }
.cookie__text a { color: var(--c-a1); }
.cookie__actions { display: flex; gap: var(--s-2); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- utilities ---------- */
.u-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ============================================================
   LEGAL PAGES (spec-sheets)
   ============================================================ */
.legal { background: var(--c-bg); }
.shell--legal { margin-left: 0; }
.legal__head { background: var(--c-bg-dark); color: var(--c-ink-inv);
  text-align: center; padding: var(--s-5) var(--s-4) var(--s-4);
  border-bottom: 1px solid var(--c-line-dark); }
.legal__logo { font-family: var(--f-display); font-size: 20px; text-decoration: none; letter-spacing: .04em; display: inline-block; }
.legal__head .scope { margin: var(--s-2) auto 6px; }
.legal__slogan { color: var(--c-a1); font-size: 12px; letter-spacing: .04em; margin: 0; }
.legal__main { max-width: 720px; margin-inline: auto; padding: var(--sec) var(--s-4); }
.legal__lead { color: var(--c-muted-ink); font-size: 16px; margin-bottom: var(--s-5); }
.legal__toc { width: 100%; border-collapse: collapse; margin-bottom: var(--s-6);
  border: 1px solid var(--c-line-ink); font-size: 14px; }
.legal__toc td { padding: 10px 14px; border-bottom: 1px solid var(--c-line-ink); }
.legal__toc tr:last-child td { border-bottom: none; }
.legal__toc td:first-child { width: 64px; color: var(--c-a1); font-weight: 600; border-right: 1px solid var(--c-line-ink); }
.legal__toc a { text-decoration: none; }
.legal__toc a:hover { color: var(--c-a1); }
.legal__main section { margin-bottom: var(--s-5); }
.legal__main h2 { font-family: var(--f-alt); font-weight: 700; font-size: 20px;
  display: flex; align-items: baseline; gap: var(--s-2); }
.legal__num { font-family: var(--f-body); font-size: 13px; color: var(--c-a1); }
.legal__main p { color: var(--c-ink); }
.legal__main code { background: rgba(16,19,18,.06); border: 1px solid var(--c-line-ink);
  border-radius: 2px; padding: 1px 6px; font-size: 13px; }
.legal__disclaimer { color: var(--c-ink); font-weight: 500; border: 1px solid var(--c-a1);
  border-radius: 2px; padding: 8px 16px; font-size: 13px; display: inline-block; margin-top: var(--s-4); }
.legal__back { margin-top: var(--s-4); font-size: 14px; }
.legal__back a { color: var(--c-a1); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .rigs__grid, .diary__list, .wired__cols, .gallery__grid { grid-template-columns: repeat(2, 1fr); }
  .bench__grid, .book__grid { grid-template-columns: 1fr; gap: var(--s-5); }
}
@media (max-width: 768px) {
  :root { --sec: 56px; --sec-inner: 40px; }
  .shell { margin-left: 0; }
  .rail { position: static; width: 100%; height: auto; flex-direction: row;
    justify-content: center; gap: var(--s-3); padding: var(--s-2); border-right: none;
    border-bottom: 1px solid var(--c-line-dark); }
  .rail__scale { flex-direction: row; margin: 0; flex: none; gap: var(--s-2); }
  .rail__marker { display: none; }
  .rail__unit { display: none; }
  .nav { top: 0; }
  .nav__links { display: none; }
  .rigs__grid, .diary__list, .wired__cols, .gallery__grid { grid-template-columns: 1fr; }
  .book__form { grid-template-columns: 1fr; }
  .field:nth-child(1) { grid-column: auto; }
}
@media (max-width: 480px) {
  body { font-size: 14px; }
  .s-hero__actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .probe { opacity: 1; transform: none; }
}
