:root {
  --paper: #f4f8f2;
  --paper-deep: #e5ede3;
  --ink: #172018;
  --ink-soft: #4b5b4e;
  --trace: #587160;
  --rust: #884333;
  --rust-soft: #c9a297;
  --chalk: #f9fbf7;
  --focus: #305f42;
  --max: 1420px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(108deg, transparent 0 34%, rgba(61, 87, 67, 0.028) 34.2%, transparent 34.5% 100%),
    radial-gradient(ellipse at 18% 12%, rgba(255, 255, 255, 0.9), transparent 42%),
    var(--paper);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.23em;
}

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

button,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 20;
  padding: 9px 12px;
  color: var(--chalk);
  background: var(--ink);
  transform: translateY(-180%);
}

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

.site-head {
  width: min(calc(100% - 40px), var(--max));
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: center;
  gap: 30px;
  border-bottom: 2px solid rgba(23, 32, 24, 0.74);
  position: relative;
}

.site-head::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 6%;
  bottom: -5px;
  height: 1px;
  background: var(--ink-soft);
  border-radius: 999px;
  transform: rotate(-0.08deg);
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.identity-mark {
  font-size: 1.55rem;
  line-height: 1;
  transform: rotate(-7deg);
}

.site-head nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.88rem;
  font-weight: 650;
}

.site-head nav a {
  text-decoration: none;
}

.site-head nav a:hover {
  color: var(--rust);
}

.motion-control,
.reset-control {
  appearance: none;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  padding: 9px 12px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 720;
}

.motion-control:hover,
.motion-control[aria-pressed="true"],
.reset-control:hover {
  background: var(--ink);
  color: var(--paper);
}

main {
  overflow: clip;
}

.board-hero {
  width: min(calc(100% - 40px), var(--max));
  min-height: calc(100vh - 76px);
  min-width: 0;
  margin: 0 auto;
  position: relative;
  display: grid;
  align-content: start;
  padding: 40px 0 24px;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.45fr);
  align-items: end;
  gap: clamp(30px, 5vw, 84px);
  padding: 0 clamp(6px, 2vw, 28px) 10px;
}

.hero-copy h1 {
  max-width: 1060px;
  margin: 0;
  font-size: clamp(3rem, 6.4vw, 5.8rem);
  line-height: 0.93;
  letter-spacing: -0.066em;
  font-weight: 820;
}

.hero-copy h1 span {
  display: block;
  white-space: nowrap;
}

.hero-copy p {
  max-width: 420px;
  margin: 0 0 0.35rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.4vw, 1.22rem);
}

.margin-note {
  position: absolute;
  z-index: 2;
  max-width: 250px;
  margin: 0;
  color: var(--rust);
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 0.8rem;
  line-height: 1.34;
}

.note-one {
  right: 8.5%;
  top: 31%;
  transform: rotate(-3deg);
}

.board-scroll {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--trace) transparent;
  scrollbar-width: thin;
}

.system-map {
  display: block;
  width: 100%;
  min-width: 980px;
  min-height: 410px;
  color: var(--ink);
}

.system-map path,
.system-map circle {
  vector-effect: non-scaling-stroke;
}

.route-under {
  fill: none;
  stroke: rgba(88, 113, 96, 0.4);
  stroke-width: 2.1;
  stroke-linecap: round;
}

.route-trace {
  fill: none;
  stroke: var(--trace);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 12 8;
}

.motion-ready .route-trace {
  animation: trace-route 8s linear infinite;
}

.trace-b,
.trace-e { animation-delay: -1.1s !important; }
.trace-c,
.trace-f { animation-delay: -2.2s !important; }
.trace-g { animation-delay: -3.2s !important; }
.trace-h { animation-delay: -4.1s !important; }
.trace-i { animation-delay: -5.1s !important; }
.trace-j { animation-delay: -6.2s !important; }

.arrow-head {
  fill: var(--trace);
}

