:root {
  --ink: #142a32;
  --muted: #5d7075;
  --paper: #edf2f3;
  --paper-deep: #d9e3e5;
  --panel: #102b35;
  --panel-line: #31525a;
  --white: #f8fbfa;
  --coral: #ff7654;
  --cobalt: #5367f2;
  --mint: #9dd5c4;
  --yellow: #f6d86d;
  --line: 1px solid rgba(20, 42, 50, .18);
  --display: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --body: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --utility: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.58;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: linear-gradient(rgba(20,42,50,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(20,42,50,.035) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: -1;
}

a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--cobalt); }

button, input { font: inherit; }
button { cursor: pointer; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header, .site-footer {
  width: min(1360px, calc(100% - 64px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: var(--line);
  font-family: var(--utility);
  font-size: 11px;
  letter-spacing: .08em;
}

.wordmark { font-weight: 700; text-decoration: none; }
.wordmark span { color: var(--coral); padding: 0 6px; }
.language-nav { display: flex; gap: 18px; }
.language-nav a { text-decoration: none; padding: 8px 0; }
.language-nav a[aria-current="page"] { color: var(--coral); border-bottom: 2px solid var(--coral); }

.section-shell {
  width: min(1200px, calc(100% - 64px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(520px, 1.15fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  min-height: 700px;
  padding: 70px 0 92px;
}

.eyebrow, .section-marker, .instrument-heading, .timer-label, .output-label {
  margin: 0;
  font-family: var(--utility);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.eyebrow { color: var(--coral); font-weight: 700; }

h1, h2 { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: -.055em; line-height: .98; }
h1 { max-width: 720px; margin-top: 18px; font-size: clamp(52px, 6.8vw, 104px); }
h2 { font-size: clamp(36px, 4vw, 64px); }

.dek { max-width: 540px; margin: 28px 0 0; font-size: clamp(21px, 2vw, 27px); line-height: 1.26; }

.hero-result {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: baseline;
  column-gap: 10px;
  max-width: 475px;
  margin-top: 40px;
  padding-top: 18px;
  border-top: 3px solid var(--ink);
}

.result-number { font-family: var(--display); font-size: 70px; font-weight: 800; letter-spacing: -.08em; line-height: .8; color: var(--cobalt); }
.result-unit { font-family: var(--utility); font-size: 13px; font-weight: 700; }
.hero-result p { grid-column: 1 / -1; margin: 15px 0 0; font-size: 16px; line-height: 1.35; }
.text-link { display: inline-block; margin-top: 30px; font-family: var(--utility); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.text-link span { color: var(--coral); font-size: 18px; margin-left: 8px; }

.hero-instrument {
  padding: 20px 20px 18px;
  color: var(--white);
  background: var(--panel);
  box-shadow: 14px 14px 0 var(--coral);
}

.instrument-heading { display: flex; justify-content: space-between; color: var(--mint); }
#pendulum-canvas { display: block; width: 100%; height: auto; margin-top: 14px; background: var(--panel); }
.instrument-key { display: flex; flex-wrap: wrap; gap: 17px; align-items: center; padding-top: 10px; border-top: 1px solid var(--panel-line); font-family: var(--utility); font-size: 10px; color: #d5e3df; }
.key-dot, .key-line { display: inline-flex; align-items: center; gap: 6px; font-style: normal; }
.key-dot::before { content: ""; width: 9px; height: 9px; display: inline-block; border-radius: 50%; background: var(--coral); }
.key-cop::before { background: var(--mint); }
.key-line::before { content: ""; width: 22px; border-top: 1px dashed var(--yellow); }
.no-js-note { margin: 13px 0 0; color: #b7cbc8; font-size: 13px; line-height: 1.35; }

.reading-section, .lab-section, .test-section, .limits-section, .sources-section {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(260px, .72fr);
  gap: 30px;
  padding: 105px 0;
  border-top: var(--line);
}

.section-marker { padding-top: 8px; color: var(--coral); }
.reading-copy { max-width: 650px; }
.reading-copy h2, .lab-intro h2, .test-copy h2, .limits-copy h2, .sources-copy h2 { margin-top: 14px; }
.reading-copy p, .lab-intro p, .test-copy p, .limits-copy p, .sources-copy p { margin: 25px 0 0; }
.reading-copy a, .sources-copy a { text-decoration-color: var(--coral); }

.evidence-figure { align-self: center; margin: 0; }
.mini-diagram { position: relative; min-height: 330px; overflow: hidden; background: var(--paper-deep); border: 1px solid rgba(20,42,50,.24); }
.mini-diagram::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px dashed rgba(20,42,50,.35); }
.diagram-ground { position: absolute; right: 10%; bottom: 16%; left: 10%; height: 8px; background: var(--ink); }
.diagram-foot { position: absolute; bottom: 8px; left: 16%; width: 35%; height: 16px; border-radius: 50% 10% 8% 15%; background: var(--ink); transform: rotate(-3deg); }
.diagram-foot.second { right: 16%; left: auto; transform: scaleX(-1) rotate(-3deg); }
.diagram-body { position: absolute; bottom: 22%; left: 50%; width: 34px; height: 58%; background: var(--ink); transform: translateX(-50%) rotate(0deg); transform-origin: 50% 100%; }
.diagram-head { position: absolute; top: -38px; left: 50%; width: 50px; height: 50px; border: 10px solid var(--ink); border-radius: 50%; transform: translateX(-50%); }
.diagram-com, .diagram-ankle, .diagram-cop { position: absolute; z-index: 2; padding: 3px 5px; font-family: var(--utility); font-size: 10px; font-weight: 700; background: var(--coral); }
.diagram-com { top: 28%; left: 58%; }
.diagram-ankle { bottom: -18px; left: 50%; color: var(--white); background: var(--cobalt); transform: translateX(-50%); }
.diagram-line { position: absolute; top: 29%; bottom: 20%; left: 50%; border-left: 2px dashed var(--yellow); }
.diagram-cop { bottom: 10%; left: 63%; color: var(--ink); background: var(--mint); }
figcaption { margin-top: 15px; font-size: 15px; line-height: 1.4; }

.lab-section { grid-template-columns: 92px minmax(0, .8fr) minmax(300px, 1fr); align-items: start; background: rgba(157,213,196,.19); }
.lab-intro { max-width: 500px; }
.control-panel { padding: 24px; border: 1px solid var(--ink); background: var(--paper); }
.control-row + .control-row { margin-top: 24px; }
.control-row label { display: flex; justify-content: space-between; gap: 18px; font-family: var(--utility); font-size: 12px; font-weight: 700; }
.control-row output { color: var(--cobalt); }
input[type="range"] { display: block; width: 100%; margin: 15px 0 0; accent-color: var(--coral); }
.switch-line { display: flex; align-items: center; gap: 10px; margin-top: 23px; font-family: var(--utility); font-size: 11px; line-height: 1.3; }
.switch-line input { width: 18px; height: 18px; accent-color: var(--cobalt); }
.primary-button, .secondary-button { min-height: 44px; padding: 10px 15px; border: 1px solid var(--ink); font-family: var(--utility); font-size: 11px; font-weight: 700; }
.primary-button { color: var(--white); background: var(--ink); }
.primary-button:hover, .primary-button:focus-visible { color: var(--ink); background: var(--yellow); }
.secondary-button { color: var(--ink); background: transparent; }
.secondary-button:hover, .secondary-button:focus-visible { background: var(--paper-deep); }
.control-panel .primary-button { width: 100%; margin-top: 22px; }
.calculation-output { grid-column: 3; margin-top: 26px; padding: 22px 0 0; border-top: 3px solid var(--coral); }
.big-output { margin: 4px 0 0; font-family: var(--display); font-size: clamp(52px, 6vw, 82px); font-weight: 800; letter-spacing: -.08em; line-height: .9; color: var(--cobalt); }
.big-output small { display: inline-block; font-family: var(--utility); font-size: 12px; letter-spacing: .02em; color: var(--ink); }
.equation { margin: 20px 0 0; font-size: 20px; }
.output-detail { margin: 15px 0 0; font-family: var(--utility); font-size: 11px; line-height: 1.45; }

.strategy-strip { display: grid; grid-template-columns: 1fr; align-content: center; gap: 12px; }
.strategy-card { display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; padding: 17px; border: 1px solid var(--ink); background: rgba(255,255,255,.3); }
.strategy-number { grid-row: 1 / span 2; display: grid; place-items: center; width: 28px; height: 28px; font-family: var(--utility); font-size: 12px; color: var(--white); background: var(--cobalt); }
.strategy-card strong { font-family: var(--display); font-size: 19px; line-height: 1; }
.strategy-card span:last-child { font-size: 14px; line-height: 1.25; }

.test-section { align-items: start; background: var(--yellow); }
.test-copy { max-width: 630px; }
.safety-note { padding: 14px 16px; border-left: 4px solid var(--coral); background: rgba(255,255,255,.38); font-size: 15px !important; line-height: 1.4; }
.timer-card { padding: 24px; border: 1px solid var(--ink); background: var(--white); }
.timer-card output { display: block; margin: 14px 0 18px; font-family: var(--display); font-size: clamp(52px, 6vw, 78px); font-weight: 800; letter-spacing: -.08em; line-height: .9; }
.timer-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.timer-card p { margin: 19px 0 0; font-size: 14px; line-height: 1.35; }

.limits-section { grid-template-columns: 92px minmax(0, 1fr); background: var(--panel); color: var(--white); }
.limits-section .section-marker, .limits-section .eyebrow { color: var(--mint); }
.limits-copy { max-width: 780px; }
.limits-copy p { color: #d0dfdc; }

.sources-section { grid-template-columns: 92px minmax(0, 820px); }
.sources-copy ol { margin: 28px 0 0; padding-left: 23px; }
.sources-copy li { margin: 0 0 16px; padding-left: 6px; font-size: 16px; line-height: 1.45; }
.method-note { padding-top: 18px; border-top: var(--line); font-size: 15px !important; }

.site-footer { display: grid; grid-template-columns: 1fr auto auto; gap: 30px; align-items: center; min-height: 100px; border-top: var(--line); font-family: var(--utility); font-size: 11px; }
.site-footer a { text-decoration: none; }

:focus-visible { outline: 3px solid var(--coral); outline-offset: 4px; }

@media (max-width: 930px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 58px; }
  .hero-copy { max-width: 720px; }
  .hero-instrument { max-width: 760px; }
  .reading-section, .lab-section, .test-section, .limits-section, .sources-section { grid-template-columns: 70px minmax(0, 1fr); }
  .evidence-figure, .strategy-strip, .timer-card, .calculation-output { grid-column: 2; }
  .calculation-output { margin-top: 0; }
  .strategy-strip { grid-template-columns: repeat(3, 1fr); }
  .site-footer { grid-template-columns: 1fr auto; }
  .site-footer > :last-child { grid-column: 1 / -1; padding-bottom: 22px; }
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  .site-header, .site-footer, .section-shell { width: min(100% - 32px, 1200px); }
  .site-header { min-height: 64px; }
  .wordmark { font-size: 9px; }
  .language-nav { gap: 12px; }
  .hero { gap: 42px; padding: 45px 0 70px; }
  h1 { font-size: clamp(48px, 15vw, 70px); }
  h2 { font-size: clamp(36px, 12vw, 52px); }
  .dek { font-size: 21px; }
  .hero-result { margin-top: 32px; }
  .result-number { font-size: 58px; }
  .hero-instrument { padding: 14px 12px 14px; box-shadow: 7px 7px 0 var(--coral); }
  .instrument-heading { font-size: 9px; }
  .instrument-key { gap: 9px; font-size: 9px; }
  .reading-section, .lab-section, .test-section, .limits-section, .sources-section { display: block; padding: 75px 0; }
  .section-marker { margin-bottom: 25px; }
  .evidence-figure, .strategy-strip, .timer-card, .calculation-output { margin-top: 42px; }
  .mini-diagram { min-height: 280px; }
  .lab-section { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .control-panel { margin-top: 34px; padding: 18px; }
  .calculation-output { padding-top: 18px; }
  .big-output { font-size: 62px; }
  .strategy-strip { grid-template-columns: 1fr; }
  .test-section { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .timer-card { padding: 18px; }
  .limits-section { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .sources-section { padding-bottom: 60px; }
  .site-footer { display: block; padding: 25px 0; }
  .site-footer > div { margin-top: 16px; }
}

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