/* Big Blue Ceiling. Editorial type, hairline surfaces, bento layouts.
   Dark is the default look; light follows the OS unless the visitor picks a
   theme (data-theme on <html>). Text/background pairs meet WCAG AA in both
   themes. Motion is opt-in: reveals and page transitions only run when the
   visitor hasn't asked for reduced motion. */

:root {
  --bg: #06080f;
  --bg-raise: #0d111c;
  --bg-sunk: #04060b;
  --line: rgb(255 255 255 / 0.08);
  --line-strong: rgb(255 255 255 / 0.16);
  --text: #eef1f7;
  --muted: #9aa3b5;
  --accent: #6d97ff;
  --accent-strong: #a3bdff;
  --on-accent: #050814;
  --glow-1: #2b5cff;
  --glow-2: #00b8f0;
  --glow-3: #7b5cff;
  --future: #ffc66e;
  --focus: #ffd34d;
  --radius: 22px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.05) inset, 0 20px 40px -24px rgb(0 0 0 / 0.8);
  --font: "Inter Tight", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --max: 76rem;
  --gutter: clamp(16px, 4vw, 40px);
  --pad-x: max(var(--gutter), calc((100vw - var(--max)) / 2));
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f7f4;
    --bg-raise: #ffffff;
    --bg-sunk: #eeeee9;
    --line: rgb(10 15 30 / 0.09);
    --line-strong: rgb(10 15 30 / 0.18);
    --text: #0b1020;
    --muted: #4a5263;
    --accent: #2348d8;
    --accent-strong: #1a37a8;
    --on-accent: #ffffff;
    --glow-1: #7aa2ff;
    --glow-2: #6fd8ff;
    --glow-3: #b9a8ff;
    --future: #9a5b00;
    --focus: #b3261e;
    --shadow: 0 1px 0 rgb(255 255 255 / 0.8) inset, 0 20px 40px -26px rgb(10 20 50 / 0.35);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f7f7f4;
  --bg-raise: #ffffff;
  --bg-sunk: #eeeee9;
  --line: rgb(10 15 30 / 0.09);
  --line-strong: rgb(10 15 30 / 0.18);
  --text: #0b1020;
  --muted: #4a5263;
  --accent: #2348d8;
  --accent-strong: #1a37a8;
  --on-accent: #ffffff;
  --glow-1: #7aa2ff;
  --glow-2: #6fd8ff;
  --glow-3: #b9a8ff;
  --future: #9a5b00;
  --focus: #b3261e;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.8) inset, 0 20px 40px -26px rgb(10 20 50 / 0.35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.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; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.65 var(--font);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* A soft glow at the top of every page, plus fine grain so flat areas don't band. */
body::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 70vh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 60% at 15% 0%, color-mix(in srgb, var(--glow-1) 28%, transparent), transparent 70%),
    radial-gradient(35% 50% at 85% 5%, color-mix(in srgb, var(--glow-3) 22%, transparent), transparent 70%),
    radial-gradient(30% 40% at 55% 0%, color-mix(in srgb, var(--glow-2) 16%, transparent), transparent 70%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
img { max-width: 100%; }

h1, h2, h3 { font-family: var(--font); line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.6rem, 1.4rem + 5.2vw, 5.4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.8rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
p { text-wrap: pretty; }
em { font-style: italic; }
.muted { color: var(--muted); }

.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.75rem; font-weight: 600; color: var(--muted); margin: 0 0 1rem; }
.lede { font-size: clamp(1.1rem, 1rem + 0.45vw, 1.3rem); line-height: 1.55; color: var(--muted); max-width: 40rem; margin: 0 0 1.5rem; }
.display { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.9rem); line-height: 1.1; letter-spacing: -0.01em; margin: -0.2em 0 1.2rem; }
.display em, .stat-num {
  background: linear-gradient(100deg, var(--glow-2), var(--accent) 45%, var(--glow-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 200; background: var(--accent); color: var(--on-accent); padding: 0.6rem 1rem; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem var(--pad-x);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.02em; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 1.7rem; height: 1.7rem; border-radius: 8px; flex: none;
  background: conic-gradient(from 210deg, var(--glow-1), var(--glow-2), var(--glow-3), var(--glow-1));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25);
}
.site-header nav { margin-left: auto; }
.site-header ul { display: flex; gap: 0.15rem; list-style: none; margin: 0; padding: 0.25rem; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--bg-raise) 60%, transparent); }
.site-header nav a { display: block; padding: 0.4rem 0.95rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--text); }
.site-header nav a[aria-current="page"] { background: var(--text); color: var(--bg); }
.theme-toggle {
  width: 2.5rem; height: 2.5rem; min-height: 0; padding: 0; justify-content: center; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 0;
}
.theme-toggle::before { content: "◐"; font-size: 1.05rem; line-height: 1; }
.theme-toggle[data-mode="light"]::before { content: "☀"; }
.theme-toggle[data-mode="dark"]::before { content: "☾"; }
.theme-toggle:hover { border-color: var(--line-strong); }
@media (max-width: 30rem) {
  .brand-name { display: none; }
  .site-header nav a { padding: 0.4rem 0.8rem; }
}