.viewer-sketch circle,
.viewer-sketch path,
.source-node circle,
.source-node path,
.brain-line,
.feed-sheet,
.feed-sheet + path,
.shield-sketch,
.shield-check {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scribble-box {
  fill: rgba(255, 255, 255, 0.34);
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scribble-box.emphasized {
  fill: rgba(136, 67, 51, 0.07);
  stroke: var(--rust);
  stroke-width: 2.4;
}

.shield-check {
  stroke: var(--rust);
  stroke-width: 3.3;
}

.map-name {
  fill: var(--ink);
  font-family: system-ui, sans-serif;
  font-size: 18px;
  font-weight: 760;
}

.map-detail {
  fill: var(--ink-soft);
  font-family: system-ui, sans-serif;
  font-size: 12px;
}

.map-footnote {
  fill: var(--rust);
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 13px;
}

.pencil {
  offset-path: path("M92 286 C170 286 173 135 255 135 S365 290 438 290 S550 290 625 290 S726 290 805 290 S908 290 984 290 S1090 290 1192 290");
  offset-rotate: auto;
  fill: var(--rust-soft);
  stroke: var(--ink);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
}

.motion-ready .pencil {
  animation: pencil-route 14s cubic-bezier(0.45, 0.05, 0.5, 0.95) infinite;
}

.motion-paused .route-trace,
.motion-paused .pencil {
  animation-play-state: paused;
}

.swipe-note {
  display: none;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.storyboard,
.score-lab,
.safety-axis,
.evidence,
.read-next {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: clamp(80px, 11vw, 150px) 0;
}

.storyboard h2,
.evidence h2 {
  max-width: 950px;
  margin: 0 0 58px;
  font-size: clamp(2.2rem, 5vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.052em;
}

.story-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(210px, 1fr));
  gap: 0;
  overflow-x: auto;
  padding-bottom: 18px;
}

.story-row article {
  min-height: 300px;
  padding: 28px 24px 24px;
  border-top: 2px solid var(--ink);
  position: relative;
}

.story-row article:nth-child(even) {
  margin-top: 48px;
}

.story-row article::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 30px;
  top: -6px;
  height: 1px;
  border-radius: 999px;
  background: var(--ink-soft);
  transform: rotate(var(--tilt, -0.7deg));
}

.story-row article:nth-child(2n) { --tilt: 0.6deg; }
.story-row article:nth-child(3n) { --tilt: -0.2deg; }

.story-number {
  display: block;
  margin-bottom: 54px;
  color: var(--rust);
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 1;
}

.story-row h3 {
  margin: 0 0 15px;
  font-size: 1.25rem;
  line-height: 1.08;
}

.story-row p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.score-lab {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(440px, 1.2fr) minmax(280px, 0.8fr);
  grid-template-areas:
    "heading sliders result"
    "note sliders result";
  column-gap: clamp(30px, 5vw, 84px);
  row-gap: 34px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.score-heading { grid-area: heading; }
.score-heading h2,
.safety-copy h2,
.read-next h2 {
  margin: 0 0 24px;
  font-size: clamp(2.2rem, 4.3vw, 4.9rem);
  line-height: 0.99;
  letter-spacing: -0.052em;
}

.score-heading p,
.safety-copy > p,
.read-next > p {
  max-width: 680px;
  margin: 0;
  color: var(--ink-soft);
}

.sliders {
  grid-area: sliders;
}

.slider-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 1.2fr) 58px;
  align-items: center;
  gap: 18px;
  min-height: 70px;
  border-bottom: 1px solid rgba(23, 32, 24, 0.34);
}

.slider-row label {
  font-weight: 700;
}

.slider-row code,
.score-note code,
footer code {
  font-size: 0.82em;
}

.slider-row.negative label {
  color: var(--rust);
}

input[type="range"] {
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: var(--ink-soft);
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: var(--ink-soft);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--ink);
  outline: 1px solid var(--ink);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--ink);
  outline: 1px solid var(--ink);
}

.slider-row.negative input[type="range"]::-webkit-slider-thumb {
  background: var(--rust);
  outline-color: var(--rust);
}

.slider-row.negative input[type="range"]::-moz-range-thumb {
  background: var(--rust);
  outline-color: var(--rust);
}

.slider-row output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
}

.reset-control {
  margin-top: 26px;
}

.score-result {
  grid-area: result;
  min-height: 440px;
  position: relative;
  display: grid;
  place-content: center;
  text-align: center;
}

.score-result svg {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(100%, 330px);
  transform: translate(-50%, -55%);
  pointer-events: none;
}

.result-ring,
.result-swipe {
  fill: none;
  stroke: var(--rust);
  stroke-linecap: round;
}

.result-ring { stroke-width: 3; }
.result-swipe { stroke-width: 1.4; opacity: 0.5; }

.result-label {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

#score-output {
  display: block;
  min-width: 280px;
  font-size: clamp(3.8rem, 7vw, 7.2rem);
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.065em;
  line-height: 1;
}

#score-reading {
  max-width: 240px;
  margin: 16px auto 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.score-note {
  grid-area: note;
  max-width: 410px;
  align-self: end;
  color: var(--rust);
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 0.8rem;
  transform: rotate(-1deg);
}

.safety-axis {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1fr);
  align-items: center;
  gap: clamp(40px, 8vw, 130px);
}

.safety-drawing svg {
  width: 100%;
  overflow: visible;
}

.safety-drawing path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.safety-drawing text {
  fill: var(--ink-soft);
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 20px;
  text-anchor: middle;
}

.safety-drawing .cross-mark { stroke: var(--rust); }
.safety-drawing .check-mark { stroke: var(--trace); }

.safety-copy dl {
  margin: 50px 0 0;
}

.safety-copy dl div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 17px 0;
  border-bottom: 1px solid rgba(23, 32, 24, 0.35);
}

.safety-copy dt { font-weight: 800; }
.safety-copy dd { margin: 0; color: var(--ink-soft); }

