/* ============================================================
   matthewshen.com — design system
   Dark, game-engine-adjacent. Per-project accent hues.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, video, canvas, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- Tokens ---------- */
:root {
  --bg:        #08090C;
  --bg-2:      #0D0F14;
  --surface:   #12151C;
  --surface-2: #191D26;
  --line:      #232833;
  --line-soft: #1A1E27;

  --text:      #EAECF2;
  --text-2:    #A5ACBB;
  --text-3:    #6C7488;

  --accent:    #66E2B7;
  --accent-ink:#08090C;

  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --wrap: 1240px;
  --gut: clamp(20px, 5vw, 64px);

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --t: 220ms cubic-bezier(.22,.61,.36,1);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film grain — keeps flat dark areas from banding */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: .022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.03em;
}
.display {
  font-size: clamp(2.5rem, 6.4vw, 5.3rem);
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1.0;
}
.h2 { font-size: clamp(1.9rem, 4.4vw, 3.3rem); }
.h3 { font-size: clamp(1.3rem, 2.4vw, 1.85rem); letter-spacing: -.025em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex; align-items: center; gap: .7em;
}
.eyebrow::before {
  content: ''; width: 26px; height: 1px;
  background: currentColor; opacity: .55; flex: none;
}
@media (min-width: 560px) { .eyebrow { white-space: nowrap; } }
.lede { font-size: clamp(1.05rem, 1.9vw, 1.3rem); color: var(--text-2); line-height: 1.6; }
.muted { color: var(--text-2); }
kbd {
  font-family: var(--font-mono); font-size: .82em;
  background: var(--surface-2); border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px; padding: .12em .45em; color: var(--text);
}

/* ---------- Custom cursor (pointer devices only) ---------- */
.cursor, .cursor-dot { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: block; position: fixed; top: 0; left: 0;
    width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    pointer-events: none; z-index: 9999;
    transition: width .28s var(--ease-out), height .28s var(--ease-out),
                margin .28s var(--ease-out), opacity .25s, background-color .25s;
    mix-blend-mode: difference;
  }
  .cursor-dot {
    display: block; position: fixed; top: 0; left: 0;
    width: 4px; height: 4px; margin: -2px 0 0 -2px;
    background: var(--accent); border-radius: 50%;
    pointer-events: none; z-index: 9999;
  }
  body.cursor-active .cursor {
    width: 62px; height: 62px; margin: -31px 0 0 -31px;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
  }
  body.cursor-hidden .cursor, body.cursor-hidden .cursor-dot { opacity: 0; }
}

/* ---------- Draft banner ---------- */
.draft-banner {
  position: relative; z-index: 60;
  background: #2A1F0A;
  border-bottom: 1px solid #4A3712;
  color: #FFD79A;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .02em;
  padding: 9px var(--gut);
  display: flex; align-items: center; justify-content: center;
  gap: .6em; text-align: center; flex-wrap: wrap;
}
.draft-banner strong { color: #FFC46B; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .35s, background-color .35s;
}
.site-header.scrolled { border-bottom-color: var(--line-soft); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 20px;
}
.brand {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.02rem; letter-spacing: -.02em;
  text-decoration: none; display: flex; align-items: center; gap: .6em;
}
.brand-mark {
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--accent); flex: none;
  animation: pulse 3.4s var(--ease) infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.45;transform:scale(.82)} }

.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); }
.nav a {
  text-decoration: none; font-size: .88rem; color: var(--text-2);
  position: relative; padding: 4px 0; transition: color .22s;
}
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .32s var(--ease-out);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 720px) { .nav .nav-hide { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .65em;
  font-family: var(--font-mono); font-size: .82rem;
  letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  padding: 13px 22px; border-radius: 100px;
  border: 1px solid var(--line);
  background: transparent; color: var(--text);
  transition: border-color .28s, background-color .28s, color .28s, transform .28s var(--ease-out);
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent); font-weight: 600;
}
.btn-primary:hover {
  color: var(--accent-ink);
  filter: brightness(1.12);
  box-shadow: 0 10px 34px -10px var(--accent);
}
.btn svg { width: 15px; height: 15px; flex: none; transition: transform .3s var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: min(100svh, 900px);
  display: flex; align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}
#field {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
.hero-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 95% 75% at 62% 45%, transparent 0%, var(--bg) 92%),
    linear-gradient(to right, var(--bg) 2%, transparent 46%),
    linear-gradient(to bottom, transparent 62%, var(--bg) 100%);
}
.hero .wrap { position: relative; z-index: 2; width: 100%; padding-block: 90px; }
.hero-inner { max-width: 46rem; }
.hero h1 { margin: 20px 0 0; }
.hero h1 .l2 { display: block; color: var(--text-3); }
.hero .lede { margin-top: 26px; max-width: 46ch; }
.hero-actions { margin-top: 38px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-hint {
  margin-top: 40px;
  font-family: var(--font-mono); font-size: .76rem;
  color: var(--text-3); letter-spacing: .02em;
}

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; z-index: 3;
  transform: translateX(-50%);
  width: 1px; height: 52px; overflow: hidden;
  background: var(--line);
}
.scroll-cue::after {
  content: ''; position: absolute; inset: 0;
  background: var(--accent);
  animation: cue 2.4s var(--ease) infinite;
}
@keyframes cue { 0%{transform:translateY(-100%)} 60%,100%{transform:translateY(100%)} }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding-block: clamp(80px, 12vw, 150px); position: relative; }
.section-head { margin-bottom: clamp(42px, 6vw, 72px); max-width: 62ch; }
.section-head h2 { margin: 18px 0 14px; }

