/* ---------- fonts ---------- */
/* Libron by Nico Verbruggen (OFL, see assets/fonts/libron/OFL.txt) */
@font-face { font-family: "Libron"; src: url("../assets/fonts/libron/Libron-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Libron"; src: url("../assets/fonts/libron/Libron-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libron"; src: url("../assets/fonts/libron/Libron-Bold.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Libron"; src: url("../assets/fonts/libron/Libron-BoldItalic.woff2") format("woff2"); font-weight: 600 700; font-style: italic; font-display: swap; }

/* Geist Mono by Vercel (OFL, see vendor/fonts/geist/LICENSE.txt), self-hosted */
@font-face { font-family: "Geist Mono"; src: url("../vendor/fonts/geist/GeistMono-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../vendor/fonts/geist/GeistMono-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../vendor/fonts/geist/GeistMono-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../vendor/fonts/geist/GeistMono-Bold.woff2") format("woff2"); font-weight: 700 800; font-style: normal; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --bg: #f4f2ef;
  --card: #ffffff;
  --ink: #1c1917;
  --muted: #69625b;
  --faint: #a29a91;
  --line: #e2ddd6;
  --chip: #ebe7e1;
  --accent: #b45309;
  --shade: #9fb4c7;
  --shadow: 0 1px 2px rgb(28 25 23 / 0.05), 0 8px 24px rgb(28 25 23 / 0.06);

  /* Main text font. To go back to the previous look: "Geist Sans", system-ui, sans-serif */
  --sans: "Libron", Georgia, "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --script: "Mrs Saint Delafield", "Brush Script MT", cursive;
  --bold: "Bricolage Grotesque", "Arial Black", Impact, sans-serif; /* heavy display font for big words */
  --hand: "Caveat", "Comic Sans MS", cursive;

  --night: 0; /* 1 in dark mode: the trotro switches to its night look */
  /* One glass material everywhere (nav, dock, chess cards, card pills…). Frosted by default;
     in Chromium js/theme.js adds .glass-refract and the same glass bends what's behind it.
     --glass-filter-thin is the same glass, thinner, for small pills and buttons. */
  --glass-filter: blur(10px) saturate(1.8);
  --glass-filter-thin: blur(8px) saturate(1.7);
  --glass-rim: inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -1px 0 rgb(0 0 0 / .08), inset 0 0 18px rgb(255 255 255 / .12);
  --wrap: 880px;
  --gutter: clamp(16px, 5vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --night: 1;
    --bg: #141312; --card: #1c1a19; --ink: #ece8e3; --muted: #a8a19a; --faint: #756e67;
    --line: #2d2a27; --chip: #262321; --accent: #f59e0b; --shade: #3e5468;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --night: 1;
  --bg: #141312; --card: #1c1a19; --ink: #ece8e3; --muted: #a8a19a; --faint: #756e67;
  --line: #2d2a27; --chip: #262321; --accent: #f59e0b; --shade: #3e5468;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* no sideways page scroll, only the card track scrolls */
  transition: background-color .25s, color .25s;
}
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a.placeholder { text-decoration-style: dotted; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 16px; }
section { margin-top: clamp(64px, 10vw, 112px); }

/* ---------- nav (Aikins) ---------- */
.nav-wrap { position: sticky; top: 12px; z-index: 20; padding-inline: var(--gutter); }
.nav {
  max-width: 720px; margin: 12px auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 8px 6px 18px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 16px;
}
.signature { font: 34px/1 var(--script); text-decoration: none; padding-top: 6px; white-space: nowrap; }
/* ---------- top-bar widget: wall clock or island (SITE.navWidget) ---------- */
.wallclock { display: none; position: relative; }
.nav-clock .wallclock { display: block; }
.nav-clock .island { display: none; }

.wallclock-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; border-radius: 50%; }
.clockface { display: block; overflow: visible; }
/* Nav controls share one height (--ctl) so the clock and the theme switch line up */
:root { --ctl: 36px; }
@media (max-width: 720px) { :root { --ctl: 32px; } }
.clockface.small { width: var(--ctl); height: var(--ctl); filter: drop-shadow(0 1px 2px rgb(0 0 0 / .18)); transition: transform .2s ease; }
.wallclock-btn:hover .clockface.small { transform: rotate(-4deg) scale(1.05); }
.wc-rim { fill: #2a2421; stroke: color-mix(in srgb, var(--ink) 18%, transparent); stroke-width: .8; }
.wc-face { fill: var(--card); transition: fill .4s; }
.wallclock.night .small .wc-face { fill: color-mix(in srgb, var(--card) 78%, #1e2a4a); }
.wc-tick { stroke: var(--ink); stroke-linecap: round; }
.wc-tick.m { stroke-width: .7; stroke: var(--faint); }
.wc-tick.h { stroke-width: 1.8; }
.wc-tick.q { stroke-width: 2.8; }
.small .wc-tick.h { stroke-width: 3; }
.small .wc-tick.q { stroke-width: 4.4; }
.wc-hand {
  stroke: var(--ink); stroke-linecap: round;
  transform-box: view-box; transform-origin: 50px 50px;
  transition: transform .5s ease;
}
.wc-hand.h { stroke-width: 4.2; }
.wc-hand.m { stroke-width: 2.8; }
.wc-hand.s { stroke: var(--accent); stroke-width: 1.1; transition: transform .3s cubic-bezier(.4, 2.1, .55, .45); } /* tick with a little bounce */
.small .wc-hand.h { stroke-width: 6.5; }
.small .wc-hand.m { stroke-width: 4.5; }
.small .wc-hand.s { stroke-width: 2; }
.wc-cap { fill: var(--accent); }
.no-anim .wc-hand { transition: none !important; }
.wc-brand { font: 700 4.6px var(--sans); letter-spacing: .3em; text-anchor: middle; fill: var(--muted); }
.wc-window { fill: #bfe3ff; stroke: var(--line); stroke-width: .6; }
.wc-sun { fill: #f5b301; }
.wc-moon { fill: #f3e9c6; display: none; }
.wallclock.night .wc-window { fill: #1e2a4a; }
.wallclock.night .wc-sun { display: none; }
.wallclock.night .wc-moon { display: block; }

.wallclock-pop {
  position: absolute; top: calc(100% + 14px); left: 50%; z-index: 30;
  width: 236px; padding: 18px 18px 16px; text-align: center;
  /* Nearly solid: a blur can't reach the page from inside the nav (the nav already blurs). */
  background: color-mix(in srgb, var(--card) 96%, transparent);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow), 0 20px 40px rgb(0 0 0 / .08);
  opacity: 0; transform: translate(-50%, -6px) scale(.96); transform-origin: top center;
  transition: opacity .2s ease, transform .2s ease;
}
.wallclock-pop.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.wallclock-pop[hidden] { display: none; }
/* invisible bridge so moving the mouse down to the card doesn't close it */
.wallclock-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.clockface.big { width: 150px; height: 150px; margin: 0 auto; filter: drop-shadow(0 6px 14px rgb(0 0 0 / .18)); }
.wc-place { margin-top: 12px; font-size: 17px; }
.wc-time { margin-top: 2px; font: 13px var(--mono); color: var(--muted); }
.wc-digital { color: var(--ink); }
.wc-mood { margin-top: 6px; font: 22px/1.1 var(--hand); color: var(--accent); transform: rotate(-2deg); }
.wc-mood:empty { display: none; }

/* Island pill (idea from aikins.xyz): slides rotate Based in → Local time → Theme */
.island {
  position: relative; overflow: hidden; isolation: isolate;
  width: 240px; height: 40px; padding: 0; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--card) 75%, transparent);
  -webkit-backdrop-filter: blur(16px) brightness(1.04); backdrop-filter: blur(16px) brightness(1.04);
  font-size: 13px; line-height: 1; color: var(--ink);
  transition: transform .15s ease;
}
.island:active { transform: scale(.97); }
/* Glassy shine on the top half */
.island::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(rgb(255 255 255 / .35), transparent 55%);
}
:root[data-theme="dark"] .island::before { background: linear-gradient(rgb(255 255 255 / .06), transparent 55%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .island::before { background: linear-gradient(rgb(255 255 255 / .06), transparent 55%); } }

.slide {
  position: absolute; inset: 0; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  opacity: 0; transform: translateY(40px); filter: blur(6px);
  transition: opacity .4s cubic-bezier(.2, .8, .2, 1), transform .4s cubic-bezier(.2, .8, .2, 1), filter .4s cubic-bezier(.2, .8, .2, 1);
  will-change: transform, opacity, filter;
}
.slide.in { opacity: 1; transform: none; filter: none; }
.slide.out { opacity: 0; transform: translateY(-40px); filter: blur(6px); }
.ind { display: flex; align-items: center; gap: 10px; color: var(--muted); white-space: nowrap; }
.val { display: flex; align-items: center; gap: 7px; font-weight: 500; white-space: nowrap; }
.island .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); flex: none; }
.island .dot.awake { background: #22a35a; box-shadow: 0 0 0 3px color-mix(in srgb, #22a35a 22%, transparent); }
.island .dot.awake.asleep { background: var(--faint); box-shadow: none; }
.clock { font-variant-numeric: tabular-nums; }
.theme-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
@media (prefers-reduced-motion: reduce) { .slide { transition: opacity .2s; transform: none !important; filter: none !important; } }.nav-links { display: flex; gap: 18px; padding-right: 10px; font-size: 15px; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--ink); }

/* ---------- "yawn" / "rise & shine" theme switch (js/theme.js) ---------- */
.tt-slot { flex: none; display: flex; justify-content: flex-end; }
.theme-toggle {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: var(--ctl); padding: 0 12px 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--chip); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent;
  font: 500 21px/1 var(--hand); transition: background-color .3s, border-color .3s, transform .2s;
}
.theme-toggle:hover { border-color: var(--faint); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* The two words share one spot; the current one slides out as the other slides in.
   They name the mode you're in: "rise & shine" (light), "yawn" (dark). */
/* clip-path hides the word sliding out but leaves room above for the z's */
.tt-words { position: relative; display: grid; justify-items: end; height: 1.2em; padding-top: .1em; clip-path: inset(-14px -14px 0 -4px); }
.tt-word { grid-area: 1 / 1; white-space: nowrap; transition: transform .45s cubic-bezier(.65, 0, .35, 1), opacity .3s; }
/* The hidden word is taken out of the layout so the pill fits the word on show */
.tt-yawn { position: absolute; right: 0; transform: translateY(110%); opacity: 0; }
.theme-toggle.is-dark .tt-rise { position: absolute; right: 0; transform: translateY(-110%); opacity: 0; }
.theme-toggle.is-dark .tt-yawn { position: relative; transform: none; opacity: 1; }
/* Little z's drift up from "yawn" */
.tt-z { position: absolute; right: -6px; top: -2px; font-size: 12px; opacity: 0; pointer-events: none; }
@media (hover: hover) { /* not on touch screens, where a tap leaves "hover" stuck on */
  .theme-toggle.is-dark:hover .tt-z { animation: zz 1.4s ease-out infinite; }
  .theme-toggle.is-dark:hover .tt-z:nth-child(2) { animation-delay: .7s; }
}
@keyframes zz { 0% { opacity: 0; transform: translate(0, 4px) scale(.7); } 30% { opacity: .8; } 100% { opacity: 0; transform: translate(8px, -12px) scale(1.1); } }

.tt-icon { width: 17px; height: 17px; flex: none; overflow: visible; }
.tt-sun { fill: #f7b733; stroke: #f7b733; stroke-width: 1.8; stroke-linecap: round; transform-origin: 12px 12px; transition: transform .5s cubic-bezier(.65, 0, .35, 1), opacity .3s; }
.tt-moon { fill: #8fa4d6; stroke: none; transform-origin: 12px 12px; transform: rotate(90deg) scale(.3); opacity: 0; transition: transform .5s cubic-bezier(.65, 0, .35, 1), opacity .3s; }
.theme-toggle.is-dark .tt-sun { transform: rotate(-90deg) scale(.3); opacity: 0; }
.theme-toggle.is-dark .tt-moon { transform: none; opacity: 1; }
.theme-toggle:not(.is-dark):hover .tt-rays { animation: rays 3s linear infinite; transform-origin: 12px 12px; }
.theme-toggle.is-dark:hover .tt-moon { transform: rotate(-18deg); }
@keyframes rays { to { transform: rotate(360deg); } }
/* Auto (following the device): a small dot under the switch */
.theme-toggle.is-auto::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: var(--faint);
}

/* The new theme spreads out in a circle from the switch (View Transitions; js/theme.js) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

@media (max-width: 720px) {
  .theme-toggle { padding: 0 10px 0 11px; font-size: 19px; }
  .tt-long { display: none; } /* phones: "rise" instead of "rise & shine" */
}
@media (max-width: 360px) { /* smallest phones: just the sun or moon */
  .tt-words { display: none; }
  .theme-toggle { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tt-word, .tt-moon, .tt-sun { transition: none; }
  .tt-z, .tt-rays { animation: none !important; }
}

/* ---------- hero (Uthman) ---------- */
.hero { text-align: center; margin-top: clamp(48px, 9vw, 88px); }
.block-name { width: min(100%, 560px); margin-inline: auto; }
.block-svg { display: block; width: 100%; height: auto; shape-rendering: crispEdges; }
.block-svg .ink rect { fill: var(--ink); }
.block-svg .shade rect { fill: var(--shade); opacity: .55; }
.role {
  margin-top: 28px; display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px;
  font: 500 13px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.stack-chips { display: inline-flex; gap: 6px; letter-spacing: 0; text-transform: none; }
.chip { padding: 4px 8px; border-radius: 6px; background: var(--chip); color: var(--ink); font-size: 12px; }
.pitch { margin: 22px auto 0; max-width: 42rem; text-wrap: balance; font: 15.5px/1.75 var(--mono); color: var(--ink); }
.pitch p:last-child { color: var(--muted); }
.hero-links { margin-top: 26px; display: flex; justify-content: center; gap: 12px; font: 15px var(--mono); }
.hero-links span { color: var(--faint); }
.socials { display: flex; gap: 18px; justify-content: center; margin-top: 22px; font-size: 14px; }
.socials a { color: var(--muted); }

/* ---------- signature writing itself (js/signature.js) ---------- */
.hero-title { position: relative; width: min(100%, 400px); margin-inline: auto; }
/* The portrait stands behind the name; its lower half fades into the page so the letters stay readable */
.hero-portrait { display: block; width: min(320px, 64vw); margin: 0 auto; }
.hero-portrait img {
  display: block; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 52%, rgb(0 0 0 / .35) 76%, transparent 94%);
  mask-image: linear-gradient(to bottom, #000 52%, rgb(0 0 0 / .35) 76%, transparent 94%);
}
.hero-portrait + .block-name { position: relative; z-index: 1; margin-top: calc(-1 * min(150px, 30vw)); }
/* Sized by height, so tall and wide signatures both fit their spot */
.sig-anim .sig-svg { display: block; height: 100%; width: auto; max-width: 100%; margin-inline: auto; overflow: visible; }
.sig-anim path { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
/* Stroke widths below are in the signature's own drawing units (no non-scaling-stroke: it breaks the dash-based writing animation). */
/* Hero: signs off the pitch text, small and slightly slanted, on empty background */
.sig-hero { height: 86px; width: min(240px, 60%); margin: 10px auto 0; transform: rotate(-5deg); pointer-events: none; }
.sig-hero path { stroke-width: 3.2; }
@media (max-width: 720px) { .sig-hero { height: 70px; } }/* Footer: smaller, signing off the page */
.sig-footer { height: 110px; width: min(320px, 70%); margin-top: 18px; transform: rotate(-4deg); transform-origin: left center; }
.sig-footer .sig-svg { margin-inline: 0; }
.sig-footer path { stroke-width: 3; }
/* Trotro page: signs off the intro, left-aligned */
.sig-intro { height: 74px; width: min(220px, 60%); margin-top: 12px; transform: rotate(-5deg); transform-origin: left center; pointer-events: none; }
.sig-intro .sig-svg { margin-inline: 0; }
.sig-intro path { stroke-width: 3.2; }

/* ---------- topographic lines behind everything (js/scenes.js) ---------- */
.topo { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.topo path { fill: none; stroke: var(--ink); stroke-width: 1; opacity: .07; stroke-linecap: round; }

/* ---------- colour shift while the chess board is centre stage ---------- */
:root.scene-dark {
  --bg: #23261d; --card: #2c3025; --ink: #ecebe3; --muted: #b4b2a2; --faint: #858372;
  --line: #3b3f31; --chip: #33372b; --accent: #d9a441; --shade: #4a5340;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  color-scheme: dark;
}
body { transition: background-color .7s ease, color .7s ease; }
.no-scene-fade body { transition: none; }

/* ---------- "Next up" card, bottom-left (idea from landonorris.com) ---------- */
.nextup {
  --cut: 18px;
  position: fixed; left: 16px; bottom: 20px; z-index: 15; width: 196px;
  transition: opacity .3s ease, transform .3s ease;
}
.nextup[hidden] { display: none; }
.nextup.away { opacity: 0; transform: translateY(12px); pointer-events: none; }
.nextup-label {
  font: 600 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 4px 2px;
}
/* Card with a notched top-right corner: an outer shape in the border colour, inner shape in card colour */
.nextup-link {
  position: relative; display: grid; gap: 4px; padding: 14px 16px 14px 30px; text-decoration: none; color: var(--ink);
  background: var(--card);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .2s ease;
}
.nextup-link::after { /* the diagonal edge of the notch */
  content: ""; position: absolute; top: 0; right: 0; width: calc(var(--cut) * 1.42); height: 1px; background: var(--line);
  transform-origin: right top; transform: rotate(45deg);
}
.nextup-link:hover { transform: translateY(-2px); color: var(--ink); }
.nextup-title { font: 700 15px/1.2 var(--sans); }
.nextup-note { font: 12px/1.35 var(--mono); color: var(--muted); }
.nextup-pulse {
  position: absolute; left: 13px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: #22a35a;
  box-shadow: 0 0 0 0 rgb(34 163 90 / .5); animation: pulse 2s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgb(34 163 90 / 0); } 100% { box-shadow: 0 0 0 0 rgb(34 163 90 / 0); } }
.nextup-close {
  position: absolute; top: -4px; right: 0; border: 0; background: none; color: var(--faint);
  font-size: 18px; line-height: 1; padding: 2px 4px; opacity: 0; transition: opacity .2s;
}
.nextup:hover .nextup-close, .nextup-close:focus-visible { opacity: 1; }
@media (max-width: 720px) { .nextup { display: none !important; } } /* no room on phones */
@media (prefers-reduced-motion: reduce) { .nextup-pulse { animation: none; } }

/* ---------- two-font headings (idea from landonorris.com) ---------- */
/* Thin serif line on top, heavy bold line underneath: "What I'm / BUILDING" */
.duo { display: flex; flex-direction: column; line-height: .92; letter-spacing: -.02em; }
.duo .duo-serif { font: 400 clamp(30px, 4.4vw, 52px)/.95 var(--sans); }
.duo .duo-bold {
  font: 800 clamp(38px, 6vw, 76px)/.9 var(--bold);
  text-transform: uppercase; letter-spacing: -.035em;
}
.section-head .duo { margin-right: auto; }
.chess-head .duo { align-items: center; }
.chess-head .duo .duo-bold { font-size: clamp(34px, 5vw, 60px); }
.footer-duo { margin-bottom: 14px; }
.footer-duo .duo-serif { color: var(--muted); }

/* ---------- On / Off the keyboard (idea from landonorris.com) ---------- */
.onoff-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 5vw, 64px); }
.onoff-side {
  display: grid; align-content: start; gap: 12px; text-decoration: none; color: var(--ink);
  padding: 8px 0;
}
.onoff-side.on { justify-items: end; text-align: right; }
.onoff-side.on .duo { align-items: flex-end; }
.onoff-side:hover { color: var(--ink); }
.onoff-text { max-width: 30ch; color: var(--muted); font-size: 16px; }
.onoff-go {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent); color: var(--bg); font-size: 20px; transition: transform .2s ease;
}
.onoff-side:hover .onoff-go { transform: translateY(3px); }

/* The photos' own title, set apart from the On / Off split above */
.snaps-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  margin-top: clamp(64px, 9vw, 112px); padding-top: clamp(28px, 4vw, 40px); border-top: 1px solid var(--line);
}
.snaps-note { color: var(--muted); font-size: 16px; max-width: 30ch; }
.snaps-head + .scrapbook { margin-top: clamp(44px, 5vw, 56px); }

/* Scattered photos on a 12-column grid, each drifting at its own speed */
.scrapbook {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 56px 20px; align-items: start;
  width: min(1120px, 100% - 2 * var(--gutter)); margin: clamp(48px, 7vw, 88px) auto 0;
  padding-bottom: 60px;
}
.snap {
  grid-column: var(--col) / span var(--span); margin: 0;
  transform: translateY(calc(var(--nudge, 0px) + var(--drift, 0px)));
  will-change: transform;
}
.snap figcaption { font: 600 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.snap img { display: block; width: 100%; object-fit: cover; border-radius: 4px; }
.photo-empty {
  display: grid; place-items: center; align-content: center; gap: 6px; width: 100%;
  border: 1px dashed var(--faint); border-radius: 4px; color: var(--faint);
  background: color-mix(in srgb, var(--card) 50%, transparent);
}
.photo-empty span { font-size: 26px; line-height: 1; }
.photo-empty small { font: 11px var(--mono); letter-spacing: .06em; }
.snap-quote {
  grid-column: 8 / span 4; margin: 0; align-self: center;
  transform: translateY(var(--drift, 0px));
}
.snap-quote p { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.3; }
.sig-mini { height: 46px; width: 140px; margin-top: 12px; }
.sig-mini .sig-svg { margin-inline: 0; }
.sig-mini path { stroke-width: 3.4; }
@media (max-width: 720px) {
  /* Phones: keep On and Off side by side, mirrored across a thin divider (like the desktop layout) */
  .onoff-split { grid-template-columns: 1fr 1fr; gap: 0; }
  .onoff-side { gap: 10px; }
  .onoff-side.on { padding-right: 14px; border-right: 1px solid var(--line); }
  .onoff-side.off { padding-left: 14px; }
  .onoff-side .duo-serif { font-size: clamp(18px, 5.6vw, 26px); }
  .onoff-side .duo-bold { font-size: clamp(21px, 7vw, 32px); }
  .onoff-text { font-size: 13.5px; line-height: 1.45; }
  .onoff-go { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
  /* Phones: two staggered columns instead of the scattered layout */
  .scrapbook { grid-template-columns: 1fr 1fr; gap: 28px 14px; }
  .snap, .snap-quote { grid-column: auto / span 1; --nudge: 0px; }
  .snap:nth-child(even) { margin-top: 40px; }
  .snap-quote { grid-column: 1 / -1; }
}

/* ---------- moving text bands ---------- */
.marquee { overflow: hidden; margin-top: clamp(56px, 8vw, 96px); padding: 6px 0; user-select: none; }
.marquee + .footer { margin-top: clamp(40px, 6vw, 72px); }
.marquee-row { overflow: hidden; }
.marquee-track {
  display: flex; align-items: center; gap: .45em; width: max-content;
  font-size: clamp(34px, 6vw, 84px); line-height: 1.05; white-space: nowrap;
  animation: marquee 60s linear infinite;
}
.marquee-row.reverse .marquee-track { animation-direction: reverse; animation-duration: 70s; }
/* Pause on mouse hover only: on touch screens a tap leaves "hover" stuck on, which froze the bands */
@media (hover: hover) and (pointer: fine) { .marquee:hover .marquee-track { animation-play-state: paused; } }
.mq-serif { font-family: var(--sans); font-weight: 400; color: var(--accent); }
.mq-bold { font: 800 1em var(--bold); text-transform: uppercase; letter-spacing: -.035em; color: var(--ink); }
.mq-dot { font-size: .35em; color: var(--faint); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- section heads ---------- */
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.section-head h2, .plain-head { font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.hint { color: var(--muted); font-size: 14px; transition: opacity .3s; }
.hint.gone { opacity: 0; }
.mono-head { font: 700 16px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.mono-head .count { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--faint); font-size: 13px; margin-left: 6px; }

/* ---------- featured cards (Aikins): picture first, a small pill for the name ---------- */
.card-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(520px, 84vw);
  gap: 18px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 6px max(var(--gutter), (100vw - var(--wrap)) / 2) 22px;
  scroll-padding-inline: max(var(--gutter), (100vw - var(--wrap)) / 2);
  scrollbar-width: none; /* the peeking next card says "swipe"; no scrollbar needed */
}
.card-track::-webkit-scrollbar { display: none; }
.card-track:focus-visible { outline-offset: -2px; }
.card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 12px; }
.card-link { display: block; color: inherit; text-decoration: none; border-radius: 18px; }
.card-media {
  position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 18px;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover .card-media { transform: translateY(-3px); }
.card-media > .shot, .card-media > .mock { position: absolute; inset: 0; width: 100%; height: 100%; }
.shot { object-fit: cover; object-position: top; }
.card-pill {
  position: absolute; right: 12px; bottom: 12px; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px 7px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 86%, transparent); border: 1px solid var(--line);
  -webkit-backdrop-filter: var(--glass-filter-thin); backdrop-filter: var(--glass-filter-thin);
  box-shadow: var(--glass-rim), 0 4px 14px rgb(0 0 0 / .14);
  font: 600 13.5px var(--sans); color: var(--ink);
}
.card-dot { width: 7px; height: 7px; border-radius: 50%; }
.card-dot.live { background: #22a35a; box-shadow: 0 0 0 3px rgb(34 163 90 / .18); }
.card-dot.wip { background: #f59e0b; box-shadow: 0 0 0 3px rgb(245 158 11 / .2); }
.card-go { color: var(--muted); transition: transform .2s; }
.card-link:hover .card-go { transform: translate(2px, -2px); color: var(--ink); }
.card-line {
  padding: 0 4px; color: var(--muted); font-size: 14.5px; line-height: 1.45;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

/* Stand-in pictures until there's a screenshot: tinted per project */
.mock {
  overflow: hidden; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 90% at 100% 0%, hsl(var(--h) 70% 60% / .22), transparent 60%),
    radial-gradient(90% 80% at 0% 100%, hsl(calc(var(--h) + 50) 70% 55% / .16), transparent 60%),
    var(--bg);
}
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--card) 70%, transparent); }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.mock-bar span { margin-left: 8px; font: 11px var(--mono); color: var(--faint); }
.mock-bar .url { flex: 1; height: 16px; margin-left: 10px; border-radius: 999px; background: var(--chip); }
/* terminal */
.mock-terminal { background: radial-gradient(120% 90% at 100% 0%, hsl(var(--h) 60% 45% / .25), transparent 60%), #111312; }
.mock-terminal .mock-bar { background: #1a1c1b; border-color: #2a2d2b; }
.mock-terminal .mock-bar i { background: #3a3d3b; }
.term { flex: 1; display: grid; align-content: center; gap: 10px; padding: 0 clamp(18px, 6%, 34px); font: 13.5px/1.5 var(--mono); color: #d8d6cf; }
.term b { color: #4be37f; font-weight: 400; }
.term-out { color: #9a988f; }
.cursor { display: inline-block; width: 8px; height: 15px; vertical-align: -2px; background: #d8d6cf; animation: blinkc 1.1s steps(2, start) infinite; }
@keyframes blinkc { 50% { opacity: 0; } }
/* phone */
.mock-phone-wrap { align-items: center; justify-content: flex-end; padding-top: 22px; }
.mock-phone {
  width: min(46%, 190px); height: 108%; margin-bottom: -18%; padding: 26px 12px 0; display: flex; flex-direction: column; gap: 9px;
  border-radius: 26px; border: 6px solid #1c1b1a; background: var(--card); box-shadow: 0 18px 40px rgb(0 0 0 / .25);
  position: relative;
}
.phone-notch { position: absolute; top: 6px; left: 50%; width: 38%; height: 9px; margin-left: -19%; border-radius: 9px; background: #1c1b1a; }
.phone-title { font: 700 14px/1.15 var(--sans); }
.phone-search { padding: 7px 10px; border-radius: 9px; background: var(--chip); font: 11px var(--mono); color: var(--faint); }
.phone-row { display: flex; align-items: center; gap: 8px; }
.phone-row i { width: 22px; height: 22px; border-radius: 7px; background: hsl(var(--h) 60% 55% / .35); flex: none; }
.phone-row span { height: 8px; border-radius: 4px; background: var(--line); }
.phone-btn { height: 26px; margin-top: 4px; border-radius: 9px; background: hsl(var(--h) 65% 50%); }
/* browser */
.web { flex: 1; display: grid; align-content: center; gap: 14px; padding: 0 clamp(18px, 7%, 40px); }
.web-head { font: 600 clamp(19px, 3.4vw, 26px)/1.15 var(--sans); letter-spacing: -.02em; max-width: 20ch; }
.web-lines { display: grid; gap: 7px; }
.web-lines span { height: 8px; border-radius: 4px; background: var(--line); }
.web-lines span:last-child { width: 70%; }
.web-btn { width: 120px; height: 30px; border-radius: 8px; background: var(--ink); }
@media (max-width: 720px) {
  .card-media { aspect-ratio: 4 / 5; } /* taller on phones, like Aikins */
  .web-head { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }
.visit { font-size: 14px; white-space: nowrap; }
.muted { color: var(--faint); }
.status {
  font: 500 11px var(--mono); color: var(--accent);
  border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px;
}
/* ---------- chess: centered, floating, controls on demand ---------- */
.chess { --glass: color-mix(in srgb, var(--card) 55%, transparent); --glass-line: color-mix(in srgb, var(--line) 85%, transparent);
  width: min(980px, 100% - 2 * var(--gutter)); margin-inline: auto; text-align: center; }

/* Frosted glass: anything sitting over the board blurs what's behind it. */
.chess-head, .chess-status, .chess-buttons button, .chess-extra, .chess-level, .chess-type input {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--glass-filter-thin);
  backdrop-filter: var(--glass-filter-thin);
  box-shadow: var(--glass-rim);
}
/* The bigger panes over the board get the full-thickness glass */
.chess-head, .chess-extra { -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter); }
.chess-extra { box-shadow: var(--glass-rim), var(--shadow); }
/* UI stays above the canvas so the board can spin underneath it. */
.chess-head, .chess-hud, .chess-extra { position: relative; z-index: 2; }

.chess-head { display: inline-block; padding: 12px 24px 14px; border-radius: 20px; }
.chess-head h2 { font-size: clamp(24px, 3.6vw, 32px); font-weight: 500; letter-spacing: -.02em; }
.chess-intro { margin-top: 4px; color: var(--muted); font-size: 15px; }

/* No box, no clipping: the board floats on the page, and slides under the heading when spun. */
.chess-stage { position: relative; z-index: 1; width: 100%; aspect-ratio: 16 / 11; margin-top: clamp(-64px, -6vw, -24px); }
.chess-stage canvas {
  display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y;
  /* Fade the canvas edges so a spun board melts away instead of being cut off in a straight line. */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 90%, transparent), linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 90%, transparent), linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-composite: intersect;
}
.chess-stage canvas:active { cursor: grabbing; }
.chess-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: var(--muted); }

.chess-hud { display: grid; justify-items: center; gap: 12px; margin-top: clamp(-56px, -5vw, -16px); }
.chess-status { font: 500 14px var(--mono); padding: 6px 14px; border-radius: 999px; }
.chess-buttons {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s;
}
/* Show the controls when someone is using the board. */
.chess:hover .chess-buttons, .chess:focus-within .chess-buttons, .chess.engaged .chess-buttons { opacity: 1; transform: none; }
@media (hover: none) { .chess-buttons { opacity: 1; transform: none; } }
.chess-buttons button, .chess-extra button, .chess-level {
  padding: 7px 16px; border-radius: 999px; font-size: 14px; color: var(--ink);
}
.chess-extra button { background: var(--card); border: 1px solid var(--line); }
.chess-buttons button:hover, .chess-extra button:hover { border-color: var(--faint); }
.chess-buttons button:disabled { opacity: .45; cursor: default; }
.chess-more[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chess-level { appearance: auto; font-family: var(--sans); }

.chess-extra {
  max-width: 420px; margin: 14px auto 0; padding: 16px;
  border-radius: 16px; box-shadow: var(--shadow);
  text-align: left; display: grid; gap: 12px;
}
.chess-extra[hidden] { display: none; }
.chess-extra-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chess-type { display: flex; gap: 8px; }
.chess-type input {
  flex: 1; min-width: 0; padding: 8px 14px; border-radius: 999px;
  color: var(--ink); font: 14px var(--mono);
}
.chess-moves {
  max-height: 150px; overflow-y: auto;
  list-style: decimal; padding-left: 2.4em;
  font: 13.5px/1.8 var(--mono); color: var(--muted); white-space: pre;
  columns: 2; column-gap: 24px;
}
.chess-moves:empty { display: none; }

/* Tip pop-up: frosted card that floats over the side of the board */
.chess-tip {
  position: absolute; z-index: 3; top: 14%; right: 0; width: min(310px, 42%);
  padding: 14px 16px 10px; border-radius: 16px; text-align: left;
  background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  box-shadow: var(--glass-rim), var(--shadow);
  opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .25s ease, transform .25s ease;
}
.chess-tip.show { opacity: 1; transform: none; }
.chess-tip[hidden] { display: none; }
.tip-kind { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.tip-text { margin-top: 6px; font-size: 16px; line-height: 1.5; }
.tip-by { margin-top: 4px; font-size: 14px; font-style: italic; color: var(--muted); }
.tip-by:empty { display: none; }
.tip-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.tip-actions button { border: 0; background: none; color: var(--faint); font-size: 13px; padding: 4px 0; }
.tip-actions button:hover { color: var(--ink); }
.tip-close { font-size: 20px !important; line-height: 1; padding: 0 4px !important; }
@media (max-width: 720px) {
  .chess-tip { top: auto; bottom: 0; left: 0; right: 0; width: auto; }
}
/* ---------- honest bit (Uthman) ---------- */
.honest {
  max-width: 600px; padding: 24px 26px;
  border: 1px dashed var(--faint); border-radius: 6px;
  background: color-mix(in srgb, var(--card) 45%, transparent);
  font: 15.5px/1.75 var(--mono);
}
.honest-label {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.honest-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.honest-body { display: grid; gap: 14px; }
.honest .aside { font-style: italic; color: var(--muted); }
/* Photo pinned beside the note: a polaroid with a strip of tape */
.honest-wrap { display: grid; grid-template-columns: minmax(0, 600px); gap: 34px; align-items: center; }
.honest-wrap:has(.honest-photo:not([hidden])) { grid-template-columns: 230px minmax(0, 600px); }
.honest-photo {
  position: relative; margin: 0; padding: 10px 10px 34px; background: #fbf8f1;
  box-shadow: 0 2px 4px rgb(0 0 0 / .12), 0 18px 34px -12px rgb(0 0 0 / .35); transform: rotate(-3deg);
  transition: transform .3s ease;
}
.honest-photo:hover { transform: rotate(-1deg) translateY(-3px); }
.honest-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; }
.honest-photo::before { /* the tape */
  content: ""; position: absolute; left: 50%; top: -12px; width: 86px; height: 24px; transform: translateX(-50%) rotate(4deg);
  background: rgb(242 236 220 / .78); box-shadow: 0 1px 2px rgb(0 0 0 / .12);
}
@media (max-width: 720px) {
  .honest-wrap:has(.honest-photo:not([hidden])) { grid-template-columns: 1fr; justify-items: center; }
  .honest-photo { width: min(220px, 62%); }
}

/* ---------- project list (Uthman) ---------- */
.project-list { margin-top: 18px; border-top: 1px solid var(--line); }
.project {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 14px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.num { font: 12px/2 var(--mono); color: var(--faint); }
.project h3 { font: 600 16px var(--mono); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.project-main > p { margin-top: 6px; font: 14.5px/1.7 var(--mono); color: var(--muted); }
.project .metric { color: var(--ink); }
.project .metric::before { content: "→ "; color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tags li { font: 11.5px var(--mono); padding: 3px 8px; border-radius: 4px; background: var(--chip); }
.project-links { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font: 13px var(--mono); white-space: nowrap; }

/* ---------- teams (Aikins) ---------- */
.team-row { display: flex; flex-wrap: wrap; gap: 12px 36px; margin-top: 18px; color: var(--muted); font-size: 17px; font-weight: 500; }

/* ---------- writing (Uthman) ---------- */
.writing-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.seg { display: flex; gap: 4px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font: 13px var(--mono); color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.post { display: flex; justify-content: space-between; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); }
.post h3 { font-size: 16px; font-weight: 500; }
.post h3 a { text-decoration: none; }
.post h3 a::after { content: ""; position: absolute; inset: 0; } /* whole row clickable */
.post { position: relative; }
.post p { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.post .post-meta { color: var(--faint); font-size: 12.5px; }
.read { font-size: 13px; white-space: nowrap; }
.post:hover .read, .post:hover h3 { color: var(--accent); }
.all-posts { display: inline-block; margin-top: 18px; font: 14px var(--mono); }
.empty { padding: 24px 0; color: var(--muted); font-family: var(--mono); }

/* ---------- footer ---------- */
.footer { margin-top: clamp(80px, 12vw, 140px); padding: 40px 0 120px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-family: var(--mono); }
.footer p { color: var(--muted); font-size: 14px; }
.footer .email { font-size: clamp(18px, 3.4vw, 26px); width: fit-content; }
.footer .socials { justify-content: flex-start; margin-top: 18px; }

/* ---------- floating resume button (Uthman) ---------- */
.cv-float { position: fixed; right: 20px; bottom: 24px; z-index: 15; display: flex; align-items: center; gap: 10px; }
.cv-note { font: 20px/1 var(--hand); color: var(--muted); transform: rotate(-4deg); }
.cv-btn {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink);
  transition: transform .2s;
}
.cv-btn:hover { transform: translateY(-2px); }

/* ---------- wall: a chessboard of signed squares ---------- */
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--chip); padding: 6px 10px; border-radius: 10px; }
.wall-page {
  /* Board squares. Dark squares use the chess section's olive in both themes. */
  --sq-light: var(--card); --sq-light-ink: var(--ink);
  --sq-dark: #23261d; --sq-dark-ink: #ecebe3; --sq-dark-muted: #b4b2a2; --sq-gold: #d9a441;
}
/* Dark theme: light squares turn cream so the board still reads as a board */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wall-page { --sq-light: #e6e3d8; --sq-light-ink: #1c1917; }
  :root:not([data-theme="light"]) .note:not(.dark) { --muted: #6b665c; --faint: #9a958a; --accent: #9a4f0c; }
}
:root[data-theme="dark"] .wall-page { --sq-light: #e6e3d8; --sq-light-ink: #1c1917; }
:root[data-theme="dark"] .note:not(.dark) { --muted: #6b665c; --faint: #9a958a; --accent: #9a4f0c; }
.wall-top {
  --wrap: 1120px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: clamp(28px, 6vw, 80px);
  align-items: start; margin-top: clamp(48px, 8vw, 88px);
}
.wall-intro .duo .duo-bold { font-size: clamp(56px, 10vw, 128px); }
.lede { margin-top: 18px; max-width: 34ch; color: var(--muted); font-size: 18px; }
.wall-count { margin-top: 28px; display: flex; align-items: baseline; gap: 10px; }
.wall-count-n { font: 800 clamp(44px, 6vw, 64px)/1 var(--bold); color: var(--accent); letter-spacing: -.03em; }
.wall-count-label { font: 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* The form is a sign-in sheet: a notched card (same notch as the "Now building" card), ruled lines, a signing line */
.sign-sheet {
  --cut: 26px;
  position: relative; display: grid; gap: 18px; padding: 26px 26px 22px;
  background: var(--card);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.sign-sheet::after {
  content: ""; position: absolute; top: 0; right: 0; width: calc(var(--cut) * 1.42); height: 1px; background: var(--line);
  transform-origin: right top; transform: rotate(45deg);
}
.sheet-label, .line-label { font: 600 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sheet-no { color: var(--faint); font-weight: 400; letter-spacing: .06em; text-transform: none; }
.line-field { display: grid; gap: 4px; }
.line-field input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; border-radius: 0;
  padding: 6px 0 10px; font: 18px var(--sans); color: var(--ink); outline: none; transition: border-color .2s;
}
.line-field input::placeholder { color: var(--faint); }
.line-field input:focus { border-bottom-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pad-wrap { display: grid; gap: 6px; }
.pad-head { display: flex; justify-content: space-between; align-items: center; }
.pad-head .muted { color: var(--faint); font-weight: 400; letter-spacing: .06em; text-transform: none; }
.pad-clear { border: 0; background: none; color: var(--muted); font: 12px var(--mono); padding: 4px 6px; border-radius: 6px; }
.pad-clear:hover { color: var(--ink); }
.pad-area {
  position: relative; border-radius: 4px;
  background: repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in srgb, var(--line) 35%, transparent) 10px 11px);
}
.pad { display: block; width: 100%; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; position: relative; z-index: 1; }
.pad-area::after { /* the line you sign on */
  content: ""; position: absolute; left: 34px; right: 14px; bottom: 22%; height: 1.5px; background: var(--ink); opacity: .55;
}
.pad-x { position: absolute; left: 12px; bottom: calc(22% - 4px); font: 22px/1 var(--sans); color: var(--muted); }
.pad-preview {
  position: absolute; left: 34px; right: 14px; bottom: calc(22% + 2px);
  font: 52px/1 var(--script); color: var(--faint); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.pad.has-ink + .pad-preview { visibility: hidden; }
.pad-hint { font: 12px/1.45 var(--mono); color: var(--muted); }

.form-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sign-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border: 0; border-radius: 0;
  background: var(--ink); color: var(--bg); font: 800 14px var(--bold); letter-spacing: .02em; text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: background-color .2s, transform .2s;
}
.sign-btn:hover { background: var(--accent); transform: translateY(-1px); }
.sign-btn span { transition: transform .2s; }
.sign-btn:hover span { transform: translateX(3px); }
.sign-btn:disabled { opacity: .6; cursor: wait; }
.form-status { font-size: 14px; color: var(--muted); }
.fine { font: 12px var(--mono); color: var(--faint); }

/* The board: square tiles, light and dark like a chessboard (js/wall.js sets .dark) */
.wall-board { margin-top: clamp(64px, 9vw, 104px); padding: 0 var(--gutter) 120px; }
.notes {
  max-width: 1120px; margin-inline: auto; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  border: 1px solid var(--line);
}
.notes .empty { grid-column: 1 / -1; padding: 40px 24px; text-align: center; }
.note { aspect-ratio: 1; min-height: 0; background: var(--sq-light); color: var(--sq-light-ink); }
.note.dark { background: var(--sq-dark); color: var(--sq-dark-ink); --muted: var(--sq-dark-muted); --faint: #858372; --accent: var(--sq-gold); }
.note-tile {
  height: 100%; display: grid; grid-template-rows: auto 1fr auto auto; gap: 6px;
  padding: 16px 18px 16px; overflow: hidden; transition: transform .25s ease;
}
.note:not(.note-fill):hover .note-tile { transform: translateY(-3px); }
.note-fill .note-head span { color: var(--faint); }
.take { display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: inherit; }
.take-text { align-self: end; font: 800 18px/1.1 var(--bold); text-transform: uppercase; letter-spacing: -.01em; color: var(--accent); }
.take-text span { display: inline-block; transition: transform .2s; }
.take:hover .take-text span { transform: translateY(-3px); }
.note-head { display: flex; justify-content: space-between; gap: 8px; font: 11px var(--mono); letter-spacing: .06em; color: var(--muted); }
.note-head span { color: var(--accent); }
.note-msg {
  margin-top: 6px; font-size: 16.5px; line-height: 1.4; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden;
}
.sig-typed { font: 42px/1.1 var(--script); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-drawn { display: block; width: 72%; height: auto; max-height: 64px; }
.sig-drawn path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.note-who { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.note-who::before { content: "— "; }

@media (max-width: 860px) {
  .wall-top { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .note-tile { padding: 12px; }
  .note { aspect-ratio: auto; min-height: 190px; } /* phones: let squares grow so the message fits */
  .note-msg { font-size: 14.5px; -webkit-line-clamp: 8; }
  .note-head time { display: none; }
  .sig-typed { font-size: 32px; }
}

/* ---------- wall, map style: every note is a pin on a contour map (js/wall-map.js) ---------- */
.wall-map { --wrap: 1120px; margin-top: clamp(56px, 8vw, 96px); padding-bottom: 120px; }
.wall-map[hidden], .wall-board[hidden] { display: none; }
.map {
  --cut: 30px;
  position: relative; aspect-ratio: 16 / 9; max-height: 78vh; width: 100%;
  background: color-mix(in srgb, var(--card) 70%, var(--bg));
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.map::after { /* diagonal edge of the notch */
  content: ""; position: absolute; top: 0; right: 0; width: calc(var(--cut) * 1.42); height: 1px; background: var(--line);
  transform-origin: right top; transform: rotate(45deg);
}
.map-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-lines path { fill: none; stroke: var(--ink); stroke-linecap: round; }
.map-lines .grid { stroke-width: .5; opacity: .07; stroke-dasharray: 2 4; }
.map-lines .minor { stroke-width: .8; opacity: .14; }
.map-lines .major { stroke-width: 1.4; opacity: .3; }
.tick { position: absolute; font: 9.5px var(--mono); letter-spacing: .04em; color: var(--faint); pointer-events: none; }
.tick.lat { left: 8px; transform: translateY(-50%); }
.tick.lon { bottom: 6px; transform: translateX(-50%); }

.pins { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.pins li { position: absolute; left: var(--x); top: var(--y); }
.pin {
  position: absolute; left: 0; top: 0; transform: translate(-9px, -9px);
  display: flex; align-items: center; gap: 7px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer;
}
.pins li.left .pin { flex-direction: row-reverse; transform: translate(calc(-100% + 9px), -9px); }
.pin-dot {
  position: relative; width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: color-mix(in srgb, var(--accent) 18%, transparent); box-shadow: inset 0 0 0 1.5px var(--accent);
  transition: transform .2s ease;
}
.pin-dot::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--accent); }
.pin-name {
  font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  padding: 2px 6px; border-radius: 3px; background: color-mix(in srgb, var(--bg) 82%, transparent);
}
.pin:hover .pin-dot, .pin:focus-visible .pin-dot, .pin[aria-expanded="true"] .pin-dot { transform: scale(1.25); }
.pin[aria-expanded="true"] .pin-name { background: var(--ink); color: var(--bg); }
.pin.newest .pin-dot::before {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; box-shadow: 0 0 0 0 var(--accent);
  animation: pin-ping 2.2s ease-out infinite;
}
@keyframes pin-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.pin.yours .pin-dot { background: none; box-shadow: none; outline: 1.5px dashed var(--muted); outline-offset: -1.5px; }
.pin.yours .pin-dot::after { display: none; }
.pin.yours .pin-name { color: var(--muted); font-style: italic; text-transform: none; letter-spacing: .04em; }
.map.crowded .pin:not(:hover):not(:focus-visible):not([aria-expanded="true"]):not(.yours) .pin-name { display: none; }

.map-card {
  --cut: 16px;
  position: absolute; z-index: 3; left: var(--x); top: var(--y); width: min(290px, 80%);
  transform: translate(18px, -24px);
  padding: 14px 16px 14px; display: grid; gap: 6px;
  background: var(--card); color: var(--ink);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px var(--line);
  filter: drop-shadow(0 10px 24px rgb(0 0 0 / .18));
  animation: card-in .18s ease-out;
}
.map-card[hidden] { display: none; }
.map-card.peek { pointer-events: none; }
.map-card.peek .map-card-close { visibility: hidden; }
.map-card.flip-x { transform: translate(calc(-100% - 18px), -24px); }
.map-card.flip-y { transform: translate(18px, calc(-100% + 24px)); }
.map-card.flip-x.flip-y { transform: translate(calc(-100% - 18px), calc(-100% + 24px)); }
@keyframes card-in { from { opacity: 0; } }
.map-card-head { display: flex; justify-content: space-between; font: 11px var(--mono); letter-spacing: .06em; color: var(--muted); padding-right: 18px; }
.map-card-head span { color: var(--accent); }
.map-card-msg { font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.map-card .sig-drawn { width: 62%; max-height: 56px; }
.map-card .sig-typed { font-size: 38px; }
.map-card-who { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.map-card-who::before { content: "— "; }
.map-card-where { font: 10.5px var(--mono); color: var(--faint); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }
.map-card-close { position: absolute; top: 6px; right: 6px; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 8px; }
.map-card-close:hover { color: var(--ink); }

.map-legend {
  position: absolute; right: 16px; bottom: 22px; display: flex; align-items: center; gap: 14px;
  font: 600 10px var(--mono); letter-spacing: .12em; color: var(--muted); pointer-events: none;
}
.compass { display: inline-flex; align-items: center; gap: 4px; }
.compass svg { width: 16px; height: 16px; }
.compass path { fill: var(--accent); }
.compass path.s { fill: none; stroke: var(--muted); stroke-width: 1.2; }
.scale { display: inline-flex; align-items: center; gap: 6px; }
.scale .bar { width: 56px; height: 5px; border: 1px solid var(--muted); border-top: 0; background: linear-gradient(90deg, var(--muted) 50%, transparent 50%) bottom / 100% 2px no-repeat; }
.map-hint { margin-top: 12px; font: 12px var(--mono); color: var(--faint); }

@media (max-width: 640px) {
  .map { aspect-ratio: 4 / 5; max-height: none; }
  .tick.lon:nth-child(4n) { display: none; }
  /* Phones: the note opens as a sheet across the bottom of the map */
  .map-card, .map-card.flip-x, .map-card.flip-y, .map-card.flip-x.flip-y {
    left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; transform: none;
  }
  .map-legend { bottom: auto; top: 12px; right: 40px; }
}
@media (prefers-reduced-motion: reduce) { .pin.newest .pin-dot::before { animation: none; } }


/* ---------- trotro style: the form is a passenger ticket (js/wall.js adds .ticket) ---------- */
.ticket-head, .ticket-stamp, .ticket-preview { display: none; }
.sign-form.ticket {
  /* Paper in both themes, like the van: its own ink colours */
  --ink: #1f1b16; --muted: #6a6055; --faint: #a09484; --line: #d9cdb6; --accent: #c4231a;
  --hole: 7px; --gap: 22px;
  color: var(--ink); padding: 26px 30px 22px;
  background:
    radial-gradient(circle at 20% 10%, rgb(255 255 255 / .55), transparent 50%),
    linear-gradient(180deg, #fbf5e6, #f3ead3);
  clip-path: none; box-shadow: none;
  /* punched, scalloped edges left and right */
  -webkit-mask: radial-gradient(circle var(--hole) at left, #0000 97%, #000) 0 50% / 51% var(--gap) repeat-y,
                radial-gradient(circle var(--hole) at right, #0000 97%, #000) 100% 50% / 51% var(--gap) repeat-y;
  mask: radial-gradient(circle var(--hole) at left, #0000 97%, #000) 0 50% / 51% var(--gap) repeat-y,
        radial-gradient(circle var(--hole) at right, #0000 97%, #000) 100% 50% / 51% var(--gap) repeat-y;
  transform: rotate(.6deg);
}
.sign-form.ticket::after { display: none; }
.sign-form.ticket .sheet-label { display: none; }
.sign-form.ticket .ticket-head { display: grid; gap: 4px; padding-bottom: 14px; border-bottom: 2px dashed var(--line); }
.ticket-co { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font: 700 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.ticket-co span { color: var(--muted); font-weight: 600; }
.ticket-title { font: 800 clamp(26px, 3.4vw, 34px)/1 var(--bold); text-transform: uppercase; letter-spacing: -.02em; }
.ticket-meta { display: flex; gap: 8px 16px; flex-wrap: wrap; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ticket-no { margin-left: auto; color: var(--ink); font-weight: 700; }
.sign-form.ticket .line-field input { color: var(--ink); border-bottom-color: var(--line); }
.sign-form.ticket .line-field input:focus { border-bottom-color: var(--accent); }
.sign-form.ticket .pad { color: var(--ink); }
.sign-form.ticket .pad-area::after { background: var(--ink); }

/* Live preview: your sticker on a small piece of window glass */
.sign-form.ticket .ticket-preview { display: grid; gap: 8px; }
.preview-glass {
  display: grid; place-items: center; min-height: 128px; padding: 18px 12px; border-radius: 12px;
  background: radial-gradient(120% 90% at 30% 0%, #3b4654, #1b2129 60%, #0d1015);
  box-shadow: inset 0 0 0 4px #121212, inset 0 10px 24px rgb(0 0 0 / .55);
}
.preview-glass .stickers { display: block; }
.preview-glass .sticker:hover { transform: translateY(var(--lift)) rotate(var(--tilt)); }

/* The stub: a tear line above the button */
.sign-form.ticket .form-row { padding-top: 16px; border-top: 2px dashed var(--line); }
.sign-form.ticket .sign-btn { background: var(--accent); color: #fff6e0; }
.sign-form.ticket .sign-btn:hover { background: #1f1b16; }
.sign-form.ticket .fine { color: var(--muted); }

/* Red rubber stamp that lands when your sticker is sent */
.sign-form.ticket .ticket-stamp {
  display: grid; place-items: center; position: absolute; right: 30px; top: 128px; z-index: 2; /* over the name line, clear of the header */
  width: 104px; height: 104px; border-radius: 50%; border: 3px double var(--accent);
  color: var(--accent); font: 800 22px/1 var(--bold); text-transform: uppercase; text-align: center; letter-spacing: .02em;
  opacity: 0; transform: rotate(-14deg) scale(1.8); pointer-events: none; mix-blend-mode: multiply;
}
.ticket-stamp small { display: block; margin-top: -18px; font: 700 8.5px var(--mono); letter-spacing: .14em; }
.sign-form.ticket.stamped .ticket-stamp { animation: stamp .45s cubic-bezier(.2, .9, .3, 1.3) forwards; }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-14deg) scale(1.8); } 60% { opacity: .9; } 100% { opacity: .88; transform: rotate(-14deg) scale(1); } }

@media (max-width: 640px) {
  .sign-form.ticket { padding: 22px 22px 18px; transform: none; }
  .sign-form.ticket .ticket-stamp { width: 86px; height: 86px; font-size: 18px; right: 18px; top: 118px; }
}
@media (prefers-reduced-motion: reduce) {
  .sign-form.ticket.stamped .ticket-stamp { animation: none; opacity: .88; transform: rotate(-14deg); }
}

/* ---------- trotro style: notes are stickers on the back of Accra trotros (js/wall-trotro.js) ---------- */
.wall-trotro { --wrap: 980px; margin-top: clamp(56px, 8vw, 96px); padding-bottom: 120px; }
.wall-trotro[hidden], .fleet-bar[hidden] { display: none; }
.fleet-bar { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 26px; }
.fleet-bar button {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 18px; box-shadow: var(--shadow); transition: transform .2s, opacity .2s;
}
.fleet-bar button:hover:not(:disabled) { transform: translateY(-2px); }
.fleet-bar button:disabled { opacity: .3; cursor: default; }
.fleet-label { font: 12px var(--mono); letter-spacing: .08em; color: var(--muted); text-align: center; min-width: 16em; }
.fleet-label b { color: var(--ink); font-size: 14px; }
.road { position: relative; display: grid; overflow: hidden; padding: 70px 18px 46px; margin: 0 -18px; touch-action: pan-y; }
.road > .van { grid-area: 1 / 1; }
.road .empty { padding: 40px; text-align: center; }

.van {
  /* The van is an object, so it keeps its paint in both themes */
  --paint: #efe9dc; --trim: #c4231a; --side: clamp(14px, 3vw, 30px);
  position: relative; color: #1a1a1a;
  animation: idle 0.9s steps(2, end) infinite; /* engine running */
}
@keyframes idle { 50% { transform: translateY(0.6px); } }
.van.leaving { animation: none; }

/* Roof rack with luggage: a Ghana-Must-Go bag, a sack and a basin */
.roof { position: absolute; left: 12%; right: 12%; top: -58px; height: 58px; }
.rack {
  position: absolute; left: 0; right: 0; bottom: 4px; height: 12px;
  border: 3px solid #2a2a2a; border-top: 0; border-radius: 0 0 4px 4px;
  background: repeating-linear-gradient(90deg, #2a2a2a 0 3px, transparent 3px 40px);
}
.bag { position: absolute; bottom: 14px; border-radius: 8px 8px 4px 4px; box-shadow: inset 0 -6px 0 rgb(0 0 0 / .15); }
.ghana-must-go {
  left: 8%; width: 30%; height: 38px;
  background:
    repeating-linear-gradient(90deg, rgb(29 79 163 / .85) 0 7px, transparent 7px 14px),
    repeating-linear-gradient(0deg, rgb(196 35 26 / .75) 0 7px, transparent 7px 14px), #f5f1ea;
  border: 2px solid #1d4fa3;
}
.sack { left: 42%; width: 24%; height: 30px; background: #c9b38a; border-radius: 16px 16px 6px 6px; }
.basin { right: 8%; width: 20%; height: 22px; background: #1f8a4c; border-radius: 4px 4px 14px 14px; }

.body {
  position: relative; padding: 16px var(--side) 22px;
  border-radius: 40px 40px 10px 10px;
  background:
    linear-gradient(180deg, transparent 70%, rgb(120 90 50 / .14)), /* road dust */
    linear-gradient(180deg, #faf7f0, var(--paint) 25%, #ddd5c3);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .8), inset 0 -3px 0 rgb(0 0 0 / .08), inset 4px 0 10px rgb(0 0 0 / .06), inset -4px 0 10px rgb(0 0 0 / .06);
}
.route {
  display: flex; justify-content: center; align-items: center; gap: 12px; width: fit-content; margin: 0 auto 10px;
  padding: 6px 16px; border-radius: 6px; background: #111;
  font: 600 11.5px var(--mono); letter-spacing: .24em; text-transform: uppercase; color: #f2b705;
  text-shadow: 0 0 8px rgb(242 183 5 / .55);
}
.route-state { color: #4be37f; text-shadow: 0 0 8px rgb(75 227 127 / .6); animation: blink 1.4s steps(2, start) infinite; }
.van.full .route-state { color: #ff5a4a; text-shadow: 0 0 8px rgb(255 90 74 / .6); animation: none; }
@keyframes blink { 50% { opacity: .25; } }
.route-arrow { letter-spacing: 0; }
.slogan {
  margin: 0 auto 14px; text-align: center; max-width: 32ch;
  font: italic 700 clamp(17px, 2.4vw, 26px)/1.1 var(--sans); color: var(--trim); text-shadow: 1px 1px 0 #1a1a1a;
}

/* Two rear doors, a seam down the middle, a window in each */
.doors { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 clamp(10px, 2.4vw, 26px); }
.doors::before { /* the seam between the doors */
  content: ""; position: absolute; left: 50%; top: -6px; bottom: -14px; width: 2px; transform: translateX(-1px);
  background: rgb(0 0 0 / .28); box-shadow: 1px 0 0 rgb(255 255 255 / .6);
}
.door { position: relative; padding-bottom: 46px; }
.glass {
  position: relative; overflow: hidden; height: 100%; min-height: 260px;
  padding: clamp(14px, 2.4vw, 24px) clamp(8px, 1.6vw, 16px);
  border-radius: 18px 18px 8px 8px;
  background: radial-gradient(120% 80% at 30% 0%, #3b4654 0%, #1b2129 55%, #0d1015 100%);
  box-shadow: inset 0 0 0 5px #121212, inset 0 0 0 7px #2a2a2a, inset 0 16px 34px rgb(0 0 0 / .6);
}
.door:first-child .glass { border-radius: 26px 12px 8px 8px; }
.door:nth-child(2) .glass { border-radius: 12px 26px 8px 8px; }
.glass::after { /* reflection over the stickers */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 0 18%, rgb(255 255 255 / .07) 18% 28%, transparent 28% 34%, rgb(255 255 255 / .05) 34% 37%, transparent 37%);
}
.handle { position: absolute; left: 10px; bottom: 18px; width: 34px; height: 9px; border-radius: 5px; background: linear-gradient(#5a5a5a, #222); box-shadow: 0 1px 0 rgb(255 255 255 / .6); }
/* Tall tail lamps up the corners of the body */
.lamp {
  position: absolute; top: 18%; width: clamp(10px, 1.8vw, 18px); height: 58%; border-radius: 6px;
  background: linear-gradient(#ff6b5a 0 55%, #f59e0b 55% 72%, #f3f0ea 72% 84%, #ff6b5a 84%);
  box-shadow: inset 0 0 0 2px #5b0b05, 0 0 16px rgb(255 60 40 / .3);
}
.lamp.left { left: calc(-1 * var(--side) + 4px); }
.lamp.right { right: calc(-1 * var(--side) + 4px); }

.stickers { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 8px; }
.sticker { position: relative; margin: -2px; transform: translateY(var(--lift)) rotate(var(--tilt)); transition: transform .25s ease; filter: drop-shadow(0 5px 8px rgb(0 0 0 / .45)); }
.sticker:hover { transform: translateY(calc(var(--lift) - 4px)) rotate(0deg) scale(1.04); z-index: 9 !important; }
.sticker-face {
  display: grid; gap: 5px; justify-items: start; max-width: 210px; padding: 11px 13px 10px;
  background: linear-gradient(135deg, rgb(255 255 255 / .22), transparent 45%), var(--bg);
  color: var(--ink); border: 3.5px solid #fff; border-radius: 7px; /* white die-cut edge */
}
.st-msg { font: 800 16px/1.08 var(--bold); text-transform: uppercase; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sticker.mid .st-msg { font-size: 13.5px; }
.sticker.long .st-msg { font: 600 13.5px/1.35 var(--sans); text-transform: none; letter-spacing: 0; }
.sticker.long .sticker-face { max-width: 250px; }
.st-meta { font: 600 8.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.sticker .sig-typed { font-size: 28px; margin: -2px 0 -6px; color: inherit; }
.sticker .sig-drawn { width: 100px; max-height: 38px; margin: -4px 0 -6px; }
.sticker .sig-drawn path { stroke-width: 4.5; } /* marker pen: a doodle, not a precise signature */
.sticker.round .sticker-face { border-radius: 20px; }
.sticker.pill .sticker-face { border-radius: 999px; padding: 10px 20px 9px; justify-items: center; text-align: center; }
.sticker.circle .sticker-face { width: 146px; height: 146px; border-radius: 50%; place-content: center; justify-items: center; text-align: center; padding: 14px; gap: 3px; }
.sticker.circle .st-msg { font-size: 13px; }
.sticker.circle .sig-typed { font-size: 22px; margin: 0; line-height: 1.2; }
.sticker.circle .sig-drawn { width: 70px; margin: 0; }
.sticker.circle .st-meta { font-size: 7.5px; max-width: 11em; }
.sticker.tag .sticker-face { border-radius: 7px 24px 7px 24px; }
.sticker.yours { filter: none; --tilt: -2deg; --lift: 0px; }
.sticker.yours .sticker-face {
  background: none; color: rgb(255 255 255 / .75); border: 2px dashed rgb(255 255 255 / .45); cursor: pointer; font: inherit;
  padding: 16px 18px; justify-items: center; text-align: center;
}
.sticker.yours:hover .sticker-face { color: #fff; border-color: #f2b705; }

.stripe { display: block; height: 22px; margin: 4px calc(-1 * var(--side)) 0; background: linear-gradient(var(--trim) 0 33.3%, #f2b705 33.3% 66.6%, #0f7a3d 66.6%); }
.tail { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 18px; }
/* Owner's signature painted on the body, the way trotro owners put their name on the back */
.owner { display: flex; align-items: center; gap: 6px; justify-self: start; }
.owner-label { font: italic 700 13px var(--sans); color: var(--trim); }
.sig-van { height: 44px; width: clamp(90px, 14vw, 150px); transform: rotate(-4deg); }
.sig-van .sig-svg { margin-inline: 0; }
.sig-van path { stroke: var(--trim); stroke-width: 3.6; }
.plate {
  display: inline-flex; align-items: stretch; border: 2px solid #111; border-radius: 6px; background: #fff; overflow: hidden;
  font: 700 clamp(15px, 2.2vw, 22px)/1 var(--mono); letter-spacing: .08em; color: #111; box-shadow: 0 2px 0 rgb(0 0 0 / .2);
}
.plate-flag { width: 13px; background: linear-gradient(#c4231a 0 33%, #f2b705 33% 66%, #0f7a3d 66%); }
.plate-text { padding: 7px 13px; }
.bumper { position: relative; height: 22px; margin: 0 -8px; border-radius: 4px 4px 12px 12px; background: linear-gradient(#3a3a3a, #121212); box-shadow: inset 0 2px 0 rgb(255 255 255 / .12); }
.step { position: absolute; left: 50%; top: 6px; width: 22%; height: 6px; transform: translateX(-50%); border-radius: 3px; background: repeating-linear-gradient(90deg, #555 0 4px, #2a2a2a 4px 8px); }
/* Wheels, mud flaps and the exhaust under the bumper */
.under { position: relative; display: flex; justify-content: space-between; align-items: flex-start; height: 40px; padding: 0 6%; }
.wheel { width: 17%; height: 30px; border-radius: 0 0 14px 14px; background: linear-gradient(#0b0b0b, #1d1d1d); }
.under .wheel:nth-child(2) { margin-right: auto; margin-left: 2%; }
.under .wheel:nth-child(3) { margin-left: auto; margin-right: 2%; }
.flap {
  width: 15%; height: 40px; display: grid; place-items: center; padding: 0 4px; text-align: center;
  background: #161616; border-radius: 0 0 3px 3px; color: #f3f0ea;
  font: 700 clamp(7px, 1vw, 10px)/1.1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.exhaust { position: absolute; left: 24%; top: 6px; }
.exhaust i { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: rgb(160 160 160 / .35); animation: puff 2.4s ease-out infinite; opacity: 0; }
.exhaust i:nth-child(2) { animation-delay: .8s; }
.exhaust i:nth-child(3) { animation-delay: 1.6s; }
@keyframes puff { 0% { opacity: .7; transform: translate(0, 0) scale(.6); } 100% { opacity: 0; transform: translate(-46px, 10px) scale(2.4); } }
.road::after { /* shadow on the ground */
  content: ""; position: absolute; left: 6%; right: 6%; bottom: 34px; height: 18px; z-index: -1;
  background: radial-gradient(closest-side, rgb(0 0 0 / .35), transparent); filter: blur(4px);
}

@media (max-width: 640px) {
  .road { padding: 62px 10px 40px; margin: 0 -10px; }
  .body { border-radius: 28px 28px 8px 8px; padding-top: 12px; }
  .route { font-size: 9.5px; letter-spacing: .16em; gap: 8px; padding: 5px 10px; }
  .doors { gap: 4px; padding: 0 6px; }
  .door { padding-bottom: 36px; }
  .glass { min-height: 200px; padding: 12px 6px; }
  .stickers { gap: 8px 4px; }
  .sticker-face { max-width: 100%; padding: 8px 9px 7px; border-width: 3px; }
  .st-msg { font-size: 12.5px; }
  .sticker.mid .st-msg, .sticker.long .st-msg { font-size: 11.5px; }
  .sticker.circle .sticker-face { width: 112px; height: 112px; padding: 10px; }
  .sticker.circle .st-msg { font-size: 10.5px; }
  .sticker .sig-typed { font-size: 22px; }
  .sticker .sig-drawn { width: 72px; }
  .st-meta { font-size: 7px; }
  .handle { width: 24px; left: 6px; bottom: 12px; }
  .tail { grid-template-columns: auto auto; justify-content: space-between; }
  .owner-spacer { display: none; }
  .sig-van { height: 34px; width: 84px; }
  .fleet-bar { gap: 10px; }
  .fleet-label { min-width: 0; flex: 1; }
  .fleet-label span { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .van, .route-state, .exhaust i { animation: none; }
  .sticker, .sticker:hover { transition: none; }
}


/* ---------- CV page (cv.html, js/cv.js) ---------- */
.cv-wrap { --wrap: 820px; margin-top: clamp(40px, 7vw, 72px); padding-bottom: 120px; }
.cv-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.cv-print {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: 0;
  background: var(--ink); color: var(--bg); font: 800 13.5px var(--bold); letter-spacing: .03em; text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); transition: background-color .2s, transform .2s;
}
.cv-print:hover { background: var(--accent); transform: translateY(-1px); }
.cv-print-hint { font: 12px var(--mono); color: var(--faint); }
.cv-print-hint b { color: var(--muted); font-weight: 600; }

/* The CV sits on a sheet of paper on screen, the same sheet that gets printed */
.cv {
  --cv-ink: #1c1917; --cv-muted: #5f5852; --cv-faint: #8f877f; --cv-line: #e4ded6; --cv-accent: #b45309;
  background: #fffdf9; color: var(--cv-ink); padding: clamp(28px, 6vw, 64px);
  box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 24px 60px -20px rgb(0 0 0 / .35); border-radius: 4px;
  font: 15px/1.55 var(--sans);
}
.cv a { color: inherit; text-decoration-color: var(--cv-line); text-underline-offset: 3px; }
.cv a:hover { text-decoration-color: var(--cv-accent); }
.cv-head { padding-bottom: 18px; border-bottom: 2px solid var(--cv-ink); }
.cv-name { font: 800 clamp(30px, 5vw, 44px)/1 var(--bold); text-transform: uppercase; letter-spacing: -.03em; }
.cv-label { margin-top: 6px; font-size: 18px; color: var(--cv-accent); }
.cv-contacts { margin-top: 10px; font: 12.5px/1.7 var(--mono); color: var(--cv-muted); }
.cv-contacts span { color: var(--cv-faint); }
.cv-summary { margin-top: 18px; font-size: 15.5px; }
.cv-section { margin-top: 28px; }
.cv-section > h2 {
  font: 700 11.5px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--cv-accent);
  padding-bottom: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--cv-line);
}
.cv-entry + .cv-entry { margin-top: 18px; }
.cv-entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; }
.cv-entry h3 { font: 700 16px/1.3 var(--sans); }
.cv-org { color: var(--cv-muted); font-size: 14px; }
.cv-dates { font: 12px var(--mono); color: var(--cv-muted); white-space: nowrap; }
.cv-text { margin-top: 6px; }
.cv-project { margin-top: 12px; }
.cv-project h4 { font: 600 14.5px var(--sans); }
.cv-bullets { margin: 6px 0 0; padding-left: 1.1em; list-style: disc; }
.cv-bullets li { margin-top: 4px; font-size: 14.5px; }
.cv-bullets li::marker { color: var(--cv-faint); }
.cv-plain { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cv-skills { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.cv-skills dt { font: 600 13px var(--mono); color: var(--cv-muted); padding-top: 1px; }
.cv-skills dd { margin: 0; font-size: 14.5px; }
@media (max-width: 560px) {
  .cv-skills { grid-template-columns: 1fr; gap: 2px; }
  .cv-skills dd { margin-bottom: 10px; }
}

/* Printing / Save as PDF: just the paper, A4, black on white in both themes */
@media print {
  @page { size: A4; margin: 13mm 14mm; }
  html, body { background: #fff !important; }
  .topo, .nav-wrap, .dock, .skip, .cv-actions, .cv-float, .nextup { display: none !important; }
  .cv-wrap { width: auto; margin: 0; padding: 0; }
  .cv { box-shadow: none; border-radius: 0; padding: 0; background: #fff; font-size: 10.5pt; line-height: 1.42; }
  .cv-name { font-size: 26pt; }
  .cv-label { font-size: 12.5pt; }
  .cv-contacts { font-size: 8.5pt; }
  .cv-summary, .cv-bullets li, .cv-skills dd { font-size: 10pt; }
  .cv-entry h3 { font-size: 11pt; }
  .cv-project h4 { font-size: 10pt; }
  .cv-section { margin-top: 16pt; }
  .cv-entry + .cv-entry { margin-top: 10pt; }
  .cv-entry-head, .cv-project h4, .cv-section > h2 { break-after: avoid; }
  .cv-bullets li, .cv-skills dt, .cv-skills dd, .cv-plain li { break-inside: avoid; }
  .cv a { text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .nav { padding-left: 14px; gap: 8px; }
  .island { width: 168px; }
  .ind { font-size: 0; gap: 0; } /* phones: dot + value only */
  .slide { padding: 0 14px; }
  .nav-links { gap: 12px; padding-right: 4px; font-size: 14px; }
  .chess-stage { aspect-ratio: 1 / 1; }
  .project { grid-template-columns: 1fr; }
  .num { display: none; }
  .project-links { flex-direction: row; align-items: flex-start; gap: 16px; margin-top: 10px; }
  .post { flex-direction: column; gap: 8px; }
  .cv-note { display: none; }
}
@media (max-width: 420px) {
  .signature { font-size: 28px; }
}

/* ---------- phones: links in a dock at the bottom (js/theme.js moves them; idea from aikins.xyz) ---------- */
.dock[hidden] { display: none; }
.has-dock .nav { width: fit-content; gap: 10px; padding: 5px 6px 5px 8px; } /* top: just the clock and the theme switch */
.dock {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20; transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px; padding: 3px 16px 3px 16px; white-space: nowrap;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px rgb(0 0 0 / .18);
}
.dock .signature { font-size: 28px; }
.dock .nav-links { gap: 14px; padding: 0; font-size: 15px; }
.has-dock body { padding-bottom: 76px; } /* room so the dock never covers the end of the page */
.has-dock .cv-float { display: none; } /* phones: the CV is a link in the dock instead */
.dock-cv {
  padding: 10px 12px; margin: -4px -8px -4px 0; border-radius: 10px; background: var(--ink); color: var(--bg); text-decoration: none;
  font: 800 12px var(--bold); letter-spacing: .04em;
}

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

/* ---------- scroll reveals (js/reveal.js; idea from landonorris.com) ---------- */
/* .rv is added by the script, so nothing is hidden without it. */
.rv:not(.duo) { opacity: 0; transform: translateY(14px); }
.duo.rv > span { opacity: 0; transform: translateY(.45em); }
.rv.rv-in:not(.duo), .duo.rv.rv-in > span {
  opacity: 1; transform: none;
  transition: opacity .6s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--rv-delay, 0ms);
}
.duo.rv.rv-in > .duo-bold { transition-delay: calc(var(--rv-delay, 0ms) + 110ms); }

/* ---------- review pass fixes ---------- */
/* The "Stuck" stamp waits invisibly at a larger size; keep it inside the ticket so phones don't scroll sideways */
.sign-form.ticket { overflow: hidden; }
.line-field input { padding: 10px 0 12px; }

/* Phones: links and buttons at least ~40px tall so they're easy to tap (the text itself doesn't move) */
@media (max-width: 720px) {
  .hero-links a, .socials a, .project-links a, .cv-contacts a { display: inline-block; padding: 11px 2px; margin: -11px 0; }
  .hero-links, .socials { row-gap: 22px; flex-wrap: wrap; }
  .dock .nav-links a { display: inline-block; padding: 12px 2px; }
  .dock .signature { padding: 6px 0; }
  .seg button { padding: 11px 18px; }
  .pad-clear { padding: 11px 12px; margin: -8px -6px; }
  /* Tiny print on the trotro: still small, but readable */
  .st-meta { font-size: 8px; }
  .flap { font-size: 8px; }
}
@media (max-width: 360px) { /* smallest phones: tighter dock so the CV link fits */
  .dock { gap: 10px; padding: 3px 12px; }
  .dock .nav-links { gap: 10px; font-size: 14px; }
  .dock .signature { font-size: 24px; }
}
/* "hidden" always wins over a display set elsewhere (e.g. the bigger tap areas on phones) */
[hidden] { display: none !important; }

/* ---------- the trotro at night (dark mode): streetlight from above, body in shadow, lamps on ---------- */
/* Everything here scales with --night (0 by day, 1 at night), so switching themes fades between them. */
.road::before { /* pool of warm streetlight falling on the van */
  content: ""; position: absolute; left: 50%; top: -30px; width: 130%; height: 105%; transform: translateX(-50%);
  background: radial-gradient(ellipse 42% 58% at 50% 0%, rgb(255 205 130 / .17), rgb(255 205 130 / .05) 55%, transparent 75%);
  opacity: var(--night); transition: opacity .6s ease; pointer-events: none;
}
.body::after { /* night shade over the paint, lighter at the top where the streetlight hits */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse 80% 70% at 50% -5%, rgb(255 200 120 / .1), rgb(10 13 24 / .42) 62%, rgb(8 10 18 / .58));
  opacity: var(--night); transition: opacity .6s ease;
}
.roof { filter: brightness(calc(1 - .45 * var(--night))); transition: filter .6s ease; }
/* Lights stay above the shade and shine */
.lamp { z-index: 3; box-shadow: inset 0 0 0 2px #5b0b05, 0 0 calc(16px + 22px * var(--night)) rgb(255 60 40 / calc(.3 + .45 * var(--night))); }
.route { position: relative; z-index: 3; }
.van .route span { text-shadow: 0 0 calc(8px + 8px * var(--night)) currentColor; }
.plate { position: relative; z-index: 3; box-shadow: 0 2px 0 rgb(0 0 0 / .2), 0 -10px 22px rgb(255 244 210 / calc(.45 * var(--night))); }
.owner { position: relative; z-index: 3; opacity: calc(1 - .25 * var(--night)); }
.under::after { /* red haze from the tail lamps on the road */
  content: ""; position: absolute; left: -6%; right: -6%; top: -18px; height: 70px; pointer-events: none; filter: blur(8px);
  background:
    radial-gradient(ellipse 16% 70% at 5% 10%, rgb(255 50 30 / .42), transparent 70%),
    radial-gradient(ellipse 16% 70% at 95% 10%, rgb(255 50 30 / .42), transparent 70%);
  opacity: var(--night); transition: opacity .6s ease;
}

/* ---------- blog.html: all posts, by year (js/blog-pages.js) ---------- */
.blog-wrap { --wrap: 820px; margin-top: clamp(48px, 8vw, 88px); padding-bottom: 120px; }
.blog-head .duo .duo-bold { font-size: clamp(48px, 8vw, 96px); }
.blog-intro { margin-top: 14px; max-width: 46ch; color: var(--muted); font-size: 18px; }
.blog-tabs { margin-top: 28px; }
.blog-list { margin-top: 26px; }
.blog-year { margin: 0; }
.blog-year + .blog-year { margin-top: 30px; }
.blog-year h2 { font: 800 13px var(--bold); letter-spacing: .12em; color: var(--faint); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.blog-item {
  display: grid; grid-template-columns: 110px 1fr; gap: 6px 22px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.blog-item time { font: 13px var(--mono); color: var(--faint); }
.bi-text { display: grid; gap: 4px; }
.bi-title { font-size: 19px; font-weight: 600; line-height: 1.3; transition: color .2s; }
.bi-sub { color: var(--muted); font-size: 15px; }
.bi-ext { color: var(--faint); }
.blog-item:hover .bi-title { color: var(--accent); }
.blog-empty { padding: 40px 0; color: var(--muted); font: 15px var(--mono); }
@media (max-width: 560px) { .blog-item { grid-template-columns: 1fr; } }

/* ---------- post.html: one post ---------- */
.post-wrap { --wrap: 720px; margin-top: clamp(40px, 7vw, 72px); padding-bottom: 120px; }
.post-back a { font: 14px var(--mono); color: var(--muted); text-decoration: none; }
.post-back a:hover { color: var(--accent); }
.post-header { margin-top: 26px; }
.post-tags-top { font: 12px var(--mono); letter-spacing: .06em; color: var(--accent); }
.post-title { margin-top: 10px; font: 700 clamp(32px, 5.4vw, 52px)/1.08 var(--sans); letter-spacing: -.02em; }
.post-sub { margin-top: 12px; font-size: 20px; line-height: 1.45; color: var(--muted); }
.post-meta-line { margin-top: 16px; font: 13px var(--mono); color: var(--faint); }
.post-cover { display: block; width: 100%; margin-top: 28px; border-radius: 14px; border: 1px solid var(--line); }

/* The writing itself */
.prose { margin-top: 34px; font-size: 18.5px; line-height: 1.78; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.9em; font: 800 24px/1.2 var(--bold); text-transform: uppercase; letter-spacing: -.01em; }
.prose h3 { margin-top: 1.6em; font-size: 21px; font-weight: 700; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--faint); }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.prose code { font: .86em var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--chip); }
.prose pre {
  padding: 18px 20px; border-radius: 12px; overflow-x: auto; background: #151513; color: #e9e6df;
  border: 1px solid #2a2926; font: 14px/1.6 var(--mono);
}
.prose pre code { padding: 0; background: none; font: inherit; color: inherit; }
.prose img { display: block; max-width: 100%; border-radius: 12px; margin-inline: auto; }
.prose hr { border: 0; text-align: center; margin: 2.2em 0; }
.prose hr::before { content: "* * *"; color: var(--faint); letter-spacing: .6em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }

.post-end { margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); }
.sig-post { height: 70px; width: 200px; transform: rotate(-4deg); transform-origin: left center; }
.sig-post .sig-svg { margin-inline: 0; }
.sig-post path { stroke-width: 3.2; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.post-tags li { padding: 4px 10px; border-radius: 999px; background: var(--chip); font: 12.5px var(--mono); color: var(--muted); }
.post-related { margin-top: 34px; }
.post-related h2 { font: 700 11.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.post-related a { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.post-related time { font: 13px var(--mono); color: var(--faint); }
.post-related a:hover span { color: var(--accent); }
@media (max-width: 560px) {
  .prose { font-size: 17px; }
  .post-related a { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- a page switched off in the admin (Pages): only a short note shows ---------- */
.page-closed main > :not(.closed-note) { display: none !important; }
.closed-note { display: grid; gap: 14px; justify-items: start; padding: clamp(60px, 12vw, 140px) 0 120px; width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.closed-note .duo-bold { font-size: clamp(56px, 10vw, 120px); }
.closed-note p { color: var(--muted); font-size: 18px; }
.closed-note a { font: 14px var(--mono); }

/* ---------- liquid glass: the nav and the phone dock bend what's behind them ---------- */
/* Everywhere: clearer frosted glass with a lit top edge and a soft shadow, so it reads as a thick pane */
.nav { position: relative; }
.nav, .dock {
  isolation: isolate; /* (no position here: the nav is relative, but the dock must stay fixed) */
  /* Frosted enough that the links stay readable over busy content (cards, the big word bands) */
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 80%, transparent), color-mix(in srgb, var(--card) 68%, transparent));
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .55),          /* light catching the top edge */
    inset 0 -1px 0 rgb(0 0 0 / .08),               /* the bottom edge */
    inset 0 0 18px rgb(255 255 255 / .12),          /* a little glow inside the glass */
    0 10px 30px -10px rgb(0 0 0 / .28);            /* lifted off the page */
}
.nav::before, .dock::before { /* a soft specular sweep across the top */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: linear-gradient(115deg, rgb(255 255 255 / .22), rgb(255 255 255 / 0) 38%, rgb(255 255 255 / 0) 70%, rgb(255 255 255 / .08));
}
:root[data-theme="dark"] .nav, :root[data-theme="dark"] .dock { box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), inset 0 -1px 0 rgb(0 0 0 / .3), inset 0 0 18px rgb(255 255 255 / .04), 0 10px 30px -10px rgb(0 0 0 / .6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav, :root:not([data-theme="light"]) .dock { box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), inset 0 -1px 0 rgb(0 0 0 / .3), inset 0 0 18px rgb(255 255 255 / .04), 0 10px 30px -10px rgb(0 0 0 / .6); }
}
/* Chromium (Chrome, Edge, Brave, Opera): real refraction, the backdrop is warped and split into
   red/green/blue at slightly different strengths (js/theme.js adds the SVG filter and this class) */
.glass-refract {
  --glass-filter: url(#liquid-glass) blur(2px) saturate(1.9);
  --glass-filter-thin: url(#liquid-glass-thin) blur(1.5px) saturate(1.8);
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-filter: none; --glass-filter-thin: none; }
  .nav, .dock, .card-pill, .chess-tip, .chess-head, .chess-status, .chess-buttons button, .chess-extra { background: var(--card); }
}

/* ---------- the hero is a dark "stage" in both themes ---------- */
/* The portrait was lit for a black studio backdrop, so the top of the page always gives it one.
   The hero uses the dark-theme colours; its stage runs edge to edge (behind the nav too) and
   fades into the page below. In dark mode it matches the page, so nothing visibly changes. */
.hero {
  --bg: #141312; --card: #1c1a19; --ink: #ece8e3; --muted: #a8a19a; --faint: #756e67;
  --line: #2d2a27; --chip: #262321; --accent: #f59e0b; --shade: #3e5468;
  position: relative; isolation: isolate; color: var(--ink);
}
.hero::before {
  content: ""; position: absolute; z-index: -1; left: 50%; width: 100vw; transform: translateX(-50%);
  top: -400px; bottom: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 50% 40%, #24221f, transparent 70%),   /* soft studio glow behind you */
    linear-gradient(to bottom, #141312 calc(100% - 72px), transparent);
}
/* The stage fades out in its own padding, after the last link and before the word bands */
.hero { padding-bottom: 80px; }
.hero + .marquee { margin-top: 28px; }
html { overflow-x: clip; } /* the full-width stage must never cause sideways scrolling */
/* While the nav sits over the dark stage (top of the home page), it uses dark-theme colours too */
.on-stage .nav-wrap {
  --bg: #141312; --card: #1c1a19; --ink: #ece8e3; --muted: #a8a19a; --faint: #756e67;
  --line: #2d2a27; --chip: #262321; --accent: #f59e0b; color: var(--ink);
}
.on-stage .nav, .on-stage .nav::before { transition: background .3s, box-shadow .3s; }

/* No chess on phones and touch tablets: dragging to scroll the page kept spinning the board
   instead. Hidden sections never load the 3D code (js/main.js loads it only when it's near),
   so phones also skip downloading Three.js. */
@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  #chess { display: none; }
}

/* Phones: the clock's pop-up opens in the middle of the screen, under the (centred) top bar,
   instead of hanging off the clock at the side. Positioned against the nav, not the clock. */
@media (max-width: 720px) {
  .has-dock .wallclock { position: static; }
  .has-dock .wallclock-pop { left: 50%; top: calc(100% + 12px); }
}
/* Nav links in full ink (not muted) so they read on any background */
.nav .nav-links a, .dock .nav-links a { color: var(--ink); }
.nav .nav-links a:hover, .dock .nav-links a:hover { color: var(--accent); }
