/* Portfolio theme, "shop drawing": the site reads like a set of engineering drawings. A
   faint drafting grid sits behind the figures, photos get crop marks, projects carry
   numbered balloons (as on an assembly drawing's parts list), facts sit in ruled
   title-block tables with small mono labels, and section heads are underlined by a
   dimension line. One signal colour (safety orange) on graphite; site.yaml's
   `theme: light` (or the footer's Theme button) switches to "vellum". Every colour is a
   token on :root. Keep the motifs to these four; more would turn it into a costume. */

:root {
  --bg: #131517;            /* graphite page */
  --bg-2: #171a1c;          /* drawing-sheet bands (hero, page heads, footer) */
  --surface: #1c1f22;       /* plates behind photos */
  --surface-2: #23272b;
  --line: #2b3035;          /* hairlines */
  --line-2: #3b4147;        /* title-block frames, chip borders */
  --grid: rgb(235 232 226 / 4%);
  --grid-major: rgb(235 232 226 / 7.5%);
  --mark: rgb(235 232 226 / 42%); /* crop marks */
  --ink: #ebe8e2;           /* 14.9:1 on --bg */
  --ink-2: #b3b0a8;         /* 8.4:1 */
  --ink-3: #8f8d87;         /* 5.3:1, labels only */
  --signal: #ff7a2e;        /* safety orange, 7.0:1 on --bg */
  --signal-ink: #ff7a2e;    /* signal used as text */
  --on-signal: #1a0c04;     /* 7.3:1 on --signal */
  --signal-soft: rgb(255 122 46 / 12%);
  --screen: #0a0b0c;        /* the arcade cell's little screen stays lit in both themes */
  --coin: #f2b632;
  --coin-hi: #fff1b8;
  --coin-edge: #a86a00;
  --hdr-bg: rgb(19 21 23 / 86%);
  --note-bg: #332a07;
  --note-ink: #ffe38f;
  --draft: #e8a200;
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --maxw: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --hdr: 64px;
  --r: 2px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f2efe8;            /* drafting vellum */
  --bg-2: #ece8df;
  --surface: #e6e1d6;
  --surface-2: #ddd7ca;
  --line: #d6d0c4;
  --line-2: #b3ac9e;
  --grid: rgb(40 44 48 / 4%);
  --grid-major: rgb(40 44 48 / 7.5%);
  --mark: rgb(27 29 31 / 45%);
  --ink: #1b1d1f;           /* 14.7:1 */
  --ink-2: #45484c;         /* 8.0:1 */
  --ink-3: #57595c;         /* 5.4:1 on --surface */
  --signal: #b8400c;        /* fills: white text 5.6:1 */
  --signal-ink: #a8360a;    /* text: 5.4:1 on --bg-2 */
  --on-signal: #ffffff;
  --signal-soft: rgb(184 64 12 / 10%);
  --screen: #16181b;
  --hdr-bg: rgb(242 239 232 / 88%);
  --note-bg: #fff4d6;
  --note-ink: #5c4400;
  color-scheme: light;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--hdr) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; }
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
code { font: .9em var(--mono); background: var(--surface); padding: .1em .35em; border-radius: var(--r); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
[hidden] { display: none !important; }
.i { width: 16px; height: 16px; flex: none; }
.wrap { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--signal); color: var(--on-signal); padding: 10px 16px; font-weight: 600; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* Mono field labels: the small captions in the corners of a drawing's title block. */
.tb-k, .eyebrow, .sec-no, .sec-meta, .crumbs, .card-date, .card-tags, .badge, .fig-k, .fig-bar, .chip-n, .pill,
.balloon, .brand-mark, .page-count, .proj-sheetno, .notes-k, .spec-k, .ftr-base, .tb-note, .readout, kbd {
  font-family: var(--mono); font-weight: 500; letter-spacing: .06em;
}
.tb-k { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.2; text-transform: uppercase; color: var(--ink-3); }
.tb-k .i { width: 12px; height: 12px; }

/* Balloon: a numbered circle, as on an assembly drawing. */
.balloon { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border: 1px solid var(--line-2); border-radius: 50%; font-size: 12px; letter-spacing: 0; color: var(--ink-2); background: var(--bg); transition: border-color .15s, color .15s; }
.balloon--signal { border-color: var(--signal); color: var(--signal-ink); }
.balloon--lg { width: 44px; height: 44px; font-size: 14px; }

/* Crop marks: four L-shaped ticks just outside a figure's corners. */
.marks { position: relative; }
.marks::after {
  content: ""; position: absolute; inset: -7px; pointer-events: none; z-index: 2;
  --m: var(--mark); --l: 12px;
  background:
    linear-gradient(var(--m), var(--m)) left top / var(--l) 1px no-repeat,
    linear-gradient(var(--m), var(--m)) left top / 1px var(--l) no-repeat,
    linear-gradient(var(--m), var(--m)) right top / var(--l) 1px no-repeat,
    linear-gradient(var(--m), var(--m)) right top / 1px var(--l) no-repeat,
    linear-gradient(var(--m), var(--m)) left bottom / var(--l) 1px no-repeat,
    linear-gradient(var(--m), var(--m)) left bottom / 1px var(--l) no-repeat,
    linear-gradient(var(--m), var(--m)) right bottom / var(--l) 1px no-repeat,
    linear-gradient(var(--m), var(--m)) right bottom / 1px var(--l) no-repeat;
  transition: inset .25s var(--ease);
}

/* Drafting sheet: a band with a faint 8 / 40 px grid that fades out towards the edges. */
.sheet { position: relative; background: var(--bg-2); border-bottom: 1px solid var(--line); isolation: isolate; }
.sheet::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 30%, #000 30%, transparent 85%);
  mask-image: radial-gradient(120% 90% at 70% 30%, #000 30%, transparent 85%);
}

.preview-bar { background: var(--note-bg); color: var(--note-ink); font-size: 13px; line-height: 1.5; padding: 8px var(--gutter); text-align: center; border-bottom: 1px solid var(--line); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: var(--r); font: 600 15px/1 var(--font); letter-spacing: .01em; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s, transform .15s; }
.btn--signal { background: var(--signal); color: var(--on-signal); border: 1px solid var(--signal); }
.btn--signal:hover { background: color-mix(in srgb, var(--signal) 86%, var(--ink)); }
.btn--line { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn--line:hover { border-color: var(--ink); }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: 14.5px; gap: 8px; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------------------------------------------------------------- header */
.hdr { position: sticky; top: 0; z-index: 40; background: var(--hdr-bg); -webkit-backdrop-filter: saturate(1.2) blur(12px); backdrop-filter: saturate(1.2) blur(12px); border-bottom: 1px solid var(--line); }
.hdr-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--hdr); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; min-width: 44px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid var(--ink); border-radius: 50%; font-size: 12px; letter-spacing: .02em; transition: background-color .15s, color .15s; }
.brand:hover .brand-mark { background: var(--ink); color: var(--bg); }
.brand-name { font: 600 17px/1 var(--font); letter-spacing: -.005em; white-space: nowrap; }
.hdr-nav { display: flex; align-items: center; gap: 4px; }
.hdr-nav > a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font: 500 15px/1 var(--font); color: var(--ink-2); text-decoration: none; position: relative; }
.hdr-nav > a:not(.btn):hover, .hdr-nav > a[aria-current] { color: var(--ink); }
.hdr-nav > a[aria-current]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 8px; height: 2px; background: var(--signal); }
.btn--hdr { min-height: 40px; padding: 0 14px; margin-left: 10px; gap: 8px; font-size: 14px; border: 1px solid var(--signal); color: var(--signal-ink); }
.btn--hdr:hover { background: var(--signal); color: var(--on-signal); }
@media (max-width: 599px) {
  :root { --hdr: 56px; }
  .hide-sm { display: none !important; }
  .hdr-in { gap: 8px; }
  .hdr-nav { gap: 0; }
  .hdr-nav > a:not(.btn) { padding: 0 10px; }
  .hdr-nav > a[aria-current]::after { left: 10px; right: 10px; }
  .btn--hdr { min-height: 44px; margin-left: 6px; padding: 0 14px; }
  .btn--hdr .i { display: none; }
  .brand { gap: 10px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 16px; }
}
@media (max-width: 419px) { .brand-name { display: none; } }