/* ---------- About ---------- */
.about-grid {
  display: grid; gap: clamp(32px, 5vw, 72px);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 900px) { .about-grid { grid-template-columns: 1fr .82fr; } }
.about-body p + p { margin-top: 1.1em; }
.about-body p { color: var(--text-2); font-size: 1.06rem; }
.about-body p:first-child { color: var(--text); font-size: 1.16rem; }

.portrait {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  aspect-ratio: 4/5;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }

.facts { margin-top: 26px; border-top: 1px solid var(--line-soft); }
.fact {
  display: flex; gap: 18px; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
}
.fact dt {
  font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); flex: none; width: 92px;
}
.fact dd { color: var(--text-2); font-size: .95rem; }

/* ============================================================
   WORK — "level select"
   ============================================================ */
/* One lead card at full width, then a two-up grid. Covers come in different
   shapes (portrait key art, wide screenshots, box photos), so every frame is
   the same size and the picture is shown whole inside it, against a blurred
   copy of itself — nothing is cropped and nothing floats in dead space. */
.work-grid {
  display: grid;
  gap: clamp(16px, 2vw, 22px);
  grid-template-columns: 1fr;
}

.card {
  --c: var(--accent);
  position: relative;
  display: grid; grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  transition: border-color .4s var(--ease), transform .5s var(--ease-out), background-color .4s;
  will-change: transform;
}
@media (min-width: 900px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-lead { grid-column: 1 / -1; grid-template-columns: 1.04fr 1fr; }
}
.card:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); background: var(--surface-2); }
.card:hover .card-poster { transform: scale(1.03); }
.card:hover .card-index { color: var(--c); }
.card:hover .card-go { border-color: var(--c); color: var(--c); }
.card:hover .card-go svg { transform: translateX(4px); }
.card:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }

.card-media {
  position: relative; overflow: hidden;
  aspect-ratio: 4/3; background: var(--bg-2);
  border-bottom: 1px solid var(--line-soft);
}
@media (min-width: 900px) {
  .card-lead .card-media {
    aspect-ratio: auto; height: 100%; min-height: 430px; border-bottom: 0;
  }
}
.card-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease-out);
}
.card-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, color-mix(in srgb, var(--c) 12%, transparent), transparent 60%);
  pointer-events: none;
}

/* what you can do with it, readable at a glance on the cover itself */
.card-flag {
  position: absolute; z-index: 3; top: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--c);
  font: 500 .7rem/1 var(--font-mono);
  letter-spacing: .08em; text-transform: uppercase;
}
.card-flag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent);
}
.card-flag.flag-board::before {
  border-radius: 2px; box-shadow: none;
  transform: rotate(45deg) scale(.95);
}
.card-flag.flag-soon { color: var(--text-2); border-color: var(--line); }
.card-flag.flag-soon::before { background: var(--text-3); box-shadow: none; }

.card-body {
  padding: clamp(22px, 2.6vw, 34px);
  display: flex; flex-direction: column; gap: 12px;
  justify-content: center;
}
.card-lead .card-body { padding: clamp(24px, 3.4vw, 42px); gap: 14px; }
.card-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-index {
  font-family: var(--font-mono); font-size: .74rem;
  color: var(--text-3); letter-spacing: .1em;
  transition: color .3s;
}
.card-kicker {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--c);
  padding: 4px 10px; border-radius: 100px;
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
  background: color-mix(in srgb, var(--c) 8%, transparent);
}
.card h3 { font-size: clamp(1.3rem, 2.1vw, 1.7rem); }
.card-lead h3 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.card-summary {
  color: var(--text-2); font-size: .94rem; max-width: 46ch;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4;
  overflow: hidden;
}
.card-lead .card-summary { font-size: .98rem; -webkit-line-clamp: 6; }
.card-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px;
}
.tag {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .08em; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 5px;
  padding: 3px 8px;
}
.card-go {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-mono); font-size: .76rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px; width: fit-content;
  transition: color .3s, border-color .3s;
}
.card-go svg { width: 14px; height: 14px; transition: transform .3s var(--ease-out); }

/* ---------- Minor work ---------- */
.minor-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}
.minor-card {
  --c: var(--accent);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px; background: var(--surface);
  transition: border-color .35s, transform .45s var(--ease-out), background-color .35s;
  position: relative; overflow: hidden;
}
.minor-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 100%; height: 2px; background: var(--c);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.minor-card:hover { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); transform: translateY(-4px); background: var(--surface-2); }
.minor-card:hover::before { transform: scaleX(1); }
.minor-kind {
  font-family: var(--font-mono); font-size: .66rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--c);
}
.minor-card h3 { font-size: 1.16rem; margin: 10px 0 8px; }
.minor-card p { color: var(--text-2); font-size: .92rem; line-height: 1.6; }

/* ============================================================
   PROJECT PAGE
   ============================================================ */
.proj-hero {
  padding-top: clamp(50px, 8vw, 88px);
  padding-bottom: clamp(30px, 5vw, 48px);
  position: relative; overflow: hidden;
}
.proj-hero::before {
  content: ''; position: absolute; top: -35%; left: 50%;
  transform: translateX(-50%);
  width: 1100px; height: 700px; max-width: 160vw;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 15%, transparent), transparent 66%);
  pointer-events: none; filter: blur(46px);
}
.proj-hero .wrap { position: relative; }
.back-link {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-mono); font-size: .76rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); text-decoration: none;
  transition: color .25s; margin-bottom: 34px;
}
.back-link:hover { color: var(--accent); }
.back-link svg { width: 14px; height: 14px; transition: transform .3s var(--ease-out); }
.back-link:hover svg { transform: translateX(-4px); }

