/* ============================================================
   KEEP RIGHT — field-manual editorial system
   One color world: interstate green. Chalk type. Amber sparingly.
   Mobile-first: base styles fit one idea per phone screen;
   min-width queries are desktop enhancements only.
   ============================================================ */

:root {
  --green-deep: #071912;
  --green-panel: #0A2018;
  --green-sign: #0C5637;
  --chalk: #F2EFE6;
  --chalk-70: rgba(242, 239, 230, 0.70);
  --chalk-45: rgba(242, 239, 230, 0.45);
  --chalk-25: rgba(242, 239, 230, 0.25);
  --chalk-14: rgba(242, 239, 230, 0.14);
  --chalk-07: rgba(242, 239, 230, 0.07);
  --amber: #FFB81C;
  --brake: #FF5A3C;
  --paper: #EFEBDF;
  --ink: #0E2A1C;
  --ink-60: rgba(14, 42, 28, 0.60);
  --ink-14: rgba(14, 42, 28, 0.16);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sign-face: 'Overpass', 'Inter', sans-serif;
  --gutter: clamp(22px, 6vw, 110px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* NOTE: no overflow-x on html — it silently disables viewport
   scroll-snap in Chrome. body carries the horizontal clip. */
html { scroll-snap-type: y mandatory; }

body {
  background: var(--green-deep);
  color: var(--chalk);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background-image: radial-gradient(var(--chalk-07) 1px, transparent 1px);
  background-size: 34px 34px;
}

::selection { background: var(--amber); color: var(--green-deep); }

/* ---------- fixed chrome ---------- */

.frame {
  position: fixed; inset: 8px; z-index: 40;
  border: 1px solid var(--chalk-14);
  pointer-events: none;
  mix-blend-mode: difference;
}
.corner {
  position: absolute;
  font-family: var(--mono); font-size: 13px; line-height: 1;
  color: var(--chalk-45);
}
.c-tl { top: -7px; left: -5px; }
.c-tr { top: -7px; right: -5px; }
.c-bl { bottom: -6px; left: -5px; }
.c-br { bottom: -6px; right: -5px; }

.spine { display: none; }
.spine-fill {
  position: absolute; top: 0; left: -0.5px; width: 2px; height: 0%;
  background: var(--amber);
}

.masthead {
  position: fixed; z-index: 41;
  top: 18px; left: var(--gutter); right: var(--gutter);
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  color: var(--chalk-70);
  mix-blend-mode: difference;
  pointer-events: none;
}
.mast-word { font-weight: 500; color: var(--chalk); }
.mast-note { display: none; }

/* ---------- layout: one idea per screen ---------- */

.panel {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(64px, 9svh, 120px) var(--gutter);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.inner { width: 100%; max-width: 1160px; margin: 0 auto; }

/* text + graphic pairs: stacked on phones, side-by-side on desktop */
.duo { display: flex; flex-direction: column; gap: clamp(18px, 3svh, 34px); }
.duo-art { width: 100%; max-width: 520px; }
.duo-art svg { width: 100%; height: auto; max-height: 30svh; display: block; }
.duo-art .mono-cap { margin-top: 10px; }
.cap-ink { color: var(--ink-60); }

/* ---------- type ---------- */

.label {
  font-family: var(--mono); font-size: 11.5px; font-weight: 400;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--chalk-70);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: clamp(20px, 4svh, 48px);
}
.tick { display: inline-block; width: 28px; height: 1px; background: var(--chalk-45); flex: 0 0 auto; }
.tick-amber { background: var(--amber); }
.tick-ink { background: var(--ink-60); }

.display {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.5rem, 9vw, 6.6rem);
  line-height: 1.04; letter-spacing: -0.015em;
  margin-bottom: clamp(20px, 3.5svh, 42px);
}
.display em { font-style: italic; color: var(--amber); }
.display .line { display: block; }
.display-sm { font-size: clamp(2rem, 7vw, 3.9rem); }

.lede, .body {
  font-size: clamp(1.05rem, 4.4vw, 1.38rem);
  line-height: 1.66; color: var(--chalk-70);
  max-width: 640px;
}
.body { margin-bottom: clamp(14px, 2.5svh, 30px); }
.body-big { font-size: clamp(1.14rem, 4.8vw, 1.6rem); line-height: 1.64; }
.body strong { font-weight: 500; color: var(--chalk); }
.body em { font-family: var(--serif); font-style: italic; font-size: 1.12em; color: var(--chalk); }
.body-close { margin-top: clamp(18px, 3svh, 40px); }

.mono-cap {
  font-family: var(--mono); font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.16em; color: var(--chalk-45);
  line-height: 1.9;
}
.mono-cap a { color: var(--chalk-70); text-decoration: none; border-bottom: 1px solid var(--chalk-25); }
.mono-cap a:hover { color: var(--amber); border-color: var(--amber); }
.mono-cap.dim { color: var(--chalk-25); margin-top: 10px; }

/* ---------- hero ---------- */

.hero { justify-content: center; }
.hero-h { margin-top: 1vh; }
.hero-road { margin-top: clamp(28px, 6svh, 64px); }
.hero-road svg { width: 100%; height: auto; display: block; }
.scroll-cue {
  margin-top: 16px; text-align: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em;
  color: var(--chalk-45);
}
.cue-arrow { display: inline-block; margin-left: 10px; animation: cue 2.2s ease-in-out infinite; }
@keyframes cue { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------- diagrams ---------- */

.diagram { margin: 0; }
.diagram .dg-scroll { overflow-x: auto; scrollbar-width: none; }
.diagram .dg-scroll::-webkit-scrollbar { display: none; }
.diagram svg { width: 100%; min-width: 660px; height: auto; display: block; overflow: visible; }
.diagram figcaption { margin-top: 16px; max-width: 590px; }

.road-edge { stroke: var(--chalk-25); stroke-width: 1.5; }
.road-dash { stroke: var(--chalk-25); stroke-width: 1.5; stroke-dasharray: 16 22; }
.dg-lanetag {
  font-family: var(--mono); font-size: 15px; letter-spacing: 0.3em;
  fill: var(--chalk-25);
}
.dg-step {
  font-family: var(--mono); font-size: 17px; letter-spacing: 0.22em;
  fill: var(--amber); opacity: 0;
}
.sign-svg-txt {
  font-family: var(--sign-face); font-weight: 700; font-size: 34px;
  fill: #123024; letter-spacing: 0.02em;
}
.car-ghost { fill: var(--green-deep); stroke: var(--chalk-45); stroke-width: 1.5; }
.car-hero { fill: var(--amber); }
.car-camper { fill: var(--chalk); }
.brake { fill: var(--brake); opacity: 0; }

/* ---------- rule card ---------- */

.rule-card {
  border: 1px solid var(--chalk-14);
  padding: clamp(24px, 6vw, 44px) clamp(22px, 6vw, 56px);
  max-width: 720px;
}
.rule-card .label { margin-bottom: 16px; color: var(--amber); }
.rule-text {
  font-family: var(--serif); font-size: clamp(1.5rem, 6vw, 2.7rem);
  line-height: 1.3;
}
.rule-text em { color: var(--amber); }

/* ---------- enforcer reasons ---------- */

.case-h {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.9rem, 7vw, 3.3rem); line-height: 1.1;
  margin-bottom: clamp(16px, 2.5svh, 26px);
}

.uvc {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.2rem, 4.8vw, 1.75rem); line-height: 1.42;
  color: var(--chalk); border-left: 1px solid var(--chalk-25);
  padding-left: 18px; margin-bottom: clamp(16px, 2.5svh, 26px);
  max-width: 590px;
}
.uvc em { color: var(--amber); font-style: italic; }
.uvc-src {
  display: block; margin-top: 10px;
  font-family: var(--mono); font-style: normal; font-size: 9px;
  letter-spacing: 0.16em; color: var(--chalk-45);
}