/* ---------------------------------------------------------------- type */
.eyebrow { margin: 0 0 20px; font-size: 12px; text-transform: uppercase; color: var(--ink-3); }
.eyebrow span { color: var(--signal-ink); margin: 0 6px; }
.display { font: 700 clamp(42px, 5.4vw, 76px)/.98 var(--font); letter-spacing: -.03em; }
.page-title { font: 700 clamp(34px, 4.2vw, 58px)/1.02 var(--font); letter-spacing: -.025em; overflow-wrap: break-word; }
.page-title .sub { display: block; margin-top: .18em; font-weight: 400; font-size: .62em; line-height: 1.15; letter-spacing: -.015em; color: var(--ink-2); }
.page-title .sub-c, .card-title .sub-c { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lede { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; color: var(--ink-2); margin: 20px 0 0; max-width: 40em; overflow-wrap: break-word; }

.prose { font-size: 17px; line-height: 1.65; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose h2 { font: 700 22px/1.25 var(--font); margin: 1.6em 0 .5em; letter-spacing: -.01em; }
.prose h3 { font: 600 18px/1.35 var(--font); margin: 1.4em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .25em 0; }
.prose a { color: var(--signal-ink); }
.prose strong { font-weight: 600; }
.prose img { margin: 1.2em 0; }
.prose blockquote { margin: 1.2em 0; padding-left: 16px; border-left: 2px solid var(--signal); color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* Title block: ruled cells, each with a mono label and a value. */
.tb { display: grid; margin: 0; border: 1px solid var(--line-2); background: var(--bg); }
.tb-cell { margin: 0; padding: 12px 16px 14px; border-top: 1px solid var(--line); min-width: 0; }
.tb-cell:first-child { border-top: 0; }
.tb-cell dd, .tb-v { margin: 6px 0 0; display: block; font: 600 16px/1.35 var(--font); color: var(--ink); overflow-wrap: break-word; }
.tb-sub { display: block; font-weight: 400; font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }
.tb-note { display: block; font-size: 12px; text-transform: uppercase; color: var(--ink-3); }

/* ---------------------------------------------------------------- home hero */
.hero-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding-top: clamp(40px, 5vw, 64px); padding-bottom: clamp(48px, 6vw, 80px); }
.hero-in--solo { grid-template-columns: minmax(0, 760px); }
.hero-copy { min-width: 0; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; }
.hero-mail { display: inline-flex; align-items: center; min-height: 44px; font-size: 15.5px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 5px; overflow-wrap: anywhere; }
.hero-mail:hover { color: var(--signal-ink); text-decoration-color: currentColor; }
.hero-tb { margin-top: 36px; grid-template-columns: 1fr; }
.hero-tb .tb-cell { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 12px 16px; }
.hero-tb .tb-cell dd { margin: 0; }
.hero-fig { display: block; text-decoration: none; min-width: 0; }
.plate { display: block; overflow: hidden; background: var(--surface) center / cover no-repeat; outline: 1px solid var(--line-2); outline-offset: -1px; }
.plate img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
/* The whole photo, never cropped: the frame takes the photo's own shape (--ar, set on the
   link), as wide as the column allows without growing taller than --hmax, and centred. The
   crop marks and the caption line up with it. */
.hero-fig { --hmax: clamp(360px, 66vh, 620px); }
.hero-fig .marks, .hero-fig .fig-cap { display: block; width: min(100%, calc(var(--hmax) * var(--ar, .8))); margin-inline: auto; }
.hero-fig .fig-cap { display: flex; }
.hero-fig .plate { aspect-ratio: var(--ar, .8); }
.hero-fig:hover .plate img { transform: scale(1.025); }
.hero-fig:hover .marks::after, .card:hover .marks::after { inset: -10px; }
.fig-cap { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.fig-cap-text { display: grid; gap: 4px; min-width: 0; flex: 1; }
.fig-k { font-size: 12px; text-transform: uppercase; color: var(--ink-3); }
.fig-title { font: 600 17px/1.3 var(--font); transition: color .15s; }
.fig-title .sub { font-weight: 400; color: var(--ink-2); }
.fig-note { font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.fig-go { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 50%; flex: none; transition: background-color .15s, color .15s, border-color .15s; }
.hero-fig:hover .fig-go { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.hero-fig:hover .fig-title { color: var(--signal-ink); }

@media (max-width: 979px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-copy { display: contents; }
  .hero-fig { order: 1; margin-top: 36px; }
  .hero-tb { order: 2; margin-top: 32px; }
  .hero-fig { --hmax: 72svh; }
}
@media (max-width: 599px) {
  .display { font-size: clamp(38px, 11vw, 46px); }
  .hero-cta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 26px; }
  .hero-cta .btn { padding: 0 12px; }
  .hero-mail { grid-column: 1 / -1; justify-content: center; margin: 2px 0 0; }
  .hero-tb .tb-cell { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* ---------------------------------------------------------------- sections */
.sec { padding-top: clamp(48px, 7vw, 96px); padding-bottom: clamp(24px, 4vw, 48px); }
.sec--about { padding-bottom: clamp(56px, 8vw, 112px); }
.sec--list { padding-top: clamp(28px, 4vw, 40px); padding-bottom: clamp(56px, 8vw, 104px); }
/* Section head, underlined by a dimension line: a hairline with a tick at each end. */
.sec-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding-bottom: 16px; margin-bottom: 28px; }
.sec-head::before, .sec-head::after { content: ""; position: absolute; bottom: 0; }
.sec-head::before { left: 0; right: 0; height: 1px; background: var(--line-2); }
.sec-head::after { left: 0; right: 0; height: 11px; bottom: -5px; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
.sec-head h2 { display: flex; align-items: baseline; gap: 14px; font: 700 clamp(30px, 3.2vw, 44px)/1.05 var(--font); letter-spacing: -.02em; }
.sec-no { font-size: 13px; letter-spacing: .04em; color: var(--signal-ink); transform: translateY(-.2em); }
.sec-meta { margin: 0; font-size: 12px; text-transform: uppercase; color: var(--ink-3); }

/* Discipline chips: links to each discipline page; on the home page site.js filters the
   grid in place instead. Wraps on wide screens, scrolls sideways (inside itself) on phones. */
.filters { margin: 0 0 32px; }
.filters-track { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r); font: 500 15px/1 var(--font); color: var(--ink-2); text-decoration: none; white-space: nowrap; transition: color .15s, border-color .15s, background-color .15s; }
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip-n { font-size: 12px; letter-spacing: 0; color: var(--ink-3); }
.chip[aria-current], .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-current] .chip-n, .chip[aria-pressed="true"] .chip-n { color: var(--bg); opacity: .75; }
@media (max-width: 767px) {
  .filters { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); }
  .filters-track { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter) 48px; padding: 6px var(--gutter); margin-top: -4px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .filters-track::-webkit-scrollbar { display: none; }
  .filters-track[data-end] { -webkit-mask-image: none; mask-image: none; }
  .chip { scroll-snap-align: start; scroll-margin-left: var(--gutter); }
}

/* ---------------------------------------------------------------- project cards */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px clamp(20px, 2.4vw, 32px); }
.card { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.card-media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface) center / cover no-repeat; outline: 1px solid var(--line); outline-offset: -1px; transition: outline-color .15s; }
.card-media picture { display: contents; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.card:hover .card-media img { transform: scale(1.04); }
.card-empty { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 6px; padding: 16px; text-align: center; color: var(--ink-2); font-size: 15px; background: repeating-linear-gradient(135deg, var(--surface) 0 12px, var(--surface-2) 12px 24px); }
.card-empty small { font-size: 12.5px; color: var(--ink-3); }
.badges { position: absolute; right: 10px; bottom: 10px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 11.5px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: rgb(12 13 14 / 78%); border-radius: var(--r); vertical-align: middle; }
.badge .i { width: 11px; height: 11px; }
.badge--draft { background: var(--draft); color: #1d1600; }
.card-body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding-top: 16px; }
.card-meta { display: flex; align-items: center; gap: 10px; order: -1; }
.leader { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--line-2) 0 2px, transparent 2px 6px); }
.card-date { font-size: 12px; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.card-title { font: 600 20px/1.25 var(--font); letter-spacing: -.01em; transition: color .15s; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; }
.card-title .sub { display: block; font-weight: 400; color: var(--ink-2); }
.card-sum { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { margin-top: auto; padding-top: 2px; font-size: 12px; text-transform: uppercase; color: var(--ink-3); }
.card-tags .more { color: var(--ink-2); }
.card:hover .card-title, .card:hover .card-title .sub { color: var(--signal-ink); }
.card:hover .card-media { outline-color: var(--signal); }
.card:hover .balloon { border-color: var(--signal); color: var(--signal-ink); }
@media (max-width: 979px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Phones: a parts list. One row per project, thumbnail on the left. */
@media (max-width: 599px) {
  .cards { grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
  .card-li { border-bottom: 1px solid var(--line); }
  .card { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 16px 0; align-items: start; }
  .card-media { aspect-ratio: 1; }
  .badges { right: 6px; bottom: 6px; }
  .badge { padding: 4px 5px; }
  .badge-t { display: none; }
  .badge--draft { font-size: 10px; }
  .card-body { padding-top: 0; gap: 7px; }
  .balloon { width: 28px; height: 28px; font-size: 11.5px; }
  .card-title { font-size: 17px; line-height: 1.28; }
  .card-sum { display: none; }
  .card-tags { font-size: 12px; line-height: 1.5; }
}

/* The resume strip at the end of the work: one row, whatever the number of projects. */
.resume-strip { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 32px; margin-top: clamp(40px, 5vw, 64px); padding: clamp(20px, 3vw, 32px); border: 1px dashed var(--line-2);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 8px 8px; }
.rs-text { display: grid; gap: 10px; min-width: 0; flex: 1 1 420px; }
.rs-text p { margin: 0; font: 600 clamp(19px, 1.8vw, 24px)/1.3 var(--font); letter-spacing: -.01em; max-width: 34em; }
.rs-cta { display: grid; grid-template-columns: auto auto; justify-content: end; align-items: center; gap: 12px; }
.rs-cta .tb-note { grid-column: 1 / -1; }
@media (max-width: 599px) {
  .rs-cta { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); justify-content: stretch; width: 100%; gap: 10px; }
  .rs-cta .btn { padding: 0 12px; }
  .rs-cta .tb-note { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- about */
.about { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.about--solo { grid-template-columns: minmax(0, 760px); }
.about-copy p { color: var(--ink-2); max-width: 38em; }
.about-copy > p:first-child { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.5; color: var(--ink); letter-spacing: -.005em; }
.about-photos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 7px; min-width: 0; }
.about-fig { margin: 0; aspect-ratio: 4 / 5; min-width: 0; background: var(--surface) center / cover no-repeat; }
.about-fig img { width: 100%; height: 100%; object-fit: cover; }
.about-fig--offset { margin-top: 48px; }
.about-fig--offset img { object-position: 50% 62%; }
.about-fig--wide { grid-column: 1 / -1; aspect-ratio: 16 / 10; margin-top: 4px; }
.photo-placeholder { display: grid; place-items: center; border: 1px dashed var(--line-2); background: repeating-linear-gradient(135deg, var(--surface) 0 12px, var(--surface-2) 12px 24px); color: var(--ink-3); text-align: center; padding: 16px; }
.photo-placeholder span { font-size: 15px; color: var(--ink-2); display: grid; gap: 6px; }
.photo-placeholder small { font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 979px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .about-photos { order: -1; max-width: 560px; }
}
@media (max-width: 599px) {
  .about-photos { gap: 14px; }
  .about-fig--offset { margin-top: 32px; }
}

/* Spec sheet: about.md's "##" blocks as ruled rows. They are <details> so phones can fold
   all but the first; on wider screens every row stays open and the label is just a label. */
.spec { margin: clamp(48px, 6vw, 80px) 0 0; border-top: 1px solid var(--line-2); }
.spec-row { position: relative; padding: 24px 0 24px 224px; border-bottom: 1px solid var(--line); }
.spec-k { position: absolute; left: 0; top: 24px; width: 200px; margin: 0; font-size: 12px; line-height: 1.9; text-transform: uppercase; color: var(--ink-3); }
.spec .prose { font-size: 16.5px; }
/* Running text keeps a readable line length on wide screens. */
.xp-body, .spec-row:not(.spec-skills) .prose li:not(.xp), .spec-row:not(.spec-skills) .prose p:not(.xp) { max-width: 40em; }
.spec .prose ul { list-style: none; padding: 0; margin: 0; }
.spec .prose li { position: relative; padding-left: 22px; margin: 0 0 8px; color: var(--ink-2); }
.spec .prose li::before { content: ""; position: absolute; left: 0; top: .8em; width: 10px; height: 1px; background: var(--ink-3); }
.spec .prose strong { color: var(--ink); }
.spec .prose p { color: var(--ink-2); }
/* "**Name**, Place: text" entries (Experience, Education): the name and place on a head line. */
.spec .prose .xp { padding: 0 0 16px; margin: 0 0 16px; border-bottom: 1px dashed var(--line); }
.spec .prose .xp:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.spec .prose li.xp { padding-left: 0; }
.spec .prose li.xp::before { display: none; }
.xp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 4px; }
.xp-head strong { font-size: 18px; }
.xp-where { font: 500 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.xp-body { display: block; color: var(--ink-2); }
.xp-body::first-letter { text-transform: uppercase; }
@media (min-width: 1100px) {
  .spec-skills ul { columns: 2; column-gap: 40px; }
  .spec-skills li { break-inside: avoid; }
}
@media (max-width: 767px) {
  .spec-row { padding: 0; }
  .spec-k { position: static; width: auto; min-height: 56px; display: flex; align-items: center; }
  .spec-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 56px; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; text-align: left; cursor: pointer; }
  .spec-toggle::after { content: "+"; content: "+" / ""; font-size: 18px; color: var(--ink-2); }
  .spec-toggle[aria-expanded="true"]::after { content: "–"; content: "–" / ""; }
  .spec-row > .prose { padding: 0 0 22px; }
  .prose { font-size: 16px; }
}

/* ---------------------------------------------------------------- list page head */
.page-head { padding: clamp(28px, 4vw, 48px) 0 clamp(32px, 5vw, 52px); }
.page-head .lede { margin-top: 14px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 14px; font-size: 12px; text-transform: uppercase; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 7px; margin: 0 -7px; }
.crumbs a:hover { color: var(--signal-ink); }
.crumbs span[aria-hidden] { color: var(--line-2); }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.page-count { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; color: var(--ink-3); }
.page-count strong { color: var(--signal-ink); font-weight: 500; }
.readout .ro { white-space: nowrap; }
.readout { display: inline-block; margin: 20px 0 0; padding: 8px 12px; border: 1px solid var(--line-2); background: var(--bg); font-size: 12px; line-height: 1.5; text-transform: uppercase; color: var(--ink-2); }
.empty { padding: 40px 24px; border: 1px dashed var(--line-2); text-align: center; color: var(--ink-2); margin: 0; }

/* ---------------------------------------------------------------- project page */
.proj-sheet { padding-bottom: clamp(40px, 5vw, 64px); }
.proj-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; padding-top: 12px; margin-bottom: clamp(16px, 3vw, 32px); }
.proj-bar .crumbs { margin: 0; }
.proj-sheetno { margin: 0; font-size: 12px; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.proj-sheetno strong { color: var(--signal-ink); font-weight: 500; }
.proj-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "intro fig" "notes fig"; grid-template-rows: auto 1fr; column-gap: clamp(32px, 5vw, 72px); align-items: start; }
.proj-head--solo { grid-template-columns: minmax(0, 760px); grid-template-areas: "intro" "notes"; }
.proj-intro { grid-area: intro; padding-top: 8px; min-width: 0; }
.proj-head > .fig--hero { grid-area: fig; }
.proj-head > .notes { grid-area: notes; min-width: 0; }
.proj-intro .balloon { margin: 0 12px 24px 0; }
.proj-intro .badge { vertical-align: 12px; }
.proj-tb { margin-top: 32px; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.proj-tb .tb-cell { border: 0; background: var(--bg); }
.tb-cell--wide { grid-column: 1 / -1; }
.tb-tags { display: flex !important; flex-wrap: wrap; gap: 8px; margin-top: 10px !important; }
.tag { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r); font: 500 14.5px/1 var(--font); text-decoration: none; color: var(--ink); transition: border-color .15s, color .15s; }
a.tag:hover { border-color: var(--signal); color: var(--signal-ink); }
.tag--plain { color: var(--ink-2); border-style: dashed; }
.proj-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; }

/* A figure: the photo placed whole on a gridded plate, with crop marks. */
.fig { margin: 0; min-width: 0; }
.fig-link { display: block; cursor: zoom-in; text-decoration: none; }
/* FIG. 01 fills its column's width and is as tall as the photo needs (up to 80% of the
   screen), so the crop marks sit on the plate and there are no empty bands. --ar is the
   photo's width / height, set on the figure. */
.fig--hero { container-type: inline-size; }
.fig--hero .plate { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: clamp(10px, 1.6vw, 20px); height: min(80svh, calc(100cqi / var(--ar, .8)));
  background-color: var(--surface);
  background-image: linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 24px 24px; background-position: center; }
.fig--hero .plate img { width: 100%; height: 100%; object-fit: contain; }
.fig--hero .plate--video { height: auto; }
.fig--hero .plate video { width: 100%; max-height: 76vh; max-height: 76svh; background: #000; }
.fig-link:hover .plate { outline-color: var(--ink-3); }
.fig-link:hover::after { inset: -10px; }
.fig-bar { display: flex; align-items: baseline; gap: 6px 12px; margin-top: 12px; font-size: 12px; line-height: 1.45; text-transform: uppercase; color: var(--ink-3); }
.fig-no { flex: none; white-space: nowrap; }
.fig-text { flex: 1; min-width: 0; font: 400 14.5px/1.45 var(--font); letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.fig-act { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-left: auto; white-space: nowrap; }
.fig-act .i { width: 12px; height: 12px; }
/* Tall enough screens keep FIG. 01 in view while the notes scroll past. */
@media (min-width: 980px) and (min-height: 760px) {
  .proj-head > .fig--hero { position: sticky; top: calc(var(--hdr) + 24px); }
  .fig--hero .plate { height: min(calc(100svh - var(--hdr) - 150px), 760px, calc(100cqi / var(--ar, .8))); }
  .fig--hero .plate--video { height: auto; }
}

.notes { padding-top: clamp(36px, 4vw, 48px); }
.notes-k { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 12px; line-height: 1.2; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.notes-k::before { content: ""; width: 20px; height: 2px; background: var(--signal); }
.notes-k::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.notes-body { font-size: 17px; line-height: 1.7; max-width: 40em; }

@media (max-width: 979px) {
  .proj-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "fig" "notes"; }
  .proj-head > .fig--hero { margin-top: 36px; }
}
@media (max-width: 599px) {
  .proj-intro .balloon { margin-bottom: 18px; width: 40px; height: 40px; }
  .proj-tb { grid-template-columns: 1fr; }
  .proj-tb .tb-cell { grid-column: auto; }
  .fig--hero .plate { padding: 0; background-image: none; }
}

/* The gallery: justified rows. Each figure grows with its aspect ratio, so the pictures
   in a row share one height and none is cropped; captions sit under them as FIG. bars. */
.figs-sec { padding-top: clamp(40px, 5vw, 72px); }
.gallery { --row: 250px; display: flex; flex-wrap: wrap; gap: 32px 16px; }
.gallery::after { content: ""; flex: 1000000 1 0px; }
.g-fig { margin: 0; min-width: 0; }
.g-item { position: relative; display: block; aspect-ratio: var(--ar); overflow: hidden; background: var(--surface) center / cover no-repeat; outline: 1px solid var(--line); outline-offset: -1px; cursor: zoom-in; }
.g-item img, .g-item video { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
a.g-item:hover img { transform: scale(1.03); }
a.g-item:hover { outline-color: var(--signal); }
a.g-item:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
a.g-item:focus-visible img { transform: scale(1.03); }
/* Narrow figures put the label above the caption. */
.g-fig .fig-bar { display: grid; gap: 4px; }
.pill { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 12px; line-height: 1; text-transform: uppercase; color: var(--on-signal); background: var(--signal); border-radius: var(--r); transition: transform .2s var(--ease); }
.pill .i { width: 11px; height: 11px; }
a.g-item:hover .pill { transform: translateY(-2px); }
@media (max-width: 599px) {
  .gallery { flex-direction: column; gap: 28px; }
  .g-fig { flex: none !important; width: 100%; }
  .g-fig .fig-bar { display: flex; }
}

/* ---------------------------------------------------------------- 3D models, YouTube, LinkedIn */
.models, .videos, .li-section { padding-top: clamp(40px, 5vw, 72px); }
.model-list { display: grid; gap: 24px; padding: 0 7px; }
.model { overflow: visible; border: 1px solid var(--line-2); background-color: var(--surface); background-image: linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px); background-size: 24px 24px; }
.model-stage-wrap { display: grid; place-items: center; min-height: 240px; }
.model-stage { width: 100%; height: min(70vh, 540px); cursor: grab; touch-action: none; }
.model-stage:active { cursor: grabbing; }
.model-load small { font: 500 12px/1 var(--mono); letter-spacing: .04em; color: var(--ink-3); margin-left: 4px; }
.model-dl { position: absolute; right: 16px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14.5px; color: var(--signal-ink); text-decoration: none; }
.videos { display: grid; gap: 24px; }
.yt { position: relative; aspect-ratio: 16 / 9; background: #000 center / cover no-repeat; }
.yt-play { position: absolute; inset: 0; margin: auto; display: grid; place-items: center; width: 72px; height: 72px; border: 0; border-radius: 50%; background: var(--signal); color: var(--on-signal); cursor: pointer; box-shadow: 0 0 0 8px var(--signal-soft); }
.yt-play .i { width: 22px; height: 22px; margin-left: 3px; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.posts { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.post { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; background: var(--bg); border: 1px solid var(--line-2); }
.post-meta { font: 500 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.post-source { color: var(--signal-ink); }
.post-text { margin: 0; font-size: 15.5px; line-height: 1.6; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.post-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: auto; }
.post-open { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14.5px; color: var(--signal-ink); }
.li-frame { width: 100%; height: 600px; border: 0; background: #fff; }
.posts-more { margin-top: 28px; }

/* ---------------------------------------------------------------- pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; margin-top: clamp(56px, 7vw, 96px); margin-bottom: clamp(56px, 7vw, 96px); }
.pager-cell { display: flex; align-items: center; gap: 18px; min-height: 112px; padding: 18px 20px; border: 1px solid var(--line-2); text-decoration: none; transition: border-color .15s, background-color .15s; min-width: 0; }
.pager-cell + .pager-cell { border-left: 0; }
.pager-cell--next { flex-direction: row-reverse; text-align: right; grid-column: 2; }
.pager-cell--next .tb-k { justify-content: flex-end; }
.pager-cell:hover { background: var(--bg-2); }
.pager-cell:hover .pager-title { color: var(--signal-ink); }
.pager-cell--all { flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; }
.pager-cell--all:last-child:not(:first-child) { align-items: flex-end; text-align: right; }
.pager-thumb { width: 76px; height: 76px; flex: none; overflow: hidden; outline: 1px solid var(--line); outline-offset: -1px; background: var(--surface); }
.pager-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pager-text { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.pager-title { font: 600 18px/1.3 var(--font); transition: color .15s; overflow-wrap: break-word; }
.pager-title .sub { font-weight: 400; color: var(--ink-2); }
@media (max-width: 599px) {
  .pager { grid-template-columns: 1fr; }
  .pager-cell + .pager-cell { border-left: 1px solid var(--line-2); border-top: 0; }
  .pager-cell--next { flex-direction: row; text-align: left; grid-column: auto; }
  .pager-cell--next .tb-k { justify-content: flex-start; }
  .pager-cell--all:last-child:not(:first-child) { align-items: flex-start; text-align: left; }
  .pager-cell { min-height: 96px; padding: 14px 16px; }
  .pager-thumb { width: 64px; height: 64px; }
  .pager-title { font-size: 16.5px; }
}

/* ---------------------------------------------------------------- footer */
.ftr { border-top: 1px solid var(--line); background: var(--bg-2); padding: clamp(48px, 6vw, 80px) 0 28px; }
.ftr-tb { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.ftr-tb > .tb-cell { grid-column: span var(--span, 12); border: 0; padding: 16px 20px 20px; background: var(--bg); }
.ftr-contact { display: flex; flex-direction: column; }
.tb-mini { display: flex; flex-direction: column; }
.ftr-line { margin: 18px 0 8px; color: var(--ink-2); font-size: 16px; }
.ftr-mail { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ftr-email { font: 600 clamp(22px, 2.7vw, 36px)/1.15 var(--font); letter-spacing: -.015em; overflow-wrap: anywhere; text-decoration: none; background: linear-gradient(var(--signal), var(--signal)) 0 100% / 0 2px no-repeat; transition: background-size .3s var(--ease), color .15s; padding: 10px 0; }
.ftr-email:hover { color: var(--signal-ink); background-size: 100% 2px; }
.copy-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: none; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; }
.copy-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.copy-btn .i { width: 14px; height: 14px; }
.tb-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--line); font: 600 16px/1.2 var(--font); text-decoration: none; }
.tb-k + .tb-link { margin-top: 10px; }
.tb-link:hover { color: var(--signal-ink); }
.ftr-resume .tb-note { margin-top: 12px; }
.ftr-links ul { list-style: none; margin: 10px 0 0; padding: 0; }
.ftr-links a { display: flex; align-items: center; gap: 8px; min-height: 44px; border-bottom: 1px solid var(--line); font: 600 16px/1.2 var(--font); text-decoration: none; }
.ftr-links a .i { margin-left: auto; color: var(--ink-3); }
.ftr-links small { font-weight: 400; font-size: 13.5px; color: var(--ink-3); }
.ftr-links a:hover, .ftr-links a:hover .i { color: var(--signal-ink); }
.ftr-links li:last-child a, .ftr-resume .tb-link:last-of-type { border-bottom: 0; }

/* The arcade entry: a title-block cell with a small lit screen and a spinning coin. The
   coin spins and "INSERT COIN" blinks a few times when the cell scrolls into view, then
   rests (and spins again on hover), so nothing keeps moving on its own. */
.arcade-cell { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 20px; row-gap: 14px; text-decoration: none; transition: background-color .2s; }
.arcade-cell .tb-k { grid-column: 1 / -1; }
.arcade-screen { position: relative; display: grid; justify-items: center; align-content: center; gap: 10px; width: 120px; height: 104px; background: var(--screen); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: inset 0 0 0 4px #000, inset 0 0 24px rgb(255 122 46 / 14%); overflow: hidden; }
.arcade-screen::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgb(255 255 255 / 4%) 0 1px, transparent 1px 3px); pointer-events: none; }
.coin { width: 44px; height: 44px; filter: drop-shadow(0 0 10px rgb(242 182 50 / 35%)); }
.arcade-credit { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #ff9a5c; }
.arcade-cell.is-live .coin { animation: coin-spin 1.6s steps(8) 3; }
.arcade-cell.is-live .arcade-credit { animation: blink 1.4s steps(1, end) 3; }
.arcade-cell:hover .coin { animation: coin-spin .6s steps(8) infinite; }
.arcade-copy { display: grid; align-content: start; gap: 6px; min-width: 0; }
.arcade-copy strong { display: inline-flex; align-items: center; gap: 8px; font: 700 20px/1.2 var(--font); letter-spacing: -.01em; transition: color .15s; }
.arcade-copy > span { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.arcade-konami { font-size: 13.5px !important; color: var(--ink-3) !important; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin: 0 1px; padding: 0 3px; border: 1px solid var(--line-2); border-radius: 3px; font-size: 11px; letter-spacing: 0; color: var(--ink-2); vertical-align: 1px; }
.arcade-cell:hover { background: linear-gradient(var(--signal-soft), var(--signal-soft)), var(--bg); }
.arcade-cell:hover strong { color: var(--signal-ink); }
@keyframes coin-spin { 0%, 100% { transform: scaleX(1); } 25% { transform: scaleX(.35); } 50% { transform: scaleX(-1); } 75% { transform: scaleX(-.35); } }
@keyframes blink { 50% { opacity: .3; } }
/* Touch screens have no arrow keys, so the keycap hint is only for keyboards. */
@media (pointer: coarse) { .arcade-konami { display: none; } }

.ftr-base { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; font-size: 12px; text-transform: uppercase; color: var(--ink-3); }
.ftr-tools { display: flex; align-items: center; gap: 8px; }
.theme-btn, .top-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.theme-btn:hover, .top-link:hover { border-color: var(--ink-3); color: var(--ink); }
.theme-k { color: var(--ink-3); }
.top-link .i { width: 12px; height: 12px; }

@media (max-width: 979px) {
  .ftr-tb > .tb-cell { grid-column: span var(--span-md, 12); }
}
@media (max-width: 599px) {
  .ftr-tb > .tb-cell { padding: 14px 16px 16px; }
  .ftr-tb > .tb-cell { grid-column: 1 / -1; }
  .tb-mini { display: none !important; }
  .arcade-cell { grid-template-columns: 1fr; }
  .arcade-screen { width: 100%; height: 88px; grid-auto-flow: column; justify-content: center; align-items: center; gap: 16px; }
}

/* ---------------------------------------------------------------- 404 */
.notfound { padding-bottom: clamp(64px, 10vw, 140px); }
.nf-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 0; }
.nf-arcade { margin: 28px 0 0; color: var(--ink-2); }
.nf-arcade a { color: var(--signal-ink); }

/* ---------------------------------------------------------------- lightbox */
html.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; grid-template-rows: minmax(0, 1fr) auto; background: rgb(10 11 12 / 96%); color: #ebe8e2; }
.lb[hidden] { display: none; }
.lb-stage { grid-column: 2; grid-row: 1; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; min-height: 0; padding: 60px 0 6px; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; -webkit-user-select: none; user-select: none; }
.lb button { background: none; border: 0; color: inherit; cursor: pointer; opacity: .8; transition: opacity .15s, color .15s; }
.lb button:hover { opacity: 1; color: #ff7a2e; }
.lb-close { position: absolute; right: 10px; top: 10px; width: 48px; height: 48px; font: 300 34px/1 var(--font); }
.lb-prev, .lb-next { grid-row: 1; align-self: center; height: 110px; font: 300 52px/1 var(--font); }
.lb-prev { grid-column: 1; }
.lb-next { grid-column: 3; }
.lb-foot { grid-column: 1 / -1; display: flex; justify-content: center; align-items: baseline; gap: 18px; padding: 10px 20px 20px; font-size: 14px; color: #b3b0a8; text-align: center; }
.lb-count { font: 500 12px/1 var(--mono); letter-spacing: .06em; color: #8f8d87; white-space: nowrap; }
.lb-cap:empty { display: none; }
.lb--single .lb-prev, .lb--single .lb-next, .lb--single .lb-count { display: none; }
@media (max-width: 700px) {
  .lb { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .lb-prev, .lb-next { display: none; }
  .lb-stage { padding: 60px 8px 6px; }
}