.proj-title { margin: 18px 0 20px; font-size: clamp(2.6rem, 8vw, 6rem); letter-spacing: -.045em; }
.proj-summary { max-width: 52ch; font-size: clamp(1.08rem, 2vw, 1.35rem); color: var(--text-2); }

.proj-meta {
  margin-top: 46px;
  display: grid; gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}
/* separators drawn per-cell, not via a gap colour, so a partly filled last
   row reads as empty space rather than a stray block of border colour */
.proj-meta div {
  background: var(--bg);
  padding: 18px 20px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.proj-meta dt {
  font-family: var(--font-mono); font-size: .66rem;
  letter-spacing: .15em; text-transform: uppercase; color: var(--text-3);
  margin-bottom: 7px;
}
.proj-meta dd { font-size: .95rem; color: var(--text); }

.stage {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; background: var(--surface); aspect-ratio: 16/9;
  position: relative;
}
.stage img, .stage video { width: 100%; height: 100%; object-fit: cover; }

.pillars { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); }
.pillar {
  border-top: 2px solid var(--accent);
  padding-top: 20px;
}
.pillar h3 { font-size: 1.14rem; margin-bottom: 10px; }
.pillar p { color: var(--text-2); font-size: .94rem; }

/* process timeline */
.process { display: grid; gap: 0; }
.step {
  display: grid; gap: 6px 30px;
  grid-template-columns: 1fr;
  padding: 30px 0;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.step:first-child { border-top: 1px solid var(--line-soft); }
@media (min-width: 800px) { .step { grid-template-columns: 40px 1fr 1.5fr; align-items: start; } }
.step-n {
  font-family: var(--font-mono); font-size: .74rem;
  color: var(--accent); letter-spacing: .1em; padding-top: 4px;
}
.step h3 { font-size: 1.18rem; }
.step p { color: var(--text-2); font-size: .98rem; }

/* gallery */
.gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.shot {
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; background: var(--surface);
}
/* .shot-media is defined in the gallery redesign block below */
.shot-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out); }
.shot:hover .shot-media img { transform: scale(1.04); }
.shot figcaption {
  padding: 13px 16px; font-size: .84rem; color: var(--text-2);
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono); line-height: 1.5;
}

.outcomes { display: grid; gap: 12px; list-style: none; }
.outcomes li {
  display: flex; gap: 14px; align-items: baseline;
  padding: 16px 20px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--text);
  font-size: .98rem;
}
.outcomes li::before {
  content: ''; width: 7px; height: 7px; border-radius: 2px;
  background: var(--accent); flex: none;
}

/* next project */
.next-proj {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: clamp(30px, 5vw, 54px);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); text-decoration: none;
  transition: border-color .35s, background-color .35s;
}
.next-proj:hover { border-color: var(--accent); background: var(--surface-2); }
.next-proj:hover .h3 { color: var(--accent); }
.next-proj .h3 { transition: color .3s; margin-top: 6px; }

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact { border-top: 1px solid var(--line-soft); }
.contact-links {
  display: grid; gap: 0; margin-top: 40px;
  border-top: 1px solid var(--line-soft);
}
.contact-link {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 24px 4px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  transition: padding-left .4s var(--ease-out), border-color .3s;
}
.contact-link:hover { padding-left: 18px; border-color: var(--accent); }
.contact-link:hover .cl-label { color: var(--accent); }
.cl-label {
  font-family: var(--font-display); font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 600; letter-spacing: -.03em; transition: color .3s;
}
.cl-handle { font-family: var(--font-mono); font-size: .82rem; color: var(--text-3); }

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 34px;
  font-family: var(--font-mono); font-size: .75rem; color: var(--text-3);
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; transition: color .25s; }
.site-footer a:hover { color: var(--accent); }

/* ============================================================
   ARCADE overlay (the `~` easter egg)
   ============================================================ */
.arcade {
  position: fixed; inset: 0; z-index: 9990;
  display: none; place-items: center;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  padding: 20px;
}
.arcade.open { display: grid; }
.arcade-box {
  width: min(760px, 100%);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg-2); overflow: hidden;
  box-shadow: 0 40px 120px -30px #000;
}
.arcade-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .76rem; color: var(--text-2);
}
.arcade-bar b { color: var(--accent); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.arcade-close {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 9px; cursor: pointer; color: var(--text-3);
  font-family: var(--font-mono); font-size: .72rem;
  transition: color .25s, border-color .25s;
}
.arcade-close:hover { color: var(--accent); border-color: var(--accent); }
#arcade-canvas { width: 100%; display: block; background: #06070A; aspect-ratio: 16/9; touch-action: none; cursor: pointer; }
.arcade-foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .72rem; color: var(--text-3);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- a11y ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10000;
  background: var(--accent); color: var(--accent-ink);
  padding: 12px 20px; border-radius: 0 0 var(--r-sm) 0;
  font-family: var(--font-mono); font-size: .82rem; text-decoration: none;
}
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.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;
}

/* ---------------------------------------------------------------
   Playable build CTA
   --------------------------------------------------------------- */