/* ---------- rage block ---------- */

.rage-art { margin-bottom: clamp(14px, 2.5svh, 28px); }
.rage-art svg { width: 100%; height: auto; max-height: 12svh; display: block; }

/* ---------- states grid ---------- */

.states-grid {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px;
  max-width: 520px;
}
.states-grid span {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.08em;
  color: var(--chalk-70); text-align: center;
  padding: 7px 0;
  background: var(--green-sign);
  border: 1px solid var(--chalk-14); border-radius: 4px;
}

/* ---------- stakes dot field ---------- */

.dotfield { width: 100%; max-width: 300px; height: auto; display: block; }

/* ---------- code glyphs ---------- */

.code-glyph { width: clamp(54px, 14vw, 74px); height: auto; flex: 0 0 auto; }

/* ---------- stat strip ---------- */

.stat-strip { margin-bottom: clamp(16px, 2.5svh, 24px); }
.stat { border-top: 1px solid var(--chalk-14); padding: clamp(12px, 2svh, 20px) 0; }
.stat:first-child { border-top: none; padding-top: 0; }
.stat-n {
  font-family: var(--serif); font-size: clamp(2.5rem, 9vw, 5.4rem);
  line-height: 1; margin-bottom: 8px;
}
.stat-n span { font-size: 0.55em; color: var(--amber); }
.stat-cap {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.13em;
  line-height: 1.75; color: var(--chalk-45); max-width: 340px;
}

/* ---------- chalk section ---------- */

