:root {
  --ink: #17212b;
  --ink-soft: #33424d;
  --paper: #f4f5ef;
  --paper-deep: #e5e9dc;
  --blue: #2739d4;
  --blue-dark: #1a278f;
  --red: #ff604f;
  --yellow: #d9ff58;
  --line: rgba(23, 33, 43, 0.24);
  --line-soft: rgba(23, 33, 43, 0.12);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --measure: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 28px 28px;
}

a { color: inherit; }

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

.section-wrap {
  width: min(calc(100% - 48px), var(--measure));
  margin-inline: auto;
}

.site-header {
  min-height: 68px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 245, 239, 0.95);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  text-decoration: none;
  font: 700 0.78rem/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand span {
  color: var(--blue);
  margin-left: 10px;
  font-weight: 500;
}

.language-nav {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.language-link {
  min-width: 42px;
  padding: 8px 10px;
  text-align: center;
  text-decoration: none;
  font: 700 0.72rem/1 var(--mono);
  letter-spacing: 0.05em;
}

.language-link.is-active { color: var(--paper); background: var(--ink); }

.hero {
  padding: 72px 0 86px;
  display: grid;
  grid-template-columns: minmax(0, 0.93fr) minmax(360px, 0.82fr);
  gap: clamp(36px, 6vw, 92px);
  align-items: center;
}

.eyebrow, .lab-index, .figure-head, .section-marker, .side-note-label {
  font: 700 0.72rem/1.25 var(--mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow { color: var(--blue); margin: 0 0 18px; }

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 { font-family: var(--sans); letter-spacing: -0.045em; }

h1 {
  max-width: 720px;
  margin-bottom: 26px;
  font-size: clamp(3.2rem, 7.1vw, 6.5rem);
  line-height: 0.91;
  font-weight: 800;
}

.hero-deck {
  max-width: 650px;
  margin-bottom: 30px;
  font-size: clamp(1.18rem, 1.8vw, 1.5rem);
  line-height: 1.42;
  color: var(--ink-soft);
}

.hero-proof {
  display: inline-flex;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 22px;
  padding: 15px 18px 13px;
  background: var(--yellow);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 var(--blue);
}

.proof-number {
  white-space: nowrap;
  font: 800 clamp(1.6rem, 3vw, 2.5rem)/1 var(--sans);
  letter-spacing: -0.06em;
}

.proof-number span { font-size: 0.44em; letter-spacing: 0; }

.hero-proof p {
  max-width: 190px;
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.2;
}

.trust-line {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0;
  color: var(--ink-soft);
  font: 0.72rem/1.4 var(--mono);
}

.trust-dot { width: 9px; height: 9px; background: var(--red); border-radius: 50%; flex: 0 0 auto; }

.spot-lab {
  padding: 24px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 10px 10px 0 var(--red);
}

.lab-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(244,245,239,.28);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.lab-index { color: var(--yellow); margin-bottom: 8px; }

.spot-lab h2 { margin-bottom: 0; font-size: clamp(1.8rem, 3.2vw, 2.8rem); line-height: 0.96; }

.lab-state { padding-top: 4px; color: var(--yellow); font: 0.7rem/1 var(--mono); text-transform: uppercase; white-space: nowrap; }

.lab-instruction { max-width: 520px; margin-bottom: 20px; color: rgba(244,245,239,.78); font-size: 1rem; line-height: 1.45; }

.test-stage {
  --target-pos: 22%;
  min-height: 230px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(244,245,239,.45);
  background-color: #25375a;
  background-image: linear-gradient(rgba(217,255,88,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(217,255,88,.12) 1px, transparent 1px);
  background-size: 24px 24px;
}

.test-stage::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 65%;
  width: 11%;
  background: rgba(255,96,79,.15);
  border-inline: 1px solid rgba(255,96,79,.55);
}

.pupil-stage { min-height: 300px; background-color: #17212b; background-image: linear-gradient(rgba(217,255,88,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(217,255,88,.12) 1px, transparent 1px); }
.pupil-stage::before { display: none; }
.iris-visual { position: absolute; top: 50%; left: 50%; width: 244px; height: 244px; transform: translate(-50%, -50%); border: 3px solid var(--yellow); border-radius: 50%; background: radial-gradient(circle at center, #17212b 0 31%, transparent 32%), repeating-conic-gradient(from 8deg, #2739d4 0 7deg, #1a278f 7deg 14deg); box-shadow: 0 0 0 16px rgba(39,57,212,.22), 0 0 0 19px rgba(217,255,88,.7); }
.pupil-opening { position: absolute; top: 50%; left: 50%; display: block; width: 52px; height: 52px; transform: translate(-50%, -50%); border: 5px solid var(--red); border-radius: 50%; background: #020406; box-shadow: 0 0 0 2px rgba(244,245,239,.88), 0 0 32px rgba(255,96,79,.45); transition: width 160ms ease, height 160ms ease; }
.pupil-label { position: absolute; top: 50%; color: rgba(244,245,239,.72); font: .65rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.pupil-label-left { left: 8%; transform: translateY(-50%); }
.pupil-label-right { right: 8%; color: var(--yellow); transform: translateY(-50%); }

.fixation-mark, .moving-target { position: absolute; z-index: 2; transform: translate(-50%, -50%); }
.fixation-mark { left: 38%; top: 50%; color: var(--yellow); font: 2rem/1 var(--mono); }
.moving-target { left: calc(38% + var(--target-pos)); top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(244,245,239,.9); transition: left 120ms ease, opacity 120ms ease, transform 120ms ease; }
.moving-target.is-gone { opacity: 0; transform: translate(-50%, -50%) scale(0.15); }
.field-rule { position: absolute; z-index: 1; top: 12%; bottom: 12%; border-left: 1px dashed rgba(244,245,239,.55); }
.field-rule-left { left: 65%; }
.field-rule-right { left: 76%; }
.field-label { position: absolute; bottom: 10px; color: rgba(244,245,239,.72); font: 0.62rem/1 var(--mono); text-transform: uppercase; }
.field-label-left { left: 38%; transform: translateX(-50%); }
.field-label-right { left: 70.5%; transform: translateX(-50%); color: var(--yellow); }

.range-label { display: flex; justify-content: space-between; margin: 19px 0 8px; font: 0.78rem/1.3 var(--mono); color: rgba(244,245,239,.82); }
.range-label output { color: var(--yellow); }

input[type="range"] { width: 100%; accent-color: var(--red); cursor: pointer; }

.lab-result { min-height: 58px; margin-top: 17px; padding: 13px 14px; border-left: 4px solid var(--yellow); background: rgba(244,245,239,.1); }
.lab-result strong { display: block; font: 700 0.95rem/1.2 var(--sans); letter-spacing: -0.02em; }
.lab-result span { display: block; margin-top: 5px; color: rgba(244,245,239,.72); font-size: 0.85rem; line-height: 1.35; }
.text-button { margin-top: 16px; padding: 6px 0; border: 0; color: var(--yellow); background: transparent; font: 700 0.73rem/1 var(--mono); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

.section-rule { width: min(calc(100% - 48px), var(--measure)); margin: 0 auto; display: flex; gap: 15px; align-items: center; color: var(--blue); font: 700 0.7rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.section-rule::before, .section-rule::after { content: ""; height: 1px; background: var(--line); }
.section-rule::before { flex: 0 1 130px; }
.section-rule::after { flex: 1; }

.article { padding: 80px 0 100px; }
.article > section { scroll-margin-top: 90px; }
.answer-section, .sources-section { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 28px; }
.measure-section, .mechanism-section { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(280px, .7fr); gap: 28px; }
.section-marker { color: var(--red); padding-top: 8px; }
.article h2 { max-width: 830px; margin-bottom: 21px; font-size: clamp(2.25rem, 4.6vw, 4.8rem); line-height: .96; }
.article p { max-width: 730px; color: var(--ink-soft); font-size: 1.12rem; line-height: 1.58; }
.answer-section { margin-bottom: 66px; }

.retina-figure { margin: 0 0 86px; padding: 18px; border: 1px solid var(--ink); background: var(--paper-deep); }
.figure-head { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--blue-dark); }
#retina-canvas { display: block; width: 100%; height: auto; min-height: 250px; background: var(--paper); }
.retina-figure figcaption { margin: 12px 0 0; max-width: 780px; color: var(--ink-soft); font-size: .9rem; line-height: 1.45; }

.measure-section { margin-bottom: 94px; align-items: start; }
.measure-copy .eyebrow { margin-bottom: 13px; }
.formula { display: inline-block; margin: 6px 0 0; padding: 10px 12px; color: var(--ink) !important; background: var(--yellow); border: 1px solid var(--ink); font: 1rem/1.2 var(--mono) !important; }
.formula-inline { white-space: nowrap; font-family: var(--mono); font-size: .92em; }
.calculator { padding: 22px; background: var(--blue); color: var(--paper); border: 1px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.calculator label { display: flex; justify-content: space-between; gap: 14px; font: 700 .82rem/1.3 var(--mono); }
.calculator output { color: var(--yellow); }
.calculator input[type="number"] { width: 100%; margin-top: 18px; padding: 10px 12px; border: 1px solid rgba(244,245,239,.7); color: var(--paper); background: rgba(23,33,43,.36); font: 700 1rem/1 var(--mono); }
.calculator input[type="range"] { margin: 22px 0 6px; }
.scale-labels { display: flex; justify-content: space-between; color: rgba(244,245,239,.68); font: .68rem/1 var(--mono); }
.calc-output { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 24px; background: rgba(244,245,239,.45); border: 1px solid rgba(244,245,239,.45); }
.calc-output div { padding: 13px; background: var(--blue); }
.calc-output span { display: block; color: rgba(244,245,239,.72); font: .68rem/1 var(--mono); text-transform: uppercase; }
.calc-output strong { display: block; margin-top: 5px; font: 800 clamp(1.4rem, 2.8vw, 2rem)/1 var(--sans); letter-spacing: -.05em; }
.calc-note { margin: 18px 0 0 !important; color: rgba(244,245,239,.78) !important; font: .85rem/1.45 var(--serif) !important; }

.mechanism-section { margin-bottom: 92px; }
.mechanism-copy { min-width: 0; }
.side-note { align-self: end; padding: 18px; border-top: 4px solid var(--red); background: var(--paper-deep); }
.side-note-label { display: block; margin-bottom: 12px; color: var(--red); }
.side-note p { margin-bottom: 15px; font-size: .98rem; line-height: 1.45; }
.side-note a, .source-list a { color: var(--blue-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.sources-section { padding-top: 10px; }
.sources-section h2 { font-size: clamp(2rem, 4vw, 3.8rem); }
.source-list { max-width: 730px; margin: 25px 0 0; padding-left: 22px; color: var(--ink-soft); }
.source-list li { padding-left: 5px; margin: 10px 0; font-size: .93rem; line-height: 1.45; }

.site-footer { display: flex; justify-content: space-between; gap: 18px; padding: 22px 0 28px; border-top: 1px solid var(--line); color: var(--ink-soft); font: .72rem/1.4 var(--mono); }
.site-footer a { color: var(--blue-dark); text-decoration-thickness: 1px; text-underline-offset: 4px; }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 55px; }
  .spot-lab { max-width: 680px; }
  .measure-section, .mechanism-section { grid-template-columns: 54px minmax(0, 1fr); }
  .calculator, .side-note { grid-column: 2; margin-top: 10px; }
}

@media (max-width: 580px) {
  body { background-size: 22px 22px; }
  .section-wrap { width: min(calc(100% - 28px), var(--measure)); }
  .site-header { min-height: 60px; padding: 0 14px; }
  .brand { font-size: .68rem; }
  .brand span { display: none; }
  .language-link { min-width: 38px; padding: 9px 7px; }
  .hero { padding: 42px 0 62px; gap: 38px; }
  h1 { font-size: clamp(3rem, 15vw, 4.2rem); }
  .hero-deck { font-size: 1.1rem; }
  .hero-proof { display: block; width: fit-content; max-width: 100%; box-shadow: 5px 5px 0 var(--blue); }
  .hero-proof p { max-width: 240px; margin-top: 8px; }
  .trust-line { align-items: flex-start; font-size: .66rem; }
  .spot-lab { padding: 18px; box-shadow: 6px 6px 0 var(--red); }
  .lab-header { gap: 10px; }
  .spot-lab h2 { font-size: 2rem; }
  .lab-state { font-size: .6rem; }
  .test-stage { min-height: 190px; }
  .pupil-stage { min-height: 250px; }
  .iris-visual { width: 188px; height: 188px; }
  .pupil-opening { max-width: 144px; max-height: 144px; }
  .pupil-label { font-size: .55rem; }
  .field-label { font-size: .55rem; }
  .section-rule { width: min(calc(100% - 28px), var(--measure)); }
  .article { padding-top: 58px; }
  .answer-section, .measure-section, .mechanism-section, .sources-section { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
  .article h2 { font-size: clamp(2.15rem, 11vw, 3rem); }
  .article p { font-size: 1.04rem; }
  .retina-figure { margin-bottom: 62px; padding: 10px; }
  #retina-canvas { min-height: 190px; }
  .figure-head { font-size: .6rem; }
  .measure-section, .mechanism-section { margin-bottom: 66px; }
  .calculator { grid-column: 2; padding: 17px; box-shadow: 5px 5px 0 var(--ink); }
  .side-note { grid-column: 2; padding: 14px; }
  .sources-section { padding-top: 0; }
  .site-footer { width: min(calc(100% - 28px), var(--measure)); flex-wrap: wrap; }
  .site-footer span { order: 3; width: 100%; }
}

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