:root {
  --ink: #11100e;
  --ink-2: #24221f;
  --paper: #efebe2;
  --paper-2: #e4ded1;
  --muted: #69645d;
  --line: rgba(17, 16, 14, 0.2);
  --line-strong: rgba(17, 16, 14, 0.46);
  --field: rgba(17, 16, 14, 0.045);
  --accent: #b9472d;
  --accent-dark: #7f2c1d;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 1440px;
  --gutter: clamp(18px, 4vw, 64px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  margin: 0;
  font-family: var(--sans);
  overflow-x: hidden;
  background:
    linear-gradient(90deg, var(--field) 1px, transparent 1px),
    linear-gradient(var(--field) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 calc(100% - 1px), rgba(17, 16, 14, 0.15) calc(100% - 1px)),
    linear-gradient(rgba(17, 16, 14, 0.08), transparent 32svh);
  opacity: 0.45;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
ol {
  margin: 0;
}

svg {
  display: block;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 70px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 3vw, 44px);
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(239, 235, 226, 0.9);
  backdrop-filter: blur(12px);
}

.brand,
.site-nav,
.header-cta,
.section-kicker,
.section-number,
.button,
.instrument-header,
.record-topline,
.record-metrics span,
.quality-strip,
.tick-labels,
.chart-ticks,
.chart-callouts {
  font-family: var(--mono);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.brand-mark {
  width: 22px;
  height: 22px;
  display: inline-block;
  border: 1px solid var(--ink);
  background:
    linear-gradient(45deg, transparent 46%, var(--ink) 47% 53%, transparent 54%),
    linear-gradient(135deg, transparent 46%, var(--accent) 47% 53%, transparent 54%);
}

.site-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 2.4vw, 30px);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.site-nav a,
.header-cta,
.button {
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
}

.header-cta {
  padding: 11px 14px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.header-cta:hover,
.header-cta:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

main {
  overflow: hidden;
}

.section-grid,
.numbered-section,
.demo-section,
.final-cta {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: clamp(76px, 12vw, 150px) var(--gutter);
}

.section-grid,
.numbered-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(34px, 7vw, 110px);
  border-bottom: 1px solid var(--line);
}

.numbered-section {
  grid-template-columns: 80px minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.hero-section {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.82fr);
  gap: clamp(34px, 5vw, 78px);
  width: 100%;
  max-width: none;
  min-height: calc(100svh - 70px);
  padding-top: clamp(54px, 8vw, 92px);
  padding-bottom: clamp(36px, 6vw, 70px);
  align-items: center;
  border-bottom: 1px solid var(--ink);
}

.hero-copy,
.hero-instrument {
  min-width: 0;
}

.section-kicker,
.section-number {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-transform: uppercase;
}

.section-number {
  color: var(--muted);
}

h1,
h2 {
  max-width: 900px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin-top: 18px;
  font-size: clamp(56px, 6.7vw, 108px);
  line-height: 0.88;
}

h2 {
  margin-top: 14px;
  font-size: clamp(38px, 5vw, 86px);
  line-height: 0.92;
}

.hero-subhead {
  max-width: 710px;
  margin-top: 28px;
  color: var(--ink-2);
  font-size: clamp(20px, 2.2vw, 34px);
  font-weight: 500;
  line-height: 1.14;
}

.hero-proof,
.section-copy,
.thesis-columns,
.demo-heading p,
.final-cta p,
.section-intro {
  color: var(--muted);
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.5;
}

.hero-proof {
  max-width: 640px;
  margin-top: 18px;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.button.primary {
  background: var(--ink);
  color: var(--paper);
}

.button.secondary {
  color: var(--ink);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
}

.button.secondary:hover,
.button.secondary:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-instrument,
.motion-record {
  border: 1px solid var(--ink);
  background: rgba(239, 235, 226, 0.76);
  overflow: hidden;
}

.hero-instrument {
  width: min(100%, 560px);
  justify-self: start;
}

.instrument-header,
.record-topline {
  min-height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.hero-record {
  width: 100%;
  min-height: min(64svh, 620px);
}

.axis-line,
.chart-axis {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.25;
}

.trace-line,
.motion-path,
.mini-trace,
.quality-line,
.tempo-line,
.drift-line {
  fill: none;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.trace-line.ghost,
.motion-path.ghost,
.quality-line.ghost {
  stroke: rgba(17, 16, 14, 0.18);
  stroke-width: 16;
}

.trace-line.draw,
.motion-path.draw,
.quality-line.draw {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
}

.trace-line.secondary {
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-dasharray: 8 9;
}

.record-frame path:first-child,
.record-note path:first-child {
  fill: rgba(239, 235, 226, 0.62);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.record-frame text,
.record-note text,
.record-timeline text {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.record-note text:nth-of-type(n + 2) {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  text-transform: none;
}

.frame-edge,
.annotation-leader {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
}

.annotation-leader {
  stroke-dasharray: 5 6;
}

.annotation-pin {
  fill: var(--paper);
  stroke: var(--accent);
  stroke-width: 3;
}

.mini-trace.before {
  stroke: var(--muted);
  stroke-width: 8;
  opacity: 0.34;
}

.mini-trace.after {
  stroke: var(--accent);
  stroke-width: 3;
}

.record-timeline path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
}

.record-timeline circle {
  fill: var(--paper);
  stroke: var(--accent);
  stroke-width: 2;
}

.frame-markers {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: square;
}

.frame-markers circle {
  fill: var(--paper);
  stroke: var(--ink);
}

.signal-bars {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: square;
}

.arc,
.endpoint-marker,
.comp-marker {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 7 6;
}

.tick-labels,
.chart-ticks,
.chart-callouts {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.section-copy,
.thesis-columns {
  display: grid;
  gap: 24px;
}

.loss-sequence {
  padding: 0;
  display: grid;
  border-top: 1px solid var(--line-strong);
  list-style: none;
  counter-reset: loss;
}

.loss-sequence li {
  counter-increment: loss;
  padding: 16px 0;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}

.loss-sequence li::before {
  content: counter(loss, decimal-leading-zero);
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.pt-section {
  align-items: start;
}

.section-intro {
  max-width: 650px;
  margin-top: 22px;
}

.measurement-categories {
  display: grid;
  border-top: 1px solid var(--ink);
}

.measurement-label {
  padding: 22px 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px 24px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
}

.measurement-label span {
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.measurement-label strong {
  font-size: clamp(20px, 2vw, 30px);
}

.measurement-label p {
  grid-column: 2;
  max-width: 360px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.demo-section {
  border-bottom: 1px solid var(--ink);
}

.demo-heading {
  max-width: 920px;
}

.demo-heading p {
  max-width: 760px;
  margin-top: 18px;
}

.motion-record {
  margin-top: clamp(34px, 5vw, 64px);
}

.trace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  min-height: 480px;
}

.trace-chart {
  width: 100%;
  height: 100%;
  min-height: 440px;
  border-right: 1px solid var(--ink);
}

.chart-grid-line {
  fill: none;
  stroke: rgba(17, 16, 14, 0.13);
  stroke-width: 1;
}

.rom-band {
  fill: rgba(185, 71, 45, 0.075);
}

.post-cue-band {
  fill: rgba(17, 16, 14, 0.04);
}

.quality-line.draw {
  stroke-width: 4;
}

.tempo-line {
  stroke: var(--ink);
  stroke-width: 2;
  stroke-dasharray: 8 7;
}

.drift-line {
  stroke: var(--accent-dark);
  stroke-width: 2;
  stroke-dasharray: 2 8;
}

.cue-line {
  stroke: var(--ink);
  stroke-width: 2;
}

.legend {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.quality-sample,
.tempo-sample,
.drift-sample {
  fill: none;
  stroke-width: 3;
}

.quality-sample {
  stroke: var(--accent);
}

.tempo-sample {
  stroke: var(--ink);
  stroke-dasharray: 8 7;
}

.drift-sample {
  stroke: var(--accent-dark);
  stroke-dasharray: 2 8;
}

.rep-markers path {
  stroke: rgba(17, 16, 14, 0.2);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

.record-metrics {
  display: grid;
  grid-template-columns: 1fr;
  border-left: 0;
}

.record-metrics div {
  min-height: 82px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.record-metrics div:last-child {
  border-bottom: 0;
}

.record-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.record-metrics strong {
  color: var(--ink);
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.05;
}

.quality-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(116px, 1fr));
  gap: 1px;
  padding-top: 8px;
  border: 1px solid var(--line-strong);
  background: var(--line);
}

.quality-chip {
  min-height: 124px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  background: rgba(239, 235, 226, 0.86);
}

.quality-chip span {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.quality-chip i {
  width: 100%;
  height: 20px;
  display: block;
  background:
    linear-gradient(135deg, transparent 0 42%, var(--accent) 43% 48%, transparent 49%),
    linear-gradient(90deg, rgba(17, 16, 14, 0.18), rgba(17, 16, 14, 0.18));
  background-size: 100% 100%, 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 0, 0 50%;
}

.quality-chip:nth-child(2) i {
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 9px, transparent 9px 17px),
    linear-gradient(90deg, rgba(17, 16, 14, 0.18), rgba(17, 16, 14, 0.18));
  background-size: 100% 2px, 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 50%, 0 50%;
}

.quality-chip:nth-child(3) i {
  background:
    radial-gradient(circle at 18% 50%, var(--accent) 0 4px, transparent 5px),
    radial-gradient(circle at 50% 50%, var(--accent) 0 4px, transparent 5px),
    radial-gradient(circle at 82% 50%, var(--accent) 0 4px, transparent 5px),
    linear-gradient(90deg, rgba(17, 16, 14, 0.22), rgba(17, 16, 14, 0.22));
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 0, 0 0, 0 0, 0 50%;
}

.quality-chip:nth-child(4) i {
  background:
    repeating-linear-gradient(90deg, rgba(17, 16, 14, 0.5) 0 2px, transparent 2px 25%),
    linear-gradient(90deg, var(--accent), var(--accent));
  background-size: 100% 100%, 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 0, 0 50%;
}

.quality-chip:nth-child(5) i {
  background:
    linear-gradient(150deg, transparent 0 32%, var(--accent-dark) 33% 38%, transparent 39%),
    linear-gradient(25deg, transparent 0 52%, var(--ink) 53% 57%, transparent 58%);
}

.quality-chip small {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.plain-statement {
  padding: 22px;
  border-left: 4px solid var(--accent);
  color: var(--ink);
  font-size: clamp(22px, 2.3vw, 34px);
  font-weight: 700;
  line-height: 1.12;
}

.privacy-section {
  background: var(--ink);
  color: var(--paper);
  max-width: none;
  border-bottom-color: rgba(239, 235, 226, 0.22);
}

.privacy-section .section-kicker {
  color: #e08b73;
}

.privacy-section .section-copy {
  color: rgba(239, 235, 226, 0.72);
}

.final-cta {
  min-height: 66svh;
  display: grid;
  align-content: center;
  justify-items: start;
  border-bottom: 0;
}

.final-cta p {
  max-width: 780px;
  margin-top: 24px;
}

.final-cta .button {
  margin-top: 34px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
}

.hero-section .reveal {
  opacity: 1;
  transform: none;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 620ms ease,
    transform 620ms ease;
}

.is-visible .trace-line.draw,
.is-visible .motion-path.draw,
.is-visible .quality-line.draw {
  animation: draw-trace 1200ms ease forwards;
}

@keyframes draw-trace {
  to {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .section-grid,
  .hero-section,
  .numbered-section {
    grid-template-columns: 1fr;
  }

  .numbered-section {
    gap: 22px;
  }

  .section-number {
    display: none;
  }

  .hero-section {
    min-height: auto;
  }

  .trace-layout {
    grid-template-columns: 1fr;
  }

  .trace-chart {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .record-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-metrics div:nth-last-child(2) {
    border-bottom: 0;
  }

  .quality-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 62px;
  }

  .header-cta {
    padding: 10px;
    font-size: 10px;
  }

  .section-grid,
  .numbered-section,
  .demo-section,
  .final-cta {
    padding: 66px var(--gutter);
  }

  h1 {
    font-size: clamp(52px, 16vw, 82px);
  }

  .hero-subhead {
    font-size: 20px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-record {
    min-height: 430px;
  }

  .instrument-header,
  .record-topline {
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    padding: 12px;
  }

  .measurement-label {
    grid-template-columns: 42px 1fr;
  }

  .measurement-label p {
    grid-column: 2;
  }

  .trace-chart {
    min-height: 360px;
  }

  .record-metrics {
    grid-template-columns: 1fr;
  }

  .record-metrics div:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .quality-strip {
    grid-template-columns: 1fr;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .trace-line.draw,
  .motion-path.draw,
  .quality-line.draw {
    stroke-dashoffset: 0;
  }
}