.play-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.play-btn {
  --pc: var(--c, var(--accent));
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 19px 34px;
  border-radius: 999px;
  border: 0;
  background: var(--pc);
  color: #0a0a0c;
  font: 700 1.06rem/1 var(--font-body);
  letter-spacing: 0.005em;
  text-decoration: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--pc) 55%, transparent),
              0 18px 44px -16px color-mix(in srgb, var(--pc) 70%, transparent);
  transition: box-shadow var(--t), transform var(--t), filter var(--t);
  animation: play-pulse 3.4s ease-out infinite;
}

.play-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-3px);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--pc) 16%, transparent),
              0 26px 60px -18px color-mix(in srgb, var(--pc) 85%, transparent);
  animation-play-state: paused;
}

.play-btn:focus-visible {
  outline: 3px solid var(--pc);
  outline-offset: 4px;
}

/* a slow halo so the button reads as the primary action without shouting */
@keyframes play-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pc) 50%, transparent),
                     0 18px 44px -16px color-mix(in srgb, var(--pc) 70%, transparent); }
  60%  { box-shadow: 0 0 0 16px transparent,
                     0 18px 44px -16px color-mix(in srgb, var(--pc) 70%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent,
                     0 18px 44px -16px color-mix(in srgb, var(--pc) 70%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .play-btn { animation: none; }
}

.play-btn:active { transform: translateY(0); }

.play-ico {
  font-size: 0.7rem;
  transform: translateX(1px);
}

.play-note {
  font: 400 0.83rem/1.5 var(--font-mono);
  color: var(--text-3);
  max-width: 34ch;
}

/* a physical game has nothing to launch, so the note stands on its own */
.play-note-solo {
  margin-top: 30px;
  max-width: 46ch;
  padding-left: 16px;
  border-left: 2px solid color-mix(in srgb, var(--c, var(--accent)) 55%, transparent);
  color: var(--text-2);
}

/* real raster/video media sits in the same frames as the generated SVGs */
.card-media video,
.stage video,
.shot-media video,
.portrait video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* pixel art must not be smoothed when scaled up */
.card-media img[src*=".png"],
.stage img[src*=".png"],
.shot-media img[src*=".png"],
.card-media img[src*=".gif"],
.stage img[src*=".gif"],
.shot-media img[src*=".gif"] {
  image-rendering: pixelated;
}

@media (max-width: 640px) {
  .play-row { gap: 12px; }
  .play-note { max-width: none; }
}


/* ---------------------------------------------------------------
   Clickable key image -> playable build
   --------------------------------------------------------------- */
.stage-play {
  --pc: var(--c, var(--accent));
  display: block;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
}

.stage-play img,
.stage-play video { transition: transform 0.7s cubic-bezier(.2,.7,.2,1), filter 0.4s ease; }
.stage-play:hover img,
.stage-play:hover video { transform: scale(1.028); filter: brightness(1.04); }

.stage-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
              rgba(6,6,9,0.88) 0%, rgba(6,6,9,0.45) 26%, rgba(6,6,9,0) 55%);
  transition: opacity var(--t);
}
.stage-play:hover .stage-veil { opacity: 0.82; }

.stage-cta {
  position: absolute;
  left: clamp(18px, 3.4vw, 42px);
  bottom: clamp(18px, 3.4vw, 40px);
  display: flex;
  align-items: center;
  gap: 18px;
}

.stage-disc {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(56px, 6.6vw, 82px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--pc);
  box-shadow: 0 14px 40px -10px color-mix(in srgb, var(--pc) 85%, transparent);
  transition: transform var(--t), box-shadow var(--t);
}
.stage-play:hover .stage-disc {
  transform: scale(1.09);
  box-shadow: 0 20px 56px -10px color-mix(in srgb, var(--pc) 95%, transparent);
}

/* CSS triangle, so there is no icon font or SVG to load */
.stage-tri {
  width: 0; height: 0;
  margin-left: 22%;
  border-left: clamp(15px, 1.75vw, 22px) solid #0a0a0c;
  border-top: clamp(9px, 1.05vw, 13px) solid transparent;
  border-bottom: clamp(9px, 1.05vw, 13px) solid transparent;
}

.stage-words { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.stage-words strong {
  font: 700 clamp(1.05rem, 1.9vw, 1.5rem)/1.1 var(--font-body);
  color: #fff;
  letter-spacing: -0.01em;
}
.stage-words em {
  font: 400 clamp(0.74rem, 1vw, 0.86rem)/1.4 var(--font-mono);
  font-style: normal;
  color: rgba(255,255,255,0.72);
}

.stage-play:focus-visible { outline: 3px solid var(--pc); outline-offset: 3px; }

@media (max-width: 560px) {
  .stage-cta { gap: 13px; left: 14px; bottom: 14px; right: 14px; }
  .stage-words em { display: none; }
}

/* ---------------------------------------------------------------
   Per-image gallery fitting
   --------------------------------------------------------------- */
/* "contain" for art that must not be cropped — portrait covers, card strips */
.shot-media.shot-contain {
  background:
    radial-gradient(120% 120% at 50% 0%,
      color-mix(in srgb, var(--c, var(--accent)) 9%, transparent), transparent 70%),
    var(--bg-2);
}
.shot-media.shot-contain img,
.shot-media.shot-contain video { object-fit: contain; padding: 14px; }

/* "trim" scales a shot up inside its frame to push stray edges out of view */
.shot-media img, .shot-media video { transform: scale(var(--trim, 1)); transform-origin: 62% 62%; }

/* ---------------------------------------------------------------
   Accolade badge — rankings and awards, linkable to the proof
   --------------------------------------------------------------- */
.accolade {
  --ac: var(--c, var(--accent));
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding: 12px 20px 12px 16px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ac) 45%, transparent);
  background: color-mix(in srgb, var(--ac) 11%, transparent);
  text-decoration: none;
  transition: background var(--t), border-color var(--t), transform var(--t);
}

