/* OpenHelmet - hand-written layer on top of Tailwind utilities.
   Palette lives in the @theme block of each page; mirrored here as plain vars. */

:root {
  --asphalt: #110f0e;
  --tar: #191614;
  --kerb: #221e1b;
  --seam: #352f2a;
  --bone: #efe6d8;
  --dust: #a39789;
  --ash: #6f665d;
  --signal: #ff5a1f;
  --amber: #ffa227;
  --chamfer: 12px;
  color-scheme: dark;
}

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background:
    radial-gradient(1200px 700px at 85% -10%, rgb(255 90 31 / 0.10), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgb(255 162 39 / 0.04), transparent 60%),
    var(--asphalt);
  color: var(--bone);
  font-feature-settings: "ss01", "kern";
  -webkit-font-smoothing: antialiased;
}

/* Film grain - keeps big dark surfaces from looking like flat plastic */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--signal); color: var(--asphalt); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Type ---------- */

.display { font-family: "Anybody", sans-serif; }

.hero-title {
  font-family: "Anybody", sans-serif;
  font-weight: 850;
  font-stretch: 62%;
  font-size: clamp(3.1rem, 7.6vw, 7.4rem);
  line-height: 0.84;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.hero-title .line { display: block; }
.js .hero-title .line {
  animation: stretch-in 1.15s cubic-bezier(0.16, 0.84, 0.12, 1) both;
  animation-delay: var(--d, 0ms);
}
@keyframes stretch-in {
  from { font-stretch: 130%; opacity: 0; transform: translateX(-0.35em); filter: blur(8px); }
  60% { filter: blur(0); }
  to { font-stretch: 62%; opacity: 1; transform: none; filter: none; }
}

.section-title {
  font-family: "Anybody", sans-serif;
  font-weight: 800;
  font-stretch: 72%;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -0.01em;
  font-size: clamp(2.4rem, 5.2vw, 4.6rem);
}

.eyebrow {
  font-family: "Martian Mono", monospace;
  font-stretch: 87.5%;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mono { font-family: "Martian Mono", monospace; font-stretch: 87.5%; }

/* ---------- Load + scroll reveals ---------- */

.js .rise { animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .hero-title .line, .js .rise { animation: none; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Chamfered shapes (number-plate corners) ---------- */

.chamfer {
  clip-path: polygon(0 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, var(--chamfer) 100%, 0 calc(100% - var(--chamfer)));
}

.btn {
  --chamfer: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.35rem 0.9rem;
  font-family: "Anybody", sans-serif;
  font-weight: 750;
  font-stretch: 90%;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, var(--chamfer) 100%, 0 calc(100% - var(--chamfer)));
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
  cursor: pointer;
}
.btn .arrow { transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.btn:hover .arrow { transform: translateX(4px); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--signal); color: var(--asphalt); }
.btn-primary:hover { background: var(--amber); }

.btn-ghost {
  color: var(--bone);
  background:
    linear-gradient(var(--asphalt), var(--asphalt)) padding-box,
    linear-gradient(135deg, var(--seam), #5a4f46) border-box;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px var(--seam);
}
.btn-ghost:hover { background: var(--kerb); }

.btn-sm { padding: 0.55rem 0.9rem 0.5rem; font-size: 0.8rem; --chamfer: 7px; }


/* Dashed lane line between sections */
.lane {
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 34px, transparent 34px 64px);
  opacity: 0.28;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.js .lane { animation: lane 2.4s linear infinite; background-size: 64px 3px; }
@keyframes lane { to { background-position: 64px 0; } }
@media (prefers-reduced-motion: reduce) { .js .lane { animation: none; } }

/* Status chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Martian Mono", monospace;
  font-stretch: 87.5%;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--seam);
  color: var(--dust);
  white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-live { color: #7fe0a0; border-color: rgb(127 224 160 / 0.3); }
.chip-wip { color: var(--amber); border-color: rgb(255 162 39 / 0.3); }

/* Blinking "on air" dot */
.on-air-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgb(255 90 31 / 0.6);
  animation: beacon 1.8s ease-out infinite;
}
@keyframes beacon {
  0% { box-shadow: 0 0 0 0 rgb(255 90 31 / 0.55); }
  70%, 100% { box-shadow: 0 0 0 9px rgb(255 90 31 / 0); }
}

/* ---------- Hero mesh sketch ---------- */

.road-edge { fill: none; stroke: #2b2521; stroke-width: 62; stroke-linecap: round; }
.road { fill: none; stroke: #191513; stroke-width: 54; stroke-linecap: round; }
.road-lane {
  fill: none; stroke: var(--amber); stroke-opacity: 0.45; stroke-width: 2.5;
  stroke-dasharray: 16 14;
}
.js .road-lane { animation: road-roll 1.6s linear infinite; }
@keyframes road-roll { to { stroke-dashoffset: 30; } }

.mesh-link { stroke: var(--bone); stroke-opacity: 0.2; stroke-width: 1.25; stroke-dasharray: 2 5; transition: stroke-opacity 0.3s, stroke 0.3s; }
.mesh-link.hot { stroke: var(--signal); stroke-opacity: 0.75; }

.rider .body { fill: var(--bone); stroke: var(--asphalt); stroke-width: 3; }
.rider .core { fill: var(--asphalt); transition: fill 0.3s; }
.rider.you .core { fill: var(--signal); }
.rider .ring, .rider .rx, .rider .range {
  transform-box: fill-box; transform-origin: center;
}
.rider .ring { fill: none; stroke: var(--signal); stroke-width: 2; opacity: 0; }
.rider .range { fill: none; stroke: var(--signal); stroke-opacity: 0.3; stroke-dasharray: 3 6; opacity: 0; transition: opacity 0.5s; }
.rider.speaking .range { opacity: 1; }
.rider.speaking .core { fill: var(--signal); }
.rider.speaking .ring { animation: ping 1.1s cubic-bezier(0, 0.4, 0.4, 1) infinite; }
.rider .rx { fill: none; stroke: var(--amber); stroke-width: 1.5; opacity: 0; }
.rider.heard .rx { animation: rx 0.5s ease-out; }
@keyframes ping { from { transform: scale(0.7); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }
@keyframes rx { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.8); opacity: 0; } }

.rider text { font-family: "Martian Mono", monospace; font-stretch: 87.5%; font-size: 11px; letter-spacing: 0.08em; fill: var(--dust); text-transform: uppercase; }
.rider text .role { fill: var(--bone); font-weight: 600; }
.rider.speaking text .role { fill: var(--signal); }

.packet { fill: var(--signal); }
.packets { filter: drop-shadow(0 0 5px rgb(255 90 31 / 0.9)); }

@media (prefers-reduced-motion: reduce) {
  .js .road-lane, .rider.speaking .ring { animation: none; }
}

/* ---------- "More detail" disclosure (hero TDMA strip) ---------- */

.more-toggle {
  display: inline-block;
  font-family: "Martian Mono", monospace; font-stretch: 87.5%;
  font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--dust); cursor: pointer; list-style: none; user-select: none;
  text-decoration: underline; text-decoration-color: var(--signal);
  text-decoration-thickness: 1px; text-underline-offset: 5px;
  transition: color 0.2s;
}
.more-toggle::-webkit-details-marker { display: none; }
.more-toggle:hover { color: var(--bone); }
.more .more-close, .more[open] .more-open { display: none; }
.more[open] .more-close { display: inline; }
.more[open] .more-body { animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@media (prefers-reduced-motion: reduce) { .more[open] .more-body { animation: none; } }

/* ---------- TDMA strip ---------- */

.tdma {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
}
.slot {
  position: relative;
  height: 4.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--seam);
  background: var(--tar);
  font-family: "Martian Mono", monospace;
  font-stretch: 87.5%;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dust);
  transition: background-color 0.12s, color 0.12s, box-shadow 0.25s;
  overflow: hidden;
}
.slot .who { color: var(--bone); }
.slot[data-free] {
  color: var(--ash);
  background: repeating-linear-gradient(135deg, transparent 0 7px, rgb(239 230 216 / 0.035) 7px 8px), var(--asphalt);
}
.slot[data-free] .who { color: var(--ash); }
.slot.on-air { border-color: rgb(255 90 31 / 0.55); }
.slot.on-air .state { color: var(--signal); }
.slot.tx { background: var(--signal); color: var(--asphalt); box-shadow: 0 0 28px -6px var(--signal); }
.slot.tx .who, .slot.tx .state { color: var(--asphalt); }
.slot[data-slot="ctl"] { border-style: dashed; }
.slot[data-slot="ctl"].tx { background: var(--amber); box-shadow: 0 0 22px -8px var(--amber); }
.playhead {
  position: absolute;
  top: -8px; bottom: -8px;
  width: 2px;
  background: var(--bone);
  box-shadow: 0 0 12px rgb(239 230 216 / 0.6);
  left: 0;
  pointer-events: none;
}
.playhead::before {
  content: ""; position: absolute; top: -5px; left: -4px;
  border: 5px solid transparent; border-top-color: var(--bone);
}
@media (max-width: 640px) {
  .slot { height: 3.4rem; padding: 0.35rem 0.3rem; font-size: 0.5rem; letter-spacing: 0.02em; }
  .slot .state { display: none; }
}

/* ---------- Control module ---------- */

.device {
  position: relative;
  width: min(100%, 340px);
  padding: 2.25rem 1.75rem 1.75rem;
  border-radius: 34px 34px 34px 34px;
  background:
    radial-gradient(120% 80% at 30% 0%, #2c2622, transparent 60%),
    linear-gradient(180deg, #221e1b, #141110);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.07),
    inset 0 -2px 0 rgb(0 0 0 / 0.4),
    0 40px 80px -30px rgb(0 0 0 / 0.8),
    0 0 0 1px #2e2824;
}
.device::after {
  /* screw heads */
  content: "";
  position: absolute; inset: 14px;
  pointer-events: none;
  background:
    radial-gradient(circle at 0 0, #3a332e 3px, transparent 3.5px) 0 0 / 100% 100% no-repeat,
    radial-gradient(circle at 100% 0, #3a332e 3px, transparent 3.5px) 0 0 / 100% 100% no-repeat,
    radial-gradient(circle at 0 100%, #3a332e 3px, transparent 3.5px) 0 0 / 100% 100% no-repeat,
    radial-gradient(circle at 100% 100%, #3a332e 3px, transparent 3.5px) 0 0 / 100% 100% no-repeat;
}
.led {
  --led: #4ade80;
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 10%, var(--led) 45%);
  box-shadow: 0 0 10px 2px var(--led), 0 0 30px 4px color-mix(in oklab, var(--led) 45%, transparent);
  transition: background 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.led.off { opacity: 0.18; box-shadow: none; }
.led.blink { animation: led-blink 0.5s steps(2) infinite; }
@keyframes led-blink { 50% { opacity: 0.2; } }

.key {
  --hold: 0;
  position: relative;
  display: grid; place-items: center;
  width: 4.5rem; height: 4.5rem;
  border-radius: 50%;
  color: var(--bone);
  background: radial-gradient(circle at 40% 30%, #3a332e, #1b1715 70%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.12),
    inset 0 -3px 6px rgb(0 0 0 / 0.5),
    0 6px 0 #0c0a09,
    0 10px 18px rgb(0 0 0 / 0.5);
  transition: transform 0.08s, box-shadow 0.08s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
.key::before {
  /* hold-progress ring */
  content: "";
  position: absolute; inset: -7px;
  border-radius: 50%;
  background: conic-gradient(var(--signal) calc(var(--hold) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}
.key::after {
  content: "";
  position: absolute; inset: -7px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--signal);
  opacity: 0;
  transition: opacity 0.2s;
}
.key.hint::after { opacity: 1; animation: hint 1.2s ease-in-out infinite; }
@keyframes hint { 50% { box-shadow: 0 0 0 1.5px var(--signal), 0 0 18px 2px rgb(255 90 31 / 0.35); } }
.key.down {
  transform: translateY(4px);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.08),
    inset 0 -1px 4px rgb(0 0 0 / 0.5),
    0 2px 0 #0c0a09,
    0 4px 8px rgb(0 0 0 / 0.5);
}
.key-play { width: 5.25rem; height: 5.25rem; }

.voice-prompt { min-height: 3.6em; }
.voice-prompt q { quotes: "\201C" "\201D"; }
.js .voice-prompt.say { animation: say 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes say { from { opacity: 0; transform: translateY(6px); } }

.vol-bars { display: inline-flex; gap: 2px; vertical-align: middle; }
.vol-bars i { width: 4px; height: 10px; background: var(--seam); }
.vol-bars i.on { background: var(--bone); }

.cheat tr { transition: background-color 0.2s; }
.cheat tbody tr:hover, .cheat tbody tr:focus-within { background: rgb(255 90 31 / 0.06); }
.cheat tbody tr:hover td:first-child, .cheat tbody tr:focus-within td:first-child { color: var(--bone); }

kbd.k {
  display: inline-grid; place-items: center;
  min-width: 1.6rem; height: 1.6rem; padding: 0 0.35rem;
  border-radius: 999px;
  font-family: "Martian Mono", monospace; font-size: 0.7rem;
  color: var(--bone);
  background: var(--kerb);
  box-shadow: inset 0 0 0 1px var(--seam), 0 2px 0 #0c0a09;
  vertical-align: middle;
}
kbd.k .k-icon { width: 0.95rem; height: 0.95rem; }

/* ---------- Hardware block diagram ---------- */

.harness { border: 1px solid var(--seam); background: var(--tar); }
.harness-scroll { overflow-x: auto; }
.harness-svg { display: block; width: 100%; min-width: 860px; height: auto; }

.wire { fill: none; stroke: #4a413a; stroke-width: 2; transition: stroke 0.2s, opacity 0.2s; }
.wire.bus { stroke-width: 5; }
.wire.air { stroke-dasharray: 2 6; stroke-linecap: round; stroke-width: 2.5; }
.wire.lit { stroke: var(--signal); }
.flow { fill: none; stroke: var(--signal); stroke-width: 2.5; stroke-dasharray: 10 70; stroke-linecap: round; opacity: 0.85; pointer-events: none; }
.js .flow { animation: flow 1.6s linear infinite; }
.js .flow.rev { animation-direction: reverse; stroke: var(--amber); }
@keyframes flow { to { stroke-dashoffset: -80; } }

.wire-labels text, .antenna text { font-family: "Martian Mono", monospace; font-stretch: 87.5%; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.wire-labels text { fill: var(--dust); paint-order: stroke; stroke: var(--tar); stroke-width: 5px; }
.antenna path { fill: none; stroke: var(--bone); stroke-width: 2; stroke-linecap: round; }
.antenna .wave { stroke: var(--signal); opacity: 0.7; }
.js .antenna .wave { animation: wave 1.8s ease-out infinite; }
.js .antenna .wave.w2 { animation-delay: 0.3s; }
@keyframes wave { 0%, 100% { opacity: 0.15; } 40% { opacity: 0.9; } }
.antenna text { fill: var(--bone); }
.antenna text.dim { fill: var(--ash); }

.hw-block { cursor: default; outline: none; transition: opacity 0.2s; }
.hw-block path { fill: var(--asphalt); stroke: var(--seam); stroke-width: 1.5; transition: stroke 0.2s, fill 0.2s; }
.hw-block.main path { stroke: #5a4f46; stroke-width: 2; }
.hw-block.ext path { fill: var(--tar); stroke-dasharray: 3 3; }
.hw-block text { pointer-events: none; }
.b-name { font-family: "Anybody", sans-serif; font-weight: 780; font-stretch: 80%; font-size: 19px; text-transform: uppercase; fill: var(--bone); }
.b-name.big { font-size: 34px; font-weight: 850; font-stretch: 65%; }
.b-sub { font-family: "Martian Mono", monospace; font-stretch: 87.5%; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--dust); }
.b-tag { font-family: "Martian Mono", monospace; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; fill: var(--signal); }
.led-dot { transition: fill 0.6s; }
.hw-block:hover path, .hw-block.lit path, .hw-block:focus-visible path { stroke: var(--signal); fill: #1d1714; stroke-dasharray: none; }
.hw-block.near path { stroke: var(--amber); }
.harness-svg.focused .wire:not(.lit) { opacity: 0.25; }
.harness-svg.focused .hw-block:not(.lit):not(.near) { opacity: 0.45; }


@media (prefers-reduced-motion: reduce) {
  .js .flow, .js .antenna .wave { animation: none; }
}

/* ---------- Code / terminal ---------- */

.term {
  background: #0b0a09;
  border: 1px solid var(--seam);
  font-family: "Martian Mono", monospace;
  font-stretch: 87.5%;
  font-size: 0.78rem;
  line-height: 1.85;
}
.term pre { overflow-x: auto; padding: 1rem 1.15rem; }
.term .p { color: var(--signal); user-select: none; }
.term .c { color: var(--ash); }

.copy-btn {
  font-family: "Martian Mono", monospace;
  font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dust);
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--seam);
  transition: color 0.2s, border-color 0.2s;
}
.copy-btn:hover { color: var(--bone); border-color: var(--dust); }
.copy-btn.done { color: #7fe0a0; border-color: rgb(127 224 160 / 0.4); }

/* ---------- Roadmap ---------- */

/* Fallback (mobile / no JS): a vertical itinerary. */
.atlas-map, .atlas-legend { display: none; }
.trip { position: relative; display: grid; gap: 1.75rem; }
.trip > li { position: relative; padding-left: 2.25rem; }
.trip > li::before {
  /* road segment down to the next stop */
  content: ""; position: absolute; left: 7px; top: 0.9rem; bottom: -2.4rem; width: 2px;
  background: var(--signal);
}
.trip > li:last-child::before { display: none; }
.trip > .here::before,
.trip > .town:not(.done)::before { background: repeating-linear-gradient(180deg, var(--seam) 0 6px, transparent 6px 12px); }
.pin {
  position: absolute; left: 0; top: 0.3rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px var(--asphalt);
}
.town:not(.done) .pin { background: var(--asphalt); box-shadow: 0 0 0 4px var(--asphalt), inset 0 0 0 2px var(--dust); }
.town h3 { font-weight: 500; }
.town p { margin-top: 0.25rem; font-size: 0.875rem; line-height: 1.6; color: var(--ash); }
/* "You are here": a nav arrow heading along the road (--heading, set by
   main.js; straight down in the vertical layouts). */
.here { min-height: 1.25rem; }
.here-arrow {
  position: absolute; left: -2px; top: 0;
  width: 28px; height: 28px; overflow: visible;
  transform: rotate(var(--heading, 180deg));
}
.here-arrow path {
  fill: var(--amber); stroke: var(--asphalt); stroke-width: 2.5; stroke-linejoin: round;
  paint-order: stroke;
  filter: drop-shadow(0 0 6px rgb(255 162 39 / 0.55));
}
.atlas-strip { display: none; }

/* Phones/tablets with JS: a vertical map. main.js draws the road through the
   pins; pins weave across a gutter so the road bends as it goes down. */
@media (max-width: 1023.98px) {
  .js .atlas { position: relative; }
  .js .atlas::before {
    /* map paper behind the road */
    content: ""; position: absolute; inset: -2rem 0; pointer-events: none;
    background: radial-gradient(circle, rgb(239 230 216 / 0.09) 1px, transparent 1.5px) 0 0 / 18px 18px;
    -webkit-mask: linear-gradient(90deg, #000 0, #000 4.5rem, transparent 11rem), linear-gradient(transparent, #000 3rem, #000 calc(100% - 3rem), transparent);
    -webkit-mask-composite: source-in;
    mask: linear-gradient(90deg, #000 0, #000 4.5rem, transparent 11rem), linear-gradient(transparent, #000 3rem, #000 calc(100% - 3rem), transparent);
    mask-composite: intersect;
  }
  .js .atlas-strip {
    display: block; position: absolute; width: 4rem; overflow: visible; pointer-events: none;
  }
  .js .atlas-strip .atlas-casing { stroke-width: 16; }
  .js .atlas-strip .atlas-done { stroke-width: 4; }

  .js .trip { gap: 2.25rem; }
  .js .trip > li { padding-left: 4.25rem; }
  .js .trip > li::before { display: none; }
  .js .trip .pin { left: 0.25rem; top: 0.15rem; box-shadow: 0 0 0 3px var(--asphalt), 0 0 0 4.5px var(--signal), 0 0 16px 2px rgb(255 90 31 / 0.4); }
  .js .trip .town:not(.done) .pin { box-shadow: 0 0 0 3px var(--asphalt), inset 0 0 0 2px var(--dust); }
  .js .trip > li:nth-child(even) .pin { left: 1.9rem; }
  .js .trip .here-arrow { left: -0.15rem; top: -0.4rem; width: 32px; height: 32px; }
  .js .trip > li.here:nth-child(even) .here-arrow { left: 1.5rem; }
  .js .trip .town h3 {
    font-family: "Anybody", sans-serif; font-weight: 760; font-stretch: 78%;
    font-size: 1.3rem; line-height: 1.1; letter-spacing: 0.035em; text-transform: uppercase;
    color: var(--bone);
  }
  .js .trip .town p { font-size: 1rem; margin-top: 0.35rem; }
  .js .trip .town:not(.done) h3 { color: var(--dust); font-weight: 600; }

  .js .atlas .atlas-strip .atlas-done {
    stroke-dashoffset: var(--len, 0);
    transition: stroke-dashoffset 2.4s cubic-bezier(0.45, 0, 0.2, 1) 0.2s;
  }
  .js .atlas.in .atlas-strip .atlas-done { stroke-dashoffset: 0; }
  .js .atlas .trip > li {
    opacity: 0; transform: translateX(-6px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    transition-delay: calc(0.2s + var(--tm, 0) * 2.4s);
  }
  .js .atlas.in .trip > li { opacity: 1; transform: none; }
}

/* Map (lg+, JS has placed the towns). */
@media (min-width: 1024px) {
  .js .atlas { position: relative; container-type: inline-size; }
  .js .atlas-map { display: block; width: 100%; height: auto; overflow: visible; }
  .js .atlas-legend {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1.75rem;
    width: min(76rem, 100% - 4rem); margin: 1.5rem auto 0; padding-top: 1rem;
    border-top: 1px solid var(--seam);
    font-family: "Martian Mono", monospace; font-stretch: 87.5%;
    font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--dust);
  }
  .atlas-legend span { display: inline-flex; align-items: center; gap: 0.6rem; }
  .atlas-legend i { display: inline-block; width: 26px; }
  .atlas-legend .lg-done { height: 4px; border-radius: 2px; background: var(--signal); }
  .atlas-legend .lg-ahead { border-top: 2.5px dotted var(--dust); }
  .atlas-legend .atlas-scale { margin-left: auto; }
  .atlas-legend .atlas-scale i {
    width: calc(var(--step, 0.07) * 100cqw); height: 6px;
    border: 1px solid var(--dust); border-top: 0;
    background: linear-gradient(90deg, var(--dust) 50%, transparent 50%) bottom / 100% 2px no-repeat;
  }

  .js .trip {
    position: absolute; top: 0; left: 0; width: 100%;
    aspect-ratio: 1600 / 640;
    display: block;
    pointer-events: none;
  }
  .js .trip > li {
    /* leader runs from the pin to the label band (dy is a fraction of map height) */
    --lead: calc(var(--dy, 0.1) * 100cqw * 640 / 1600);
    position: absolute;
    left: calc(var(--x) * 100%);
    top: calc(var(--y) * 100%);
    width: 0; height: 0; padding: 0;
  }

  /* leader line from the pin to the town label */
  .js .trip > .town::before {
    left: -0.5px; width: 1px; height: var(--lead);
    background: linear-gradient(var(--seam), var(--seam));
  }
  .js .trip > .town[data-side="n"]::before { top: auto; bottom: 0; }
  .js .trip > .town[data-side="s"]::before { top: 0; bottom: auto; }
  .js .trip > .town:last-child::before { display: block; }
  .js .trip > .here::before { display: none; }

  .js .trip .pin {
    left: -8px; top: -8px;
    box-shadow: 0 0 0 3px var(--asphalt), 0 0 0 4.5px var(--signal), 0 0 18px 2px rgb(255 90 31 / 0.45);
  }
  .js .trip .town:not(.done) .pin {
    box-shadow: 0 0 0 3px var(--asphalt), inset 0 0 0 2px var(--dust);
  }

  .js .trip .tag {
    position: absolute; left: -0.5px;
    width: min(13cqw, 18rem);
    padding: 0 0 0 0.7rem;
    border-left: 1px solid var(--seam);
    pointer-events: auto;
  }
  .js .trip .town[data-side="n"] .tag { bottom: var(--lead); padding-bottom: 0.1rem; }
  .js .trip .town[data-side="s"] .tag { top: var(--lead); padding-top: 0.1rem; }
  .js .trip .town h3 {
    font-family: "Anybody", sans-serif;
    font-weight: 760; font-stretch: 78%;
    font-size: clamp(1.05rem, 1.3cqw, 1.45rem); line-height: 1.02;
    letter-spacing: 0.035em; text-transform: uppercase;
    color: var(--bone);
    text-wrap: balance;
  }
  .js .trip .town:not(.done) h3 { color: var(--dust); font-weight: 600; }
  .js .trip .town p { font-size: clamp(0.8125rem, 0.98cqw, 1.05rem); line-height: 1.45; margin-top: 0.35rem; text-wrap: pretty; }

  .js .trip .here-arrow {
    left: -22px; top: -22px; width: 44px; height: 44px;
    transform: rotate(var(--heading-map, 90deg));
  }
  .js .trip .here::after {
    /* pulse ring around the arrow */
    content: ""; position: absolute; left: -19px; top: -19px; width: 38px; height: 38px; border-radius: 50%;
    animation: beacon-amber 1.8s ease-out infinite;
  }

  /* Reveal: draw the travelled road, then drop the towns in order. */
  .js .atlas .atlas-done {
    stroke-dashoffset: var(--len, 0);
    transition: stroke-dashoffset 2.4s cubic-bezier(0.45, 0, 0.2, 1) 0.2s;
  }
  .js .atlas.in .atlas-done { stroke-dashoffset: 0; }
  .js .atlas .trip > li {
    opacity: 0;
    transition: opacity 0.6s ease-out;
    transition-delay: calc(0.2s + var(--t, 0) * 2.4s);
  }
  .js .atlas.in .trip > li { opacity: 1; }
}
@keyframes beacon-amber {
  0% { box-shadow: 0 0 0 0 rgb(255 162 39 / 0.6); }
  70%, 100% { box-shadow: 0 0 0 12px rgb(255 162 39 / 0); }
}
@media (prefers-reduced-motion: reduce) {
  .js .atlas .atlas-done, .js .atlas .trip > li { transition: none; transform: none; }
  .js .trip .here::after { animation: none; }
}

.atlas-river { fill: none; stroke: #2c3a3f; stroke-width: 7; stroke-linecap: round; opacity: 0.8; }
.atlas-minor { fill: none; stroke: #241f1c; stroke-width: 7; stroke-linecap: round; }
.atlas-grid { fill: none; stroke: var(--bone); stroke-opacity: 0.045; stroke-dasharray: 3 7; }
.atlas-casing { fill: none; stroke: #2a2420; stroke-width: 20; stroke-linecap: round; }
.atlas-ahead {
  fill: none; stroke: var(--dust); stroke-opacity: 0.55; stroke-width: 2.5;
  stroke-linecap: round; stroke-dasharray: 0.1 9;
}
.atlas-done {
  fill: none; stroke: var(--signal); stroke-width: 5; stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgb(255 90 31 / 0.55));
}
.atlas-ticks text {
  font-family: "Martian Mono", monospace; font-size: 11px; letter-spacing: 0.1em;
  fill: var(--ash); text-anchor: middle;
}
.atlas-compass circle { fill: none; stroke: var(--seam); }
.atlas-compass .needle-s { fill: var(--seam); }
.atlas-compass .needle-n { fill: var(--signal); }
.atlas-compass text {
  font-family: "Martian Mono", monospace; font-size: 11px; fill: var(--dust); text-anchor: middle;
}

/* ---------- Waitlist dialog ---------- */

dialog.waitlist {
  width: min(560px, calc(100% - 2rem));
  margin: auto;
  padding: 0;
  color: var(--bone);
  background: var(--tar);
  border: 1px solid var(--seam);
  box-shadow: 0 50px 120px -20px rgb(0 0 0 / 0.9);
}
dialog.waitlist::backdrop { background: rgb(8 7 6 / 0.72); backdrop-filter: blur(6px); }
dialog.waitlist[open] { animation: pop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

.field {
  width: 100%;
  padding: 0.95rem 1rem;
  background: var(--asphalt);
  border: 1px solid var(--seam);
  color: var(--bone);
  font-size: 1.05rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field::placeholder { color: var(--ash); }
.field:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgb(255 90 31 / 0.18); }

.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--seam);
  font-size: 0.875rem;
  color: var(--dust);
  cursor: pointer;
  transition: all 0.2s;
}
.pick span:hover { color: var(--bone); border-color: var(--dust); }
.pick input:checked + span { color: var(--asphalt); background: var(--bone); border-color: var(--bone); }
.pick input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- Footer wordmark ---------- */

.wordmark-xl {
  font-family: "Anybody", sans-serif;
  font-weight: 900;
  font-stretch: 150%;
  text-transform: uppercase;
  line-height: 0.8;
  letter-spacing: -0.03em;
  font-size: clamp(2.4rem, 9.2vw, 8.8rem);
  color: transparent;
  -webkit-text-stroke: 1px #3a332d;
  user-select: none;
}

/* ---------- Install page ---------- */

.skeleton {
  background: linear-gradient(90deg, var(--kerb) 0%, #2b2622 50%, var(--kerb) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.asset-row { transition: background-color 0.2s; }
.asset-row:hover { background: rgb(239 230 216 / 0.03); }

.seg button {
  font-family: "Martian Mono", monospace; font-stretch: 87.5%;
  font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.45rem 0.8rem;
  color: var(--dust);
  transition: all 0.2s;
}
.seg button[aria-pressed="true"] { background: var(--bone); color: var(--asphalt); }
.seg button:disabled { opacity: 0.35; cursor: not-allowed; }

.step-num {
  font-family: "Anybody", sans-serif;
  font-weight: 900;
  font-stretch: 60%;
  font-size: 5.5rem;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--seam);
  transition: -webkit-text-stroke-color 0.3s;
}
.step:hover .step-num { -webkit-text-stroke-color: var(--signal); }

.check input { appearance: none; width: 1.05rem; height: 1.05rem; border: 1.5px solid var(--dust); display: grid; place-items: center; flex: none; margin-top: 0.2rem; cursor: pointer; transition: all .2s; }
.check input:checked { background: var(--signal); border-color: var(--signal); }
.check input:checked::after { content: ""; width: 5px; height: 9px; border: solid var(--asphalt); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.check input:checked + span { color: var(--ash); text-decoration: line-through; text-decoration-color: var(--seam); }

.notes h4 { font-family: "Martian Mono", monospace; font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dust); margin: 1rem 0 0.4rem; }
.notes li { position: relative; padding-left: 1rem; margin: 0.25rem 0; }
.notes li::before { content: "-"; position: absolute; left: 0; color: var(--signal); }
.notes code { font-family: "Martian Mono", monospace; font-size: 0.85em; color: var(--amber); }