.evidence {
  border-top: 2px solid var(--ink);
}

.evidence-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}

.evidence-table [role="row"] {
  display: contents;
}

.evidence-table span {
  min-height: 92px;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(23, 32, 24, 0.35);
}

.evidence-table span:not(:nth-child(3n + 1)) {
  border-left: 1px solid rgba(23, 32, 24, 0.35);
}

.evidence-head span {
  min-height: 74px;
  font-weight: 820;
  color: var(--rust);
}

.read-next {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.55fr);
  grid-template-areas:
    "title links"
    "body links";
  column-gap: clamp(40px, 9vw, 150px);
  align-items: end;
}

.read-next h2 { grid-area: title; }
.read-next > p { grid-area: body; }
.document-links {
  grid-area: links;
  display: grid;
  align-content: end;
}

.document-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 4px;
  border-bottom: 2px solid var(--ink);
  text-decoration: none;
  font-weight: 760;
}

.document-link:hover {
  padding-left: 10px;
  padding-right: 10px;
  color: var(--rust);
  border-color: var(--rust);
}

.document-link span {
  transition: transform 180ms ease;
}

.document-link:hover span {
  transform: translate(3px, -3px);
}

footer {
  width: min(calc(100% - 40px), var(--max));
  min-height: 120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 30px;
  border-top: 2px solid var(--ink);
  color: var(--ink-soft);
  font-size: 0.8rem;
}

footer p { margin: 0; }
footer p:last-child { text-align: right; }

.noscript-note {
  margin: 0;
  padding: 12px 20px;
  color: var(--paper);
  background: var(--ink);
  text-align: center;
  font-size: 0.8rem;
}

@keyframes trace-route {
  to { stroke-dashoffset: -80; }
}

@keyframes pencil-route {
  0%, 7% { offset-distance: 0%; }
  93%, 100% { offset-distance: 100%; }
}

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

  .site-head nav {
    display: none;
  }

  .hero-copy {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-copy p {
    max-width: 640px;
  }

  .score-lab {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "heading heading"
      "sliders result"
      "note result";
  }

  .safety-axis {
    gap: 45px;
  }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .site-head,
  .board-hero,
  .storyboard,
  .score-lab,
  .safety-axis,
  .evidence,
  .read-next,
  footer {
    width: min(calc(100% - 28px), var(--max));
  }

  .site-head {
    min-height: 68px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .identity span:last-child {
    max-width: 125px;
    line-height: 1.05;
  }

  .motion-control {
    padding: 7px 9px;
    font-size: 0.7rem;
  }

  .board-hero {
    min-height: calc(100svh - 68px);
    padding-top: 34px;
  }

  .hero-copy {
    padding: 0 0 22px;
    gap: 22px;
  }

  .hero-copy h1 {
    font-size: 2.1rem;
    line-height: 0.95;
  }

  .system-map {
    min-width: 900px;
    min-height: 360px;
  }

  .note-one {
    display: none;
  }

  .swipe-note {
    display: block;
  }

  .storyboard,
  .score-lab,
  .safety-axis,
  .evidence,
  .read-next {
    padding: 88px 0;
  }

  .storyboard h2,
  .evidence h2 {
    margin-bottom: 36px;
  }

  .story-row {
    grid-template-columns: 1fr;
    overflow: visible;
    padding-bottom: 0;
  }

  .story-row article,
  .story-row article:nth-child(even) {
    display: grid;
    grid-template-columns: 48px 1fr;
    column-gap: 18px;
    min-width: 0;
    min-height: 0;
    margin-top: 0;
    padding: 24px 4px 42px;
  }

  .story-number {
    grid-row: 1 / 3;
    margin-bottom: 0;
    font-size: 2.1rem;
  }

  .story-row h3 {
    margin-bottom: 10px;
  }

  .score-lab {
    grid-template-columns: 1fr;
    grid-template-areas:
      "heading"
      "sliders"
      "result"
      "note";
  }

  .slider-row {
    grid-template-columns: minmax(160px, 1fr) 62px;
    gap: 8px 14px;
    padding: 11px 0;
  }

  .slider-row input {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .score-result {
    min-height: 350px;
  }

  .safety-axis {
    grid-template-columns: 1fr;
  }

  .safety-drawing {
    max-width: 520px;
    margin: 0 auto;
  }

  .evidence-table {
    display: block;
    border-top: 0;
  }

  .evidence-table [role="row"] {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 25px;
    border-top: 2px solid var(--ink);
  }

  .evidence-table span,
  .evidence-table span:not(:nth-child(3n + 1)) {
    min-height: auto;
    padding: 17px 4px;
    border-left: 0;
  }

  .read-next {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "body"
      "links";
    gap: 24px;
  }

  .document-links {
    margin-top: 18px;
  }

  footer {
    min-height: 150px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 10px;
  }

  footer p:last-child {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .route-trace,
  .pencil,
  .document-link span {
    animation: none !important;
    transition: none !important;
  }
}