a.accolade:hover {
  background: color-mix(in srgb, var(--ac) 20%, transparent);
  border-color: color-mix(in srgb, var(--ac) 75%, transparent);
  transform: translateY(-2px);
}

/* laurel-ish mark without loading an icon font */
.accolade::before {
  content: "★";
  font-size: 0.9rem;
  line-height: 1;
  color: var(--ac);
}

.acc-rank {
  font: 700 0.94rem/1.2 var(--font-body);
  color: var(--ac);
  letter-spacing: 0.005em;
}

.acc-detail {
  font: 400 0.79rem/1.3 var(--font-mono);
  color: var(--text-3);
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
}

/* compact variant sits next to the kicker on a homepage card */
.accolade-sm {
  margin-top: 0;
  margin-left: 10px;
  padding: 3px 10px 3px 8px;
  gap: 6px;
  vertical-align: middle;
}
.accolade-sm::before { font-size: 0.68rem; }
.accolade-sm .acc-rank {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 560px) {
  .accolade { flex-wrap: wrap; gap: 7px; padding: 11px 16px; }
  .acc-detail { padding-left: 0; border-left: 0; flex-basis: 100%; }
  .accolade-sm { display: none; }
}

/* ---------------------------------------------------------------
   Art gallery — homepage strip + full sketchbook page
   --------------------------------------------------------------- */
.tile-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.tile {
  display: block;
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1), filter var(--t);
  filter: saturate(0.92);
}
.tile:hover img { transform: scale(1.06); filter: saturate(1.05); }

.more-link {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 32px;
  font: 500 0.95rem/1 var(--font-body);
  color: var(--accent);
  text-decoration: none;
}
.more-link:hover { text-decoration: underline; text-underline-offset: 5px; }
/* same missing arrow size as .doc-cta: it rendered huge and wrapped the label */
.more-link { white-space: nowrap; }
.more-link svg { width: 15px; height: 15px; flex: none; transition: transform .3s var(--ease-out); }
.more-link:hover svg { transform: translateX(-3px); }

/* --- full gallery --- */
.plates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 26px;
}

.plate { margin: 0; }

.plate-media {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 50% 0%,
      color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    var(--bg-2);
  aspect-ratio: 4/3;
  display: grid;
  place-items: center;
}
.plate-media.plate-tall { aspect-ratio: 3/4; }
.plate-media.plate-xtall { aspect-ratio: 1/2; }   /* tall, narrow art: a limb, a full figure */

/* art is shown whole — never cropped */
.plate-media img, .plate-media video {
  width: 100%; height: 100%;
  /* a grid item won't shrink under its min-content height on its own, so the
     picture overflowed this frame and overflow:hidden cut the bottom off it */
  min-height: 0;
  object-fit: contain;
  padding: 12px;
}

.plate figcaption {
  margin-top: 12px;
  font: 400 0.84rem/1.5 var(--font-mono);
  color: var(--text-3);
}

.section.alt-bg { background: var(--bg-2); }

@media (max-width: 560px) {
  .tile-strip { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .plates { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------------------------------------------------------------
   Contact form
   --------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.cform { display: flex; flex-direction: column; gap: 20px; }

.f-row { display: flex; flex-direction: column; gap: 9px; }

.f-row label {
  font: 500 0.72rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.f-opt {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--text-3);
  margin-left: 8px;
}

.cform input,
.cform textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font: 400 0.97rem/1.55 var(--font-body);
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.cform textarea { resize: vertical; min-height: 150px; }

.cform input::placeholder,
.cform textarea::placeholder { color: color-mix(in srgb, var(--text-3) 75%, transparent); }

.cform input:focus,
.cform textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent);
  background: var(--bg);
}

.cform input[aria-invalid="true"],
.cform textarea[aria-invalid="true"] { border-color: #E5533D; }

/* honeypot — off-screen for humans, still fillable by bots */
.f-hp {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.f-send {
  align-self: flex-start;
  padding: 15px 30px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0a0c;
  font: 700 0.97rem/1 var(--font-body);
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), filter var(--t);
}
.f-send:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: 0 16px 40px -16px color-mix(in srgb, var(--accent) 80%, transparent);
}
.f-send:disabled { opacity: 0.55; cursor: not-allowed; }

.f-note { font: 400 0.88rem/1.55 var(--font-body); color: var(--text-3); min-height: 1.2em; }
.f-note.ok  { color: var(--accent); }
.f-note.bad { color: #FF8A7A; }

.cside {
  padding: 26px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: var(--bg-2);
}
.cside-label {
  font: 500 0.7rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}
.cside-mail {
  display: inline-block;
  font: 600 1.02rem/1.4 var(--font-body);
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}
.cside-mail:hover { text-decoration: underline; text-underline-offset: 4px; }
.cside-note { margin-top: 14px; font: 400 0.84rem/1.6 var(--font-body); color: var(--text-3); }

@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; }
}


/* ---------------------------------------------------------------
   Project gallery — frames take the picture's own proportions, so
   nothing is cropped; click opens the full-size viewer
   --------------------------------------------------------------- */
.gal-hint {
  margin-top: 10px;
  font: 400 0.84rem/1.5 var(--font-mono);
  color: var(--text-3);
}

