/* ============================================
   DESIGN TOKENS
   Warm ivory paper + ink, highway-sign colours for the road-trip theme.
   Values are "r g b" so Tailwind can apply opacity.
   ============================================ */
:root {
  --paper: 251 247 240;
  --surface: 255 255 255;
  --ink: 28 22 18;
  --muted: 122 106 94;
  --line: 233 221 206;

  --saffron: 242 107 29;
  --amber: 245 166 35;
  --coral: 255 94 58;
  --rose: 232 69 122;

  /* Real road-sign colours */
  --sign-green: 31 122 63;
  --sign-blue: 30 90 168;
  --sign-brown: 122 74 42;
  --sign-red: 192 57 43;
  --sign-yellow: 244 163 0;
  --paper-card: 253 250 243;
  --steel: 74 76 86;
  --asphalt: 54 55 63;

  --grad: linear-gradient(135deg, rgb(var(--coral)) 0%, rgb(var(--saffron)) 55%, rgb(var(--amber)) 100%);
  --glow: var(--saffron);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

.dark {
  --paper: 18 14 11;
  --surface: 27 22 18;
  --ink: 246 239 230;
  --muted: 172 154 140;
  --line: 54 43 35;

  --saffron: 255 140 66;
  --amber: 255 191 77;
  --coral: 255 122 92;
  --rose: 255 118 160;

  --paper-card: 36 31 27;
  --steel: 52 54 62;
  --asphalt: 28 29 34;
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  background-color: rgb(var(--paper));
  color: rgb(var(--ink));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  transition: background-color 0.4s ease, color 0.4s ease;
}

::selection {
  background: rgb(var(--sign-yellow) / 0.4);
  color: rgb(var(--ink));
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgb(var(--line));
  border-radius: 999px;
  border: 2px solid rgb(var(--paper));
}
::-webkit-scrollbar-thumb:hover { background: rgb(var(--muted)); }

:focus-visible {
  outline: 2px solid rgb(var(--sign-yellow));
  outline-offset: 3px;
  border-radius: 6px;
}

/* Film grain over the whole page, very faint */
.grain::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.dark .grain::after { opacity: 0.05; }

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  filter: blur(8px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out),
    filter 0.9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ============================================
   SPOTLIGHT CARD
   A soft glow follows the cursor, and the border lights up near it.
   ============================================ */
.spotlight {
  position: relative;
  isolation: isolate;
}
.spotlight::before,
.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.spotlight::before {
  background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 50%), rgb(var(--glow) / 0.10), transparent 45%);
  z-index: 1;
}
.spotlight::after {
  padding: 1px;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgb(var(--glow) / 0.85), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 2;
}
.spotlight:hover::before,
.spotlight:hover::after { opacity: 1; }

/* ============================================
   SMALL INTERACTIONS
   ============================================ */

/* Underline that draws in from the left */
.link-draw {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.45s var(--ease-out);
}
.link-draw:hover,
.group:hover .link-draw { background-size: 100% 1px; }

/* Arrow that slips out and back in on hover */
.arrow-slip { overflow: hidden; display: inline-flex; position: relative; }
.arrow-slip > svg { transition: transform 0.45s var(--ease-out); }
.arrow-slip > svg + svg {
  position: absolute;
  inset: 0;
  transform: translate(-120%, 120%);
}
.group:hover .arrow-slip > svg:first-child { transform: translate(120%, -120%); }
.group:hover .arrow-slip > svg + svg { transform: translate(0, 0); }

/* Live status dot */
.pulse-dot { position: relative; }
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: inherit;
  animation: pulse-ring 2s var(--ease-out) infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* Button press */
.press { transition: transform 0.2s var(--ease-out); }
.press:active { transform: scale(0.97); }

