/* Dillon Green — portfolio. Plain CSS, no build step.
   Type: Archivo (variable, wdth 62–125) + JetBrains Mono, both OFL, self-hosted. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2?v=e3a28eade2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2?v=83c005d49d") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* ---------- tokens ----------
   Night (default): near-black, neon cyan primary, hot magenta secondary, amber for warnings,
   after the Smart Mirror's cyberpunk theme. Daylight ([data-theme="light"], opt-in from the
   header toggle) keeps the same accents, darkened until every text pairing passes WCAG AA. */
:root {
  color-scheme: dark;
  --bg: #06080b;
  --bg-2: #0b1117;
  --bg-3: #111a22;
  --line: #1a2f39;
  --line-2: #27505b;
  --ink: #e8f6fa;
  --ink-2: #b3c6ce;
  --ink-3: #8aa3ad;
  --accent: #2de2ff;
  --accent-2: #ff3dc8;
  --accent-ink: #00161c;
  --accent-soft: rgba(45, 226, 255, 0.09);
  --accent-2-soft: rgba(255, 61, 200, 0.1);
  --live: #3dff9a;
  --amber: #ffb547;
  --shadow: 0 0 0 1px rgba(45, 226, 255, 0.04), 0 14px 34px rgba(0, 0, 0, 0.45);
  --grid: rgba(45, 226, 255, 0.045);
  --glow: rgba(45, 226, 255, 0.35);

  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 4px;
  --gutter: 16px;
  --max: 1180px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f4;
  --bg-2: #ffffff;
  --bg-3: #e2ebed;
  --line: #c4d7dc;
  --line-2: #8db3bc;
  --ink: #081317;
  --ink-2: #31454d;
  --ink-3: #4b616a;
  --accent: #006f86;
  --accent-2: #b0007b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0, 111, 134, 0.08);
  --accent-2-soft: rgba(176, 0, 123, 0.07);
  --live: #0a6b35;
  --amber: #8a5500;
  --shadow: 0 1px 2px rgba(8, 19, 23, 0.05), 0 10px 26px rgba(8, 19, 23, 0.07);
  --grid: rgba(0, 111, 134, 0.07);
  --glow: rgba(0, 111, 134, 0.18);
}

@media (min-width: 640px) { :root { --gutter: 28px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "ss01" on;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.08; font-weight: 750; letter-spacing: -0.02em; text-wrap: balance; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.top.is-stuck { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap;
}
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  font-size: 0.9rem; color: var(--ink-2); text-decoration: none;
  padding: 8px 10px; border-radius: 8px;
}
@media (hover: hover) { .nav a:hover { color: var(--ink); background: var(--bg-3); } }
.nav .hide-sm { display: none; }
@media (min-width: 720px) { .nav .hide-sm { display: inline-block; } }
.nav .hide-xs { display: none; }
@media (min-width: 440px) { .nav .hide-xs { display: inline-block; } }
.theme-btn {
  display: grid; place-items: center; width: 38px; height: 38px; margin-left: 4px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); color: var(--ink);
  cursor: pointer; padding: 0;
}
@media (hover: hover) { .theme-btn:hover { border-color: var(--line-2); } }
.theme-btn svg { width: 18px; height: 18px; }
/* night is the default, so the button offers daylight (sun); in daylight it offers night (moon) */
.theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 0 18px; border-radius: 11px;
  font: 600 0.95rem/1 var(--sans); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--ink); background: var(--bg-2);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.btn svg { width: 17px; height: 17px; flex: none; }
@media (hover: hover) { .btn:hover { border-color: var(--ink-3); } }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (hover: hover) { .btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.chips li {
  font: 500 0.74rem/1 var(--mono); letter-spacing: 0.01em;
  padding: 6px 8px; border-radius: 6px;
  color: var(--ink-2); background: var(--bg-3); border: 1px solid var(--line);
}

.status {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 0.72rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2); white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.status.live::before { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent); }
.status.review::before { background: var(--amber); }
.status.soon::before { background: var(--accent); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 0.95rem; color: var(--accent); text-decoration: none;
}
.link-arrow svg { width: 15px; height: 15px; transition: transform 0.15s; }
@media (hover: hover) { .link-arrow:hover { text-decoration: underline; } }
@media (hover: hover) { .link-arrow:hover svg { transform: translate(2px, -2px); } }
@media (hover: hover) { .link-arrow.internal:hover svg { transform: translateX(3px); } }

/* ---------- section scaffolding ---------- */
section { padding-block: 72px; }
@media (min-width: 900px) { section { padding-block: 88px; } }
.kicker {
  display: flex; align-items: center; gap: 12px;
  font: 600 0.75rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 18px;
}
.kicker b { color: var(--accent); font-weight: 600; white-space: nowrap; }
.kicker::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-head { display: grid; gap: 14px; margin-bottom: 40px; max-width: 760px; }
.section-head h2 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); font-stretch: 112%; }
.section-head p { color: var(--ink-2); margin: 0; font-size: 1.08rem; }

/* ---------- hero ---------- */
.hero { padding-block: 40px 24px; position: relative; isolation: isolate; }
@media (min-width: 900px) { .hero { padding-block: 72px 32px; } }
.hero::before {
  /* faint display graticule */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 30% 30%, #000 30%, transparent 75%);
}
.annunciator {
  display: flex; align-items: flex-start; gap: 10px;
  font: 600 0.72rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 28px;
}
.annunciator .lamp {
  width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; margin-top: 4px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 20%, transparent);
}
.hero-grid { display: grid; gap: 28px; align-items: end; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.08fr 1fr; gap: 56px; } }
.hero h1 {
  font-size: clamp(3.1rem, 1.2rem + 9vw, 7.4rem);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.9;
}
.hero h1 span { display: block; }
.hero h1 .dot { display: inline; color: var(--accent); }
.role {
  margin-top: 18px;
  font: 500 0.82rem/1.5 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.lead { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.42rem); line-height: 1.45; color: var(--ink); margin-bottom: 26px; text-wrap: pretty; }
.lead em { font-style: normal; color: var(--ink-2); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- ARINC 429 word ---------- */
.word {
  margin: 48px 0 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); box-shadow: var(--shadow);
  overflow: hidden;
}
.word-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font: 600 0.7rem/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}
.word-bar .hint { color: var(--ink-3); font-weight: 500; letter-spacing: 0.04em; text-transform: none; }
.word-bar .hint a { color: var(--accent); text-underline-offset: 3px; }
.word-body { padding: 16px; display: grid; gap: 16px; }
@media (min-width: 900px) { .word-body { grid-template-columns: 1fr auto; align-items: center; gap: 28px; padding: 20px 22px; } }

.bits { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; }
@media (min-width: 720px) { .bits { grid-template-columns: repeat(32, minmax(0, 1fr)); } }
.bit {
  appearance: none; border: 0; margin: 0; padding: 0;
  display: grid; grid-template-rows: auto auto; justify-items: center; gap: 1px;
  padding-block: 6px 5px; border-radius: 5px; cursor: pointer;
  font-family: var(--mono); color: var(--ink);
  background: var(--bg-3);
  border-top: 2px solid var(--f, var(--line-2));
  transition: background 0.15s, color 0.15s;
}
.bit .n { font-size: 0.56rem; color: var(--ink-3); line-height: 1; }
.bit .v { font-size: 0.95rem; font-weight: 600; line-height: 1.2; }
.bit[aria-pressed="true"] { background: color-mix(in srgb, var(--f, var(--ink)) 16%, var(--bg-3)); }
.bit[aria-pressed="false"] .v { color: var(--ink-3); font-weight: 400; }
@media (hover: hover) { .bit:hover { background: color-mix(in srgb, var(--f, var(--ink)) 26%, var(--bg-3)); } }
.bit.flip { animation: flip 0.35s ease; }
@keyframes flip { 0% { transform: scaleY(1); } 45% { transform: scaleY(0.2); } 100% { transform: scaleY(1); } }