.gallery {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
  grid-auto-flow: dense;
}

@media (min-width: 720px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery .g-wide,
  .gallery .g-strip { grid-column: span 2; }
}

@media (min-width: 1080px) {
  .gallery { grid-template-columns: repeat(6, 1fr); gap: 26px; }
  .gallery .g-norm  { grid-column: span 3; }
  .gallery .g-tall  { grid-column: span 2; }
  .gallery .g-wide  { grid-column: span 4; }
  .gallery .g-strip { grid-column: span 6; }
}

.shot { margin: 0; }

/* the frame matches the image, so "contain" fills it exactly — no crop */
.shot-media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 16/10);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  cursor: zoom-in;
  background:
    radial-gradient(130% 130% at 50% 0%,
      color-mix(in srgb, var(--c, var(--accent)) 8%, transparent), transparent 72%),
    var(--bg-2);
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}

.shot-media img,
.shot-media video {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  transform: none;
}

/* sprite sheets and icon rows need room to breathe and crisp upscaling */
.g-strip .shot-media,
.g-tall  .shot-media { padding: 10px; }
.shot-media.is-pixel img { image-rendering: pixelated; }

.shot-media:hover {
  border-color: color-mix(in srgb, var(--c, var(--accent)) 55%, transparent);
  transform: translateY(-3px);
  box-shadow: 0 20px 50px -24px color-mix(in srgb, var(--c, var(--accent)) 70%, transparent);
}
.shot-media:focus-visible {
  outline: 3px solid var(--c, var(--accent));
  outline-offset: 3px;
}

.shot-cue {
  position: absolute;
  right: 12px; bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8,8,11,0.82);
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 45%, transparent);
  color: var(--c, var(--accent));
  font: 500 0.66rem/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--t), transform var(--t);
}
.shot-media:hover .shot-cue,
.shot-media:focus-visible .shot-cue { opacity: 1; transform: translateY(0); }

.shot figcaption {
  margin-top: 12px;
  font: 400 0.85rem/1.55 var(--font-mono);
  color: var(--text-3);
}

/* ---------------------------------------------------------------
   Full-size viewer
   --------------------------------------------------------------- */
.lb {
  position: fixed; inset: 0; z-index: 200;
  display: none;
  background: rgba(5,5,8,0.95);
  backdrop-filter: blur(6px);
}
.lb[open], .lb.is-open { display: grid; grid-template-rows: auto 1fr auto; }

.lb-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(14px, 3vw, 28px);
  color: var(--text-3);
  font: 400 0.8rem/1.4 var(--font-mono);
}
.lb-count { color: var(--text-3); }

.lb-stage {
  position: relative;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 0 clamp(10px, 3vw, 28px);
}
.lb-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
/* actual-size mode: show native pixels and allow panning */
.lb-stage.is-actual { place-items: start center; }
.lb-stage.is-actual img { max-width: none; max-height: none; }
.lb-stage img.is-pixel { image-rendering: pixelated; }

.lb-foot {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px clamp(14px, 3vw, 28px) 22px;
  text-align: center;
}
.lb-cap {
  font: 400 0.9rem/1.5 var(--font-body);
  color: var(--text-2);
  max-width: 70ch;
}

.lb-btn {
  flex: none;
  display: inline-grid; place-items: center;
  min-width: 40px; height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  font: 500 0.78rem/1 var(--font-mono);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.lb-btn:hover { border-color: var(--accent); color: var(--accent); }
.lb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(10,10,14,0.8);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
}
.lb-prev { left: clamp(6px, 2vw, 20px); }
.lb-next { right: clamp(6px, 2vw, 20px); }
.lb-nav:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 620px) {
  .lb-nav { width: 38px; height: 38px; }
  .lb-cap { font-size: 0.83rem; }
}

@media (prefers-reduced-motion: reduce) {
  .shot-media, .shot-cue { transition: none; }
  .shot-media:hover { transform: none; }
}

/* ---------------------------------------------------------------
   Thesis band — the through-line, stated once, before the work
   --------------------------------------------------------------- */
.thesis {
  background: var(--bg-2);
  border-block: 1px solid var(--line-soft);
}

.th-head { max-width: min(100%, 900px); }