/* Theme icon spin-in */
.spin-in { animation: spin-in 0.5s var(--ease-out); }
@keyframes spin-in {
  from { transform: rotate(-90deg) scale(0.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Pop */
.pop-in { animation: pop-in 0.35s var(--ease-out); }
@keyframes pop-in {
  from { transform: translateY(6px) scale(0.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Drop in from above, like a sign being hung */
.drop-in { animation: drop-in 0.7s var(--ease-spring) both; }
@keyframes drop-in {
  from { transform: translateY(-18px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Children pop in one after another when the card changes */
.stagger > * { animation: pop-in 0.5s var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 45ms; }
.stagger > *:nth-child(3) { animation-delay: 90ms; }
.stagger > *:nth-child(4) { animation-delay: 135ms; }
.stagger > *:nth-child(5) { animation-delay: 180ms; }
.stagger > *:nth-child(6) { animation-delay: 225ms; }
.stagger > *:nth-child(7) { animation-delay: 270ms; }
.stagger > *:nth-child(8) { animation-delay: 315ms; }

/* Cursor tilt. Cards can also carry a resting tilt so they sit in the world like objects. */
.tilt {
  transform: rotateX(calc(var(--rx, 0deg) + var(--base-rx, 0deg))) rotateY(calc(var(--ry, 0deg) + var(--base-ry, 0deg)));
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s ease;
  will-change: transform;
}

/* ============================================
   TRIP JOURNAL CARDS
   Paper cards with real thickness, tape, highway-sign headers and a postmark.
   ============================================ */
.card-paper {
  position: relative;
  background-color: rgb(var(--paper-card));
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-blend-mode: soft-light;
  border: 1px solid rgb(var(--ink) / 0.14);
  border-radius: 8px;
  /* A thick pad of paper: three sheets underneath, a hard edge, then a real drop shadow */
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.7) inset,
    0 -1px 0 rgb(var(--ink) / 0.05) inset,
    0 7px 0 -3px rgb(var(--paper-card)),
    0 8px 0 -3px rgb(var(--ink) / 0.2),
    0 14px 0 -6px rgb(var(--paper-card)),
    0 15px 0 -6px rgb(var(--ink) / 0.16),
    0 21px 0 -9px rgb(var(--paper-card)),
    0 22px 0 -9px rgb(var(--ink) / 0.12),
    0 34px 44px -20px rgb(0 0 0 / 0.5),
    0 60px 80px -40px rgb(0 0 0 / 0.35);
}
.dark .card-paper {
  border-color: rgb(255 255 255 / 0.12);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.06) inset,
    0 7px 0 -3px rgb(var(--paper-card)),
    0 8px 0 -3px rgb(0 0 0 / 0.55),
    0 14px 0 -6px rgb(var(--paper-card)),
    0 15px 0 -6px rgb(0 0 0 / 0.45),
    0 21px 0 -9px rgb(var(--paper-card)),
    0 22px 0 -9px rgb(0 0 0 / 0.35),
    0 34px 44px -20px rgb(0 0 0 / 0.85),
    0 60px 80px -40px rgb(0 0 0 / 0.6);
}
/* Folded corner at the bottom right */
.card-paper > .fold {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  pointer-events: none;
  z-index: 4;
  border-bottom-right-radius: 8px;
  background: linear-gradient(135deg, transparent 50%, rgb(var(--ink) / 0.07) 50%, rgb(var(--ink) / 0.12) 100%);
}
.card-paper > .fold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgb(var(--paper-card)) 50%, transparent 50%);
  filter: drop-shadow(-1px -1px 1px rgb(0 0 0 / 0.12));
  -webkit-mask: linear-gradient(135deg, transparent 50%, #000 50%);
  mask: linear-gradient(135deg, transparent 50%, #000 50%);
  transform: scale(-1);
  opacity: 0.9;
}
.card-paper:hover { z-index: 5; }

/* The floating district cards sit at a slight angle, like a board propped by the road */
.float-card .card-paper { --base-ry: -5deg; --base-rx: 1.5deg; }
.float-card.left .card-paper { --base-ry: 5deg; }
@media (max-width: 767px) {
  .float-card .card-paper { --base-ry: 0deg; --base-rx: 0deg; }
}

/* Body of a card that can scroll: fades out at the bottom so it never looks cut */
.card-scroll {
  overflow-y: auto;
  scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
}

/* Tape across a corner */
.tape {
  position: absolute;
  top: -10px;
  left: 22px;
  width: 92px;
  height: 24px;
  transform: rotate(-6deg);
  background: rgb(255 243 190 / 0.75);
  background-image: repeating-linear-gradient(90deg, rgb(255 255 255 / 0.25) 0 2px, transparent 2px 6px);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.15);
  pointer-events: none;
  z-index: 5;
}
.tape.right { left: auto; right: 22px; transform: rotate(5deg); }
.dark .tape { background-color: rgb(255 230 150 / 0.4); }

/* Highway sign header: coloured plate, white inset border, four rivets, a brushed sheen */
.sign {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 14px 14px 0;
  padding: 11px 14px 11px 16px;
  border-radius: 6px;
  color: #fff;
  background:
    radial-gradient(circle at 8px 8px, rgb(255 255 255 / 0.9) 0 1.6px, rgb(0 0 0 / 0.35) 1.9px, transparent 3px),
    radial-gradient(circle at calc(100% - 8px) 8px, rgb(255 255 255 / 0.9) 0 1.6px, rgb(0 0 0 / 0.35) 1.9px, transparent 3px),
    radial-gradient(circle at 8px calc(100% - 8px), rgb(255 255 255 / 0.9) 0 1.6px, rgb(0 0 0 / 0.35) 1.9px, transparent 3px),
    radial-gradient(circle at calc(100% - 8px) calc(100% - 8px), rgb(255 255 255 / 0.9) 0 1.6px, rgb(0 0 0 / 0.35) 1.9px, transparent 3px),
    linear-gradient(100deg, transparent 20%, rgb(255 255 255 / 0.12) 38%, transparent 52%),
    rgb(var(--sign));
  box-shadow:
    inset 0 0 0 2px rgb(var(--sign)),
    inset 0 0 0 4px rgb(255 255 255 / 0.88),
    inset 0 -2px 0 5px rgb(0 0 0 / 0.08),
    0 2px 0 rgb(0 0 0 / 0.28),
    0 8px 14px -8px rgb(0 0 0 / 0.55);
}
.sign-green { --sign: var(--sign-green); }
.sign-blue { --sign: var(--sign-blue); }
.sign-brown { --sign: var(--sign-brown); }
.sign-red { --sign: var(--sign-red); }
.sign-yellow { --sign: var(--sign-yellow); color: #1c1612; }
.sign-yellow { box-shadow: inset 0 0 0 2px rgb(var(--sign)), inset 0 0 0 4px rgb(28 22 18 / 0.85), 0 2px 0 rgb(0 0 0 / 0.25), 0 8px 14px -8px rgb(0 0 0 / 0.55); }
.sign h2, .sign .sign-title {
  font-family: "Bungee", Impact, sans-serif;
  font-size: 15px;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.25);
}
.sign .sign-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  opacity: 0.92;
  white-space: nowrap;
}
/* Sign post peeking out below the plate */
.sign::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 7px;
  height: 10px;
  margin-left: -3.5px;
  background: linear-gradient(90deg, #8a8a92, #5a5a62 60%, #46464e);
  border-radius: 0 0 2px 2px;
}

/* Small highway-sign chips: categories, statuses, nav items */
.chip-sign {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: "Bungee", Impact, sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: rgb(var(--sign, var(--sign-green)));
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.85), inset 0 0 0 2.5px rgb(var(--sign, var(--sign-green))), 0 1.5px 0 rgb(0 0 0 / 0.3);
  white-space: nowrap;
}
.chip-sign.green { --sign: var(--sign-green); }
.chip-sign.blue { --sign: var(--sign-blue); }
.chip-sign.brown { --sign: var(--sign-brown); }
.chip-sign.red { --sign: var(--sign-red); }
.chip-sign.yellow { --sign: var(--sign-yellow); color: #1c1612; box-shadow: inset 0 0 0 1.5px rgb(28 22 18 / 0.85), inset 0 0 0 2.5px rgb(var(--sign-yellow)), 0 1.5px 0 rgb(0 0 0 / 0.3); }
.chip-sign.paper {
  color: rgb(var(--ink));
  background: rgb(var(--paper-card));
  box-shadow: inset 0 0 0 1px rgb(var(--ink) / 0.2), 0 1.5px 0 rgb(var(--ink) / 0.18);
}

/* Labels floating over the 3D world: tiny road signs on posts */
.sign-label {
  padding: 5px 9px 5px;
  border-radius: 5px;
  font-family: "Bungee", Impact, sans-serif;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--ink));
  background: rgb(var(--paper-card));
  box-shadow: inset 0 0 0 1px rgb(var(--ink) / 0.25), 0 2px 0 rgb(0 0 0 / 0.25), 0 6px 10px -6px rgb(0 0 0 / 0.5);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}
.sign-label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 3px;
  height: 9px;
  margin-left: -1.5px;
  background: linear-gradient(90deg, #8a8a92, #46464e);
}
.sign-label.is-on {
  color: #fff;
  background: rgb(var(--sign-green));
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.9), inset 0 0 0 2.5px rgb(var(--sign-green)), 0 2px 0 rgb(0 0 0 / 0.3), 0 10px 14px -6px rgb(0 0 0 / 0.5);
}
.sign-label:hover { background: rgb(var(--sign-yellow)); color: #1c1612; }
.sign-label.is-on:hover { background: rgb(var(--sign-green)); color: #fff; }

/* Postmark stamp */
.postmark {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px dashed rgb(var(--sign-red) / 0.75);
  color: rgb(var(--sign-red));
  font-family: "Bungee", Impact, sans-serif;
  font-size: 13px;
  line-height: 1;
  text-align: center;
  transform: rotate(-12deg);
  opacity: 0.9;
  mix-blend-mode: multiply;
}
.dark .postmark { mix-blend-mode: screen; color: #ff8a7a; border-color: rgb(255 138 122 / 0.7); }
.postmark small { display: block; font-family: "JetBrains Mono", monospace; font-size: 8px; letter-spacing: 0.1em; margin-top: 2px; }

/* 3D display type: Bungee with a stacked extrusion */
.type-3d {
  font-family: "Bungee", Impact, sans-serif;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-shadow:
    0 1px 0 rgb(var(--ex)),
    0 2px 0 rgb(var(--ex)),
    0 3px 0 rgb(var(--ex)),
    0 4px 0 rgb(var(--ex)),
    0 5px 0 rgb(var(--ex)),
    0 6px 0 rgb(var(--ex) / 0.9),
    0 10px 14px rgb(0 0 0 / 0.35);
  -webkit-text-stroke: 0.5px rgb(var(--ex) / 0.6);
}
.type-3d.green { --ex: var(--sign-green); }
.type-3d.blue { --ex: var(--sign-blue); }
.type-3d.red { --ex: var(--sign-red); }
.type-3d.brown { --ex: var(--sign-brown); }
.type-3d.yellow { --ex: var(--sign-brown); color: rgb(var(--sign-yellow)); }
.type-3d.ink { --ex: var(--ink); color: rgb(var(--paper-card)); }
.type-3d.big {
  text-shadow:
    0 1px 0 rgb(var(--ex)), 0 2px 0 rgb(var(--ex)), 0 3px 0 rgb(var(--ex)), 0 4px 0 rgb(var(--ex)),
    0 5px 0 rgb(var(--ex)), 0 6px 0 rgb(var(--ex)), 0 7px 0 rgb(var(--ex)), 0 8px 0 rgb(var(--ex)),
    0 9px 0 rgb(var(--ex) / 0.9), 0 16px 22px rgb(0 0 0 / 0.4);
}

/* Sign-style buttons */
.btn-sign {
  --b: var(--sign-green);
  background: rgb(var(--b));
  color: #fff;
  box-shadow: inset 0 0 0 2px rgb(var(--b)), inset 0 0 0 3.5px rgb(255 255 255 / 0.8), 0 3px 0 rgb(0 0 0 / 0.28), 0 8px 12px -8px rgb(0 0 0 / 0.5);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s ease, filter 0.2s ease;
}
.btn-sign:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-sign:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px rgb(var(--b)), inset 0 0 0 3.5px rgb(255 255 255 / 0.8), 0 1px 0 rgb(0 0 0 / 0.28); }
.btn-sign.blue { --b: var(--sign-blue); }
.btn-sign.red { --b: var(--sign-red); }
.btn-sign.brown { --b: var(--sign-brown); }
.btn-sign.yellow { --b: var(--sign-yellow); color: #1c1612; box-shadow: inset 0 0 0 2px rgb(var(--b)), inset 0 0 0 3.5px rgb(28 22 18 / 0.8), 0 3px 0 rgb(0 0 0 / 0.28), 0 8px 12px -8px rgb(0 0 0 / 0.5); }

/* Paper button: for secondary actions on cards */
.btn-paper {
  background: rgb(var(--paper-card));
  color: rgb(var(--ink));
  box-shadow: inset 0 0 0 1px rgb(var(--ink) / 0.2), 0 2px 0 rgb(var(--ink) / 0.18);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s ease, background-color 0.2s ease;
}
.btn-paper:hover { background: #fff; transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgb(var(--ink) / 0.3), 0 3px 0 rgb(var(--ink) / 0.18); }
.dark .btn-paper:hover { background: rgb(255 255 255 / 0.08); }
.btn-paper:active { transform: translateY(1px); box-shadow: inset 0 0 0 1px rgb(var(--ink) / 0.3), 0 1px 0 rgb(var(--ink) / 0.18); }

/* Dashed route line with a marker that moves with the drive */
.route {
  position: relative;
  height: 14px;
  margin: 0 14px;
  background-image: repeating-linear-gradient(90deg, rgb(var(--ink) / 0.35) 0 8px, transparent 8px 14px);
  background-size: 100% 2px;
  background-position: 0 50%;
  background-repeat: no-repeat;
}
.route .route-car {
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 10px;
  margin: -5px 0 0 -9px;
  border-radius: 3px 5px 2px 2px;
  background: #d7263d;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.3);
  transition: transform 0.1s linear;
}
.route .route-car::before,
.route .route-car::after {
  content: "";
  position: absolute;
  bottom: -3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1e1e22;
}
.route .route-car::before { left: 2px; }
.route .route-car::after { right: 2px; }
.route .route-flag {
  position: absolute;
  right: -2px;
  top: -4px;
  width: 2px;
  height: 14px;
  background: rgb(var(--ink) / 0.5);
}
.route .route-flag::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 0;
  width: 8px;
  height: 6px;
  background: rgb(var(--sign-red));
}

/* Logo tiles that look like little luggage stickers */
.sticker {
  border-radius: 6px;
  background: #fff;
  border: 1px solid rgb(var(--ink) / 0.12);
  box-shadow: 0 2px 0 rgb(var(--ink) / 0.12);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease;
}
.dark .sticker { background: rgb(255 255 255 / 0.08); }
.group:hover .sticker { transform: translateY(-2px) rotate(-3deg); box-shadow: 0 5px 0 rgb(var(--ink) / 0.14); }

/* Polaroid photo: white frame, a little tape, a slight tilt */
.polaroid {
  position: relative;
  padding: 8px 8px 12px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgb(var(--ink) / 0.1) inset, 0 3px 0 rgb(var(--ink) / 0.12), 0 22px 30px -18px rgb(0 0 0 / 0.5);
  transform: rotate(var(--tilt, -1deg));
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s ease;
}
.dark .polaroid { background: #f1ebe0; }
.polaroid:hover { transform: rotate(0deg) translateY(-3px); box-shadow: 0 1px 0 rgb(var(--ink) / 0.1) inset, 0 5px 0 rgb(var(--ink) / 0.12), 0 32px 40px -20px rgb(0 0 0 / 0.55); }
.polaroid > img, .polaroid .shot { display: block; width: 100%; border-radius: 2px; }

/* Trip ticket: perforated card with notches */
.ticket {
  position: relative;
  background: rgb(var(--paper-card));
  border: 1px solid rgb(var(--ink) / 0.18);
  border-radius: 10px;
  /* Two full-size masks, each punching one semicircle out of an edge; intersect keeps both notches */
  -webkit-mask:
    radial-gradient(10px at 0 var(--notch, 64px), transparent 97%, #000 100%),
    radial-gradient(10px at 100% var(--notch, 64px), transparent 97%, #000 100%);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(10px at 0 var(--notch, 64px), transparent 97%, #000 100%),
    radial-gradient(10px at 100% var(--notch, 64px), transparent 97%, #000 100%);
  mask-composite: intersect;
}
.ticket .tear {
  border-top: 2px dashed rgb(var(--ink) / 0.2);
}

/* Dashed centre line as a divider */
.dash-line {
  height: 2px;
  background-image: repeating-linear-gradient(90deg, rgb(var(--ink) / 0.3) 0 10px, transparent 10px 18px);
}

/* ============================================
   HEADER: an overhead sign gantry
   ============================================ */
.gantry {
  position: relative;
  border-radius: 10px;
  transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}
.gantry.is-scrolled {
  background: rgb(var(--steel) / 0.96);
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.3), 0 14px 24px -14px rgb(0 0 0 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.12);
}
.plate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 6px;
  color: #fff;
  background: rgb(var(--sign));
  box-shadow: inset 0 0 0 1.5px rgb(var(--sign)), inset 0 0 0 3px rgb(255 255 255 / 0.85), 0 2px 0 rgb(0 0 0 / 0.3), 0 8px 12px -8px rgb(0 0 0 / 0.55);
}
.plate-green { --sign: var(--sign-green); }
.plate-blue { --sign: var(--sign-blue); }
/* License plate for the brand */
.plate-licence {
  color: rgb(var(--sign-blue));
  background: #f7f4ea;
  box-shadow: inset 0 0 0 2px rgb(var(--sign-blue)), inset 0 0 0 3px #f7f4ea, 0 2px 0 rgb(0 0 0 / 0.3), 0 8px 12px -8px rgb(0 0 0 / 0.55);
}
.nav-sign {
  position: relative;
  z-index: 1;
  font-family: "Bungee", Impact, sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.85);
  transition: color 0.2s ease;
}
.nav-sign:hover, .nav-sign.is-active { color: #fff; }
.nav-pill {
  position: absolute;
  top: 5px;
  bottom: 5px;
  border-radius: 4px;
  background: rgb(var(--sign-yellow));
  box-shadow: inset 0 0 0 1.5px rgb(28 22 18 / 0.7), 0 1px 0 rgb(0 0 0 / 0.3);
  transition: left 0.35s var(--ease-out), width 0.35s var(--ease-out), opacity 0.25s ease;
}
.nav-sign.is-active, .nav-sign.is-hot { color: #1c1612; }

/* Day / night switch styled like a dashboard toggle */
.day-night {
  position: relative;
  width: 50px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, #86c5ff, #d8ecff);
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.35), 0 1px 0 rgb(255 255 255 / 0.3);
  transition: background 0.5s ease;
}
.dark .day-night { background: linear-gradient(180deg, #0b1226, #22304f); }
.day-night .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 35%, #fff6c8, #f4a300);
  color: #7a4a00;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 0 10px rgb(255 200 60 / 0.6);
  transition: transform 0.45s var(--ease-spring), background 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
}
.dark .day-night .knob {
  transform: translateX(24px);
  background: radial-gradient(circle at 35% 35%, #ffffff, #c9d2e6);
  color: #3a4466;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 0 8px rgb(200 215 255 / 0.5);
}
.day-night .stars {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image: radial-gradient(#fff 0.8px, transparent 1px), radial-gradient(#fff 0.6px, transparent 1px);
  background-size: 14px 12px, 9px 10px;
  background-position: 4px 3px, 10px 8px;
  transition: opacity 0.5s ease;
  -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent);
  mask-image: linear-gradient(90deg, #000 55%, transparent);
}
.dark .day-night .stars { opacity: 0.9; }

/* ============================================
   FOOTER: a rest-stop board at the end of the road
   ============================================ */
.rest-stop {
  position: relative;
  background: rgb(var(--asphalt));
  color: #f1ebe0;
}
.rest-stop::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background:
    linear-gradient(90deg, rgb(var(--sign-yellow)) 0 14px, transparent 14px 28px) 0 0 / 28px 2px repeat-x,
    linear-gradient(180deg, rgb(255 255 255 / 0.12), transparent);
}
.rest-stop .lane {
  height: 2px;
  background-image: repeating-linear-gradient(90deg, rgb(255 255 255 / 0.55) 0 18px, transparent 18px 32px);
}
.mile-marker {
  display: inline-grid;
  place-items: center;
  width: 44px;
  padding: 6px 0 8px;
  border-radius: 4px 4px 2px 2px;
  background: rgb(var(--sign-green));
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.85), inset 0 0 0 2.5px rgb(var(--sign-green)), 0 2px 0 rgb(0 0 0 / 0.3);
  font-family: "Bungee", Impact, sans-serif;
  font-size: 12px;
  line-height: 1;
}
.mile-marker small { font-family: "JetBrains Mono", monospace; font-size: 7px; letter-spacing: 0.15em; opacity: 0.9; margin-bottom: 4px; }

/* ============================================
   INNER PAGES: a flat low-poly backdrop drawn in CSS
   ============================================ */
.page-sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #3f8fe0 0%, #9dc9f0 42%, #dcecf8 62%, #dcecf8 100%);
}
.dark .page-sky { background: linear-gradient(180deg, #050a1c 0%, #121b36 45%, #1b2746 62%, #1b2746 100%); }
.page-sky .sun {
  position: absolute;
  left: 14%;
  top: 46%;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8dc 0 22%, rgb(255 236 170 / 0.75) 30%, rgb(255 200 120 / 0.35) 48%, transparent 70%);
}
.dark .page-sky .sun { background: radial-gradient(circle, #f3f1e6 0 12%, rgb(200 215 255 / 0.5) 20%, rgb(170 190 255 / 0.18) 40%, transparent 65%); }
.page-sky .hill {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  height: 46%;
}
.page-sky .hill-far { background: #8fb3c7; clip-path: polygon(0 60%, 8% 42%, 17% 55%, 26% 36%, 36% 52%, 45% 30%, 56% 50%, 64% 38%, 73% 54%, 82% 34%, 92% 50%, 100% 40%, 100% 100%, 0 100%); opacity: 0.8; }
.page-sky .hill-mid { background: #86b25f; clip-path: polygon(0 70%, 10% 62%, 22% 72%, 33% 58%, 47% 70%, 58% 60%, 70% 72%, 81% 62%, 92% 72%, 100% 64%, 100% 100%, 0 100%); }
.page-sky .hill-near { background: #7cae62; clip-path: polygon(0 84%, 12% 78%, 25% 86%, 40% 76%, 55% 86%, 68% 78%, 84% 88%, 100% 80%, 100% 100%, 0 100%); }
.dark .page-sky .hill-far { background: #1b2742; }
.dark .page-sky .hill-mid { background: #213a26; }
.dark .page-sky .hill-near { background: #1f3a28; }
.page-sky .road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 9%;
  background: #4b4c55;
  border-top: 5px solid #d9d5c8;
}
.dark .page-sky .road { background: #1e2026; border-top-color: #3a3a3c; }
.page-sky .road::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  background-image: repeating-linear-gradient(90deg, #f2f2ea 0 40px, transparent 40px 70px);
  opacity: 0.9;
}
.page-sky .cloud {
  position: absolute;
  width: 140px;
  height: 44px;
  border-radius: 999px;
  background: #fff;
  opacity: 0.95;
  animation: cloud-drift var(--dur, 90s) linear infinite;
}
.page-sky .cloud::before, .page-sky .cloud::after {
  content: "";
  position: absolute;
  bottom: 10px;
  border-radius: 50%;
  background: inherit;
}
.page-sky .cloud::before { left: 22px; width: 56px; height: 56px; }
.page-sky .cloud::after { left: 62px; width: 70px; height: 70px; }
.dark .page-sky .cloud { background: #2a3148; opacity: 0.8; }
@keyframes cloud-drift {
  from { transform: translateX(-200px); }
  to { transform: translateX(110vw); }
}
/* Dim the backdrop so content stays readable */
.page-sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(var(--paper) / 0) 0%, rgb(var(--paper) / 0.35) 40%, rgb(var(--paper) / 0.75) 100%);
}

/* Scroll hint: a little "mouse" sign */
.hint-sign {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  border-radius: 6px;
  background: rgb(var(--paper-card) / 0.92);
  color: rgb(var(--ink));
  font-size: 11.5px;
  box-shadow: inset 0 0 0 1px rgb(var(--ink) / 0.2), 0 2px 0 rgb(0 0 0 / 0.25);
  transition: opacity 0.6s ease, transform 0.6s var(--ease-out);
}
.hint-sign.is-gone { opacity: 0; transform: translateY(8px); pointer-events: none; }
.hint-sign .wheel {
  width: 14px;
  height: 22px;
  border-radius: 8px;
  border: 1.5px solid rgb(var(--ink) / 0.6);
  position: relative;
}
.hint-sign .wheel::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 2px;
  height: 5px;
  margin-left: -1px;
  border-radius: 2px;
  background: rgb(var(--ink) / 0.7);
  animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel {
  0%, 100% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(7px); opacity: 0.2; }
}

/* ============================================
   PROSE for blog posts, on paper
   ============================================ */
.prose-paper { font-size: 1.05rem; line-height: 1.8; color: rgb(var(--ink) / 0.88); }
.prose-paper h1, .prose-paper h2, .prose-paper h3 { font-family: "Bungee", Impact, sans-serif; color: rgb(var(--ink)); line-height: 1.2; margin: 2rem 0 0.75rem; }
.prose-paper h1 { font-size: 1.6rem; }
.prose-paper h2 { font-size: 1.25rem; }
.prose-paper h3 { font-size: 1.05rem; }
.prose-paper p { margin: 0 0 1.2rem; }
.prose-paper a { color: rgb(var(--sign-blue)); text-decoration: underline; text-underline-offset: 3px; }
.prose-paper ul, .prose-paper ol { padding-left: 1.4rem; margin: 0 0 1.2rem; }
.prose-paper li { margin-bottom: 0.4rem; }
.prose-paper blockquote { border-left: 3px solid rgb(var(--sign-green)); padding: 0.6rem 1.2rem; margin: 1.4rem 0; background: rgb(var(--ink) / 0.04); font-style: italic; }
.prose-paper code { font-family: "JetBrains Mono", monospace; font-size: 0.86em; padding: 2px 6px; border-radius: 4px; background: rgb(var(--ink) / 0.07); }
.prose-paper pre { margin: 1.4rem 0; padding: 1.1rem 1.3rem; border-radius: 8px; background: #1c1612; color: #f1ebe0; overflow-x: auto; font-size: 0.875rem; line-height: 1.7; }
.prose-paper pre code { background: transparent; padding: 0; color: inherit; }
.prose-paper img { width: 100%; margin: 1.4rem 0; border-radius: 6px; border: 1px solid rgb(var(--line)); }
.prose-paper table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 1.4rem 0; }
.prose-paper th { text-align: left; padding: 8px 12px; border-bottom: 2px solid rgb(var(--ink)); font-family: "Bungee", Impact, sans-serif; font-size: 0.7rem; letter-spacing: 0.05em; }
.prose-paper td { padding: 8px 12px; border-bottom: 1px solid rgb(var(--line)); }
.prose-paper hr { border: none; height: 2px; margin: 2rem 0; background-image: repeating-linear-gradient(90deg, rgb(var(--ink) / 0.3) 0 10px, transparent 10px 18px); }
.prose-paper .hljs-keyword { color: #c792ea; }
.prose-paper .hljs-string { color: #c3e88d; }
.prose-paper .hljs-number { color: #f78c6c; }
.prose-paper .hljs-comment { color: #8a8a92; font-style: italic; }
.prose-paper .hljs-title, .prose-paper .hljs-function { color: #82aaff; }
.prose-paper .hljs-attr, .prose-paper .hljs-tag, .prose-paper .hljs-name { color: #f07178; }
.prose-paper .hljs-built_in, .prose-paper .hljs-type { color: #ffcb6b; }

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .pulse-dot::after, .page-sky .cloud, .hint-sign .wheel::after { animation: none !important; }
  .tilt { transform: none !important; }
  .stagger > *, .drop-in { animation: none; }
  .nav-pill, .day-night .knob, .polaroid, .card-paper { transition: none; }
}

/* ============================================
   NOTICE BOARD (all projects page)
   A roadside cork board in a wooden frame. Cards are pinned and taped at slightly random angles.
   ============================================ */

.board {
  position: relative;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 64px max(22px, calc(50vw - 36rem + 22px)) 72px;
  background-color: #c9a06b;
  background-image:
    radial-gradient(60% 50% at 50% 40%, rgb(255 236 200 / 0.25), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.30  0 0 0 0 0.15  0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: inset 0 30px 60px -30px rgb(0 0 0 / 0.35), inset 0 -40px 60px -30px rgb(0 0 0 / 0.35);
}
/* Wooden rails top and bottom */
.board::before,
.board::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  background:
    repeating-linear-gradient(90deg, rgb(0 0 0 / 0.06) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #8a5a33, #6e4525 60%, #5a3619);
}
.board::before { top: -22px; box-shadow: 0 6px 10px -4px rgb(0 0 0 / 0.5); }
.board::after { bottom: -22px; box-shadow: 0 -4px 8px -4px rgb(0 0 0 / 0.35), 0 10px 0 -2px #3d2412; }
.dark .board {
  background-color: #6a4a2c;
  box-shadow: inset 0 30px 60px -30px rgb(0 0 0 / 0.6), inset 0 -40px 60px -30px rgb(0 0 0 / 0.6);
}
.dark .board::before, .dark .board::after { background: repeating-linear-gradient(90deg, rgb(0 0 0 / 0.1) 0 2px, transparent 2px 9px), linear-gradient(180deg, #4a2f1a, #3a2312 60%, #2b190c); }

/* Title block on the board */
.board-title {
  font-family: "Bungee", Impact, sans-serif;
}

.marker { font-family: "Permanent Marker", cursive; }

/* ── Things pinned to the board ── */
.b-card {
  position: relative;
  display: block;
  color: #1c1612;
  transform: rotate(var(--tilt, 0deg)) translateY(var(--dy, 0px));
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
  filter: drop-shadow(0 10px 10px rgb(0 0 0 / 0.28));
  z-index: 1;
}
.b-card:hover {
  transform: rotate(0deg) translateY(calc(var(--dy, 0px) - 6px)) scale(1.025);
  filter: drop-shadow(0 22px 22px rgb(0 0 0 / 0.38));
  z-index: 5;
}
.b-shot { overflow: hidden; background: #e9e3d6; }
.b-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1.2s var(--ease-out); }
.b-card:hover .b-shot img { transform: scale(1.05); }

/* 1. Postcard: cream card, picture on top, stamp and postmark in the corner */
.b-postcard {
  position: relative;
  background: #fbf6ea;
  padding: 10px 10px 14px;
  border-radius: 3px;
  background-image: linear-gradient(115deg, rgb(255 255 255 / 0.4), transparent 35%, rgb(0 0 0 / 0.03) 60%, transparent);
}
.b-stamp {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 52px;
  padding: 4px;
  background: #fff;
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Bungee", Impact, sans-serif;
  font-size: 9px;
  /* Perforated edge */
  -webkit-mask: radial-gradient(circle at 3px 3px, transparent 2.2px, #000 2.4px) -3px -3px / 7px 7px;
  mask: radial-gradient(circle at 3px 3px, transparent 2.2px, #000 2.4px) -3px -3px / 7px 7px;
  z-index: 2;
}
.b-stamp > span { display: grid; place-items: center; width: 100%; height: 100%; background: var(--stamp, #1f7a3f); }
.b-postmark {
  position: absolute;
  top: 2px;
  right: 40px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgb(28 22 18 / 0.35);
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  color: rgb(28 22 18 / 0.5);
  transform: rotate(-14deg);
  z-index: 3;
  pointer-events: none;
}
.b-postmark::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1px solid rgb(28 22 18 / 0.3); }

/* 2. Polaroid */
.b-polaroid {
  background: #fff;
  padding: 10px 10px 16px;
  border-radius: 2px;
}

/* 3. Ticket stub: pale yellow with notched sides and a perforated divider */
.b-ticket {
  position: relative;
  background: #fff3c4;
  padding: 10px 14px 12px;
  border-radius: 8px;
  -webkit-mask: radial-gradient(circle at 0 var(--notch, 68%), transparent 9px, #000 9.5px), radial-gradient(circle at 100% var(--notch, 68%), transparent 9px, #000 9.5px);
  mask: radial-gradient(circle at 0 var(--notch, 68%), transparent 9px, #000 9.5px), radial-gradient(circle at 100% var(--notch, 68%), transparent 9px, #000 9.5px);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.b-ticket .b-shot { border-radius: 4px; }
.b-tear { border-top: 2px dashed rgb(28 22 18 / 0.3); margin: 12px -14px 10px; }

/* 4. Index card: ruled lines and a red margin */
.b-note {
  background: #fdfcf7;
  background-image:
    linear-gradient(90deg, transparent 22px, rgb(214 90 90 / 0.55) 22px, rgb(214 90 90 / 0.55) 23px, transparent 23px),
    repeating-linear-gradient(180deg, transparent 0 25px, rgb(90 120 200 / 0.28) 25px 26px);
  padding: 12px 12px 12px 30px;
  border-radius: 3px;
}

/* Bits holding things on */
.b-pin {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 8%, var(--pin, #e01e5a) 10% 60%, color-mix(in srgb, var(--pin, #e01e5a) 55%, #000) 100%);
  box-shadow: 0 3px 4px rgb(0 0 0 / 0.4), 0 0 0 1px rgb(0 0 0 / 0.15);
  z-index: 4;
}
.b-pin::after { content: ""; position: absolute; left: 50%; top: 14px; width: 2px; height: 8px; margin-left: -1px; background: linear-gradient(#aaa, #666); z-index: -1; }
.b-tape {
  position: absolute;
  top: -11px;
  width: 92px;
  height: 24px;
  background: rgb(255 243 170 / 0.75);
  background-image: repeating-linear-gradient(90deg, rgb(255 255 255 / 0.25) 0 2px, transparent 2px 6px);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
  z-index: 4;
}
.b-live {
  position: absolute;
  top: -12px;
  right: -10px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgb(var(--sign-green));
  color: #fff;
  font-family: "Bungee", Impact, sans-serif;
  font-size: 11px;
  box-shadow: inset 0 0 0 2px rgb(var(--sign-green)), inset 0 0 0 4px rgb(255 255 255 / 0.85), 0 3px 0 rgb(0 0 0 / 0.3);
  transform: rotate(12deg);
  z-index: 4;
  animation: live-bob 2.8s ease-in-out infinite;
}
@keyframes live-bob { 0%, 100% { transform: rotate(12deg) scale(1); } 50% { transform: rotate(6deg) scale(1.07); } }
.b-ribbon {
  position: absolute;
  top: 14px;
  left: -8px;
  padding: 3px 10px 3px 8px;
  background: rgb(var(--sign-red));
  color: #fff;
  font-family: "Bungee", Impact, sans-serif;
  font-size: 9px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.3);
  z-index: 4;
  clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 50%, 100% 100%, 0 100%);
}
.b-ribbon::after { content: ""; position: absolute; left: 0; bottom: -6px; border: 4px solid transparent; border-top-color: #7a1f16; border-right-color: #7a1f16; }
.b-doodle {
  position: absolute;
  pointer-events: none;
  z-index: 6;
  font-family: "Permanent Marker", cursive;
  color: #1c1612;
  background: #fff8b0;
  padding: 2px 8px;
  box-shadow: 0 2px 3px rgb(0 0 0 / 0.25);
}
.b-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-family: "Bungee", Impact, sans-serif;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgb(var(--sign, var(--sign-green)));
}
.b-chip.green { --sign: var(--sign-green); }
.b-chip.blue { --sign: var(--sign-blue); }
.b-chip.brown { --sign: var(--sign-brown); }
.b-chip.red { --sign: var(--sign-red); }
.b-chip.yellow { --sign: var(--sign-yellow); color: #1c1612; }

@media (prefers-reduced-motion: reduce) {
  .b-live { animation: none; }
  .b-card, .b-card:hover { transition: none; }
}

/* ============================================
   FOOTER: the end of the road
   An asphalt verge with a big highway exit sign for the links.
   ============================================ */
.exit-board {
  position: relative;
  border-radius: 10px;
  padding: 18px 20px 16px;
  color: #fff;
  background: rgb(var(--sign-green));
  box-shadow: inset 0 0 0 3px rgb(var(--sign-green)), inset 0 0 0 6px rgb(255 255 255 / 0.9), 0 4px 0 rgb(0 0 0 / 0.3), 0 20px 30px -18px rgb(0 0 0 / 0.7);
}
.exit-board.brown { background: rgb(var(--sign-brown)); box-shadow: inset 0 0 0 3px rgb(var(--sign-brown)), inset 0 0 0 6px rgb(255 255 255 / 0.9), 0 4px 0 rgb(0 0 0 / 0.3), 0 20px 30px -18px rgb(0 0 0 / 0.7); }
.exit-board.blue { background: rgb(var(--sign-blue)); box-shadow: inset 0 0 0 3px rgb(var(--sign-blue)), inset 0 0 0 6px rgb(255 255 255 / 0.9), 0 4px 0 rgb(0 0 0 / 0.3), 0 20px 30px -18px rgb(0 0 0 / 0.7); }
.exit-board .exit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 4px 10px;
  border-bottom: 2px solid rgb(255 255 255 / 0.55);
  font-family: "Bungee", Impact, sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.25);
}
.exit-board .exit-head small { font-family: "JetBrains Mono", monospace; font-size: 10px; opacity: 0.85; }
.exit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 6px;
  border-bottom: 1px solid rgb(255 255 255 / 0.18);
  font-family: "Bungee", Impact, sans-serif;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: #fff;
  text-align: left;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.25);
  transition: background-color 0.2s ease, padding-left 0.25s var(--ease-out);
}
.exit-row:last-child { border-bottom: 0; }
.exit-row:hover { background: rgb(255 255 255 / 0.12); padding-left: 12px; }
.exit-row .exit-no {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  background: #fff;
  color: rgb(var(--sign-green));
  font-size: 10px;
  text-shadow: none;
}
.exit-board.brown .exit-row .exit-no { color: rgb(var(--sign-brown)); }
.exit-row .exit-arrow { margin-left: auto; opacity: 0.8; transition: transform 0.25s var(--ease-out); }
.exit-row:hover .exit-arrow { transform: translateX(4px); opacity: 1; }
/* Two posts holding the board up */
.exit-board::before, .exit-board::after {
  content: "";
  position: absolute;
  bottom: -30px;
  width: 10px;
  height: 30px;
  background: linear-gradient(90deg, #8a8a92, #5a5a62);
  border-radius: 0 0 2px 2px;
  z-index: -1;
}
.exit-board::before { left: 14%; }
.exit-board::after { right: 14%; }

.rest-stop .verge {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 14px;
  background: linear-gradient(180deg, #6f9a52, #557a3e);
}
.dark .rest-stop .verge { background: linear-gradient(180deg, #2a4a2e, #1f3a24); }

/* ============================================
   CHAT: a handheld console with a rocket landing inside it
   ============================================ */

/* 3D push button: a coloured top face sitting on a darker side */
.chat-btn {
  width: 60px;
  height: 60px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chat-btn-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(180deg, #2b9a55, #1f7a3f 60%, #19653a);
  box-shadow:
    inset 0 0 0 2px #1f7a3f, inset 0 0 0 3.5px rgb(255 255 255 / 0.85),
    inset 0 2px 0 rgb(255 255 255 / 0.25),
    0 7px 0 #11452a, 0 9px 0 rgb(0 0 0 / 0.25), 0 18px 20px -10px rgb(0 0 0 / 0.6);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background 0.2s ease;
}
.chat-btn:hover .chat-btn-face { transform: translateY(-2px); box-shadow: inset 0 0 0 2px #1f7a3f, inset 0 0 0 3.5px rgb(255 255 255 / 0.85), inset 0 2px 0 rgb(255 255 255 / 0.25), 0 9px 0 #11452a, 0 11px 0 rgb(0 0 0 / 0.25), 0 22px 22px -10px rgb(0 0 0 / 0.6); }
.chat-btn:active .chat-btn-face { transform: translateY(5px); box-shadow: inset 0 0 0 2px #1f7a3f, inset 0 0 0 3.5px rgb(255 255 255 / 0.85), 0 2px 0 #11452a, 0 3px 0 rgb(0 0 0 / 0.25), 0 8px 10px -6px rgb(0 0 0 / 0.5); }
.chat-btn.is-open .chat-btn-face {
  background: linear-gradient(180deg, #e04a5a, #c0392b 60%, #9f2d22);
  box-shadow: inset 0 0 0 2px #c0392b, inset 0 0 0 3.5px rgb(255 255 255 / 0.85), inset 0 2px 0 rgb(255 255 255 / 0.25), 0 7px 0 #6e1d15, 0 9px 0 rgb(0 0 0 / 0.25), 0 18px 20px -10px rgb(0 0 0 / 0.6);
}
.chat-led {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff35c;
  box-shadow: 0 0 6px #fff35c, 0 0 0 1.5px rgb(0 0 0 / 0.25);
  animation: led-blink 2.4s infinite;
}
.chat-led.is-off { background: #777; box-shadow: 0 0 0 1.5px rgb(0 0 0 / 0.25); animation: none; }
@keyframes led-blink { 0%, 88%, 100% { opacity: 1; } 94% { opacity: 0.25; } }

/* The console */
.cockpit { perspective: 1200px; }
.cockpit-body {
  position: relative;
  border-radius: 18px;
  padding: 10px;
  background: linear-gradient(160deg, #4a4c57, #2d2e36 55%, #24252c);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.18), inset 0 0 0 1px rgb(0 0 0 / 0.5),
    0 10px 0 #151519, 0 12px 0 rgb(0 0 0 / 0.3), 0 34px 44px -18px rgb(0 0 0 / 0.75);
  transform-origin: 100% 100%;
}
.phase-open .cockpit-body { animation: cockpit-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.phase-leaving .cockpit-body { animation: cockpit-out 0.3s ease-in both; }
@keyframes cockpit-pop {
  0% { transform: translateY(40px) scale(0.6) rotateX(22deg); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@keyframes cockpit-out {
  0% { transform: none; opacity: 1; }
  100% { transform: translateY(40px) scale(0.7) rotateX(18deg); opacity: 0; }
}
.rivet {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9a9ca8, #45474f 70%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.15), inset 0 1px 1px rgb(0 0 0 / 0.5);
}
.cockpit-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px 10px;
}
.plate-label {
  padding: 4px 9px;
  border-radius: 4px;
  font-family: "Bungee", Impact, sans-serif;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgb(var(--sign-green));
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.85), inset 0 0 0 2.5px rgb(var(--sign-green)), 0 1.5px 0 rgb(0 0 0 / 0.4);
}
.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; margin-left: auto; }
.signal i { display: block; width: 4px; background: #39ff88; border-radius: 1px; box-shadow: 0 0 4px #39ff88; }
.signal i:nth-child(1) { height: 5px; } .signal i:nth-child(2) { height: 8px; } .signal i:nth-child(3) { height: 11px; } .signal i:nth-child(4) { height: 14px; }
.signal.is-busy i { animation: bars 0.7s ease-in-out infinite; }
.signal.is-busy i:nth-child(2) { animation-delay: 0.1s; } .signal.is-busy i:nth-child(3) { animation-delay: 0.2s; } .signal.is-busy i:nth-child(4) { animation-delay: 0.3s; }
.signal.is-off i { background: #666; box-shadow: none; }
@keyframes bars { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }

/* The hangar window */
.hangar {
  position: relative;
  height: 158px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, #8fc4ea 0%, #cfe6f5 70%, #cfe6f5 100%);
  box-shadow: inset 0 0 0 2px rgb(0 0 0 / 0.45), inset 0 6px 14px rgb(0 0 0 / 0.35), inset 0 -2px 0 rgb(255 255 255 / 0.1);
}
.dark .hangar { background: linear-gradient(180deg, #0b1636 0%, #33467a 80%); }
.hangar-stars { position: absolute; inset: 0; opacity: 0; background: radial-gradient(1px 1px at 12% 20%, #fff 99%, transparent), radial-gradient(1px 1px at 30% 55%, #fff 99%, transparent), radial-gradient(1.5px 1.5px at 55% 25%, #fff 99%, transparent), radial-gradient(1px 1px at 72% 48%, #fff 99%, transparent), radial-gradient(1px 1px at 88% 18%, #fff 99%, transparent), radial-gradient(1px 1px at 40% 12%, #fff 99%, transparent), radial-gradient(1.5px 1.5px at 80% 70%, #fff 99%, transparent); }
.dark .hangar-stars { opacity: 0.9; }
.hangar-cloud {
  position: absolute;
  width: 54px;
  height: 18px;
  border-radius: 20px;
  background: #fff;
  opacity: 0.9;
  animation: hangar-drift 18s linear infinite;
}
.hangar-cloud::before { content: ""; position: absolute; left: 12px; top: -10px; width: 26px; height: 22px; border-radius: 50%; background: #fff; }
.dark .hangar-cloud { background: #46507a; opacity: 0.8; }
.dark .hangar-cloud::before { background: #46507a; }
@keyframes hangar-drift { from { transform: translateX(-10px); } to { transform: translateX(60px); } }
.hangar-ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26px;
  background: linear-gradient(180deg, #7cae62 0 10px, #6b9a52 10px);
  box-shadow: inset 0 3px 0 rgb(255 255 255 / 0.15);
}
.dark .hangar-ground { background: linear-gradient(180deg, #26482f 0 10px, #1f3a28 10px); }
.hangar-ground::after {
  content: "";
  position: absolute;
  left: 18%;
  bottom: 6px;
  width: 92px;
  height: 10px;
  border-radius: 50%;
  background: #5a5a62;
  box-shadow: inset 0 0 0 2px #fbf6ea, inset 0 0 0 4px #5a5a62;
}

/* Rocket: starts above the window, drops in and lands on the pad */
.ship {
  position: absolute;
  left: 18%;
  bottom: 6px;
  width: 78px;
  filter: drop-shadow(0 8px 8px rgb(0 0 0 / 0.35));
  will-change: transform;
}
.ship-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ship-flame {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: flame-flicker 0.1s infinite alternate;
}
@keyframes flame-flicker { from { transform: scaleY(0.85) scaleX(0.96); } to { transform: scaleY(1.15) scaleX(1.06); } }
.phase-open .ship { animation: ship-land 1.4s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both, ship-idle 3.2s 1.9s ease-in-out infinite; }
.phase-open .ship-flame { animation: flame-flicker 0.1s infinite alternate, flame-off 0.25s 1.65s ease-out both; }
.phase-leaving .ship { animation: ship-leave 0.3s ease-in both; }
@keyframes ship-land {
  0% { transform: translateY(-240px) rotate(-8deg); }
  70% { transform: translateY(10px) rotate(2deg); }
  86% { transform: translateY(-6px) rotate(-1deg); }
  100% { transform: translateY(0) rotate(0); }
}
@keyframes ship-idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes ship-leave { to { transform: translateY(-240px); } }
@keyframes flame-off { to { opacity: 0; transform: scaleY(0.2); } }

/* Smoke from the nozzle during the landing, then it clears */
.smoke { position: absolute; left: calc(18% + 39px); bottom: 10px; width: 0; height: 0; }
.phase-open .smoke { animation: smoke-clear 0.4s 1.75s ease-out both; }
.smoke span {
  position: absolute;
  left: -14px;
  top: -14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgb(245 240 230 / 0.95), rgb(190 185 175 / 0.75) 60%, transparent 75%);
  opacity: 0;
  animation: puff 0.9s ease-out infinite;
  animation-delay: calc(var(--d, 0s) + 0.35s);
}
@keyframes puff {
  0% { transform: translate(0, 0) scale(calc(var(--s, 1) * 0.35)); opacity: 0.95; }
  100% { transform: translate(var(--x, 0px), 60px) scale(calc(var(--s, 1) * 1.8)); opacity: 0; }
}
@keyframes smoke-clear { to { opacity: 0; } }

/* Dust ring on touchdown */
.dust {
  position: absolute;
  left: calc(18% + 39px);
  bottom: 10px;
  width: 20px;
  height: 8px;
  margin-left: -10px;
  border-radius: 50%;
  border: 3px solid rgb(240 230 210 / 0.95);
  opacity: 0;
}
.phase-open .dust { animation: dust 0.6s 1.45s ease-out both; }
@keyframes dust { 0% { transform: scale(0.4); opacity: 0.9; } 100% { transform: scale(7, 3.5); opacity: 0; } }

/* The pilot climbs out beside the rocket and points at the bubble */
.pilot-window {
  position: absolute;
  left: calc(18% + 70px);
  bottom: 18px;
  width: 70px;
  height: 66px;
  overflow: hidden;
}
.pilot-svg { display: block; width: 100%; height: auto; transform: translateY(100%); }
.phase-open .pilot-svg { animation: pilot-pop 0.6s 1.85s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes pilot-pop { from { transform: translateY(100%); } to { transform: translateY(8%); } }
.pilot-arm {
  transform-box: view-box;
  transform-origin: 86px 98px;
  animation: point-wag 1.3s 2.5s ease-in-out infinite;
}
@keyframes point-wag { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-9deg); } }
.bubble {
  position: absolute;
  right: 10px;
  bottom: 44px;
  width: 150px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff8b0;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.25);
  opacity: 0;
}
.bubble::before {
  content: "";
  position: absolute;
  left: -9px;
  bottom: 12px;
  border: 7px solid transparent;
  border-right-color: #fff8b0;
  border-left: 0;
}
.phase-open .bubble { animation: bubble-in 0.4s 2.3s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes bubble-in { from { transform: translateX(-8px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* Screen and deck */
.screen {
  margin-top: 10px;
  border-radius: 10px;
  background: #fbf6ea;
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgb(28 22 18 / 0.05) 27px 28px);
  box-shadow: inset 0 0 0 2px rgb(0 0 0 / 0.45), inset 0 6px 12px rgb(0 0 0 / 0.25);
  color: #1c1612;
}
.msg-user { background: rgb(var(--sign-blue)); color: #fff; box-shadow: 0 2px 0 rgb(0 0 0 / 0.25); }
.msg-bot { background: #fff; color: #1c1612; border: 1px solid rgb(28 22 18 / 0.15); box-shadow: 0 2px 0 rgb(0 0 0 / 0.12); }
.deck { display: flex; gap: 8px; align-items: center; padding: 10px 2px 2px; }
.deck-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 0;
  font-size: 14px;
  color: #fff;
  background: #1b1c22;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.7), inset 0 0 0 1px rgb(255 255 255 / 0.08);
  outline: none;
}
.deck-input::placeholder { color: rgb(255 255 255 / 0.4); }
.deck-input:focus { box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.7), inset 0 0 0 1.5px rgb(var(--sign-yellow)); }
.key { padding: 0; border: 0; background: transparent; cursor: pointer; }
.key:disabled { cursor: default; opacity: 0.55; }
.key-face {
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  border-radius: 8px;
  color: #1c1612;
  background: linear-gradient(180deg, #ffd34d, #f4a300);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), 0 5px 0 #9a6700, 0 7px 0 rgb(0 0 0 / 0.3);
  transition: transform 0.1s var(--ease-out), box-shadow 0.1s var(--ease-out);
}
.key:not(:disabled):active .key-face { transform: translateY(4px); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), 0 1px 0 #9a6700, 0 2px 0 rgb(0 0 0 / 0.3); }

@media (prefers-reduced-motion: reduce) {
  .chat-led, .hangar-cloud, .ship-flame, .smoke span, .pilot-arm, .signal.is-busy i { animation: none !important; }
  .phase-open .cockpit-body, .phase-leaving .cockpit-body, .phase-open .ship, .phase-leaving .ship, .phase-open .dust, .phase-open .smoke { animation: none !important; }
  .ship-flame { opacity: 0; }
  .pilot-svg { transform: translateY(8%); }
  .bubble { opacity: 1; }
}

/* ============================================
   NOTICE BOARD: cork grain, loose pins, scraps and the red thread
   ============================================ */
.board {
  background-color: #c9a06b;
  background-image:
    radial-gradient(60% 50% at 50% 40%, rgb(255 236 200 / 0.22), transparent 70%),
    radial-gradient(circle at 30% 40%, rgb(110 70 30 / 0.45) 0 1.3px, transparent 2.2px),
    radial-gradient(circle at 72% 64%, rgb(255 232 190 / 0.5) 0 1.1px, transparent 2px),
    radial-gradient(circle at 55% 20%, rgb(90 55 25 / 0.35) 0 0.9px, transparent 1.8px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42  0 0 0 0 0.27  0 0 0 0 0.12  0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.18  0 0 0 0 0.06  0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
  background-size: auto, 23px 19px, 29px 23px, 17px 31px, 220px 220px, 600px 600px;
  background-position: 0 0, 0 0, 7px 11px, 3px 5px, 0 0, 0 0;
}
.dark .board { background-color: #6a4a2c; }

.b-loosepin {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 8%, var(--pin, #e01e5a) 10% 60%, color-mix(in srgb, var(--pin, #e01e5a) 55%, #000) 100%);
  box-shadow: 0 3px 4px rgb(0 0 0 / 0.4), 0 0 0 1px rgb(0 0 0 / 0.15);
  z-index: 0;
}
.b-scrap {
  position: absolute;
  width: 54px;
  height: 36px;
  background: #fbf6ea;
  box-shadow: 0 2px 3px rgb(0 0 0 / 0.3);
  clip-path: polygon(0 8%, 30% 0, 62% 6%, 100% 0, 96% 60%, 100% 100%, 40% 94%, 0 100%);
  z-index: 0;
  opacity: 0.9;
}
.b-scrap::after {
  content: "";
  position: absolute;
  left: 8px; right: 10px; top: 10px;
  height: 2px;
  background: rgb(28 22 18 / 0.25);
  box-shadow: 0 7px 0 rgb(28 22 18 / 0.2), 0 14px 0 rgb(28 22 18 / 0.15);
}
.b-thread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}
.b-thread path {
  fill: none;
  stroke: #d7263d;
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 1px rgb(0 0 0 / 0.35));
}
.b-thread circle { fill: #b51a2d; stroke: #fff; stroke-width: 1.5; }