.chalk {
  background: var(--paper); color: var(--ink);
  background-image: radial-gradient(rgba(14,42,28,0.05) 1px, transparent 1px);
  background-size: 34px 34px;
}
.chalk .label { color: var(--ink-60); }
.chalk .body { color: var(--ink-60); }
.chalk .body strong, .chalk .body em { color: var(--ink); }
.figure-n {
  font-family: var(--serif);
  font-size: clamp(4.2rem, 19vw, 12rem);
  line-height: 0.95; letter-spacing: -0.02em;
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}
.figure-cap {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  color: var(--ink-60); margin-bottom: clamp(20px, 4svh, 48px);
  line-height: 1.9; max-width: 560px;
}

/* ---------- signs ---------- */

.signs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2.4vw, 28px);
  max-width: 820px;
}
.sign {
  background: var(--green-sign);
  border: 2px solid var(--chalk);
  border-radius: 10px;
  box-shadow: 0 0 0 5px var(--green-deep), 0 0 0 6px var(--chalk-14);
  padding: clamp(14px, 3.4vw, 32px) clamp(14px, 3.6vw, 36px) clamp(12px, 2.6vw, 24px);
}
.sign-txt {
  font-family: var(--sign-face); font-weight: 700;
  font-size: clamp(0.9rem, 3.4vw, 1.75rem); line-height: 1.24;
  letter-spacing: 0.015em; color: var(--chalk);
  margin-bottom: 10px;
}
.sign-tag {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em;
  line-height: 1.6;
  color: rgba(242, 239, 230, 0.55);
}

/* ---------- the code ---------- */

.code-list { list-style: none; max-width: 820px; }
.code-item {
  display: flex; align-items: center; gap: clamp(16px, 4vw, 44px);
  border-top: 1px solid var(--chalk-14);
  padding: clamp(12px, 2svh, 22px) 0;
}
.code-item:last-child { border-bottom: 1px solid var(--chalk-14); }
.code-n { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; color: var(--amber); flex: 0 0 auto; }
.code-item p {
  font-family: var(--serif); font-size: clamp(1.3rem, 5vw, 2.35rem);
  line-height: 1.22;
}

/* ---------- pledge ---------- */

.pledge { text-align: center; }
.pledge .inner { display: flex; flex-direction: column; align-items: center; }
.pledge-road { width: 100%; max-width: 1160px; margin: clamp(24px, 5svh, 56px) auto 0; }
.pledge-h { font-size: clamp(3rem, 12vw, 8rem); }
.pledge .body { max-width: 460px; }
.cta-row {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-top: clamp(20px, 3.5svh, 40px);
}
.cta {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.2em;
  padding: 14px 24px; border-radius: 999px;
  background: var(--chalk); color: var(--green-deep);
  border: 1px solid var(--chalk);
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.cta:hover { background: var(--amber); border-color: var(--amber); transform: translateY(-1px); }
.cta-ghost { background: transparent; color: var(--chalk-70); border-color: var(--chalk-25); }
.cta-ghost:hover { background: transparent; color: var(--amber); border-color: var(--amber); }
.cta-plus { font-size: 13px; }
.pledge-thanks { margin-top: 22px; color: var(--amber); letter-spacing: 0.24em; }

/* ---------- spread it ---------- */

.sticker-preview { margin: 0 auto; width: min(62vw, 34svh, 300px); }
.sticker-preview img {
  width: 100%; height: auto; aspect-ratio: 1 / 1; display: block;
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  transform: rotate(-2deg);
}
.spread-copy .display-sm { margin-bottom: clamp(12px, 2svh, 24px); }
.cta-row-left { justify-content: flex-start; margin-top: 0; margin-bottom: 16px; }
.spread-copy .mono-cap { max-width: 420px; }

/* ---------- ambient CSS motion (off under reduced motion) ---------- */

.dotwrap { position: relative; display: block; line-height: 0; overflow: hidden; width: fit-content; max-width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .dotwrap::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 42%, rgba(239, 235, 223, 0.65) 50%, transparent 58%);
    transform: translateX(-130%);
    animation: dotsweep 5s ease-in-out infinite;
  }
  @keyframes dotsweep { 60%, 100% { transform: translateX(130%); } }
  .sticker-preview img { animation: stickfloat 5.5s ease-in-out infinite alternate; }
  @keyframes stickfloat {
    from { transform: rotate(-2deg) translateY(0); }
    to { transform: rotate(0.8deg) translateY(-8px); }
  }
}

/* ---------- footer ---------- */

.footer {
  padding: clamp(44px, 7svh, 90px) var(--gutter);
  border-top: 1px solid var(--chalk-14);
  scroll-snap-align: end;
}
.footer .inner { max-width: 980px; }

/* ---------- reveal (JS-gated) ---------- */