/* Buttons */
button, .button {
  font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 44px; padding: 0.6rem 1.25rem;
  border-radius: 999px; border: 1px solid transparent;
  text-decoration: none; font-weight: 600; font-size: 0.98rem;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.button { background: var(--text); color: var(--bg); }
.button:hover { color: var(--bg); transform: translateY(-1px); }
.button.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.button.ghost:hover { border-color: var(--text); }

/* Sections */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) var(--pad-x); }
.section > h2 { display: flex; align-items: baseline; gap: 0.75rem; }
.count { font-size: 0.4em; font-weight: 600; letter-spacing: 0; padding: 0.25em 0.7em; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); align-self: center; }

/* Surfaces shared by tiles and cards */
.tile, .card {
  position: relative; overflow: hidden;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Bento hero */
.bento {
  display: grid; gap: clamp(10px, 1.4vw, 16px);
  padding: clamp(1.25rem, 4vw, 3rem) var(--pad-x) clamp(2rem, 5vw, 4rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "intro intro" "portrait portrait" "film stat" "p1 p1" "p2 p2";
}
@media (min-width: 44rem) {
  .bento { grid-template-areas: "intro intro" "portrait portrait" "film stat" "p1 p2"; }
}
@media (min-width: 64rem) {
  .bento {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas: "intro intro portrait portrait" "intro intro film stat" "p1 p1 p2 p2";
  }
}
.tile { padding: clamp(1.25rem, 2.6vw, 2.25rem); text-decoration: none; color: var(--text); }
a.tile:hover { border-color: var(--line-strong); color: var(--text); }
a.tile:hover img { transform: scale(1.04); }
.tile img { transition: transform 0.6s cubic-bezier(.2, .7, .2, 1); }
.tile-intro { grid-area: intro; display: flex; flex-direction: column; justify-content: flex-end; min-height: clamp(22rem, 46vw, 34rem);
  background:
    radial-gradient(90% 70% at 0% 0%, color-mix(in srgb, var(--glow-1) 22%, transparent), transparent 60%),
    radial-gradient(70% 60% at 100% 100%, color-mix(in srgb, var(--glow-3) 16%, transparent), transparent 60%),
    var(--bg-raise);
}
.tile-intro h1 { margin-bottom: 0.15em; }
.tile-intro .lede { font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }
.tile-portrait { grid-area: portrait; margin: 0; padding: 0; min-height: 16rem; }
.tile-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 30%; }
.tile-portrait figcaption, .tile-caption {
  position: absolute; left: 1rem; bottom: 1rem; right: 1rem;
  font-size: 0.85rem; font-weight: 600;
}
.tile-portrait figcaption { right: auto; padding: 0.35rem 0.8rem; border-radius: 999px; background: rgb(6 8 15 / 0.6); color: #eef1f7; backdrop-filter: blur(8px); }
.tile-stat { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; min-height: 12rem; }
.tile-film { grid-area: film; }
.tile-stat:not(.tile-film) { grid-area: stat; }
.stat-num { font-size: clamp(3rem, 2rem + 4vw, 5.2rem); font-weight: 800; letter-spacing: -0.05em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 0.95rem; max-width: 14rem; position: relative; z-index: 1; }
.poster-fan { position: absolute; right: -0.5rem; top: 1rem; display: flex; }
.poster-fan img { width: clamp(3.2rem, 5vw, 4.4rem); height: auto; border-radius: 6px; box-shadow: 0 10px 20px -8px rgb(0 0 0 / 0.7); margin-left: -1.2rem; }
.poster-fan img:nth-child(1) { transform: rotate(-10deg) translateY(6px); }
.poster-fan img:nth-child(2) { transform: rotate(-2deg); z-index: 1; }
.poster-fan img:nth-child(3) { transform: rotate(7deg) translateY(4px); }
.tile-project { padding: 0; min-height: clamp(13rem, 24vw, 19rem); }
.tile-p1 { grid-area: p1; }
.tile-p2 { grid-area: p2; }
.tile-project img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-project::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(4 6 11 / 0.85), transparent 55%); }
.tile-caption { z-index: 1; display: grid; gap: 0.2rem; color: #eef1f7; }
.tile-caption .eyebrow { margin: 0; color: rgb(238 241 247 / 0.75); }
.tile-caption strong { font-size: clamp(1.2rem, 1rem + 1vw, 1.7rem); letter-spacing: -0.03em; line-height: 1.1; }

/* Featured: a bento on wide screens, a swipeable row on phones */
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(10px, 1.4vw, 16px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.features > li:first-child { grid-column: span 2; grid-row: span 2; }
.features > li:first-child h3 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); }
.features > li:first-child .card-media { aspect-ratio: 16 / 9; }
@media (max-width: 52rem) {
  .features {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(85%, 24rem);
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: calc(-1 * var(--pad-x)); padding: 0 var(--pad-x) 0.5rem; scroll-padding-inline: var(--pad-x);
    scrollbar-width: none;
  }
  .features::-webkit-scrollbar { display: none; }
  .features > li, .features > li:first-child { scroll-snap-align: start; grid-column: auto; grid-row: auto; }
}

