:root {
  color-scheme: light;
  --paper: #e6f0ec;
  --paper-raised: #f7fbf8;
  --paper-deep: #d5e4df;
  --ink: #102b29;
  --muted: #496460;
  --rule: rgba(34, 92, 86, 0.23);
  --grid-small: rgba(34, 92, 86, 0.09);
  --grid-large: rgba(34, 92, 86, 0.16);
  --blue: #174ed4;
  --blue-dark: #0e3190;
  --orange: #eb4b2f;
  --orange-dark: #9e2b18;
  --yellow: #f0cf3f;
  --white: #ffffff;
  --shadow: rgba(16, 43, 41, 0.14);
  --display: "Arial Narrow", "Avenir Next Condensed", "Helvetica Neue", Arial, sans-serif;
  --body: Charter, "Bitstream Charter", Georgia, serif;
  --utility: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --content: min(1160px, calc(100vw - 48px));
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-large) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-large) 1px, transparent 1px),
    linear-gradient(var(--grid-small) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-small) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  font-family: var(--body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
  line-height: 1.65;
  overflow-x: clip;
}

body::before {
  position: fixed;
  inset: 0 auto 0 max(18px, calc((100vw - 1340px) / 2));
  z-index: -1;
  width: 2px;
  content: "";
  background: rgba(235, 75, 47, 0.46);
}

a {
  color: var(--blue-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--orange-dark);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 0.7rem 1rem;
  color: var(--white);
  background: var(--blue-dark);
  transform: translateY(-160%);
}

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

.site-header {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  width: var(--content);
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-mark {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-family: var(--utility);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.language-nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--utility);
  font-size: 0.76rem;
}

.language-nav a,
.language-nav span {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--ink);
  text-decoration: none;
}

.language-nav [aria-current="page"] {
  color: var(--white);
  background: var(--ink);
}

main {
  overflow: clip;
}

.hero {
  width: var(--content);
  min-height: calc(100svh - 69px);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 7rem) 0 clamp(4rem, 8vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1.12fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 7rem);
}

.kicker,
.section-label,
.plot-label,
.micro-label {
  margin: 0;
  font-family: var(--utility);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.35;
  text-transform: uppercase;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--blue-dark);
}

.kicker::before {
  width: 22px;
  height: 2px;
  content: "";
  background: var(--orange);
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 7.6ch;
  margin: 1.4rem 0 1.8rem;
  font-family: var(--display);
  font-size: clamp(4rem, 8.5vw, 8.8rem);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.82;
}

h1 .unit {
  display: block;
  color: var(--orange);
  font-family: var(--utility);
  font-size: 0.22em;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  transform: translateX(0.15em) rotate(-1.2deg);
  transform-origin: left center;
}

.lede {
  max-width: 39rem;
  margin: 0;
  font-size: clamp(1.15rem, 1rem + 0.75vw, 1.55rem);
  line-height: 1.48;
}

.hero-answer {
  max-width: 38rem;
  margin: 1.5rem 0 0;
  padding: 1rem 0 1rem 1.1rem;
  border-left: 5px solid var(--orange);
  font-family: var(--utility);
  font-size: 0.88rem;
  line-height: 1.55;
}

.jump-link {
  min-height: 48px;
  margin-top: 1.8rem;
  padding: 0.72rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--white);
  background: var(--blue-dark);
  border: 2px solid var(--blue-dark);
  font-family: var(--utility);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.jump-link::after {
  content: "↓";
  color: var(--yellow);
  font-size: 1.2rem;
}

.jump-link:hover {
  color: var(--ink);
  background: var(--yellow);
}

.hero-instrument {
  position: relative;
  min-width: 0;
}

.chart-paper {
  position: relative;
  padding: clamp(1rem, 2vw, 1.5rem);
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper-raised);
  box-shadow: 18px 18px 0 var(--paper-deep), 20px 20px 0 var(--ink);
  transform: rotate(0.55deg);
}

.chart-paper::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(23, 78, 212, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 78, 212, 0.08) 1px, transparent 1px);
  background-size: 18px 18px;
}

.plot-topline {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

.plot-topline output {
  color: var(--orange-dark);
  font-family: var(--utility);
  font-weight: 800;
}

.trace-canvas,
.spectrum-canvas {
  position: relative;
  width: 100%;
  display: block;
}

.trace-canvas {
  height: 290px;
  margin: 0.7rem 0 1rem;
}

.spectrum-canvas {
  height: 250px;
}

.demo-control {
  position: relative;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.demo-control label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--utility);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

input[type="range"] {
  width: 100%;
  min-height: 44px;
  margin: 0.25rem 0;
  accent-color: var(--orange);
}

.demo-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 0.68rem;
}