.th-statement {
  margin-top: 14px;
  font: 600 clamp(1.6rem, 3.6vw, 2.7rem)/1.18 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

.th-points {
  list-style: none;
  margin: clamp(30px, 5vw, 52px) 0 0;
  padding: 0;
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.th-point {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.th-num {
  flex: none;
  font: 500 0.7rem/1.6 var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.1em;
}
.th-point p {
  margin: 0;
  font: 400 0.95rem/1.65 var(--font-body);
  color: var(--text-2);
}
.th-point strong { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------
   Reserved project slot — honest empty space, never invented work
   --------------------------------------------------------------- */
.card-soon {
  cursor: default;
  border-style: dashed;
  background: transparent;
}
.card-soon:hover { transform: none; }

.soon-media {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  background:
    radial-gradient(90% 70% at 50% 40%,
      color-mix(in srgb, var(--c) 10%, transparent), transparent 70%),
    repeating-linear-gradient(135deg,
      color-mix(in srgb, var(--c) 7%, transparent) 0 10px,
      transparent 10px 20px),
    var(--bg-2);
}
/* as the lead card it fills the height beside the text, so a reserved slot
   still reads as a designed panel rather than a gap */
@media (min-width: 900px) {
  .card-lead .soon-media { aspect-ratio: auto; height: 100%; min-height: 430px; }
  .card-lead .soon-mark { width: 46px; height: 46px; }
  .card-lead .soon-mark::before { top: 13px; bottom: 13px; }
  .card-lead .soon-mark::after { left: 13px; right: 13px; }
}
.soon-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--c) 60%, transparent);
  position: relative;
}
.soon-mark::before,
.soon-mark::after {
  content: "";
  position: absolute;
  background: color-mix(in srgb, var(--c) 70%, transparent);
}
.soon-mark::before { left: 50%; top: 9px; bottom: 9px; width: 1px; transform: translateX(-50%); }
.soon-mark::after  { top: 50%; left: 9px; right: 9px; height: 1px; transform: translateY(-50%); }
/* ---------------------------------------------------------------
   Reading layout — prose wants a different measure and rhythm than
   the rest of the site, which is tuned for screenshots
   --------------------------------------------------------------- */
.reading .read-lede {
  margin-top: 22px;
  max-width: 62ch;
  font: 400 clamp(1.02rem, 1.5vw, 1.16rem)/1.72 var(--font-body);
  color: var(--text-2);
}

.wip-note {
  margin-top: 26px;
  max-width: 62ch;
  padding: 15px 20px;
  border-radius: var(--r);
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font: 400 0.92rem/1.6 var(--font-body);
  color: var(--text-2);
}
.wip-note strong { color: var(--accent); font-weight: 600; }

.wstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  margin-top: 42px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--line-soft);
}
.wstat { background: var(--bg); padding: 20px; }
.wstat-n {
  display: block;
  font: 600 clamp(1.5rem, 3vw, 2.1rem)/1 var(--font-display);
  color: var(--accent);
}
.wstat-l {
  display: block;
  margin-top: 8px;
  font: 400 0.72rem/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.read-sec .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr);
  gap: clamp(26px, 5vw, 70px);
  align-items: start;
}
.read-head { position: sticky; top: 96px; }
.read-blurb {
  margin-top: 12px;
  font: 400 0.92rem/1.6 var(--font-body);
  color: var(--text-3);
}

/* the prose itself: wider leading, longer measure, serif for reading */
.read-body p,
.excerpt p {
  max-width: 68ch;
  font: 400 clamp(1.04rem, 1.35vw, 1.15rem)/1.78 Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  color: var(--text-2);
}
.read-body p + p { margin-top: 1.15em; }

.wlist { margin: 0; display: grid; gap: 20px; }
.wlist dt {
  font: 600 1.02rem/1.4 var(--font-display);
  color: var(--text);
}
.wlist dd {
  margin: 7px 0 0;
  max-width: 62ch;
  font: 400 0.99rem/1.72 Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  color: var(--text-2);
}

.excerpt-sec { background: var(--bg-2); border-block: 1px solid var(--line-soft); }
.excerpt-sec .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr);
  gap: clamp(26px, 5vw, 70px);
  align-items: start;
}
.excerpt {
  margin: 0;
  padding-left: clamp(18px, 2.5vw, 30px);
  border-left: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
}
.excerpt p + p { margin-top: 1.1em; }
.excerpt p { color: var(--text); }

.read-closing {
  max-width: 66ch;
  font: 400 1.02rem/1.75 Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  color: var(--text-2);
}

@media (max-width: 900px) {
  .read-sec .wrap, .excerpt-sec .wrap { grid-template-columns: 1fr; }
  .read-head { position: static; }
}

/* ---------------------------------------------------------------
   Full working document — long-form, with a sticky contents rail
   --------------------------------------------------------------- */
.doc-meta {
  margin-top: 14px;
  font: 400 0.8rem/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.doc-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 8px;
  padding: 15px 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0a0c;
  font: 700 0.98rem/1 var(--font-body);
  text-decoration: none;
  transition: transform var(--t), filter var(--t), box-shadow var(--t);
}
/* the arrow had no size of its own, so it rendered at 90px and squeezed the
   label onto three lines */
.doc-cta { white-space: nowrap; }
.doc-cta svg { width: 16px; height: 16px; flex: none; transition: transform .3s var(--ease-out); }
.doc-cta:hover svg { transform: translateX(3px); }

/* the copy in the hero sits under the work-in-progress note, so it needs a
   little more air above it and none of the bottom one's trailing space */
.doc-cta-top { margin: 22px 0 4px; }

.doc-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: 0 16px 40px -16px color-mix(in srgb, var(--accent) 80%, transparent);
}

.doc-wrap {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: start;
}

.doc-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 130px);
  overflow: auto;
  padding-right: 8px;
}
.doc-toc-h {
  font: 500 0.7rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}
.doc-toc ol { list-style: none; margin: 0; padding: 0; }
.doc-toc li { margin-bottom: 9px; }
.doc-toc li.t1 { padding-left: 14px; }
.doc-toc a {
  font: 400 0.86rem/1.45 var(--font-body);
  color: var(--text-3);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 10px;
  display: block;
  transition: color var(--t), border-color var(--t);
}
.doc-toc li.t1 a { font-size: 0.8rem; }
.doc-toc a:hover { color: var(--accent); border-left-color: var(--accent); }

.doc { max-width: 74ch; }

.doc-h {
  margin: 54px 0 20px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font: 600 clamp(1.25rem, 2.2vw, 1.6rem)/1.3 var(--font-display);
  color: var(--text);
  letter-spacing: -0.01em;
  scroll-margin-top: 90px;
}
.doc-h:first-child { margin-top: 0; border-top: 0; padding-top: 0; }