/* Cards */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(10px, 1.4vw, 16px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.card { display: flex; flex-direction: column; padding: 0 1.15rem 1.1rem; transition: transform 0.25s ease, border-color 0.25s ease; }
.card:hover, .card:focus-within { transform: translateY(-3px); border-color: var(--line-strong); }
.card h3 { margin: 0 0 0.35rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card h3 a:focus-visible { outline: none; }
.card h3 a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 3px; }
.card > p { color: var(--muted); margin: 0 0 1rem; font-size: 0.95rem; line-height: 1.5; }
.card-feature { padding: 0 1.5rem 1.4rem; }
.card-feature > p { font-size: 1rem; }
.card-role { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; color: var(--accent); margin: 0 0 0.5rem; }
.card-media { margin: 0 -1.15rem 1rem; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-sunk); border-bottom: 1px solid var(--line); }
.card-feature .card-media { margin: 0 -1.5rem 1.2rem; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card-media img { transform: scale(1.05); }
.card-art {
  display: grid; place-items: center;
  background:
    radial-gradient(70% 90% at 15% 10%, hsl(var(--h) 80% 60% / 0.55), transparent 65%),
    radial-gradient(80% 80% at 95% 95%, hsl(calc(var(--h) + 50) 80% 55% / 0.4), transparent 65%),
    linear-gradient(160deg, hsl(var(--h) 45% 16%), hsl(calc(var(--h) + 40) 50% 9%));
}
.card-art span { font: 400 clamp(2.4rem, 5vw, 3.6rem)/1 var(--serif); font-style: italic; color: hsl(var(--h) 90% 92% / 0.9); }
.tags { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tags li { font-size: 0.72rem; font-weight: 500; padding: 0.15rem 0.55rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.draft-flag { margin: 0.8rem 0 0; font-size: 0.75rem; font-weight: 600; color: var(--future); border: 1px dashed var(--future); border-radius: 999px; padding: 0.15rem 0.6rem; align-self: flex-start; }

/* Phones: the work wall becomes a compact list, thumbnail beside text. */
@media (max-width: 34rem) {
  #work .cards { gap: 8px; }
  #work .card { display: grid; grid-template-columns: 5.5rem 1fr; column-gap: 0.9rem; align-items: center; padding: 0.6rem 0.9rem 0.6rem 0.6rem; border-radius: 16px; }
  #work .card .card-media { grid-row: span 3; margin: 0; aspect-ratio: 1; border-radius: 10px; border: 0; }
  #work .card h3 { font-size: 1rem; margin: 0; }
  #work .card > p { font-size: 0.85rem; margin: 0.15rem 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #work .card .tags { display: none; }
  #work .card .draft-flag { grid-column: 2; margin-top: 0.3rem; }
  #work .card-art span { font-size: 1.6rem; }
}

/* Filters: wrap on wide screens, one swipeable row on narrow ones. The
   group is a <fieldset>, which defaults to min-width: min-content and would
   otherwise stretch the page to fit every button instead of scrolling. */
.filters { margin-bottom: 0.75rem; }
.filter-group { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.filter-group legend { float: left; margin-right: 0.4rem; font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; }
.filter-group button { min-height: 38px; padding: 0.3rem 0.95rem; background: transparent; color: var(--muted); border-color: var(--line); font-weight: 500; font-size: 0.9rem; white-space: nowrap; }
.filter-group button:hover { color: var(--text); border-color: var(--line-strong); }
.filter-group button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
@media (max-width: 52rem) {
  .filter-group { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; margin-inline: calc(-1 * var(--pad-x)); padding: 0.2rem var(--pad-x); scroll-padding-inline: var(--pad-x); scrollbar-width: none; }
  .filter-group button { flex: none; }
  .filter-group::-webkit-scrollbar { display: none; }
  .filter-group legend { display: none; }
}
.filter-status { color: var(--muted); font-size: 0.9rem; min-height: 1.5em; margin: 0 0 1rem; }

/* Film band and poster marquees */
.film-band { display: grid; gap: 2rem; }
.film-band-head { max-width: 46rem; }
.film-band h2 { margin-bottom: 0.4rem; }
.stat { font-variant-numeric: tabular-nums; background: linear-gradient(100deg, var(--glow-2), var(--accent) 45%, var(--glow-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.marquee { display: grid; gap: 0.8rem; overflow: hidden; margin-inline: calc(-1 * var(--pad-x)); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-row {
  --w: clamp(6.5rem, 10vw, 9.5rem); --gap: 0.8rem;
  list-style: none; margin: 0; padding: 0; display: flex; gap: var(--gap); width: max-content;
  animation: drift calc(var(--n) * 6s) linear infinite;
}
.marquee-row.reverse { animation-direction: reverse; }
.marquee-row li { flex: none; width: var(--w); }
.marquee-row img { width: 100%; height: auto; aspect-ratio: 600 / 889; object-fit: cover; border-radius: 10px; display: block; transition: transform 0.25s ease; }
.marquee-row a:hover img, .marquee-row a:focus-visible img { transform: scale(1.05); }
.marquee:hover .marquee-row, .marquee:focus-within .marquee-row, .marquee.paused .marquee-row { animation-play-state: paused; }
@keyframes drift { to { transform: translateX(calc(-50% - var(--gap) / 2)); } }
.marquee-toggle { justify-self: end; background: transparent; color: var(--muted); border-color: var(--line); font-size: 0.85rem; min-height: 38px; }
.marquee-toggle:hover { color: var(--text); }

.film-hero { position: relative; isolation: isolate; overflow: hidden; padding: 1.5rem 0 2rem; display: grid; }
.film-hero .marquee { opacity: 0.5; margin-inline: 0; }
.film-hero-inner {
  position: relative; margin: -8rem auto 0; width: min(100% - 2 * var(--gutter), 60rem);
  padding: clamp(1.25rem, 3vw, 2.5rem); border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-raise) 85%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line);
}
.film-hero .marquee-toggle { margin: 1rem var(--pad-x) 0 auto; }
.film-stat { margin: 0; font-weight: 600; }
.film-portrait { float: right; width: min(30%, 10rem); height: auto; aspect-ratio: 1; border-radius: 50%; margin: 0 0 1rem 1.5rem; box-shadow: 0 0 0 3px var(--bg-raise), 0 0 0 4px var(--line-strong); }
@media (max-width: 40rem) { .film-portrait { width: 5.5rem; } }
.film-page { padding-top: 2.5rem; }
.section-tight { margin-top: 3.5rem; }
.poster-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.5rem), 1fr)); }
.poster-grid a { display: block; color: var(--muted); text-decoration: none; font-size: 0.8rem; line-height: 1.3; }
.poster-grid a:hover { color: var(--text); }
.poster-grid img { width: 100%; height: auto; aspect-ratio: 600 / 889; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 0.4rem; transition: transform 0.2s ease; }
.poster-grid a:hover img { transform: translateY(-3px); }
@media (max-width: 34rem) { .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Project and content pages */
.project, .page { max-width: 60rem; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) 5rem; }
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; padding: 0; font-size: 0.85rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; color: var(--line-strong); }
.project-header { margin-bottom: 2.25rem; }
.project-header h1 { font-size: clamp(2.3rem, 1.4rem + 4vw, 4.4rem); }
.byline { display: flex; align-items: center; gap: 0.75rem; margin: -0.25rem 0 1.5rem; }
.byline > span { display: grid; line-height: 1.35; }
.byline a { font-weight: 600; color: var(--text); text-decoration: none; }
.byline a:hover { text-decoration: underline; }
.byline .muted { font-size: 0.88rem; }
.byline-avatar, .author-avatar { flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line-strong); }
.byline-avatar { width: 2.75rem; height: 2.75rem; }
.author-avatar { width: 4.5rem; height: 4.5rem; }
.facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; margin: 0; padding: 1rem 0 0; border-top: 1px solid var(--line); }
.facts dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 0.1rem 0 0; font-size: 0.95rem; }