.inline-readout {
  position: relative;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.inline-readout div {
  padding: 0.75rem 0;
}

.inline-readout div + div {
  padding-left: 1rem;
  border-left: 1px solid var(--ink);
}

.inline-readout dt {
  color: var(--muted);
  font-family: var(--utility);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.inline-readout dd {
  margin: 0.2rem 0 0;
  font-family: var(--utility);
  font-size: clamp(1.15rem, 1rem + 1vw, 1.7rem);
  font-weight: 800;
}

.section {
  padding: clamp(5rem, 10vw, 9rem) 0;
  border-top: 1px solid var(--rule);
}

.section__inner {
  width: var(--content);
  margin: 0 auto;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(280px, 1.3fr);
  align-items: end;
  gap: clamp(2rem, 6vw, 6rem);
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.section h2 {
  max-width: 11ch;
  margin: 0.8rem 0 0;
  font-family: var(--display);
  font-size: clamp(2.7rem, 5.6vw, 6.4rem);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.section-heading > p {
  max-width: 42rem;
  margin: 0;
  font-size: clamp(1.08rem, 1rem + 0.45vw, 1.35rem);
}

.lab-section {
  color: var(--white);
  background: var(--blue-dark);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  border-color: transparent;
}

.lab-section .section-label,
.lab-section a {
  color: var(--yellow);
}

.lab-section .section-heading > p {
  color: rgba(255, 255, 255, 0.82);
}

.lab-grid {
  display: grid;
  grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.protocol {
  position: sticky;
  top: 1.5rem;
  padding: 1.4rem;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.25);
  transform: rotate(-0.45deg);
}

.protocol h3 {
  margin: 0 0 0.8rem;
  font-family: var(--display);
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.protocol ol {
  margin: 0;
  padding-left: 1.25rem;
}

.protocol li + li {
  margin-top: 0.65rem;
}

.protocol .boundary {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(16, 43, 41, 0.45);
  font-family: var(--utility);
  font-size: 0.72rem;
  line-height: 1.55;
}

.recorder {
  min-width: 0;
  padding: clamp(1rem, 3vw, 2rem);
  color: var(--ink);
  background: var(--paper-raised);
  border: 2px solid var(--ink);
}

.recorder-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.record-button {
  min-height: 56px;
  padding: 0.85rem 1rem;
  color: var(--white);
  background: var(--orange-dark);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--utility);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  text-transform: uppercase;
}

.record-button[data-kind="hand"] {
  background: var(--blue);
}

.record-button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--yellow);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.record-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.capture-progress {
  width: 100%;
  height: 9px;
  margin: 1.3rem 0 0.65rem;
  overflow: hidden;
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
}

.capture-progress::-webkit-progress-bar {
  background: var(--paper-deep);
}

.capture-progress::-webkit-progress-value {
  background: var(--orange);
}

.capture-progress::-moz-progress-bar {
  background: var(--orange);
}

.capture-status {
  min-height: 3.2em;
  margin: 0;
  font-family: var(--utility);
  font-size: 0.76rem;
  line-height: 1.55;
}

.capture-status[data-state="error"] {
  color: var(--orange-dark);
  font-weight: 800;
}

.capture-plots {
  margin-top: 1.4rem;
  display: grid;
  gap: 1.4rem;
}

.capture-plot {
  min-width: 0;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}

.capture-plot figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 0.7rem;
}

.results-table {
  width: 100%;
  margin-top: 1.2rem;
  border-collapse: collapse;
  font-family: var(--utility);
  font-size: 0.76rem;
}

.results-table th,
.results-table td {
  padding: 0.75rem 0.45rem;
  border-top: 1px solid var(--rule);
  text-align: right;
  vertical-align: top;
}

.results-table th:first-child,
.results-table td:first-child {
  padding-left: 0;
  text-align: left;
}

.results-table th {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.comparison-output {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  color: var(--white);
  background: var(--ink);
  font-family: var(--utility);
  font-size: 0.75rem;
}

.mechanism-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
}

.prose {
  max-width: 44rem;
}

.prose > p:first-child {
  margin-top: 0;
  font-size: 1.2em;
}

.prose p + p {
  margin-top: 1.2rem;
}

.formula-slip {
  margin: 2rem 0;
  padding: 1.2rem 1.4rem;
  color: var(--white);
  background: var(--ink);
  border-left: 8px solid var(--orange);
  font-family: var(--utility);
  font-size: clamp(1.1rem, 1rem + 1vw, 1.6rem);
  transform: rotate(0.35deg);
}

.mechanical-chain {
  align-self: start;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 2px solid var(--ink);
  background: var(--paper-raised);
  box-shadow: 14px 14px 0 var(--paper-deep);
}

.mechanical-chain li {
  position: relative;
  min-height: 120px;
  padding: 1.35rem 1.4rem 1.35rem 5.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mechanical-chain li + li {
  border-top: 1px solid var(--ink);
}

.mechanical-chain .chain-mark {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  border-radius: 50%;
  font-family: var(--utility);
  font-size: 0.75rem;
  transform: translateY(-50%);
}

.mechanical-chain strong {
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.mechanical-chain span:last-child {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.evidence-strip {
  margin-top: clamp(3rem, 7vw, 6rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 2px solid var(--ink);
  background: var(--paper-raised);
}

.evidence-strip article {
  padding: clamp(1.3rem, 3vw, 2.2rem);
}

.evidence-strip article + article {
  border-left: 2px solid var(--ink);
}

.evidence-strip h3 {
  margin: 0.5rem 0 0.8rem;
  font-family: var(--display);
  font-size: clamp(1.7rem, 1.4rem + 1vw, 2.5rem);
  line-height: 1;
}

.comparison-line {
  margin: 1.2rem 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--utility);
  font-size: 0.72rem;
}

.comparison-line .line {
  position: relative;
  height: 11px;
  background: var(--paper-deep);
  border: 1px solid var(--ink);
}

.comparison-line .line::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill, 75%);
  content: "";
  background: var(--orange);
}

.method-section {
  background: var(--paper-raised);
}

.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: clamp(2rem, 6vw, 6rem);
}

.method-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: method;
}

.method-steps li {
  position: relative;
  padding: 1.25rem 0 1.25rem 4rem;
  border-top: 1px solid var(--rule);
  counter-increment: method;
}

.method-steps li::before {
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 2.65rem;
  height: 2.65rem;
  display: grid;
  place-items: center;
  content: counter(method, decimal-leading-zero);
  color: var(--white);
  background: var(--blue-dark);
  border-radius: 50%;
  font-family: var(--utility);
  font-size: 0.68rem;
}

.method-steps strong {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: 1.1;
}

.limits {
  align-self: start;
  padding: 1.5rem;
  border: 2px solid var(--orange-dark);
  background: #fff1eb;
  box-shadow: 12px 12px 0 rgba(235, 75, 47, 0.18);
}

.limits h3 {
  margin: 0 0 0.8rem;
  font-family: var(--display);
  font-size: 1.9rem;
  line-height: 1;
}

.limits p:last-child {
  margin-bottom: 0;
}

.sources-list {
  max-width: 900px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sources;
}

.sources-list li {
  position: relative;
  padding: 1.2rem 0 1.2rem 4.2rem;
  border-top: 1px solid var(--rule);
  counter-increment: sources;
}

.sources-list li::before {
  position: absolute;
  left: 0;
  top: 1.15rem;
  content: "S" counter(sources, decimal-leading-zero);
  color: var(--orange-dark);
  font-family: var(--utility);
  font-size: 0.74rem;
  font-weight: 800;
}

.sources-list cite {
  font-style: normal;
}

.sources-list span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  padding: 2rem 0 3rem;
  color: var(--white);
  background: var(--ink);
}