.doc-h3 {
  margin: 34px 0 12px;
  font: 600 1.04rem/1.4 var(--font-display);
  color: var(--accent);
  scroll-margin-top: 90px;
}

.doc p {
  margin: 0 0 1.05em;
  font: 400 1.02rem/1.78 Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  color: var(--text-2);
}

.doc-list { list-style: none; margin: 0 0 1.3em; padding: 0; }
.doc-list li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 20px;
  font: 400 0.99rem/1.72 Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  color: var(--text-2);
}
.doc-list li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.72em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
}
.doc-list li.d1 { padding-left: 40px; }
.doc-list li.d1::before { left: 22px; background: var(--line); }

@media (max-width: 900px) {
  .doc-wrap { grid-template-columns: 1fr; }
  .doc-toc { position: static; max-height: none; margin-bottom: 30px; }
}

/* ---------------------------------------------------------------
   "LETS GO" as part of the furniture, not just a gallery item
   --------------------------------------------------------------- */

/* the sketchbook now opens on the piece itself */
.art-banner {
  margin: 30px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-2);
  position: relative;
}
.art-banner img {
  display: block;
  width: 100%;
  height: auto;
  /* the artwork sits on mid grey; pull it toward the site's ground so it
     reads as part of the page rather than a pasted-in rectangle */
  filter: brightness(0.82) contrast(1.08) saturate(1.06);
}
.art-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 55%, rgba(8,9,12,0.55));
}
.art-banner figcaption {
  position: relative;
  z-index: 1;
  margin-top: -34px;
  padding: 0 20px 14px;
  font: 400 0.84rem/1.5 var(--font-mono);
  color: rgba(255,255,255,0.72);
}

/* the homepage hero picks up his creature wall on the right, where the
   layout is empty anyway — behind the lattice, never competing with text */
.hero-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* compressed copy: the hero darkens it heavily, so JPEG artefacts are invisible
     and it costs 321KB instead of 2.5MB. Full-quality PNG is the art-page banner. */
  /* URL is supplied inline per page so it carries a content hash; images are
     served with max-age=604800 and would otherwise stay stale for a week */
  background-image: var(--hero-img);
  background-repeat: no-repeat;
  background-position: right center;
  background-size: cover;
  /* knock the mid-grey ground down to near the page colour, keep the
     coloured outlines readable */
  filter: brightness(0.78) saturate(1.65) contrast(1.12);
  opacity: 0.95;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 32%, #000 80%);
          mask-image: linear-gradient(to right, transparent 0%, transparent 32%, #000 80%);
}

@media (max-width: 900px) {
  /* on narrow screens the text fills the width, so the art would sit under it */
  .hero-art { opacity: 0.3; }
  .art-banner figcaption { margin-top: 0; padding: 12px 16px 0; color: var(--text-3); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art { opacity: 0.5; }
}


/* ---------------------------------------------------------------
   Matthew's signature, lifted out of the top-left of the painting.
   The main art layer masks the left side away to keep the headline
   clean, so the signature gets its own layer above that mask.
   --------------------------------------------------------------- */
.hero-sign {
  position: absolute;
  left: 0;
  top: 0;
  width: 34%;
  height: 26%;
  /* above .hero-veil, which is z-index 1 and near-opaque black in this corner */
  z-index: 2;
  pointer-events: none;
  background-image: var(--hero-img);
  background-repeat: no-repeat;
  /* zoom into the painting's own top-left corner where the signature sits */
  background-size: 300% auto;
  background-position: 0% 0%;
  /* The painting's ground sits at luminance ~70 and the signature ink runs
     96-180, so brightness+contrast crushes the ground to black and keeps only
     the ink; screen blending then drops the black out entirely, leaving the
     signature alone rather than a bright grey patch. */
  filter: grayscale(1) brightness(1.3) contrast(5);
  mix-blend-mode: screen;
  opacity: 0.85;
  /* fade out well before the eyebrow and headline begin */
  -webkit-mask-image: radial-gradient(ellipse 70% 78% at 20% 30%,
                       #000 0%, #000 46%, transparent 82%);
          mask-image: radial-gradient(ellipse 70% 78% at 20% 30%,
                       #000 0%, #000 46%, transparent 82%);
}

@media (max-width: 900px) {
  .hero-sign { opacity: 0.32; width: 52%; height: 20%; }
}


/* ---------------------------------------------------------------
   Portrait art in a landscape frame (e.g. a game's box cover):
   the image is shown whole, and a blurred copy of itself fills the
   rest, so nothing is cropped and the frame never looks empty.
   --------------------------------------------------------------- */
.fit-contain { position: relative; overflow: hidden; isolation: isolate; }
.fit-contain::before {
  content: "";
  position: absolute;
  inset: -40px;
  z-index: 0;
  background: var(--bg) center / cover no-repeat;
  filter: blur(28px) brightness(0.42) saturate(1.25);
  transform: scale(1.08);
  pointer-events: none;
}
.card-media.fit-contain .card-poster,
.stage.fit-contain > img,
.stage.fit-contain > video {
  position: relative;
  z-index: 1;
  object-fit: contain;
  /* a smoothed cover shrunk several times over looks jagged with
     nearest-neighbour sampling, so let the browser filter it */
  image-rendering: auto;
}
.card-media.fit-contain .card-poster { position: absolute; }
.fit-contain .stage-veil { z-index: 2; }
.fit-contain .stage-cta  { z-index: 3; }
.card-media.fit-contain::after { z-index: 2; }