.f-p    { --f: var(--ink-3); }
.f-ssm  { --f: var(--amber); }
.f-data { --f: var(--accent); }
.f-sdi  { --f: #9b87f5; }
.f-lbl  { --f: var(--live); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; padding: 0; list-style: none; font: 500 0.72rem/1.3 var(--mono); color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend li::before { content: ""; width: 10px; height: 3px; border-radius: 2px; background: var(--f); }
.legend b { color: var(--ink); font-weight: 600; }

.readout {
  display: grid; gap: 2px; min-width: 0;
  padding: 12px 14px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--line);
  font-family: var(--mono);
}
@media (min-width: 900px) { .readout { min-width: 270px; } }
.readout .lbl { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.readout .val { font-size: 1.7rem; font-weight: 700; color: var(--accent); line-height: 1.15; font-variant-numeric: tabular-nums; }
.readout .val small { font-size: 0.9rem; font-weight: 600; color: var(--ink-2); margin-left: 4px; }
.readout .sub { font-size: 0.74rem; color: var(--ink-2); }
.readout .ok { color: var(--live); }
.readout .bad { color: var(--amber); }
.readout-actions { display: flex; gap: 12px; margin-top: 8px; }
.readout button {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  font: 600 0.72rem/1 var(--mono); color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- featured work ---------- */
.work-list { display: grid; gap: 28px; }
.project {
  display: grid; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
  background: var(--bg-2); overflow: hidden; box-shadow: var(--shadow);
}
@media (min-width: 900px) {
  .project { grid-template-columns: 1.1fr 1fr; min-height: 440px; }
  .project.flip .media { order: 2; border-right: 0; border-left: 1px solid var(--line); }
}
.media {
  position: relative; min-width: 0;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
@media (min-width: 900px) { .media { border-bottom: 0; border-right: 1px solid var(--line); } }

.phones {
  display: flex; justify-content: center; align-items: center;
  padding: 36px 12px 0; height: 100%; min-height: 320px; overflow: hidden;
}
@media (min-width: 900px) { .phones { padding: 44px 24px 0; align-items: flex-end; } }
.phone {
  flex: none; width: clamp(118px, 30vw, 200px);
  border-radius: clamp(16px, 4vw, 26px); overflow: hidden;
  border: 1px solid var(--line-2);
  background: #000;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  aspect-ratio: 1290 / 2796;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone.side { transform: translateY(26px) scale(0.92); opacity: 0.96; }
.phone.side:first-child { margin-right: -26px; }
.phone.side:last-child { margin-left: -26px; }
.phone.main { position: relative; z-index: 1; }
@media (min-width: 900px) {
  .phone { width: min(200px, 30%); }
  .phones { margin-bottom: -40px; } /* phones run off the bottom edge */
  .phone.side { transform: translateY(30px) scale(0.9); }
}

.shot-wide { padding: 20px; display: grid; place-items: center; height: 100%; }
@media (min-width: 900px) { .shot-wide { padding: 32px; } }
.shot-wide img { border-radius: 10px; border: 1px solid var(--line-2); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22); width: 100%; }

.project-body { padding: 26px 22px 28px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 640px) { .project-body { padding: 34px 34px 36px; } }
@media (min-width: 900px) { .project-body { padding: 44px 44px; justify-content: center; } }
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.platforms { font: 600 0.72rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.project h3 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem); font-stretch: 115%; }
.project h3 .sub { display: block; margin-top: 8px; font-size: 1.02rem; font-stretch: 100%; font-weight: 600; letter-spacing: -0.005em; color: var(--ink-2); line-height: 1.35; }
.project p { color: var(--ink-2); margin: 0; }
.project .links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 2px; }
.project .note { font: 500 0.78rem/1.4 var(--mono); color: var(--ink-3); }

/* PAR "display unit" panel */
.du {
  height: 100%; padding: 22px; display: grid; align-content: center; gap: 14px;
}
@media (min-width: 900px) { .du { padding: 36px; } }
.du-screen {
  border-radius: 12px; background: #0a0d11; color: #e6ebf0; border: 1px solid #262e38;
  padding: 16px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 18px 40px rgba(0,0,0,0.2);
  font-family: var(--mono);
}
.du-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.66rem; letter-spacing: 0.12em; color: #8a95a3; padding-bottom: 12px; border-bottom: 1px solid #222a33; margin-bottom: 12px; }
.du-head .on { color: #5fd38d; }
.du-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
@media (min-width: 480px) { .du-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .du-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .du-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.du-cell { display: grid; gap: 2px; min-width: 0; }
.du-cell .k { font-size: 0.62rem; letter-spacing: 0.12em; color: #8a95a3; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.du-cell .v { font-size: 1.45rem; font-weight: 700; color: #62d3e6; line-height: 1.1; font-variant-numeric: tabular-nums; }
.du-cell .v.g { color: #5fd38d; }
.du-cell .v.w { color: #e6ebf0; }
.du-flow {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid #222a33;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.66rem; letter-spacing: 0.06em; color: #b0b8c3;
}
.du-flow span { padding: 4px 6px; border: 1px solid #2c3540; border-radius: 4px; white-space: nowrap; }
.du-flow i { font-style: normal; color: #62d3e6; }
.du-caption { font: 500 0.72rem/1.4 var(--mono); color: var(--ink-3); text-align: center; margin: 0; }

/* ---------- more shipped ---------- */
.grid-4 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.tile {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2);
  overflow: hidden; transition: border-color 0.15s, transform 0.2s;
}
@media (hover: hover) { .tile:hover { border-color: var(--line-2); } }
.thumb {
  position: relative; aspect-ratio: 16 / 11; background: var(--bg-3); overflow: hidden;
  border-bottom: 1px solid var(--line);
  display: grid; place-items: center;
}
.thumb .portrait {
  position: absolute; left: 50%; top: 11%; transform: translateX(-50%);
  width: 46%; max-width: 200px; height: auto;
  border-radius: 12px 12px 0 0; border: 1px solid var(--line-2); border-bottom: 0;
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}
.thumb .landscape { width: 86%; border-radius: 8px; border: 1px solid var(--line-2); box-shadow: 0 10px 26px rgba(0,0,0,0.16); }
.thumb .cover { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.tile-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tile h3 { font-size: 1.2rem; font-stretch: 110%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile p { color: var(--ink-2); font-size: 0.95rem; margin: 0; flex: 1; }
.tile .link-arrow { font-size: 0.88rem; margin-top: 4px; }
.tile .tag { font: 600 0.66rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.tile > .tile-body > .status { align-self: flex-start; white-space: normal; line-height: 1.3; }
.tile .tile-tech { flex: none; font: 500 0.78rem/1.5 var(--mono); color: var(--ink-3); }
.tile-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; }
.tile-links .link-arrow { margin-top: 0; }
/* Little Airfield: the featured game spans the whole row above the four small tiles */
@media (min-width: 720px) {
  .tile.feature { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .tile.feature .thumb { aspect-ratio: auto; min-height: 100%; border-bottom: 0; border-right: 1px solid var(--line); }
  .tile.feature .tile-body { padding: 26px 28px 28px; gap: 10px; justify-content: center; }
  .tile.feature h3 { font-size: 1.6rem; }
  .tile.feature p { flex: none; }
}

/* ---------- how I work ---------- */
.practice { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 760px) { .practice { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.practice > div { background: var(--bg-2); padding: 26px 22px 28px; }
@media (min-width: 760px) { .practice > div { padding: 32px 32px 34px; } }
.practice .num { font: 600 0.72rem/1 var(--mono); color: var(--accent); letter-spacing: 0.1em; }
.practice h3 { font-size: 1.3rem; font-stretch: 110%; margin: 12px 0 10px; }
.practice p { color: var(--ink-2); margin: 0; }

/* ---------- experience ---------- */
.xp { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.xp > li { display: grid; gap: 6px 32px; padding: 26px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 820px) { .xp > li { grid-template-columns: 220px 1fr; } }
.xp .when { font: 500 0.8rem/1.5 var(--mono); color: var(--ink-3); padding-top: 4px; }
.xp h3 { font-size: 1.28rem; font-stretch: 108%; letter-spacing: -0.01em; }
.xp h3 { text-wrap: pretty; }
.xp h3 .org { display: block; margin-top: 4px; font-size: 1.02rem; font-stretch: 100%; color: var(--ink-2); font-weight: 600; }
@media (min-width: 820px) {
  .xp h3 .org { display: inline; margin: 0; font-size: inherit; font-stretch: inherit; }
}
.xp ul { margin: 10px 0 0; padding-left: 1.1em; color: var(--ink-2); }
.xp li li { margin-bottom: 4px; }
.xp li li::marker { color: var(--ink-3); }
.xp-foot { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; color: var(--ink-2); font-size: 0.95rem; }

/* ---------- experiments (low-key) ---------- */
.lab { padding-top: 0; }
.lab .section-head h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
.lab .grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.lab .tile { background: transparent; }
.lab .thumb { aspect-ratio: 16 / 10; }
.lab .thumb .portrait { width: 52%; top: 9%; border-radius: 10px 10px 0 0; }
.lab .tile h3 { font-size: 1.02rem; }
.lab .tile p { font-size: 0.88rem; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding-block: 56px 44px; }
.foot-grid { display: grid; gap: 28px; }
@media (min-width: 820px) { .foot-grid { grid-template-columns: 1fr auto; align-items: end; } }
.foot h2 { font-size: clamp(1.8rem, 1.1rem + 2.6vw, 3rem); font-stretch: 118%; margin-bottom: 12px; }
.foot p { color: var(--ink-2); margin: 0; max-width: 520px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px; }
.colophon {
  margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font: 500 0.74rem/1.5 var(--mono); color: var(--ink-3);
}
.colophon a { color: var(--ink-2); }

/* ---------- case study (par.html) ---------- */
.cs-hero { padding-block: 48px 40px; }
@media (min-width: 900px) { .cs-hero { padding-block: 80px 56px; } }
.back { display: inline-flex; align-items: center; gap: 8px; font: 600 0.78rem/1 var(--mono); letter-spacing: 0.06em; color: var(--ink-3); text-decoration: none; margin-bottom: 28px; }
@media (hover: hover) { .back:hover { color: var(--accent); } }
.back svg { width: 14px; height: 14px; }
.cs-hero h1 { font-size: clamp(2.3rem, 1.2rem + 5vw, 4.8rem); font-stretch: 120%; font-weight: 800; letter-spacing: -0.03em; line-height: 0.98; max-width: 14ch; }
.cs-hero .lead { margin-top: 22px; max-width: 760px; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 36px; }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.facts div { background: var(--bg-2); padding: 18px 18px 16px; min-width: 0; }
.facts dt { font: 600 0.66rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 6px 0 0; font: 700 clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem)/1.05 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.facts dd small { display: block; margin-top: 4px; font: 500 0.78rem/1.35 var(--sans); color: var(--ink-2); }

.cs-section { padding-block: 56px; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .cs-section { padding-block: 80px; } }
.cs-grid { display: grid; gap: 18px 56px; }
@media (min-width: 900px) { .cs-grid { grid-template-columns: 260px 1fr; } }
.cs-grid > header .kicker { margin-bottom: 12px; }
.cs-grid > header .kicker::after { display: none; }
.cs-grid h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); font-stretch: 112%; }
.prose { max-width: 720px; color: var(--ink-2); }
.prose p { margin-bottom: 1.1em; }
.prose strong { color: var(--ink); font-weight: 650; }
.feature-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 720px) { .feature-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feature-list li { background: var(--bg-2); padding: 20px 20px 22px; }
.feature-list h3 { font-size: 1.06rem; font-stretch: 106%; letter-spacing: -0.005em; margin-bottom: 8px; color: var(--ink); line-height: 1.25; }
.feature-list p { margin: 0; font-size: 0.95rem; color: var(--ink-2); }

.diagram {
  margin: 8px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2);
  padding: 16px; overflow: hidden;
}
@media (min-width: 720px) { .diagram { padding: 24px; } }
.diagram svg { width: 100%; height: auto; }
.diagram figcaption { margin-top: 14px; font: 500 0.76rem/1.5 var(--mono); color: var(--ink-3); }
.diagram .d-box { fill: var(--bg-3); stroke: var(--line-2); stroke-width: 1.25; }
.diagram .d-core { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.diagram .d-store { fill: var(--bg-2); stroke: var(--ink-3); stroke-width: 1.25; }
.diagram .d-group { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 4 4; }
.diagram .d-t { fill: var(--ink); font: 650 14px var(--sans); }
.diagram .d-s { fill: var(--ink-2); font: 500 11.5px var(--mono); }
.diagram .d-g { fill: var(--ink-3); font: 600 10.5px var(--mono); letter-spacing: 0.12em; }
.diagram .d-line { stroke: var(--ink-3); stroke-width: 1.4; fill: none; }
.diagram .d-line.a { stroke: var(--accent); }
.diagram .d-arrow { fill: var(--ink-3); }
.diagram .d-arrow.a { fill: var(--accent); }
.diagram .d-small { display: block; }
.diagram .d-large { display: none; }
@media (min-width: 760px) { .diagram .d-small { display: none; } .diagram .d-large { display: block; } }

.checks { display: grid; gap: 14px; margin-top: 8px; }
@media (min-width: 720px) { .checks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.check { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--bg-2); }
.check .n { font: 700 1.9rem/1 var(--mono); color: var(--accent); }
.check .t { margin-top: 8px; font-weight: 650; color: var(--ink); }
.check p { margin: 6px 0 0; font-size: 0.92rem; color: var(--ink-2); }
.checks + .prose { margin-top: 22px; }
.disclaimer {
  margin-top: 8px; padding: 14px 16px; border-radius: 10px; border: 1px dashed var(--line-2);
  font: 500 0.8rem/1.5 var(--mono); color: var(--ink-3);
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- print ---------- */
@media print {
  .top, .theme-btn, .word, .cta { display: none !important; }
  body { background: #fff; color: #000; }
}
.hero h1 + .lead { margin-top: 24px; }

/* =====================================================================
   Fun layer (assets/js/fun.js). All motion is removed under reduced motion
   by the global rule above; JS also checks the preference before animating.
   ===================================================================== */
[hidden] { display: none !important; }

.term-btn { font: 700 0.78rem/1 var(--mono); letter-spacing: -0.02em; }
.glitch { display: inline-block; }

/* blinking cursor on the hero name */
.hero h1 .dot { animation: blink 1.15s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ambient cursor grid: one fixed layer behind every page (assets/js/fun.js builds it for mouse and
   trackpad users only). A 600px glow box follows the cursor by transform; its own grid is shifted by
   background-position so the lit lines sit exactly on the page's 48px grid while it scrolls. Nothing
   in it is laid out, so it can't shift content; the clip box keeps it from widening the page. */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 0.45s; }
.ambient.on { opacity: 1; }
.ambient-glow {
  position: absolute; left: 0; top: 0; width: 600px; height: 600px; will-change: transform;
  background-image:
    radial-gradient(closest-side, var(--accent-soft), transparent),
    linear-gradient(color-mix(in srgb, var(--accent) 24%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 24%, transparent) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent 85%);
  mask-image: radial-gradient(closest-side, #000, transparent 85%);
}
:root[data-theme="light"] .ambient-glow { opacity: 0.8; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) { .ambient { display: none; } }
@media print { .ambient { display: none; } }

/* card tilt + pointer glow: mouse/trackpad only, so nothing sticks or creates layers on touch */
.project, .tile { position: relative; }
@media (hover: hover) and (pointer: fine) {
  .project, .tile {
    transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.45s cubic-bezier(.2,.7,.2,1), border-color 0.2s, box-shadow 0.3s;
  }
  .project.is-tilting, .tile.is-tilting { transition: transform 0.08s linear, border-color 0.2s, box-shadow 0.3s; }
  .project::after, .tile::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
    transition: opacity 0.35s;
    background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 11%, transparent), transparent 60%);
  }
  .project.is-tilting::after, .tile.is-tilting::after { opacity: 1; }
  .project.is-tilting, .tile.is-tilting { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
}

/* RGB-split glitch on project names while hovering their card */
@media (hover: hover) { .project:hover .glitch, .tile:hover .glitch, .hero h1:hover span { animation: glitch 0.42s steps(2) 1; } }
@keyframes glitch {
  0%   { text-shadow: 2px 0 #ff2bd6, -2px 0 #2be4ff; transform: translateX(0); }
  25%  { text-shadow: -3px 0 #ff2bd6, 3px 0 #2be4ff; transform: translateX(1px); clip-path: inset(10% 0 55% 0); }
  50%  { text-shadow: 2px 0 #ff2bd6, -2px 0 #2be4ff; transform: translateX(-1px); clip-path: inset(50% 0 10% 0); }
  75%  { text-shadow: -1px 0 #ff2bd6, 1px 0 #2be4ff; clip-path: none; }
  100% { text-shadow: none; transform: none; }
}

/* scanlines on the PAR display unit */
.du-screen { position: relative; overflow: hidden; }
.du-screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.028) 0 1px, transparent 1px 3px);
}

/* smart mirror frames */
.phone.mframe {
  aspect-ratio: 720 / 1280; border-radius: 6px; border: 7px solid #221c17; background: #000;
  box-shadow: 0 0 0 1px #3a3029, 0 18px 40px rgba(0, 0, 0, 0.3);
}
.as-btn { appearance: none; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }

/* boot / POST overlay */
.boot {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: var(--bg); transition: opacity 0.4s;
}
.boot.out, .intrusion.out, .rain.out, .toast.out { opacity: 0; }
.boot-text {
  margin: 0; max-width: 100%; overflow: hidden; min-height: 9.5em;
  font: 500 clamp(0.7rem, 0.55rem + 0.7vw, 0.95rem)/1.65 var(--mono); color: var(--ink-2); white-space: pre;
}
.boot-text::first-line { color: var(--accent); font-weight: 700; }
.boot-text::after { content: "▮"; color: var(--accent); animation: blink 0.8s steps(1) infinite; }
.boot-hint {
  position: absolute; left: 0; right: 0; bottom: 28px; margin: 0; text-align: center;
  font: 500 0.72rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}

/* katakana rain */
.rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; opacity: 0.55; transition: opacity 0.6s; }
:root[data-theme="light"] .rain:not(.front) { opacity: 0.35; }
.rain.front { z-index: 89; opacity: 1; }

/* netrunner intrusion */
.intrusion {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; cursor: pointer;
  background: rgba(2, 5, 7, 0.72); transition: opacity 0.45s;
}
.intrusion-text {
  margin: 0; max-width: 100%; overflow: hidden; white-space: pre-wrap;
  font: 600 clamp(0.72rem, 0.5rem + 0.9vw, 1.05rem)/1.7 var(--mono); color: #3cff8f;
  text-shadow: 0 0 8px rgba(60, 255, 143, 0.55);
}
.intrusion .boot-hint { color: #8a95a3; }
html.glitching body { animation: shake 0.65s steps(3) 1; }
html.glitching h1, html.glitching h2, html.glitching h3 { text-shadow: 3px 0 #ff2bd6, -3px 0 #2be4ff; }
html.glitching img { filter: hue-rotate(90deg) saturate(2); }
@keyframes shake {
  0% { transform: translate(0); } 20% { transform: translate(-4px, 2px) skewX(2deg); }
  40% { transform: translate(5px, -1px); filter: invert(1); } 60% { transform: translate(-2px, 1px) skewX(-3deg); filter: none; }
  80% { transform: translate(3px, 0); } 100% { transform: none; }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 95; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font: 600 0.85rem/1.4 var(--mono); box-shadow: var(--shadow);
  transition: opacity 0.4s;
}

/* terminal */
.term {
  width: min(760px, calc(100vw - 24px)); height: min(520px, calc(100dvh - 48px)); max-width: none; max-height: none;
  padding: 0; border: 1px solid #2a333d; border-radius: 12px; overflow: hidden;
  background: #0a0d11; color: #d6e4ee; font: 500 0.86rem/1.55 var(--mono);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.term[open] { display: flex; flex-direction: column; }
.term::backdrop { background: rgba(5, 8, 12, 0.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.term-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 14px; border-bottom: 1px solid #1e252e; color: #8a95a3; font-size: 0.74rem; letter-spacing: 0.06em;
}
.term-x {
  appearance: none; width: 30px; height: 30px; border-radius: 8px; border: 1px solid #2a333d; background: #12161b;
  color: #d6e4ee; font: 600 1rem/1 var(--mono); cursor: pointer;
}
@media (hover: hover) { .term-x:hover { border-color: #62d3e6; } }
.term-out { flex: 1; overflow-y: auto; padding: 14px; }
.t-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.t-line.cmd { color: #62d3e6; margin-top: 8px; }
.t-line.err { color: #ff8aa0; }
.t-line.ok { color: #5fd38d; }
.t-line.dim { color: #8a95a3; }
.t-line a { color: #62d3e6; }
.term-form { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid #1e252e; }
.term-form:focus-within { background: #0d1217; }
.term-ps { color: #5fd38d; white-space: nowrap; }
.term-in {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #e9ecf0;
  font: inherit; caret-color: #62d3e6; padding: 6px 0;
}

.hint { color: var(--ink-3); }
.hint kbd {
  font: 600 0.72rem/1 var(--mono); padding: 2px 5px; border-radius: 4px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink-2);
}

@media print { .boot, .term, .rain, .intrusion, .toast { display: none !important; } }
@media (min-width: 900px) {
  .phone.mframe { width: min(220px, 31%); }
  .phone.main.mframe { width: min(250px, 36%); }
}

/* =====================================================================
   Writing, guestbook, studio, privacy (subpages). Same tokens as above.
   ===================================================================== */

/* nav: current page + a wider breakpoint so mobile keeps two links */
.nav a[aria-current="page"] { color: var(--ink); background: var(--bg-3); }
.nav .hide-lg { display: none; }
@media (min-width: 1024px) { .nav .hide-lg { display: inline-block; } }
/* Arcade: from 800px (between 720 and 800 the header is full; it is in the menu sheet there) */
.nav .hide-md { display: none; }
@media (min-width: 800px) { .nav .hide-md { display: inline-block; } }

/* footer site links */
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.foot-nav a { color: var(--ink-2); }
@media (hover: hover) { .foot-nav a:hover { color: var(--accent); } }

/* ---------- post lists (kept for when writing returns; unused while it is unpublished) ---------- */
.strip { padding-top: 0; }
.strip .section-head { margin-bottom: 22px; }
.strip .section-head h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
.post-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.post-links a {
  display: grid; gap: 4px 24px; padding: 18px 20px; background: var(--bg-2); text-decoration: none;
  transition: background 0.15s;
}
@media (min-width: 720px) { .post-links a { grid-template-columns: 190px 1fr auto; align-items: baseline; padding: 20px 24px; } }
@media (hover: hover) { .post-links a:hover { background: var(--bg-3); } }
.post-links .date { font: 500 0.76rem/1.5 var(--mono); color: var(--ink-3); letter-spacing: 0.04em; white-space: nowrap; }
.post-links .title { font-size: 1.12rem; font-weight: 700; font-stretch: 106%; letter-spacing: -0.01em; line-height: 1.3; color: var(--ink); }
.post-links .sum { display: block; margin-top: 6px; font-size: 0.95rem; font-weight: 400; font-stretch: 100%; letter-spacing: 0; color: var(--ink-2); }
.post-links .go { display: inline-flex; align-items: center; gap: 6px; font: 600 0.74rem/1 var(--mono); color: var(--accent); white-space: nowrap; }
.post-links .go svg { width: 14px; height: 14px; transition: transform 0.15s; }
@media (hover: hover) { .post-links a:hover .go svg { transform: translateX(3px); } }

/* ---------- long-form posts ---------- */
.post-head h1 { font-size: clamp(2.1rem, 1.2rem + 3.6vw, 3.9rem); max-width: 20ch; }
.post-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 24px;
  font: 500 0.76rem/1.5 var(--mono); letter-spacing: 0.04em; color: var(--ink-3);
}
.post-meta { display: block; } /* plain inline text: the " · " separators are real characters, so copy and innerText read naturally */
.post-meta .sep { color: var(--ink-3); }
.post-body { padding-block: 8px 64px; }
@media (min-width: 900px) { .post-body { padding-block: 16px 88px; } }
.post {
  font-size: 1.05rem; line-height: 1.72; color: var(--ink-2);
  overflow-wrap: break-word;
}
@media (min-width: 640px) { .post { font-size: 1.1rem; } }
.post > :first-child { margin-top: 0; }
.post p { margin: 0 0 1.15em; text-wrap: pretty; }
.post strong { color: var(--ink); font-weight: 650; }
.post a:not(.btn) { color: var(--accent); }
.post h2 {
  margin: 2.1em 0 0.7em; color: var(--ink);
  font-size: clamp(1.45rem, 1.2rem + 1vw, 1.95rem); font-stretch: 110%; line-height: 1.15;
}
.post h3 { margin: 1.8em 0 0.5em; color: var(--ink); font-size: 1.18rem; font-stretch: 106%; letter-spacing: -0.01em; line-height: 1.3; }
.post ul, .post ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.post li { margin-bottom: 0.45em; padding-left: 0.2em; }
.post li::marker { color: var(--ink-3); }
.post blockquote {
  margin: 1.6em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--accent); color: var(--ink);
  font-size: 1.06em; line-height: 1.55;
}
.post blockquote p:last-child { margin-bottom: 0; }
.post hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.post code {
  font: 500 0.84em/1.4 var(--mono); color: var(--ink);
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 5px; padding: 0.08em 0.36em;
}
.post pre {
  margin: 1.5em 0; padding: 16px 18px; border-radius: 12px; border: 1px solid #262e38;
  background: #0a0d11; color: #d6e4ee; overflow-x: auto; -webkit-overflow-scrolling: touch;
  font: 500 0.8rem/1.65 var(--mono); tab-size: 2;
}
@media (min-width: 640px) { .post pre { font-size: 0.85rem; padding: 18px 22px; } }
.post pre code { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
.post pre .c { color: #8a95a3; }
.post pre .k { color: #62d3e6; }
.post pre .g { color: #5fd38d; }
.post pre .a { color: #f0b44c; }
.post pre .v { color: #c3b5ff; }
.table-wrap {
  margin: 1.5em 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2);
}
.post table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.45; }
.post th, .post td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.post th { font: 600 0.68rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); background: var(--bg-3); white-space: nowrap; }
.post td { color: var(--ink-2); }
.post td:first-child { color: var(--ink); font-family: var(--mono); font-size: 0.86rem; white-space: nowrap; }
.post tr:last-child td { border-bottom: 0; }
.callout {
  margin: 1.6em 0; padding: 16px 18px; border-radius: 12px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--bg-2);
  font-size: 0.97rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout .k { display: block; margin-bottom: 6px; font: 600 0.7rem/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
/* posts use a narrower measure; the bit-flipper sits in a wider band between text blocks */
.wrap.narrow { max-width: calc(760px + var(--gutter) * 2); }
.wrap.mid { max-width: calc(1080px + var(--gutter) * 2); }
.post-body .word { margin: 8px 0 14px; }
.word-try { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 2em; }
.word-try button {
  appearance: none; cursor: pointer; padding: 8px 11px; border-radius: 8px;
  font: 600 0.76rem/1.2 var(--mono); color: var(--ink-2); background: var(--bg-2); border: 1px solid var(--line-2);
}
@media (hover: hover) { .word-try button:hover { color: var(--ink); border-color: var(--accent); } }
.word-try button b { color: var(--accent); font-weight: 600; }
.post-end { margin-top: 2.6em; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 18px; }
.post-end p { margin: 0; font-size: 0.96rem; }
.post-end .links { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- forms (guestbook + waitlist) ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > label, .field > .label {
  font: 600 0.74rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.field .opt { color: var(--ink-3); font-weight: 500; letter-spacing: 0.02em; text-transform: none; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; margin: 0; padding: 12px 14px;
  font: 400 1rem/1.45 var(--sans); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 128px; resize: vertical; }
.field select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23808a96' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}
.field select:invalid { color: var(--ink-3); }
.field select option { color: var(--ink); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); opacity: 0.8; }
@media (hover: hover) { .field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-3); } }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-row { display: grid; gap: 18px; }
@media (min-width: 560px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field-hint { display: flex; justify-content: space-between; gap: 12px; font: 500 0.74rem/1.4 var(--mono); color: var(--ink-3); }
.field-hint .count { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.field-hint .count.over { color: var(--amber); font-weight: 700; }
.field-check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.97rem; color: var(--ink-2); cursor: pointer; }
.field-check input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); cursor: pointer; }
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form-foot .fine { margin: 0; font: 500 0.74rem/1.5 var(--mono); color: var(--ink-3); flex: 1 1 220px; }
.form-foot .fine a { color: var(--ink-2); }
button.btn { cursor: pointer; }
button.btn:disabled { opacity: 0.6; cursor: progress; }
.form-status { margin: 0; font: 600 0.86rem/1.45 var(--mono); color: var(--ink-2); }
.form-status:empty { display: none; }
.form-status.ok { color: var(--live); }
.form-status.err { color: var(--amber); }
/* result panels: clear enough to read at a glance on a phone */
.form-status.ok, .form-status.err {
  display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; border: 1px solid;
  font: 500 0.95rem/1.5 var(--sans); color: var(--ink);
}
.form-status.ok { border-color: color-mix(in srgb, var(--live) 55%, var(--line)); background: color-mix(in srgb, var(--live) 9%, var(--bg-2)); }
.form-status.err { border-color: color-mix(in srgb, var(--amber) 60%, var(--line)); background: color-mix(in srgb, var(--amber) 9%, var(--bg-2)); }
.form-status-title { font-size: 1.05rem; font-weight: 700; color: var(--live); }
.gb-entry.pending { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.gb-pending {
  justify-self: start; display: inline-block; margin-top: 8px; padding: 4px 7px; border-radius: 5px;
  font: 600 0.75rem/1.3 var(--mono); letter-spacing: 0.03em; color: var(--accent);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.panel {
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--bg-2);
  box-shadow: var(--shadow); padding: 22px 18px;
}
@media (min-width: 640px) { .panel { padding: 30px 30px 32px; } }
.noscript-note { margin: 0; padding: 14px 16px; border-radius: 10px; border: 1px dashed var(--line-2); font: 500 0.82rem/1.5 var(--mono); color: var(--ink-2); }

/* ---------- guestbook ---------- */
.gb-section { padding-top: 8px; }
.gb-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .gb-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; } }
.gb-window { border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); box-shadow: var(--shadow); overflow: hidden; }
.gb-titlebar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--line-2);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, var(--bg-3)), var(--bg-3) 70%);
  font: 600 0.74rem/1.2 var(--mono); letter-spacing: 0.04em; color: var(--ink);
}
.gb-titlebar .ctl { display: flex; gap: 4px; }
.gb-titlebar .ctl i {
  display: grid; place-items: center; width: 20px; height: 18px; border-radius: 3px;
  font: 700 0.66rem/1 var(--mono); font-style: normal; color: var(--ink-2); background: var(--bg-2);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.5), inset -1px -1px 0 rgba(0, 0, 0, 0.18); border: 1px solid var(--line-2);
}
.gb-window .form { padding: 20px 18px 22px; }
@media (min-width: 640px) { .gb-window .form { padding: 26px 26px 28px; } }
.marquee {
  overflow: hidden; white-space: nowrap; border-bottom: 1px dashed var(--line-2);
  font: 600 0.72rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  padding: 9px 0; background: var(--accent-soft);
}
.marquee span { display: inline-block; padding-left: 100%; animation: marquee 24s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .marquee span { padding-left: 14px; } }
.gb-side { display: grid; gap: 18px; }
.counter-box {
  display: grid; justify-items: center; gap: 12px; padding: 22px 18px 20px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2);
}
.counter-box .cap { font: 600 0.7rem/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.odometer { display: inline-flex; gap: 4px; padding: 6px; border-radius: 8px; background: #05070a; border: 1px solid #262e38; position: relative; overflow: hidden; }
.odometer span {
  display: grid; place-items: center; width: 1.45em; height: 1.85em; border-radius: 4px;
  font: 700 clamp(1.3rem, 1rem + 1.2vw, 1.75rem)/1 var(--mono); color: #5fd38d; font-variant-numeric: tabular-nums;
  background: linear-gradient(#141a21, #0a0d11 48%, #0d1116 52%, #141a21);
  text-shadow: 0 0 8px rgba(95, 211, 141, 0.45);
}
.odometer::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
}
.counter-box .sub { margin: 0; font-size: 0.9rem; color: var(--ink-2); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.badge88 {
  display: grid; place-items: center; width: 88px; height: 31px; padding: 0 4px; text-align: center;
  font: 700 0.54rem/1.1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid #000; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.4), inset -1px -1px 0 rgba(0, 0, 0, 0.4);
}
.badge88.b1 { background: #0a0d11; color: #5fd38d; }
.badge88.b2 { background: #0a6c7d; color: #fff; }
.badge88.b3 { background: #f0b44c; color: #1a1200; }
.badge88.b4 { background: #e9ecf0; color: #15181c; }
.badge88.b5 { background: #1c120f; color: #ff9b73; border-color: #d97757; }
.badge88.b6 { background: #f6821f; color: #1f0e00; }
.badge88.b7 { background: #ff3dc8; color: #1a0014; }
/* "Signed from N countries" + a flag row (approved entries only; forms.js). Fixed heights: no shift when it fills in. */
.gb-geo { display: grid; justify-items: center; gap: 4px; width: 100%; }
html:not(.js) .gb-geo { display: none; }
.gb-geo-text { height: 20px; margin: 0; font: 600 0.75rem/20px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.gb-flags { display: flex; justify-content: center; align-items: center; gap: 4px; width: 100%; height: 32px; margin: 0; overflow: hidden; }
.gb-flag { flex: none; font: 400 22px/32px "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif; }
.gb-flag-more { flex: none; font: 600 0.75rem/32px var(--mono); color: var(--ink-3); }
.gb-flag.is-code {
  height: 24px; padding: 0 5px; font: 700 0.75rem/22px var(--mono); letter-spacing: 0.06em; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line-2)); border-radius: 2px; background: var(--bg-3);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.08), inset -1px -1px 0 rgba(0, 0, 0, 0.25);
}
.gb-flag-slot { flex: none; width: 28px; height: 20px; border: 1px dashed var(--line-2); border-radius: 2px; }
.gb-rules { padding: 18px 18px 16px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); font-size: 0.93rem; color: var(--ink-2); }
.gb-rules h2 { font: 600 0.72rem/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.gb-rules ul { margin: 0; padding-left: 1.3em; }
.gb-rules li { margin-bottom: 5px; }
.gb-rules li::marker { content: "★  "; color: var(--accent); font-size: 0.8em; }
.gb-entries { margin-top: 64px; }
.gb-entries .section-head { margin-bottom: 22px; }
.gb-entries .section-head h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
.gb-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 900px) { .gb-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gb-entry { min-width: 0; padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.gb-entry .head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.gb-entry .num { font: 600 0.72rem/1 var(--mono); color: var(--accent); }
.gb-entry .who { font-weight: 700; font-stretch: 106%; color: var(--ink); overflow-wrap: anywhere; }
.gb-entry .when { margin-left: auto; font: 500 0.72rem/1.4 var(--mono); color: var(--ink-3); }
.gb-entry .site { display: block; margin-top: 2px; font: 500 0.76rem/1.4 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.gb-entry .msg { margin: 10px 0 0; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.gb-new {
  font: 700 0.6rem/1 var(--mono); letter-spacing: 0.08em; color: var(--accent-ink); background: var(--accent);
  padding: 3px 5px; border-radius: 3px; animation: blink 1.2s steps(1) infinite;
}
.gb-empty { padding: 22px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-2); font: 500 0.88rem/1.5 var(--mono); text-align: center; }

/* ---------- studio ---------- */
.who-for { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 28px 0 0; }
.who-for li {
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2);
  font-size: 0.92rem; font-weight: 600; color: var(--ink-2);
}
.waitlist-grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .waitlist-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 56px; } }
.waitlist-grid .section-head { margin-bottom: 0; }
.steps { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; color: var(--ink-2); font-size: 0.97rem; }
.steps li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font: 600 0.74rem/1.9 var(--mono); color: var(--accent);
}

/* ---------- terminal: fly ---------- */
.t-fly { position: relative; height: 30px; margin: 6px 0 2px; overflow: hidden; }
.t-fly::before {
  content: ""; position: absolute; left: 0; right: 0; top: 15px; border-top: 1px dashed rgba(98, 211, 230, 0.35);
  transform-origin: left; animation: t-trail var(--fly-ms, 3200ms) linear forwards;
}
.t-fly svg { position: absolute; top: 3px; left: 0; width: 46px; height: 24px; color: #62d3e6; animation: t-fly var(--fly-ms, 3200ms) linear forwards; }
@keyframes t-fly { from { transform: translateX(-50px); } to { transform: translateX(var(--fly-to, 700px)); } }
@keyframes t-trail { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.t-fly.calm svg { left: 50%; transform: translateX(-50%); animation: none; }
.t-fly.calm::before { animation: none; transform: none; }

/* =====================================================================
   Phones and small tablets. Everything below 720px is tuned here, after the
   desktop rules, so wide layouts are untouched. Minimums on phones: body text
   16px+, secondary text 14px+, mono labels 12px+, tap targets 44px+.
   ===================================================================== */

/* safe areas (viewport-fit=cover); env() is 0 on desktop, so this is a no-op there */
.wrap {
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.top { padding-top: env(safe-area-inset-top); }
.foot { padding-bottom: calc(44px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ---------- menu button + sheet ---------- */
.menu-btn svg { width: 20px; height: 20px; }
@media (min-width: 1024px) { .menu-btn { display: none; } }
.menu {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(380px, 88vw); max-width: none; height: 100vh; height: 100dvh; max-height: none;
  padding: calc(8px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) 20px;
  border: 0; border-left: 1px solid var(--line); border-radius: 0;
  background: var(--bg-2); color: var(--ink); box-shadow: -24px 0 60px rgba(0, 0, 0, 0.28);
  overflow-y: auto; overscroll-behavior: contain;
}
.menu[open] { display: flex; flex-direction: column; gap: 20px; animation: menu-in 0.24s cubic-bezier(.2, .7, .2, 1); }
@keyframes menu-in { from { transform: translateX(32px); opacity: 0; } }
.menu::backdrop { background: rgba(5, 8, 12, 0.55); }
.menu-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.menu-title { font: 600 0.8rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.menu-x svg { width: 20px; height: 20px; }
.menu-nav ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.menu-nav li { border-bottom: 1px solid var(--line); }
.menu-nav a {
  display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 4px 2px;
  font-size: 1.3rem; font-weight: 700; font-stretch: 110%; letter-spacing: -0.01em; line-height: 1.2;
  color: var(--ink); text-decoration: none;
}
@media (hover: hover) { .menu-nav a:hover { color: var(--accent); } }
.menu-nav a[aria-current="page"] { color: var(--accent); }
.menu-nav a[aria-current="page"]::after { content: "you are here"; margin-left: auto; font: 500 0.75rem/1 var(--mono); letter-spacing: 0.04em; color: var(--ink-2); }
.menu-n { min-width: 24px; font: 600 0.8rem/1 var(--mono); letter-spacing: 0.04em; color: var(--accent); }
.menu-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: auto; }
.menu-actions .btn { justify-content: center; }
.menu-actions .btn-primary { grid-column: 1 / -1; }
.menu-note { margin: 0; font: 500 0.8rem/1.4 var(--mono); color: var(--ink-2); text-align: center; }
html.menu-open, html.menu-open body { overflow: hidden; }

/* ---------- "More" disclosure (phones only) ---------- */
.more-btn { display: none; }
@media (min-width: 720px) { .m-only { display: none !important; } }

@media (max-width: 719.98px) {
  html { scroll-padding-top: 68px; }

  /* header: brand + terminal + theme + menu, all 44px */
  .top .wrap { height: 56px; gap: 10px; }
  .brand { min-height: 44px; }
  .nav { gap: 6px; }
  .nav a { padding: 12px 10px; }
  .theme-btn { width: 44px; height: 44px; margin-left: 0; border-radius: 12px; }

  /* type floor */
  .kicker { font-size: 0.75rem; flex-wrap: wrap; row-gap: 8px; line-height: 1.35; margin-bottom: 12px; }
  .kicker::after { flex: 1 0 24px; }
  .annunciator, .platforms, .status, .chips li, .legend, .tile .tag,
  .du-head, .du-cell .k, .du-caption, .facts dt, .post th, .callout .k { font-size: 0.75rem; }
  .colophon, .post-links .go, .field > label, .field > .label, .field-hint, .form-foot .fine,
  .diagram figcaption, .gb-titlebar, .marquee, .counter-box .cap, .gb-rules h2,
  .gb-entry .num, .gb-entry .when, .steps li::before, .hint kbd { font-size: 0.8rem; }
  .facts dd small { font-size: 0.875rem; }
  .gb-new { font-size: 0.75rem; }

  /* rhythm */
  section { padding-block: 40px; }
  .section-head { gap: 10px; margin-bottom: 20px; }
  .section-head h2 { font-size: clamp(1.6rem, 1.1rem + 2.4vw, 2.1rem); }
  .section-head p { font-size: 1rem; }

  /* hero */
  .hero { padding-block: 20px 8px; }
  .annunciator { margin-bottom: 14px; text-wrap: balance; }
  .hero-grid { gap: 16px; }
  .role { margin-top: 12px; font-size: 0.8rem; }
  .lead { font-size: 1.1rem; margin-bottom: 18px; }
  .cta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cta .btn { justify-content: center; padding: 0 12px; }
  .cta .btn-primary { grid-column: 1 / -1; }

  /* ARINC 429 word: edge to edge, 4 rows of 8 bits, readout right under the bits */
  .word {
    margin: 24px calc(var(--gutter) * -1) 0; border-radius: 0; border-left: 0; border-right: 0; box-shadow: none;
  }
  .word-bar { padding: 10px var(--gutter); font-size: 0.75rem; }
  .word-bar .hint { font-size: 0.8rem; letter-spacing: 0.01em; }
  .word-body { padding: 12px 8px 14px; gap: 12px; }
  .word-body > div:first-child { display: contents; }
  .bits { order: 1; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px 2px; }
  .bit { min-height: 50px; padding-block: 7px 6px; border-radius: 6px; border-top-width: 3px; }
  .bit .n { font-size: 0.75rem; }
  .bit[aria-pressed="true"] .n { color: var(--ink-2); }
  .bit .v { font-size: 1.2rem; }
  .readout { order: 2; padding: 10px 12px; }
  .readout .lbl { font-size: 0.75rem; letter-spacing: 0.06em; }
  .readout .val { font-size: 1.6rem; }
  .readout .sub { font-size: 0.8rem; }
  .readout-actions { margin-top: 2px; }
  .readout button { font-size: 0.85rem; min-height: 44px; }
  .legend { order: 3; margin: 0; padding-inline: 4px; gap: 6px 12px; }
  .post-body .word { margin: 8px calc(var(--gutter) * -1) 14px; }
  .word-try button { min-height: 44px; font-size: 0.8rem; }

  /* featured work */
  .work-list { gap: 18px; }
  .project { border-radius: var(--radius); }
  .phones { aspect-ratio: 2 / 1; height: auto; min-height: 0; padding: 22px 12px 0; align-items: flex-start; }
  .phones { gap: 8px; }
  .phone, .phone.side, .phone.mframe { width: calc((100% - 16px) / 3); max-width: 132px; border-radius: 12px; transform: none; opacity: 1; margin: 0; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
  .phone.mframe { border-width: 4px; border-radius: 6px; }
  .phone.side:first-child, .phone.side:last-child { margin: 0; }
  .shot-wide { padding: 14px; }
  .shot-wide img, .thumb .portrait, .thumb .landscape { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16); }
  .project, .panel, .gb-window, .du-screen { box-shadow: none; }
  .du { padding: 12px 12px 10px; gap: 8px; }
  .du-screen { padding: 12px; }
  .du-head { letter-spacing: 0.08em; padding-bottom: 10px; margin-bottom: 10px; }
  .du-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
  .du-cell .k { letter-spacing: 0.02em; }
  .du-cell .v { font-size: 1.35rem; }
  .du-2nd, .du-flow { display: none; }
  .project-body { padding: 16px 18px 14px; gap: 10px; }
  .project-meta .status { white-space: normal; line-height: 1.3; border-radius: 12px; letter-spacing: 0.04em; }
  .project h3 { font-size: 1.65rem; }
  .project h3 .sub { margin-top: 6px; font-size: 1rem; }
  .project .note { font-size: 0.875rem; }
  .project .links { gap: 0 18px; margin-top: -4px; }
  .project .links .more-btn { margin-left: auto; }
  .link-arrow { min-height: 44px; }
  .js .m-extra:not(.is-open) { display: none; }
  .js .more-btn {
    display: inline-flex; align-items: center; align-self: flex-start; gap: 6px;
    min-height: 44px; padding: 0 2px; border: 0; background: none; cursor: pointer;
    font: 600 0.95rem/1 var(--sans); color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 0.25em;
  }
  @media (hover: hover) { .more-btn:hover { color: var(--ink); } }
  .more-chev { width: 16px; height: 16px; flex: none; transition: transform 0.2s; }
  .more-btn[aria-expanded="true"] .more-chev { transform: rotate(180deg); }

  /* card rails: sideways scroll-snap with a peek of the next card */
  .rail {
    display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 12px;
    scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  }
  .rail > * { flex: 0 0 min(76%, 300px); scroll-snap-align: start; }
  .practice.rail { background: none; border: 0; border-radius: 0; overflow-y: hidden; }
  .practice.rail > div { flex-basis: min(88%, 360px); border: 1px solid var(--line); border-radius: var(--radius); }
  .lab .rail { gap: 12px; }
  .lab .rail > .tile { flex-basis: min(66%, 250px); }
  .lab .thumb { aspect-ratio: 16 / 9; }
  .rail:focus-visible { outline-offset: -2px; border-radius: 0; }
  .thumb { aspect-ratio: 16 / 10; }
  .tile-body { padding: 14px 16px 16px; gap: 6px; }
  .tile h3 { font-size: 1.15rem; }
  .tile p { font-size: 0.92rem; }
  .lab .tile p { font-size: 0.875rem; }

  /* how I work */
  .practice > div { padding: 18px 18px 20px; }
  .practice p { font-size: 0.97rem; }
  .practice .num { font-size: 0.75rem; }
  .practice h3 { font-size: 1.2rem; margin: 10px 0 8px; }

  /* experience */
  .xp > li { padding: 16px 0; gap: 4px; }
  .xp .when { padding-top: 0; }
  .xp h3 { font-size: 1.18rem; }
  .xp h3 .org { margin-top: 2px; font-size: 0.97rem; }
  .xp ul { margin-top: 8px; }
  .xp-foot { margin-top: 14px; font-size: 0.9rem; }
  .js .xp-more { margin-top: 6px; }
  .xp-foot .btn { width: 100%; justify-content: center; }

  /* writing strip */
  .strip .section-head { margin-bottom: 16px; }
  .post-links a { padding: 14px 18px 16px; grid-template-columns: 1fr auto; align-items: center; gap: 6px 16px; }
  .post-links .date { grid-column: 1; grid-row: 1; }
  .post-links .go { grid-column: 2; grid-row: 1; }
  .post-links .title { grid-column: 1 / -1; }

  /* footer */
  .foot { padding-top: 40px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .foot-grid { gap: 22px; }
  .foot-links { display: grid; }
  .foot-links .btn { justify-content: center; }
  .colophon { margin-top: 28px; flex-direction: column; gap: 6px; }
  .foot-nav { gap: 0 18px; }
  .foot-nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }

  /* case study */
  .cs-hero { padding-block: 28px 32px; }
  .cs-hero h1 { font-size: clamp(2rem, 1.3rem + 3.4vw, 2.5rem); max-width: none; }
  .back { min-height: 44px; margin-bottom: 12px; }
  .facts { margin-top: 28px; }
  .facts div { padding: 14px 14px 12px; }
  .cs-section { padding-block: 44px; }
  .diagram { padding: 10px; }
  .diagram .d-small .d-s { font-size: 12px; }

  /* long-form posts */
  .post-head h1 { font-size: clamp(1.9rem, 1.2rem + 3.6vw, 2.4rem); }
  .post h2 { font-size: 1.45rem; margin-top: 1.8em; }
  .post pre { margin-inline: calc(var(--gutter) * -1); border-radius: 0; border-left: 0; border-right: 0; padding: 14px var(--gutter); font-size: 0.8rem; }
  .table-wrap { margin-inline: calc(var(--gutter) * -1); border-radius: 0; border-left: 0; border-right: 0; }
  .post-end .links .btn { width: 100%; justify-content: center; white-space: normal; text-align: center; line-height: 1.25; padding-block: 10px; }

  /* forms */
  .form { gap: 16px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .field-check { min-height: 44px; align-items: center; }
  .field-check input { margin-top: 0; width: 20px; height: 20px; }
  .form-foot .btn { width: 100%; justify-content: center; }
  .form-foot .fine { flex-basis: 100%; }

  /* terminal: no zoom-on-focus, bigger close button */
  .term-in { font-size: 16px; }
  .term-x { width: 44px; height: 44px; }

  /* studio + guestbook */
  .who-for { margin-top: 22px; }
  .who-for li { font-size: 0.9rem; }
  .gb-entries { margin-top: 44px; }
}

/* the keyboard easter-egg hint is noise on touch screens */
@media (hover: none) and (pointer: coarse) { .colophon .hint { display: none; } }

/* very narrow phones: keep the DG mark, drop the wordmark so the header buttons fit */
@media (max-width: 359.98px) { .brand > span:last-child { display: none; } }

/* =====================================================================
   Stability on touch screens: no sticky hover, no pointer effects, no blur
   behind the sticky header, nothing that appears late and pushes content.
   ===================================================================== */
/* final guard against sideways scroll; tools/verify.js measures with it switched off, so root
   causes still fail the check. clip (not hidden) keeps position: sticky working. */
html, body { overflow-x: clip; }
html { -webkit-tap-highlight-color: rgba(45, 226, 255, 0.16); }
/* JS-only controls are styled visible from the first paint (theme.js adds .js in <head>), so they
   don't pop in and shove the header or a row of buttons sideways when the scripts run */
html:not(.js) [data-term], html:not(.js) [data-menu], html:not(.js) [data-intrusion], html:not(.js) [data-word-try] { display: none !important; }
@media (hover: none), (pointer: coarse), (max-width: 719.98px) {
  .top { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  .btn:active, .more-btn:active, .menu-nav a:active, .post-links a:active, .bit:active { opacity: 0.75; }
}

/* =====================================================================
   CYBERPUNK SKIN. Static by design: the look comes from colour, type,
   thin neon borders, corner brackets and a faint grid, never from motion.
   Body copy stays a clean sans in --ink/--ink-2; neon is for accents,
   labels, headings and borders. Works in both night and daylight.
   ===================================================================== */
body {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
}
::selection { background: var(--accent-2); color: #fff; }
a { text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }

/* small HUD accents: katakana and MIRROR-OS labels (decorative, hidden from screen readers) */
.kana { font: 500 0.75rem/1.3 var(--mono); letter-spacing: 0.18em; color: var(--accent-2); }

/* header */
.top { border-bottom: 1px solid color-mix(in srgb, var(--accent) 14%, transparent); }
.top.is-stuck { border-bottom-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.brand-mark {
  background: transparent; color: var(--accent); border: 1px solid var(--accent); border-radius: 3px;
  box-shadow: 0 0 12px var(--glow), inset 0 0 8px color-mix(in srgb, var(--accent) 18%, transparent);
}
.nav a { font: 600 0.78rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; border-radius: 3px; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.theme-btn { border-radius: 4px; border-color: var(--line-2); background: var(--bg-2); }
@media (hover: hover) { .theme-btn:hover { border-color: var(--accent); color: var(--accent); } }

/* buttons: clipped-corner primary, neon-outlined secondary */
.btn { border-radius: 3px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); background: var(--bg-2); }
.btn-primary {
  border-radius: 0; border-color: var(--accent); background: var(--accent); color: var(--accent-ink);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.btn-primary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -5px; }
@media (hover: hover) { .btn:hover { border-color: var(--accent); color: var(--accent); } .btn-primary:hover { color: var(--accent-ink); } }

/* chips + status pills: square, HUD-like */
.chips li { border-radius: 2px; background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.status { border-radius: 2px; background: transparent; letter-spacing: 0.08em; }
.status.live { border-color: color-mix(in srgb, var(--live) 50%, var(--line)); color: var(--live); }
.status.review { border-color: color-mix(in srgb, var(--amber) 50%, var(--line)); color: var(--amber); }
.status.soon { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--accent); }
.status.internal { border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line)); color: var(--accent-2); }
.status.internal::before { background: var(--accent-2); }
.status.exp { border-color: var(--line-2); color: var(--ink-2); }
.status.exp::before { background: transparent; border: 1px solid var(--ink-3); }

/* section labels read like a HUD: "// 01  FEATURED WORK" */
.kicker b::before { content: "// "; content: "// " / ""; color: var(--accent-2); }
.kicker::after { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, transparent), transparent); }
.platforms { color: var(--accent-2); }
.annunciator { color: var(--accent); }
.annunciator .lamp { background: var(--live); box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 18%, transparent), 0 0 10px var(--live); }

/* hero */
.hero h1 { text-shadow: 0 0 34px color-mix(in srgb, var(--accent) 22%, transparent); }
.hero h1 .dot { color: var(--accent-2); text-shadow: 0 0 18px var(--accent-2); }
.role { color: var(--ink-2); }
.role::before { content: "> "; content: "> " / ""; color: var(--accent); }
.hero-tag { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 14px 0 0; }

/* frames: thin borders + neon corner brackets on the main panels */
.project, .pcard, .panel, .word, .gb-window, .tile, .practice > div, .facts, .check, .feature-list, .post-links,
.diagram, .table-wrap, .counter-box, .gb-entry, .readout, .callout {
  border-radius: var(--radius);
}
.project, .pcard, .panel, .word, .gb-window { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.project, .pcard, .panel, .word, .gb-window, .tile { position: relative; }
.project::before, .pcard::before, .panel::before, .word::before, .gb-window::before, .tile::before {
  content: ""; position: absolute; inset: -1px; z-index: 3; pointer-events: none;
  --c: var(--accent);
  background:
    linear-gradient(var(--c), var(--c)) left top / 16px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) left top / 2px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 16px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 2px 16px no-repeat;
}
.project.flip::before, .pcard:nth-child(even)::before { --c: var(--accent-2); }
.word-bar { color: var(--accent); }
.word-bar .hint { color: var(--ink-3); }
.readout { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.media { background-color: var(--bg); }
.project h3 .sub { color: var(--ink-2); }
.du-screen { border-color: color-mix(in srgb, var(--accent) 35%, #262e38); }
.practice { background: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.practice .num { color: var(--accent-2); }
.xp > li { border-color: var(--line); }
.xp .when { color: var(--accent); }
.xp li li::marker { color: var(--accent-2); }
.post-links { background: color-mix(in srgb, var(--accent) 20%, var(--line)); }
.post-links .date { color: var(--accent-2); }

/* featured -> all projects */
.see-all { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 26px; color: var(--ink-2); font-size: 0.95rem; }
.tag-note { font: 500 0.75rem/1.3 var(--mono); color: var(--ink-3); letter-spacing: 0.04em; }

/* long-form */
.post blockquote { border-left-color: var(--accent-2); }
.callout { border-left-color: var(--accent-2); }
.callout .k { color: var(--accent-2); }
.post pre, .term { border-color: color-mix(in srgb, var(--accent) 30%, #262e38); }

/* footer */
.foot { border-top-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.foot h2 { text-shadow: 0 0 26px color-mix(in srgb, var(--accent) 22%, transparent); }
.foot h2::after { content: "_"; content: "_" / ""; color: var(--accent); }
.colophon { border-top-color: var(--line); }

/* guestbook leans all the way in */
.gb-titlebar { background: linear-gradient(90deg, color-mix(in srgb, var(--accent-2) 30%, var(--bg-3)), color-mix(in srgb, var(--accent) 22%, var(--bg-3)) 70%); }
.marquee { color: var(--accent-2); background: var(--accent-2-soft); border-bottom-color: color-mix(in srgb, var(--accent-2) 40%, var(--line)); }
.gb-entry { border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.gb-entry .num { color: var(--accent-2); }
.gb-rules { border-color: color-mix(in srgb, var(--accent-2) 40%, var(--line)); }
.gb-rules li::marker { color: var(--accent-2); }
.counter-box { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }

/* ---------- /projects/ ---------- */
.projects { padding-top: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
html:not(.js) .filters, html:not(.js) .filter-count { display: none; }
.filters button {
  appearance: none; cursor: pointer; min-height: 44px; padding: 0 16px; border-radius: 2px;
  font: 600 0.8rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2); background: var(--bg-2); border: 1px solid var(--line-2);
}
.filters button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
@media (hover: hover) { .filters button:hover { border-color: var(--accent); color: var(--accent); } .filters button[aria-pressed="true"]:hover { color: var(--accent-ink); } }
.filter-count { margin: 0 0 18px; font: 500 0.8rem/1.4 var(--mono); color: var(--ink-3); letter-spacing: 0.04em; }
.pgrid { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.pcard { display: flex; flex-direction: column; min-width: 0; background: var(--bg-2); border: 1px solid var(--line); scroll-margin-top: 80px; }
.pcard .thumb { aspect-ratio: 16 / 10; border-bottom: 1px solid var(--line); background: var(--bg-3); }
.pcard .thumb .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .cover.top { object-position: center 12%; }
.thumb .cover.tl { object-position: top left; }
.pcard-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.pcard-name { font-size: 1.35rem; font-stretch: 112%; }
.pcard-pitch { margin: 0; color: var(--ink-2); font-size: 0.97rem; flex: 1; }
.pcard .chips { margin-top: 2px; }
.pcard-act { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 4px; width: 100%; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 0.9rem; }
.pcard-act .link-arrow { min-height: 44px; }
.pcard-more { width: 100%; }
.pcard-more summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 0.95rem; color: var(--accent);
}
.pcard-more summary::-webkit-details-marker { display: none; }
.pcard-more summary::after { content: "+"; content: "+" / ""; font: 700 1rem/1 var(--mono); }
.pcard-more[open] summary::after { content: "−"; content: "−" / ""; }
.pcard-more p { margin: 0 0 4px; color: var(--ink-2); font-size: 0.95rem; }
/* PAR has no screenshots (internal data), so its thumbnail is a little status readout */
.du-mini {
  position: absolute; inset: 14px; display: grid; align-content: center; gap: 10px; padding: 14px;
  background: #0a0d11; color: #e6ebf0; border: 1px solid color-mix(in srgb, var(--accent) 35%, #262e38); border-radius: 4px; font-family: var(--mono);
}
.du-mini-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.75rem; letter-spacing: 0.08em; color: #8aa3ad; }
.du-mini-head i { font-style: normal; color: #3dff9a; }
.du-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.du-mini-grid > span { display: grid; }
.du-mini-grid b { font-size: 1.3rem; line-height: 1.1; color: #2de2ff; }
.du-mini-grid b.g { color: #3dff9a; }
.du-mini-grid small { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: #8aa3ad; }

@media (max-width: 719.98px) {
  /* filters: one sideways-scrolling chip row */
  .filters {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 4px; gap: 8px;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; padding: 0 14px; }
  /* phones: the picture always sits on top of the card at full card width in a fixed 16:9 box (one
     column, then two compact columns from 480px), never squeezed into a side column */
  .pgrid { grid-template-columns: 1fr; gap: 14px; }
  .pcard .thumb { aspect-ratio: 16 / 9; }
  .pcard-body { padding: 12px 14px 12px; gap: 6px; }
  .pcard-name { font-size: 1.15rem; }
  .pcard-pitch { font-size: 0.92rem; line-height: 1.45; }
  .pcard .chips li { padding: 5px 6px; }
  .pcard-act { margin-top: 0; }
  .du-mini { inset: 10px; padding: 10px 12px; gap: 6px; }
  .du-mini-head { letter-spacing: 0.04em; }
  .du-mini-grid { gap: 4px 12px; }
  .du-mini-grid b { font-size: 1.15rem; }
  .pcard .chips li:nth-child(n+4) { display: none; }
  .see-all .btn { width: 100%; justify-content: center; }
  .project::before, .pcard::before, .panel::before, .word::before, .gb-window::before, .tile::before {
    background-size: 12px 2px, 2px 12px, 12px 2px, 2px 12px;
  }
  .word { border-left: 0; border-right: 0; }
}

.annunciator .kana { margin-left: 4px; }
.colophon .eol { color: var(--accent-2); }
.thumb .cover.mid { object-position: center 58%; }
.sig { font: 600 0.8rem/1.5 var(--mono); letter-spacing: 0.08em; color: var(--accent-2); margin: -6px 0 22px; }

.xp h3 .org-sep { display: none; }
@media (min-width: 820px) { .xp h3 .org-sep { display: inline; font-weight: inherit; color: var(--ink-2); } }

/* /projects/: one-glance index of everything that's live */
.live-web { margin: 0 0 26px; padding: 14px 16px 6px; border: 1px solid color-mix(in srgb, var(--live) 35%, var(--line)); border-radius: var(--radius); background: var(--bg-2); }
.live-web h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font: 600 0.8rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--live); }
.live-web .lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live); flex: none; }
.live-web .lw-count { margin-left: auto; color: var(--ink-3); letter-spacing: 0.04em; }
.live-web ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); column-gap: 18px; }
.live-web li { border-top: 1px solid var(--line); }
.live-web a { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--ink); min-width: 0; }
.live-web .lw-name { font-weight: 700; white-space: nowrap; }
.live-web .lw-host { flex: 1; min-width: 0; font: 500 0.78rem/1.3 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; text-align: right; }
.live-web a svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
@media (hover: hover) { .live-web a:hover .lw-name { color: var(--accent); } }

.pcard-aside { font: 500 0.8rem/1 var(--mono); letter-spacing: 0.04em; color: var(--ink-3); }
/* "open site": a brief screen flash, mouse/trackpad only (the reduced-motion rule removes it too) */
@media (hover: hover) and (pointer: fine) {
  html.flash body { animation: dg-flash 0.42s steps(3) 1; }
  @keyframes dg-flash { 33% { filter: brightness(1.6) hue-rotate(40deg); } 66% { filter: invert(1) hue-rotate(180deg); } }
}

/* status pills may wrap rather than push a narrow card wider than the screen */
.status { max-width: 100%; }
.pcard .status { white-space: normal; line-height: 1.3; }

/* =====================================================================
   Gameplay clips (assets/js/clips.js). The still is the poster; the video
   is laid absolutely over it in the same box, so swapping can't shift
   anything. It fades in once it actually plays.
   ===================================================================== */
.clip-box { position: relative; }
.clip-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center;
  opacity: 0; transition: opacity 0.45s; pointer-events: none; background: transparent;
}
.clip-box.is-live .clip-video { opacity: 1; }
.clip-hud {
  position: absolute; left: 8px; top: 8px; z-index: 2; pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px 4px 6px; border-radius: 2px;
  font: 600 0.72rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  color: #e8f6fa; background: rgba(6, 8, 11, 0.72); border: 1px solid rgba(45, 226, 255, 0.45);
  opacity: 0; transition: opacity 0.45s;
}
.clip-hud::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff3dc8; box-shadow: 0 0 6px #ff3dc8; }
.clip-box.is-live .clip-hud { opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .clip-box.is-live .clip-hud::before { animation: blink 1.4s steps(1) infinite; } }
/* home: the wide shots get a frame that carries the border, so the video lines up with the image */
.shot-wide .clip-frame {
  position: relative; width: 100%; overflow: hidden;
  border-radius: 10px; border: 1px solid var(--line-2); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}
.shot-wide .clip-frame img { border: 0; border-radius: 0; box-shadow: none; }
/* case study: a live capture or screenshot in the article, framed like the home cards */
.cs-media { margin: 28px 0 0; }
.cs-media .clip-frame { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line-2); box-shadow: var(--shadow); background: var(--bg-3); }
.cs-media img { display: block; width: 100%; height: auto; }
.cs-media figcaption { margin-top: 12px; font: 500 0.76rem/1.5 var(--mono); color: var(--ink-3); }

/* live-status dot on live project cards. assets/js/status.js sets data-state="up|slow|down"; until it
   does (or with JS off) the chip stays hidden. Absolutely placed in the image corner, so it never moves
   anything when it appears. The state is spelled out, never colour alone. */
.sdot {
  position: absolute; right: 8px; top: 8px; z-index: 3; pointer-events: none;
  display: none; align-items: center; gap: 6px; padding: 4px 7px; border-radius: 2px;
  font: 600 0.72rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  color: #e8f6fa; background: rgba(6, 8, 11, 0.72); border: 1px solid rgba(232, 246, 250, 0.22);
}
.sdot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; box-sizing: border-box; }
.sdot[data-state="up"], .sdot[data-state="slow"], .sdot[data-state="down"] { display: inline-flex; }
.sdot[data-state="up"] { border-color: rgba(61, 255, 154, 0.5); }
.sdot[data-state="up"]::before { background: #3dff9a; box-shadow: 0 0 0 3px rgba(61, 255, 154, 0.22), 0 0 6px #3dff9a; }
.sdot[data-state="up"]::after { content: "Up"; content: "Up" / ""; }
.sdot[data-state="slow"] { border-color: rgba(255, 181, 71, 0.55); }
.sdot[data-state="slow"]::before { background: #ffb547; }
.sdot[data-state="slow"]::after { content: "Slow"; content: "Slow" / ""; }
.sdot[data-state="down"] { border-color: rgba(255, 61, 200, 0.6); }
.sdot[data-state="down"]::before { border: 1.5px solid #ff3dc8; }
.sdot[data-state="down"]::after { content: "Down"; content: "Down" / ""; }
.media > .sdot { right: 12px; top: 12px; }

/* status panel slots (home + /projects/). The widget (status.js + status.css, built separately) fills
   [data-status-panel]; status.css reserves its height, and the slot reserves the same height again so
   nothing below moves even before status.css arrives: 3 columns x 4 rows from 480px, 2 x 6 below
   (11 nodes; keep in step with --ns-rows in status.css). */
.status-slot { padding-block: 0; min-height: 300px; }
@media (max-width: 479.98px) { .status-slot { min-height: 408px; } }
html:not(.js) .status-slot { display: none; }
#work .status-slot { margin-top: 28px; }
.live-row { display: grid; gap: 18px; margin: 0 0 26px; }
.live-row .live-web { margin: 0; }
@media (min-width: 1024px) { .live-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
/* side by side with the status panel, the list is narrower: host goes under the name instead of wrapping */
@media (min-width: 1024px) {
  .live-row .live-web a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; padding: 5px 0; }
  .live-row .live-web .lw-name { grid-row: 1; grid-column: 1; line-height: 1.25; }
  .live-row .live-web .lw-host { grid-row: 2; grid-column: 1; text-align: left; overflow-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .live-row .live-web a svg { grid-row: 1 / 3; grid-column: 2; }
}
@media (max-width: 719.98px) {
  .clip-hud, .sdot { font-size: 0.75rem; }
  .pcard .sdot { right: 4px; top: 4px; padding: 3px 5px; gap: 4px; letter-spacing: 0.04em; }
  .shot-wide .clip-frame { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16); }
}

/* ---------- /now/ ---------- */
.now-log {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 1px;
  background: color-mix(in srgb, var(--accent) 20%, var(--line)); border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: var(--radius); overflow: hidden;
}
.now-entry { display: grid; gap: 12px 32px; padding: 22px 20px 24px; background: var(--bg-2); min-width: 0; }
@media (min-width: 720px) { .now-entry { grid-template-columns: 150px minmax(0, 1fr); padding: 26px 28px 28px; } }
.now-k {
  display: flex; align-items: baseline; gap: 10px; margin: 0;
  font: 600 0.8rem/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink);
}
.now-k span { color: var(--accent-2); }
.now-k span::before { content: "// "; content: "// " / ""; }
.now-body p, .now-items p { margin: 0; color: var(--ink-2); }
.now-body a, .now-items p a, .now-note a { color: var(--accent); }
.now-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.now-items li { display: grid; gap: 6px; min-width: 0; }
.now-items .now-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.now-items .now-name a { font-size: 1.15rem; font-weight: 700; font-stretch: 108%; letter-spacing: -0.01em; color: var(--ink); text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); }
@media (hover: hover) { .now-items .now-name a:hover { color: var(--accent); } }
.now-note { margin: 22px 0 0; font: 500 0.82rem/1.6 var(--mono); color: var(--ink-3); }
.now-note em { font-style: normal; color: var(--ink-2); }
@media (max-width: 719.98px) {
  .now-entry { padding: 18px 16px 20px; }
  .now-items .now-name a { display: inline-flex; align-items: center; min-height: 44px; }
  .now-items .now-name { gap: 0 12px; }
  .now-items .status { white-space: normal; line-height: 1.3; }
}

/* "Latest from the workshop" (/now/, assets/js/activity.js + /api/activity). The feed box reserves
   6 fixed rows before anything loads, so the skeleton, the list, the "quiet week" note and the offline
   note all take exactly the same space; with JS off it shrinks to a one-line link to GitHub. */
.ws {
  position: relative; padding: 0; margin: 22px 0 0;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: var(--radius); background: var(--bg-2);
}
.ws::before {
  content: ""; position: absolute; inset: -1px; z-index: 2; pointer-events: none; --c: var(--accent-2);
  background:
    linear-gradient(var(--c), var(--c)) left top / 16px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) left top / 2px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 16px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 2px 16px no-repeat;
}
.ws-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 6px 12px 6px 20px; border-bottom: 1px solid var(--line);
}
.ws-title { min-width: 0; }
.ws-title span { white-space: nowrap; }
.ws-src {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; flex: none;
  font: 600 0.78rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); text-decoration: none;
}
.ws-src svg { width: 14px; height: 14px; }
@media (hover: hover) { .ws-src:hover { text-decoration: underline; } }
.ws-feed { --ws-rows: 6; --ws-row: 64px; height: calc(var(--ws-rows) * var(--ws-row)); overflow: hidden; }
html:not(.js) .ws-feed { height: auto; }
.ws-list { list-style: none; margin: 0; padding: 0; }
.ws-list li { height: var(--ws-row); border-bottom: 1px solid var(--line); }
.ws-list li:last-child { border-bottom: 0; }
.ws-item {
  box-sizing: border-box; display: grid; grid-template-rows: 22px 22px; align-content: center; row-gap: 3px;
  height: 100%; min-width: 0; padding: 0 20px; color: inherit; text-decoration: none;
}
a.ws-item { transition: background 0.15s; }
@media (hover: hover) { a.ws-item:hover { background: var(--bg-3); } a.ws-item:hover .ws-repo { color: var(--accent); } }
.ws-l1 { display: flex; align-items: center; gap: 10px; min-width: 0; font: 500 0.75rem/22px var(--mono); white-space: nowrap; }
.ws-kind {
  flex: none; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 2px;
  font: 700 0.75rem/18px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.ws-kind.push { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.ws-kind.create { color: var(--live); border-color: color-mix(in srgb, var(--live) 50%, var(--line)); }
.ws-kind.release { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line)); }
.ws-repo { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: 0.8125rem; color: var(--ink); }
.ws-when { margin-left: auto; flex: none; color: var(--ink-3); }
.ws-l2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.95rem; line-height: 22px; color: var(--ink-2); }
.ws-item.is-skel .ws-kind, .ws-item.is-skel .ws-repo, .ws-item.is-skel .ws-l2 { color: transparent; background: var(--bg-3); border-color: transparent; border-radius: 3px; }
.ws-item.is-skel .ws-kind { width: 54px; }
.ws-item.is-skel .ws-repo { width: 120px; height: 12px; }
.ws-item.is-skel .ws-l2 { width: 70%; height: 12px; margin-top: 5px; }
.ws-msg {
  box-sizing: border-box; height: 100%; margin: 0; display: grid; place-content: center; gap: 8px; padding: 18px 22px; text-align: center;
  font: 500 0.85rem/1.6 var(--mono); color: var(--ink-2);
}
html:not(.js) .ws-msg { display: block; text-align: left; padding: 16px 20px; }
.ws-msg b { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.ws-feed > .ws-msg { margin: 14px; height: calc(100% - 28px); border: 1px dashed var(--line-2); border-radius: var(--radius); }
html:not(.js) .ws-feed > .ws-msg { margin: 0; height: auto; border: 0; }
.ws-msg a { color: var(--accent); }
.ws-foot {
  height: 40px; margin: 0; padding: 0 20px; border-top: 1px solid var(--line); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 500 0.75rem/40px var(--mono); letter-spacing: 0.02em; color: var(--ink-3);
}
@media (max-width: 719.98px) {
  .ws-head { padding: 4px 6px 4px 16px; }
  .ws-item { padding: 0 16px; }
  .ws-foot { padding: 0 16px; }
  .ws-msg { padding: 16px; font-size: 0.8125rem; }
}

/* card art direction (thumb.fit in tools/projects.json): portrait phone screens and very wide shots
   sit on a tinted panel (the card surface plus the faint grid) instead of being cropped to a sliver */
.thumb.is-panel {
  background-color: var(--bg-3);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; background-position: center;
}
.pcard .thumb .contain { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22)); }
.pcard .thumb .shot-phone {
  position: absolute; left: 50%; top: 9%; height: 150%; width: auto; max-width: none; transform: translateX(-50%);
  border: 1px solid var(--line-2); border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}
@media (min-width: 480px) and (max-width: 719.98px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .du-mini-head i { display: none; }
  .du-mini-grid b { font-size: 1rem; }
}

/* the card picture links to the card's primary action (tabindex -1: the button stays the one tab stop).
   Mouse/trackpad users get a small zoom, a glow and a "▶ Play" / "↗ Open" chip; touch gets none of it. */
.pcard-media { position: relative; color: inherit; text-decoration: none; cursor: pointer; }
.shot-wide .clip-frame { display: block; }
.media-go {
  position: absolute; left: 10px; bottom: 10px; z-index: 3; pointer-events: none;
  display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 2px;
  font: 700 0.75rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  color: #00161c; background: #2de2ff; box-shadow: 0 0 16px rgba(45, 226, 255, 0.55);
  opacity: 0; transform: translateY(4px); transition: opacity 0.2s, transform 0.2s;
}
.phones .media-go { top: 14px; bottom: auto; }
.du .media-go { left: auto; right: 22px; bottom: 22px; }
.pcard-media:focus-visible .media-go { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .pcard-media img, .pcard-media .clip-video, .pcard-media .du-screen { transition: scale 0.35s cubic-bezier(.2, .7, .2, 1), opacity 0.45s, box-shadow 0.3s; }
  .pcard-media:hover .media-go { opacity: 1; transform: none; }
  .pcard-media:hover > img, .pcard-media:hover > .clip-video, .pcard-media:hover .phone img { scale: 1.04; }
  .pcard-media:hover .du-screen { scale: 1.015; box-shadow: 0 0 0 1px var(--accent), 0 0 24px var(--glow); }
  .pcard-media.clip-frame:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 26px var(--glow); }
  .pcard .pcard-media:hover { box-shadow: inset 0 -2px 0 var(--accent); }
}
@media (hover: none), (pointer: coarse) { .media-go { display: none; } }

/* card focal points, generated by tools/build_projects.py from thumb.focus */
/* build:focus */
.thumb img.focus-linework { object-position: 35% 50%; }
.thumb img.focus-fernwood { object-position: 50% 40%; }
.thumb img.focus-airfield { object-position: 50% 45%; }
.thumb img.focus-airfield-roblox { object-position: 50% 50%; }
.thumb img.focus-mixtape { object-position: 50% 55%; }
.thumb img.focus-dragonrealm { object-position: 50% 40%; }
.thumb img.focus-butter { object-position: 50% 50%; }
.thumb img.focus-beepbeach { object-position: 50% 50%; }
.thumb img.focus-retros { object-position: 0% 0%; }
.thumb img.focus-spectro { object-position: 0% 50%; }
.thumb img.focus-cyberhome { object-position: 0% 0%; }
.thumb img.focus-this-site { object-position: 50% 0%; }
.thumb img.focus-tinyduel { object-position: 50% 55%; }
.thumb img.focus-crittercup { object-position: 50% 45%; }
.thumb img.focus-sixfold { object-position: 50% 50%; }
/* /build:focus */