html.gsap .reveal { opacity: 0; transform: translateY(26px); }
html.gsap .hero-road.reveal, html.gsap .diagram.reveal { transform: none; }

/* ============================================================
   Desktop enhancements
   ============================================================ */

@media (min-width: 861px) {
  .frame { inset: 14px; }
  .masthead { top: 26px; font-size: 10.5px; letter-spacing: 0.24em; }
  .mast-note { display: inline; }

  .spine {
    display: block;
    position: fixed; z-index: 39;
    left: calc(var(--gutter) * 0.42);
    top: 14px; bottom: 14px; width: 1px;
    background: repeating-linear-gradient(
      to bottom, rgba(150, 153, 143, 0.45) 0 14px, transparent 14px 30px);
  }

  .label { font-size: 12px; letter-spacing: 0.24em; gap: 14px; }
  .tick { width: 34px; }

  .diagram svg { min-width: 0; }
  .dg-lanetag { font-size: 11px; }
  .dg-step { font-size: 12px; }

  .stat-strip {
    display: grid; grid-template-columns: repeat(3, 1fr);
    margin: clamp(30px, 5svh, 54px) 0 18px;
  }
  .stat { border-top: none; border-left: 1px solid var(--chalk-14); padding: 6px 26px 2px; }
  .stat:first-child { border-left: none; padding-left: 0; }
  .stat-n { margin-bottom: 14px; }
  .stat-cap { font-size: 10.5px; max-width: 280px; }

  .sign { border-radius: 12px; box-shadow: 0 0 0 6px var(--green-deep), 0 0 0 7px var(--chalk-14); }
  .sign-txt { margin-bottom: 14px; }
  .sign-tag { font-size: 9px; letter-spacing: 0.18em; }

  .duo {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(40px, 5vw, 84px); align-items: center;
  }
  .duo-text .display { font-size: clamp(2.4rem, 3.6vw, 4.6rem); }
  .duo-text .case-h { font-size: clamp(1.9rem, 2.6vw, 3.1rem); }
  .duo-art { max-width: none; justify-self: end; width: 100%; }
  .duo-art svg { max-height: 52vh; }
  .dotfield { max-width: none; max-height: 56vh; }
  .rage-art svg { max-height: 16vh; }
  .states-grid { gap: 6px; max-width: none; }
  .states-grid span { font-size: 11px; padding: 13px 0; border-radius: 6px; }

  .sticker-preview { width: min(100%, 400px); margin: 0; justify-self: end; }
  .sticker-preview img { border-radius: 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
  #spread .duo-art { justify-self: start; }

  .cta { font-size: 11px; letter-spacing: 0.22em; padding: 15px 28px; }
}

/* ---------- short viewports: laptops at 720p, small phones ---------- */

@media (max-height: 768px) {
  .panel { padding-top: clamp(44px, 6.5svh, 84px); padding-bottom: clamp(44px, 6.5svh, 84px); }
  .display { font-size: clamp(2.05rem, min(8.5vw, 10svh), 4.7rem); }
  .hero-road { margin-top: clamp(18px, 4svh, 40px); }
  .lede, .body { font-size: clamp(0.94rem, min(4vw, 2.5svh), 1.08rem); }
  .code-item { padding: clamp(10px, 1.9svh, 20px) 0; }
  .code-item p { font-size: clamp(1.02rem, min(4.6vw, 3.2svh), 1.65rem); }
  .sticker-preview { width: min(44vw, 25svh, 240px); }
  .spread-copy .mono-cap { max-width: 380px; }
  .spread-copy .display-sm { font-size: clamp(1.6rem, min(6.5vw, 5svh), 3rem); }
  .cta { padding: 11px 20px; }
  .label { margin-bottom: clamp(14px, 3svh, 36px); }
  .dotfield { max-height: 21svh; }
  .figure-n { font-size: clamp(3.6rem, min(19vw, 13svh), 9rem); }
}

@media (max-height: 700px) {
  .dotfield { max-width: 220px; }
  .duo-art svg { max-height: 23svh; }
  .stat-n { font-size: clamp(2rem, min(9vw, 6svh), 4rem); margin-bottom: 4px; }
  .stat { padding: clamp(8px, 1.6svh, 14px) 0; }
  .stat-cap { font-size: 9px; }
  .rage-art { margin-bottom: 10px; }
  .rage-art svg { max-height: 8svh; }
  .figure-n { font-size: clamp(3rem, min(17vw, 11svh), 8rem); margin-bottom: 8px; }
  .figure-cap { margin-bottom: 8px; }
  .chalk .body { font-size: 0.9rem; line-height: 1.6; }
  .duo { gap: 12px; }
  .label { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cue-arrow { animation: none; }
}