.subnav { position: sticky; top: 3.7rem; z-index: 10; margin: 0 calc(-1 * var(--gutter)) 2.25rem; padding: 0 var(--gutter); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav ul { list-style: none; display: flex; gap: 0.25rem; margin: 0; padding: 0; min-width: max-content; }
.subnav a { display: block; padding: 0.8rem 0.9rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 600; font-size: 0.92rem; }
.subnav a:hover { color: var(--text); }
.subnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

.project-image { margin: 0 0 2.5rem; }
.project-image img { width: 100%; height: auto; border-radius: var(--radius); display: block; border: 1px solid var(--line); }
.project-image figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 0.5rem; }
.prose { max-width: 42rem; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); margin-top: 2.2em; letter-spacing: -0.03em; }
.prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--muted); }
.prose blockquote { margin: 1.6em 0; padding: 0; border: 0; font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1.2; color: var(--text); }
.prose blockquote p::before { content: "“"; color: var(--accent); }
.prose blockquote p::after { content: "”"; color: var(--accent); }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--bg-sunk); padding: 0.1em 0.35em; border-radius: 5px; border: 1px solid var(--line); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.prose-figure { margin: 2em 0; }
.prose-figure a { display: block; cursor: zoom-in; }
.prose-figure img { display: block; width: 100%; }
.prose-figure figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 0.55rem; line-height: 1.45; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }

/* Gallery: images open in a lightbox (site.js), videos play inline, YouTube
   loads only when the visitor asks for it. */
.gallery-section { margin-top: 3.5rem; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.gallery li.wide { grid-column: 1 / -1; }
.gallery figure { margin: 0; }
.gallery img, .gallery video { width: 100%; display: block; border-radius: var(--radius-sm); background: var(--bg-sunk); }
.gallery li:not(.wide) img { aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.4s ease; }
.gallery a:hover img { transform: scale(1.02); }
.gallery figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 0.4rem; line-height: 1.4; }
.gallery a { display: block; position: relative; overflow: hidden; border-radius: var(--radius-sm); }
@media (max-width: 34rem) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; } .gallery figcaption { font-size: 0.75rem; } }
.yt .play { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; width: 64px; height: 64px; border-radius: 50%; background: rgb(255 255 255 / 0.92); box-shadow: 0 10px 30px -8px rgb(0 0 0 / 0.6); }
.yt .play::after { content: ""; position: absolute; inset: 50% auto auto 55%; translate: -50% -50%; border: 11px solid transparent; border-left: 17px solid #06080f; border-right: 0; }
.yt iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-sm); display: block; }

.lightbox-dialog { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lightbox-dialog::backdrop { background: rgb(2 4 10 / 0.92); backdrop-filter: blur(6px); }
.lightbox-dialog img { max-width: 96vw; max-height: 84vh; display: block; margin: 0 auto; border-radius: 10px; }
.lightbox-dialog p { color: #eef1f7; text-align: center; margin: 0.6rem 0 0; }
.lightbox-dialog .lb-close, .lightbox-dialog .lb-nav { position: fixed; background: rgb(0 0 0 / 0.55); color: #fff; border-color: rgb(255 255 255 / 0.25); backdrop-filter: blur(8px); }
.lightbox-dialog .lb-close { top: 1rem; right: 1rem; }
.lightbox-dialog .lb-prev { left: 1rem; top: 50%; }
.lightbox-dialog .lb-next { right: 1rem; top: 50%; }

.link-list { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.link-list h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); }
.link-list ul { padding-left: 1.1rem; }
.link-list li + li { margin-top: 0.3rem; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 3rem; }
.pager a { display: block; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--text); background: var(--bg-raise); font-weight: 600; }
.pager a:hover { border-color: var(--line-strong); }
.pager span { display: block; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; }
.pager-next { grid-column: 2; text-align: right; }
@media (max-width: 34rem) { .pager { grid-template-columns: 1fr; } .pager-next { grid-column: auto; } }
.related { margin-top: 4.5rem; }
.related .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); }