.site-footer__inner {
  width: var(--content);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  font-family: var(--utility);
  font-size: 0.72rem;
}

.site-footer a {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  color: var(--yellow);
}

.back-to-top {
  position: fixed;
  right: max(14px, calc((100vw - 1340px) / 2));
  bottom: 16px;
  z-index: 10;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--orange-dark);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 1.2rem;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.not-found {
  width: min(760px, calc(100vw - 48px));
  min-height: calc(100svh - 69px);
  margin: 0 auto;
  display: grid;
  align-content: center;
}

.not-found h1 {
  max-width: none;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .hero,
  .section-heading,
  .lab-grid,
  .mechanism-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-instrument {
    width: min(100%, 680px);
  }

  .protocol {
    position: static;
    transform: none;
  }

  .section-heading > p {
    max-width: 46rem;
  }
}

@media (max-width: 640px) {
  :root {
    --content: calc(100vw - 32px);
  }

  body::before {
    left: 8px;
  }

  .site-header__inner {
    min-height: 62px;
  }

  .site-mark {
    max-width: 19ch;
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .hero {
    padding-top: 2.7rem;
    gap: 3rem;
  }

  h1 {
    font-size: clamp(3.45rem, 18vw, 5.5rem);
  }

  .chart-paper {
    box-shadow: 8px 8px 0 var(--paper-deep), 10px 10px 0 var(--ink);
    transform: none;
  }

  .trace-canvas {
    height: 220px;
  }

  .spectrum-canvas {
    height: 210px;
  }

  .section {
    padding: 4.5rem 0;
  }

  .section h2 {
    font-size: clamp(2.8rem, 14vw, 4.2rem);
  }

  .recorder-controls,
  .evidence-strip {
    grid-template-columns: 1fr;
  }

  .evidence-strip article + article {
    border-top: 2px solid var(--ink);
    border-left: 0;
  }

  .results-table {
    font-size: 0.67rem;
  }

  .results-table th,
  .results-table td {
    padding-right: 0.2rem;
    padding-left: 0.2rem;
  }

  .site-footer__inner {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .jump-link,
  .recorder-controls,
  .capture-progress,
  .back-to-top {
    display: none;
  }

  body {
    background: var(--white);
  }

  .hero {
    min-height: auto;
  }

  .section,
  .lab-section {
    color: var(--ink);
    background: var(--white);
    break-inside: avoid;
  }
}
