:root {
  color-scheme: light dark;
  --background: #f0f1ed;
  --foreground: #182023;
  --muted: #657074;
  --faint: #d5d9d5;
  --stage: #e7eae6;
  --accent: #28727a;
  --accent-soft: rgba(40, 114, 122, 0.16);
  --edge: rgba(73, 87, 91, 0.25);
  --point: #28727a;
  --selection: #182023;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --page: min(1180px, calc(100vw - 48px));
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #161a1b;
    --foreground: #e8ece8;
    --muted: #9ca7a8;
    --faint: #343b3c;
    --stage: #1c2223;
    --accent: #67abb1;
    --accent-soft: rgba(103, 171, 177, 0.16);
    --edge: rgba(174, 190, 191, 0.2);
    --point: #67abb1;
    --selection: #e8ece8;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
}

main {
  width: var(--page);
  margin: 0 auto;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  column-gap: clamp(32px, 7vw, 100px);
  align-items: end;
  padding: clamp(54px, 9vw, 120px) 0 34px;
}

.hero-top {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}

.hero-top .eyebrow {
  margin-bottom: 0;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
}

.view-tabs button {
  padding: 0 0 6px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
}

.view-tabs button:hover {
  color: var(--foreground);
}

.view-tabs button[aria-pressed="true"] {
  border-bottom-color: var(--accent);
  color: var(--foreground);
}

.view-tabs button:active {
  transform: translateY(1px);
}

.eyebrow {
  grid-column: 1 / -1;
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  max-width: 820px;
  font-size: clamp(3rem, 7.4vw, 7rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.lede {
  max-width: 36rem;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.22rem);
  line-height: 1.55;
}

.measure-line {
  grid-column: 2;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.measure-line span {
  padding: 0 0.36em;
  color: var(--accent);
}

.atlas {
  border-top: 1px solid var(--faint);
}

.atlas-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.atlas-toolbar label {
  color: var(--foreground);
  font-weight: 500;
}

select {
  max-width: 220px;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--faint);
  border-radius: 3px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
}

.gesture-note {
  margin-left: auto;
}

.atlas-stage {
  position: relative;
  height: min(70svh, 720px);
  min-height: 500px;
  overflow: hidden;
  background: var(--stage);
}

#atlas-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#atlas-canvas.is-dragging {
  cursor: grabbing;
}

.map-key {
  position: absolute;
  right: 18px;
  bottom: 14px;
  color: var(--muted);
  font-size: 0.7rem;
  pointer-events: none;
}

.key-mark {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  vertical-align: -1px;
}

.atlas-detail {
  min-height: 28px;
  margin: 0;
  padding: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.atlas-detail strong {
  color: var(--foreground);
  font-weight: 500;
}

.method,
.finding {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(42px, 9vw, 140px);
  margin-top: clamp(100px, 15vw, 190px);
  padding-top: 24px;
  border-top: 1px solid var(--faint);
}

.method h2,
.finding h2 {
  max-width: 520px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4.2vw, 4.2rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.method-copy,
.finding > [data-mode-panel] {
  max-width: 650px;
}

.standfirst,
.finding > [data-mode-panel] p:first-child {
  color: var(--foreground);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.55;
}

.method-step {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--faint);
}

.standfirst + .method-step {
  margin-top: 44px;
}

.method-step h3 {
  margin-bottom: 0;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.6;
}

.method-step p,
.finding > [data-mode-panel] p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

.formula {
  display: block;
  margin-top: 12px;
  color: var(--foreground);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: normal;
}

.finding > [data-mode-panel] p + p {
  margin-top: 22px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-top: clamp(110px, 17vw, 210px);
  padding: 24px 0 42px;
  border-top: 1px solid var(--faint);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

footer p {
  max-width: 620px;
  margin-bottom: 0;
}

.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;
}

@media (max-width: 760px) {
  :root {
    --page: min(100% - 28px, 1180px);
  }

  .hero {
    display: block;
    padding-top: 48px;
  }

  .hero-top {
    flex-wrap: wrap;
    gap: 16px;
  }

  .view-tabs {
    width: 100%;
  }

  h1 {
    font-size: clamp(2.25rem, 13vw, 4.2rem);
    overflow-wrap: normal;
  }

  .lede {
    margin-top: 28px;
  }

  .measure-line {
    margin-top: 16px;
  }

  .atlas-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .gesture-note {
    width: 100%;
    margin-left: 0;
  }

  .atlas-stage {
    height: 62svh;
    min-height: 430px;
  }

  .map-key {
    max-width: calc(100% - 36px);
    text-align: right;
  }

  .method,
  .finding {
    display: block;
  }

  .method-copy,
  .finding > [data-mode-panel] {
    margin-top: 48px;
  }

  .method-step {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  footer {
    display: block;
  }

  footer p + p {
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