/* Portraits */
.about-portrait { margin: 0 0 2rem; }
.about-portrait img { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--line); }
.portrait-strip { list-style: none; margin: 3rem 0 0; padding: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); }
.portrait-strip img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); display: block; }
@media (max-width: 34rem) { .portrait-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.author-card {
  display: flex; gap: 1.25rem; align-items: center;
  margin: 0 auto 3rem; width: min(100% - 2 * var(--gutter), 60rem); padding: 1.25rem 1.5rem;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
}
.author-card p { margin: 0 0 0.3rem; color: var(--muted); font-size: 0.95rem; }
.author-card .author-name { color: var(--text); font-weight: 700; font-size: 1.05rem; }
@media (max-width: 34rem) { .author-card { align-items: flex-start; } .author-avatar { width: 3.5rem; height: 3.5rem; } }

/* 404: hero, Ceiling Runner, project finder */
.nf-hero { padding: clamp(2.5rem, 7vw, 5rem) var(--pad-x) 2rem; max-width: calc(var(--max) + 2 * var(--pad-x)); }
.nf-hero h1 em { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; background: linear-gradient(100deg, var(--glow-2), var(--accent) 45%, var(--glow-3)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.04em; }
.nf-game, .nf-find, .nf-featured { padding: 1.5rem var(--pad-x) 2.5rem; }
.nf-game-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; }
.nf-game-head h2 { margin: 0; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.nf-game-head p { margin: 0; }
kbd { font: 600 0.8em var(--mono); padding: 0.1em 0.4em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; }
.nf-stage { position: relative; margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raise); overflow: hidden; box-shadow: var(--shadow); }
.runner { display: block; width: 100%; height: 240px; cursor: pointer; touch-action: manipulation; }
.runner:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.nf-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 0.9rem; padding: 1rem; text-align: center; background: radial-gradient(60% 70% at 50% 50%, color-mix(in srgb, var(--bg-raise) 80%, transparent), transparent); }
.nf-msg { margin: 0; max-width: 34rem; font-size: 1.05rem; font-weight: 600; }
.nf-score { min-height: 1.5em; color: var(--muted); font-size: 0.9rem; margin: 0.6rem 0 0; }
.nf-search { width: 100%; max-width: 36rem; font: inherit; font-size: 1.05rem; padding: 0.8rem 1.1rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--text); margin-bottom: 1.25rem; }
.nf-search:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.nf-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); max-height: 26rem; overflow-y: auto; }
.nf-results a { display: grid; padding: 0.55rem 0.7rem; border-radius: 12px; text-decoration: none; color: var(--text); }
.nf-results a:hover { background: var(--bg-raise); }
.nf-results strong { font-weight: 650; }
.nf-results span { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Drafts-only needs table */
.needs-page { max-width: 76rem; }
.needs { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.needs th, .needs td { text-align: left; vertical-align: top; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
.needs thead th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; }
.needs td:nth-child(2), .needs td:nth-child(3), .needs td:nth-child(4) { font-variant-numeric: tabular-nums; }

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center;
  padding: 2rem var(--pad-x) calc(2rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem;
}
.site-footer p { margin: 0; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* Desktop/mobile view switch in the footer, and the phone-sized preview */
.view-toggle { flex-basis: 100%; justify-content: center; background: transparent; color: var(--muted); border-color: var(--line); font-size: 0.85rem; min-height: 40px; }
.view-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.phone-preview { padding: 0; border: 0; background: transparent; overflow: visible; display: grid; justify-items: center; gap: 1rem; }
.phone-preview:not([open]) { display: none; }
.phone-preview::backdrop { background: rgb(2 4 10 / 0.85); backdrop-filter: blur(8px); }
.phone-frame { width: 390px; height: min(844px, 86vh); padding: 12px; border-radius: 48px; background: #0b0d14; box-shadow: 0 0 0 2px #2a2f3d, 0 40px 80px -20px rgb(0 0 0 / 0.8); }
.phone-frame iframe { width: 100%; height: 100%; border: 0; border-radius: 36px; background: var(--bg); }
.phone-close { background: #eef1f7; color: #06080f; }

/* Motion, only for visitors who haven't asked for less of it:
   cross-fading page navigations, and content that rises in as it scrolls into view. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  @supports (animation-timeline: view()) {
    .cards > li, .features > li, .gallery > li, .poster-grid > li, .bento > .tile:not(.tile-intro), .prose > * {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
  .tile-intro > * { animation: fade-up 0.8s cubic-bezier(.2, .7, .2, 1) both; }
  .tile-intro > :nth-child(2) { animation-delay: 0.06s; }
  .tile-intro > :nth-child(3) { animation-delay: 0.12s; }
  .tile-intro > :nth-child(4) { animation-delay: 0.18s; }
  .tile-intro > :nth-child(5) { animation-delay: 0.24s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .marquee-row { animation: none; flex-wrap: wrap; width: auto; }
  .marquee-row li[aria-hidden="true"] { display: none; }
}

@media (forced-colors: active) {
  .tile, .card, .pager a, .author-card { border: 1px solid CanvasText; }
  .display em, .stat-num, .stat { color: CanvasText; background: none; }
  .filter-group button[aria-pressed="true"] { outline: 2px solid Highlight; }
}

@media print {
  .site-header, .filters, .theme-toggle, .marquee, .marquee-toggle, .subnav, body::before, body::after { display: none !important; }
  body { background: #fff; color: #000; }
}
