/* =========================================================
   Personal Portfolio — Light editorial / cinematic hybrid
   Type:   Newsreader (display serif), Geist (sans), JetBrains Mono
   Palette: warm off-white, deep charcoal, single ember accent
   ========================================================= */

:root {
  /* Palette — Graphite (default, dark) */
  --bg: oklch(0.22 0.005 250);
  --bg-elev: oklch(0.26 0.006 250);
  --bg-sunk: oklch(0.18 0.005 250);
  --fg: oklch(0.94 0.004 250);
  --fg-muted: oklch(0.66 0.006 250);
  --fg-faint: oklch(0.50 0.006 250);
  --rule: oklch(0.34 0.006 250);
  --rule-strong: oklch(0.44 0.008 250);
  --accent: oklch(0.72 0.14 38);
  --accent-ink: oklch(0.78 0.12 38);
  --grid: oklch(0.30 0.006 250 / 0.55);
  --grid-major: oklch(0.40 0.008 250 / 0.45);

  /* Density */
  --pad-x: clamp(24px, 5vw, 96px);
  --section-y: clamp(96px, 14vh, 180px);
  --gutter: 32px;

  /* Type families */
  --ff-display: "Newsreader", "Source Serif Pro", Georgia, serif;
  --ff-sans: "Geist", "Söhne", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Type scale */
  --t-eyebrow: 11px;
  --t-body: 15.5px;
  --t-lead: 19px;
  --t-h3: clamp(20px, 1.8vw, 24px);
  --t-h2: clamp(30px, 3.4vw, 48px);
  --t-display: clamp(56px, 9vw, 132px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ff-sans);
  font-size: var(--t-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  position: relative;
}

/* Subtle background grid — reinforces 3D/tech vibe */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--grid) 0 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 0 1px, transparent 1px);
  background-size: var(--grid-size, 64px) var(--grid-size, 64px);
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 85%);
  opacity: var(--grid-opacity, 1);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--grid-major) 0 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-major) 0 1px, transparent 1px);
  background-size: calc(var(--grid-size, 64px) * 4) calc(var(--grid-size, 64px) * 4);
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 90%);
  opacity: var(--grid-major-opacity, 1);
}
.shell { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

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

/* ---------- shell ---------- */
.shell {
  min-height: 100vh;
  padding: 0 var(--pad-x);
}

.rule {
  height: 1px;
  background: var(--rule);
  width: 100%;
}
.rule--strong { background: var(--rule-strong); }

/* ---------- TopBar ---------- */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  z-index: 30;
}
.topbar__brand {
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  gap: 14px;
  align-items: center;
}
.topbar__brand .dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
}
.topbar__nav {
  display: flex;
  gap: 36px;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topbar__nav a {
  position: relative;
  padding: 4px 0;
  transition: color .2s ease;
}
.topbar__nav a:hover { color: var(--accent); }
.topbar__nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right .35s cubic-bezier(.2,.7,.3,1);
}
.topbar__nav a:hover::after { right: 0; }
.topbar__meta {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.topbar__meta .pulse {
  display: inline-flex; align-items: center; gap: 8px;
}
.topbar__meta .pulse::before {
  content: "";
  width: 6px; height: 6px;
  background: oklch(0.6 0.15 145);
  border-radius: 50%;
  box-shadow: 0 0 0 0 oklch(0.6 0.15 145 / .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 oklch(0.6 0.15 145 / .6); }
  70% { box-shadow: 0 0 0 8px oklch(0.6 0.15 145 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.6 0.15 145 / 0); }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(32px, 6vh, 72px) 0 0;
  position: relative;
}
.hero__meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 24px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 36px;
}
.hero__meta b { color: var(--fg); font-weight: 500; display: block; margin-top: 6px; font-family: var(--ff-sans); font-size: 14px; letter-spacing: 0; text-transform: none; }

.hero__title {
  font-family: var(--ff-sans);
  font-weight: 500;
  font-size: calc(var(--t-display) * 0.5);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
  max-width: 31ch;
}
.hero__title em {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--fg-muted);
  display: inline-block;
  padding: 0 0.05em;
}
.hero__title .tok {
  font-family: var(--ff-mono);
  font-weight: 400;
  font-size: 0.4em;
  letter-spacing: 0;
  color: var(--accent);
  vertical-align: 0.55em;
  margin-right: 0.3em;
}
.hero__sub {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: end;
}
.hero__lede {
  font-size: var(--t-lead);
  max-width: 56ch;
  color: var(--fg-muted);
  line-height: 1.45;
  text-wrap: pretty;
}
.hero__lede strong { color: var(--fg); font-weight: 500; }

.hero__scroll {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.hero__scroll .line {
  width: 1px; height: 56px;
  background: linear-gradient(to bottom, var(--rule-strong), transparent);
  margin-left: auto;
}

.hero__plate {
  margin-top: 56px;
  position: relative;
  border: 1px solid var(--rule);
  background: var(--bg-sunk);
  aspect-ratio: 973 / 189;
  overflow: hidden;
}
.hero__plate .corner {
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--fg);
}
.hero__plate .corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.hero__plate .corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.hero__plate .corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.hero__plate .corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

.hero__plate__caption {
  position: absolute;
  bottom: 22px; left: 28px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  padding: 6px 10px;
  border: 1px solid var(--rule);
  backdrop-filter: blur(6px);
}
.hero__plate__caption b { color: var(--accent-ink); font-weight: 500; }

/* Image-placeholder treatment (subtle stripes + label) */
.placeholder {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--fg) 6%, transparent) 0 1px,
      transparent 1px 14px),
    linear-gradient(180deg, var(--bg-sunk), var(--bg-elev));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.placeholder span {
  border: 1px dashed var(--rule-strong);
  padding: 8px 14px;
  background: color-mix(in oklab, var(--bg) 50%, transparent);
}

/* Hero parallax */
.hero__plate__layer {
  position: absolute; inset: 0;
  transition: transform 1.2s cubic-bezier(.2,.7,.3,1);
  will-change: transform;
}
.hero__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* ---------- Chip strip (replaces marquee) ---------- */
.chips {
  margin-top: calc(var(--section-y) * 0.6);
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chips__label {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-right: 10px;
}
.chip {
  font-family: var(--ff-mono);
  font-size: 12px;
  padding: 6px 11px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--fg);
  background: var(--bg-elev);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.chip:hover { border-color: var(--fg); }
.chip__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.chip--ghost { background: transparent; color: var(--fg-muted); }
.chip--solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---------- Section header ---------- */
.section {
  padding-top: var(--section-y);
}
.section__head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--gutter);
  align-items: end;
  margin-bottom: 56px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}
.section__index {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.section__index b { color: var(--accent-ink); font-weight: 500; }
.section__title {
  font-family: var(--ff-sans);
  font-weight: 500;
  font-size: var(--t-h2);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
  max-width: 28ch;
}
.section__title em {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 300;
  color: var(--fg-muted);
}
.section__title .tok {
  font-family: var(--ff-mono);
  font-weight: 400;
  font-size: 0.5em;
  color: var(--accent);
  display: block;
  vertical-align: baseline;
  margin: 0 0 0.35em;
  letter-spacing: 0;
}
.section__subtitle {
  grid-column: 2;
  grid-row: 2;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 12px;
}
#case-studies .section__index {
  align-self: end;
  grid-row: 2;
}
#case-studies .section__title {
  grid-column: 2;
  grid-row: 1;
}
.case-tabs {
  margin-bottom: 32px;
}
.case-tab .yr {
  order: -1;
}

/* ---------- Works grid ---------- */
.works {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  border: 1px solid var(--rule);
  background: var(--bg-sunk);
  padding: var(--gutter);
}
.work {
  position: relative;
  display: block;
  cursor: pointer;
  border: 1px solid var(--rule-strong);
  background: var(--bg-sunk);
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px var(--bg-sunk),
    0 0 0 1px color-mix(in oklab, var(--bg-sunk) 75%, black);
}
.work--lg { grid-column: span 7; }
.work--md { grid-column: span 5; }
.work--full { grid-column: span 12; }
.work--half { grid-column: span 6; }
.work--third { grid-column: span 4; }

.work__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg-sunk);
}
.work--full .work__frame { aspect-ratio: 21 / 9; }
.work--portrait .work__frame { aspect-ratio: 4 / 5; }

.work__img {
  position: absolute; inset: 0;
  transition: transform 1.4s cubic-bezier(.2,.7,.3,1);
  will-change: transform;
}
.work__media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-sunk);
}
.work__logo {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  width: min(31%, 190px);
  height: auto;
  padding: 6px 8px;
  background: color-mix(in oklab, var(--fg) 92%, transparent);
  border: 1px solid var(--rule-strong);
  pointer-events: none;
}
.work__logo--right {
  left: auto;
  right: 18px;
  width: min(26%, 160px);
}
.work:hover .work__img { transform: scale(1.04); }

.work__overlay {
  position: absolute; inset: 0;
  background: color-mix(in oklab, var(--fg) 0%, transparent);
  transition: background .35s ease;
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 22px;
  pointer-events: none;
}
.work:hover .work__overlay { background: color-mix(in oklab, var(--fg) 22%, transparent); }
.work__overlay__tag {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--fg);
  padding: 6px 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s ease, transform .35s ease;
}
.work:hover .work__overlay__tag { opacity: 1; transform: translateY(0); }

.work__caption {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  margin-top: 0;
  padding: 12px 10px;
  border-top: 1px solid var(--rule);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  align-items: baseline;
}
.work__caption .num {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--fg-faint);
}
.work__caption .title {
  font-family: var(--ff-sans);
  font-size: var(--t-h3);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.work__caption .meta {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-align: right;
}

/* ---------- Case study (long-form) ---------- */
.case {
  display: grid;
  grid-template-columns: minmax(260px, 0.74fr) minmax(0, 2.35fr);
  gap: clamp(28px, 3vw, 48px);
  align-items: start;
}
.case__aside {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.case__aside h4 { color: var(--fg); margin: 22px 0 4px; font-family: var(--ff-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.12em; }
.case__aside p { margin: 0; font-family: var(--ff-sans); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--fg); line-height: 1.45; }
.case__aside ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.case__aside ul li { font-family: var(--ff-sans); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--fg); display: flex; gap: 10px; }
.case__aside ul li::before { content: "→"; color: var(--accent); }

.case__body {
  display: flex;
  flex-direction: column;
  gap: 56px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg);
}
.case__body h3 {
  font-family: var(--ff-sans);
  font-size: var(--t-h3);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.case__body h3 .num {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-right: 18px;
  vertical-align: middle;
}
.case__body p { margin: 0; max-width: 64ch; text-wrap: pretty; }
.case__body p + p { margin-top: 14px; }
.case__pullquote {
  font-family: var(--ff-sans);
  font-weight: 500;
  font-style: normal;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--fg);
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 22px;
  margin: 8px 0;
  max-width: 40ch;
  text-wrap: balance;
}
.case__pullquote span {
  display: block;
  margin-top: 12px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 400;
}
.case__breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.case__breakdown__cell {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--bg-sunk);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.case__breakdown__cell .label {
  position: absolute;
  bottom: 8px; left: 8px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--fg);
  color: var(--bg);
  padding: 4px 8px;
}

.case__metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.case__metric {
  padding: 22px 18px;
  border-right: 1px solid var(--rule);
}
.case__metric:last-child { border-right: 0; }
.case__metric .num {
  font-family: var(--ff-sans);
  font-size: clamp(32px, 3.4vw, 46px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.case__metric .num em {
  font-family: var(--ff-mono);
  font-style: normal;
  font-size: 0.5em;
  font-weight: 400;
  color: var(--fg-muted);
  margin-left: 4px;
  vertical-align: 0.2em;
}
.case__metric .lbl {
  margin-top: 8px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ---------- Tech art (Houdini node graph) ---------- */
.tech {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 48px;
  align-items: start;
}
.tech__copy h3 {
  font-family: var(--ff-sans);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  text-wrap: balance;
  line-height: 1.25;
}
.tech__copy p { color: var(--fg-muted); max-width: 44ch; line-height: 1.6; }
.tech__copy p + p { margin-top: 14px; }
.tech__stack {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--fg);
}
.tech__stack div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--rule); }
.tech__stack div span:last-child { color: var(--fg-muted); }
.architecture-copy h3 {
  font-family: var(--ff-sans);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 16px;
  max-width: 30ch;
  text-wrap: balance;
}
.architecture-copy p {
  color: var(--fg-muted);
  max-width: 58ch;
  line-height: 1.65;
}
.architecture-body .tech__stack {
  margin-top: 4px;
}
.architecture-body .graph {
  margin-top: 8px;
}

.graph {
  position: relative;
  border: 1px solid var(--rule);
  background:
    linear-gradient(var(--bg-elev), var(--bg-elev)),
    repeating-linear-gradient(0deg, var(--rule) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 28px);
  background-blend-mode: normal, multiply, multiply;
  aspect-ratio: 7 / 5;
  overflow: hidden;
}
.graph::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, color-mix(in oklab, var(--fg) 6%, transparent) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, color-mix(in oklab, var(--fg) 6%, transparent) 0 1px, transparent 1px 28px);
  pointer-events: none;
}
.graph__header {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(4px);
  z-index: 2;
}
.graph__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.graph__svg--diagram {
  color: var(--fg);
  padding-top: 28px;
}
.svg-node {
  cursor: pointer;
}
.svg-node__box,
.svg-node__head {
  transition: filter .25s ease, stroke-width .25s ease, opacity .25s ease;
}
.svg-node:hover .svg-node__box {
  filter: drop-shadow(4px 4px 0 var(--fg));
  stroke-width: 1.8;
}
.svg-node--accent:hover .svg-node__box {
  filter: drop-shadow(4px 4px 0 var(--accent));
}
.svg-node:hover .svg-node__head {
  opacity: .92;
}
.graph-wires path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  marker-end: url(#building-arrow-case);
}
.graph-wires .wire-accent {
  color: var(--accent);
}
.svg-node__box {
  fill: var(--bg-elev);
  stroke: var(--fg);
  stroke-width: 1;
}
.svg-node__head {
  fill: var(--fg);
}
.svg-node--accent .svg-node__box {
  stroke: var(--accent);
}
.svg-node--accent .svg-node__head {
  fill: var(--accent);
}
.svg-node__title,
.svg-node__badge-text,
.svg-node__body {
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.svg-node__title {
  fill: var(--bg);
  font-size: 10px;
  font-weight: 600;
}
.svg-node__badge {
  fill: var(--bg);
  stroke: var(--bg);
  stroke-width: 1;
}
.svg-node__badge-text {
  fill: var(--fg);
  font-size: 8px;
  font-weight: 600;
  text-anchor: middle;
}
.svg-node--accent .svg-node__badge-text {
  fill: var(--accent);
}
.svg-node__body {
  fill: var(--fg-muted);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: none;
}
.svg-node__body .strong {
  fill: var(--fg);
  font-weight: 600;
}

.node {
  position: absolute;
  width: 18%;
  min-width: 120px;
  background: var(--bg-elev);
  border: 1px solid var(--fg);
  font-family: var(--ff-mono);
  font-size: 11px;
  z-index: 1;
  transition: transform .25s ease, box-shadow .25s ease;
}
.node:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--fg); }
.node__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--fg);
  color: var(--bg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
}
.node__title b {
  font-weight: 500;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.node__title span {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid currentColor;
  background: var(--bg);
  color: var(--fg);
  font-size: 9px;
  line-height: 1;
}
.node--accent .node__title span {
  color: var(--accent);
}
.node__body {
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
  color: var(--fg-muted);
  overflow-wrap: anywhere;
}
.node__body span b { color: var(--fg); font-weight: 500; }
.node--accent .node__title { background: var(--accent); }
.node--accent { border-color: var(--accent); }

/* ---------- Shipped Titles ---------- */
.gallery__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  margin-bottom: 24px;
  font-family: var(--ff-mono);
  font-size: 12px;
}
.gallery__bar__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-right: 12px;
}
.gallery__tab {
  font-family: var(--ff-mono);
  font-size: 12px;
  padding: 7px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.gallery__tab .yr {
  color: var(--fg-faint);
  font-size: 11px;
}
.gallery__tab:hover { border-color: var(--fg); }
.gallery__tab[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.gallery__tab[aria-pressed="true"] .yr { color: color-mix(in oklab, var(--bg) 70%, transparent); }

.gallery__meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  border-bottom: 0;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.gallery__meta > div {
  padding: 12px 14px;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 4px;
}
.gallery__meta > div:last-child { border-right: 0; }
.gallery__meta > div b {
  color: var(--fg);
  font-family: var(--ff-sans);
  font-size: 14px;
  letter-spacing: -0.005em;
  font-weight: 500;
  text-transform: none;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  border: 1px solid var(--rule);
  border-top: 0;
  padding: var(--gutter);
  background: var(--bg-sunk);
}
.gslot {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.gslot:hover { transform: translateY(-2px); box-shadow: 0 6px 0 -2px var(--rule-strong); }
.gslot--hero { grid-column: span 12; }
.gslot--third { grid-column: span 4; }
.gslot--half { grid-column: span 6; }
.gslot--portrait { grid-column: span 4; }
.gslot--wide { grid-column: span 8; }
.gslot__visual {
  position: relative;
  overflow: hidden;
  background: var(--bg-sunk);
  border-bottom: 1px solid var(--rule);
}
.gslot--hero .gslot__visual { aspect-ratio: 21 / 9; }
.gslot--third .gslot__visual { aspect-ratio: 4 / 3; }
.gslot--half .gslot__visual { aspect-ratio: 16 / 9; }
.gslot--portrait .gslot__visual { aspect-ratio: 4 / 5; }
.gslot--wide .gslot__visual { aspect-ratio: 16 / 9; }
.gslot__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: var(--bg-sunk);
}
.gallery__grid--livelike .gslot__media {
  object-fit: cover;
}
.gallery__grid--gtav .gslot__media {
  object-fit: cover;
}
.gallery__grid--rdr2 .gslot__media {
  object-fit: cover;
}
.gallery__grid--rdr .gslot__media {
  object-fit: cover;
}
.gallery__grid--midnightclub .gslot__media {
  object-fit: cover;
}
.gslot--hero .gslot__visual {
  aspect-ratio: auto;
}
.gslot--hero .gslot__media {
  position: static;
  height: auto;
  object-fit: contain !important;
}
.gslot__logos {
  position: absolute;
  inset: auto 12px 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}
.gslot--hero .gslot__logos {
  inset: auto 24px 24px;
}
.gslot__logo {
  display: block;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px color-mix(in oklab, black 70%, transparent));
}
.gslot__logo--company {
  margin-right: auto;
  max-width: min(33%, 144px);
  max-height: clamp(27px, 4.5vw, 51px);
}
.gslot__logo--game {
  margin-left: auto;
  max-width: min(59%, 256px);
  max-height: clamp(48px, 8vw, 91px);
  transform: translate(-8px, 6px);
}
.gallery__grid--livelike .gslot__logo--company {
  max-width: min(28%, 112px);
  max-height: clamp(24px, 4vw, 44px);
  transform: none;
}
.gallery__grid--livelike .gslot__logo--game {
  max-width: min(34%, 148px);
  max-height: clamp(28px, 4.6vw, 56px);
  transform: none;
}
.gallery__grid--skate .gslot__logo--company {
  max-width: min(24%, 112px);
  max-height: clamp(22px, 3.6vw, 42px);
  transform: none;
}
.gallery__grid--skate .gslot__logo--game {
  max-width: min(30%, 140px);
  max-height: clamp(24px, 4vw, 52px);
  transform: none;
}
.gslot--hero .gslot__logo--company {
  max-width: min(66%, 288px);
  max-height: clamp(54px, 9vw, 102px);
}
.gslot--hero .gslot__logo--game {
  max-width: min(88%, 512px);
  max-height: clamp(96px, 16vw, 182px);
}
.gallery__grid--livelike .gslot--hero .gslot__logo--company {
  max-width: min(56%, 224px);
  max-height: clamp(48px, 8vw, 88px);
}
.gallery__grid--livelike .gslot--hero .gslot__logo--game {
  max-width: min(68%, 296px);
  max-height: clamp(56px, 9.2vw, 112px);
}
.gslot__chip {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--fg);
  color: var(--bg);
  padding: 4px 8px;
  z-index: 2;
}
.gslot__chip--accent { background: var(--accent); }
.gallery__grid .gslot__chip--accent {
  background: var(--fg);
  color: var(--bg);
}
.case-media .gslot__chip--accent {
  background: var(--fg);
  color: var(--bg);
}
.gslot__caption {
  position: static;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  padding: 8px 10px;
  border: 0;
  display: flex; justify-content: space-between; gap: 12px;
  min-height: 38px;
  align-items: center;
  backdrop-filter: none;
  z-index: 2;
}
.gslot__caption b {
  min-width: 0;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.gslot__caption span {
  flex: 0 0 auto;
  color: var(--fg-muted);
}
.case-media__caption {
  display: grid;
  align-items: start;
  gap: 6px;
}
.case-media__caption-head {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.case-media__caption p {
  margin: 0;
  width: 100%;
  color: var(--fg-muted);
  font-family: var(--ff-sans);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0;
}
.case-media__caption-head > span {
  flex: 0 0 auto;
  padding-top: 1px;
  font-size: 10px;
  color: var(--fg-muted);
}
.gslot__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}
.gslot__play__btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--fg) 86%, transparent);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono);
  font-size: 14px;
  border: 1px solid var(--bg);
}

.case__intro p {
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--fg);
  max-width: 42ch;
}
.case__media-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.case__media-grid--reels {
  gap: var(--gutter);
  border: 1px solid var(--rule);
  background: var(--bg-sunk);
  padding: var(--gutter);
}
.case-media {
  position: relative;
  grid-column: span 6;
  border: 1px solid var(--rule);
  background: var(--bg-sunk);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.case-media:not(.case-media--hero) {
  border-color: var(--rule-strong);
  box-shadow:
    inset 0 0 0 1px var(--bg-sunk),
    0 0 0 1px color-mix(in oklab, var(--bg-sunk) 75%, black);
}
.case-media:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 -2px var(--rule-strong);
}
.case-media:not(.case-media--hero):hover {
  box-shadow:
    inset 0 0 0 1px var(--bg-sunk),
    0 6px 0 -2px var(--rule-strong);
}
.case-media--hero {
  grid-column: span 12;
  width: min(100%, 980px);
  justify-self: center;
}
.case-media--wide { grid-column: span 8; }
.case-media--half { grid-column: span 6; }
.case-media--third { grid-column: span 4; }
.case-media__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--fg) 6%, transparent) 0 1px,
      transparent 1px 14px),
    linear-gradient(180deg, var(--bg-sunk), var(--bg-elev));
  border: 1px solid var(--rule);
}
.case-media__frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed var(--rule-strong);
  pointer-events: none;
  z-index: 1;
}
.case-media--hero .case-media__frame {
  aspect-ratio: 16 / 9;
}
.case-media__frame video,
.case-media__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.case-media__frame video {
  object-fit: contain;
  background: var(--bg-sunk);
}
.case-media__frame img {
  object-fit: cover;
}
.case-media--zoomable {
  cursor: zoom-in;
}
.case-media__frame--button {
  display: block;
  width: 100%;
  padding: 0;
  color: inherit;
  text-align: inherit;
  cursor: zoom-in;
  appearance: none;
}
.case-media__frame--button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}
.case-media__zoom-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  padding: 8px 10px;
  border: 1px solid var(--rule-strong);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  color: var(--fg);
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transform: translate(-50%, calc(-50% + 4px));
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.case-media--zoomable:hover .case-media__zoom-hint,
.case-media__frame--button:focus-visible .case-media__zoom-hint {
  opacity: 1;
  transform: translate(-50%, -50%);
}
.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 56px);
  background:
    linear-gradient(color-mix(in oklab, var(--bg) 78%, transparent), color-mix(in oklab, var(--bg) 78%, transparent)),
    repeating-linear-gradient(0deg, color-mix(in oklab, var(--fg) 8%, transparent) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, color-mix(in oklab, var(--fg) 8%, transparent) 0 1px, transparent 1px 32px);
  backdrop-filter: blur(12px);
}
.media-lightbox__panel {
  width: min(1180px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid var(--rule-strong);
  background: var(--bg-sunk);
  box-shadow: 0 22px 80px color-mix(in oklab, black 58%, transparent);
}
.media-lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.media-lightbox__bar div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.media-lightbox__bar span {
  flex: 0 0 auto;
  background: var(--fg);
  color: var(--bg);
  padding: 4px 8px;
  text-transform: uppercase;
}
.media-lightbox__bar b {
  min-width: 0;
  overflow-wrap: anywhere;
}
.media-lightbox__close {
  border: 1px solid var(--rule-strong);
  background: var(--fg);
  color: var(--bg);
  padding: 7px 10px;
  font: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  cursor: pointer;
}
.media-lightbox__close:hover,
.media-lightbox__close:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.media-lightbox__description {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.45;
}
.media-lightbox__frame {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  overflow: auto;
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--fg) 5%, transparent) 0 1px,
      transparent 1px 14px),
    var(--bg-elev);
}
.media-lightbox__frame img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 82px);
  width: auto;
  height: auto;
  border: 1px solid var(--rule);
  object-fit: contain;
}
.case__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.diagram-panel,
.code-card {
  border: 1px solid var(--rule);
  background:
    linear-gradient(var(--bg-elev), var(--bg-elev)),
    repeating-linear-gradient(0deg, color-mix(in oklab, var(--fg) 6%, transparent) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, color-mix(in oklab, var(--fg) 6%, transparent) 0 1px, transparent 1px 28px);
  background-blend-mode: normal, multiply, multiply;
  overflow: hidden;
}
.diagram-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.flow-diagram {
  display: grid;
  grid-template-columns:
    minmax(118px, 1fr) 18px
    minmax(118px, 1fr) 18px
    minmax(118px, 1fr) 18px
    minmax(118px, 1fr) 18px
    minmax(118px, 1fr) 18px
    minmax(118px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 28px 14px;
}
.flow-node {
  min-height: 56px;
  padding: 10px 8px;
  border: 1px solid var(--fg);
  background: var(--bg-elev);
  font-family: var(--ff-mono);
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.flow-node--accent {
  border-color: var(--accent);
  color: var(--accent-ink);
}
.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}
.road-flow-diagram {
  display: grid;
  gap: 14px;
  padding: 26px 14px;
}
.road-flow-row {
  display: grid;
  grid-template-columns:
    minmax(128px, 1fr) 22px
    minmax(128px, 1fr) 22px
    minmax(128px, 1fr) 22px
    minmax(128px, 1fr);
  gap: 8px;
  align-items: stretch;
}
.road-flow-node {
  min-height: 62px;
  padding: 10px 8px;
  border: 1px solid var(--fg);
  background: var(--bg-elev);
  font-family: var(--ff-mono);
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.road-flow-node--accent {
  border-color: var(--accent);
  color: var(--accent-ink);
}
.road-flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}
.data-tree {
  padding: 24px;
  display: grid;
  justify-items: center;
}
.data-tree__row {
  width: min(100%, 320px);
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 28px;
}
.data-tree__row::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 28px;
  background: var(--rule-strong);
}
.data-tree__row:first-child::before {
  display: none;
}
.data-tree__node {
  width: 100%;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-elev);
  padding: 10px 14px;
  font-family: var(--ff-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}
.data-tree__node b {
  font-size: 11px;
  color: var(--fg);
  font-weight: 500;
}
.data-tree__node span {
  font-size: 10px;
  line-height: 1.35;
  color: var(--fg-muted);
  overflow-wrap: anywhere;
}
.data-tree__row:first-child .data-tree__node {
  border-color: var(--fg);
}
.data-tree__row:last-child .data-tree__node {
  border-color: var(--accent);
}
.code-card pre {
  margin: 0;
  padding: 24px;
  overflow-x: auto;
}
.code-card code {
  font-family: var(--ff-mono);
  font-size: 12px;
  line-height: 1.75;
  color: var(--fg);
}
.case__bullets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}
.case__bullets li {
  border-top: 1px dashed var(--rule);
  padding-top: 10px;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.case__bullets li::before {
  content: "->";
  color: var(--accent);
  margin-right: 10px;
}
.case__numbered {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 12px;
}
.case__numbered li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-top: 1px dashed var(--rule);
}
.case__numbered li > span {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent-ink);
}
.case__numbered b {
  display: block;
  margin-bottom: 4px;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}
.case__numbered p {
  margin: 0;
  color: var(--fg-muted);
}
.future-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.future-card {
  min-height: 154px;
  border: 1px solid var(--rule-strong);
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--fg) 5%, transparent) 0 1px,
      transparent 1px 14px),
    var(--bg-elev);
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 9px;
}
.future-card span {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent-ink);
}
.future-card b {
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
}
.future-card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 960px) {
  .gallery__meta { grid-template-columns: 1fr 1fr; }
  .gallery__meta > div:nth-child(2) { border-right: 0; }
  .gallery__grid { grid-template-columns: repeat(6, 1fr); padding: 16px; gap: 16px; }
  .gslot--hero { grid-column: span 6; }
  .gslot--hero .gslot__visual { aspect-ratio: 16 / 9; }
  .gslot--third, .gslot--portrait { grid-column: span 3; }
  .gslot--half, .gslot--wide { grid-column: span 6; }
  .case__media-grid { grid-template-columns: repeat(6, 1fr); }
  .case-media--hero, .case-media--wide, .case-media--half { grid-column: span 6; }
  .case-media--third { grid-column: span 3; }
  .case__split { grid-template-columns: 1fr; }
  .case__bullets { grid-template-columns: 1fr; }
  .future-grid { grid-template-columns: 1fr; }
  .flow-diagram {
    grid-template-columns: 1fr;
  }
  .road-flow-diagram {
    grid-template-columns: 1fr;
  }
  .road-flow-row {
    grid-template-columns: 1fr;
  }
  .flow-node { min-height: 46px; }
  .road-flow-node { min-height: 46px; }
}
.ledger {
  display: grid;
  grid-template-columns: 1fr;
}
.ledger__row {
  display: grid;
  grid-template-columns: 100px 1.4fr 1fr 1fr 0.5fr;
  gap: 24px;
  align-items: baseline;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  position: relative;
  transition: padding-left .4s cubic-bezier(.2,.7,.3,1);
}
.ledger__row:last-child { border-bottom: 1px solid var(--rule); }
.ledger__row:hover { padding-left: 18px; }
.ledger__row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .4s cubic-bezier(.2,.7,.3,1);
}
.ledger__row:hover::before { transform: scaleY(1); }
.ledger__year {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--fg-muted);
}
.ledger__title {
  font-family: var(--ff-sans);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.ledger__role, .ledger__studio {
  font-size: 14px;
  color: var(--fg-muted);
}
.ledger__cta {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: right;
  color: var(--fg-faint);
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 64px;
  align-items: start;
}
.about__portrait {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--bg-sunk);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.about__portrait__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.about__copy p {
  font-size: 18px;
  line-height: 1.65;
  max-width: 56ch;
  color: var(--fg);
  text-wrap: pretty;
}
.about__copy p + p { margin-top: 16px; }
.about__copy p:first-child::first-letter {
  /* drop-cap removed for tech-doc feel */
}
.about__facts {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 32px;
}
.about__facts div {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.about__facts div b {
  display: block;
  font-family: var(--ff-sans);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg);
  font-weight: 500;
  margin-top: 6px;
}

/* ---------- Contact ---------- */
.contact {
  padding: var(--section-y) 0 calc(var(--section-y) * 0.7);
  text-align: center;
  border-top: 1px solid var(--rule);
}
.contact__kicker {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.contact__title {
  font-family: var(--ff-sans);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
  max-width: 22ch;
  margin-inline: auto;
}
.contact__title em {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 300;
  color: var(--fg-muted);
}
.contact__email {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  font-family: var(--ff-mono);
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 14px 22px;
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
  transition: background .2s ease, color .2s ease;
}
.contact__email:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.contact__email:hover { color: var(--accent); border-color: var(--accent); }
.contact__sub {
  margin-top: 18px;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.contact__links {
  margin-top: 56px;
  display: flex; justify-content: center; gap: 36px;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.contact__links a { transition: color .2s ease; }
.contact__links a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0 36px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.footer__right { text-align: right; }
.footer__center { text-align: center; }

/* ---------- Density modes ---------- */
[data-density="compact"] {
  --pad-x: clamp(20px, 4vw, 64px);
  --section-y: clamp(72px, 10vh, 130px);
  --gutter: 22px;
}
[data-density="roomy"] {
  --pad-x: clamp(32px, 6vw, 128px);
  --section-y: clamp(120px, 18vh, 240px);
  --gutter: 40px;
}

/* ---------- Hero variants ---------- */
[data-hero="reel"] .hero__plate__layer { transform: scale(1); }
[data-hero="grid"] .hero__plate__caption b::after { content: " · 9 STILLS"; color: var(--fg-muted); }
[data-hero="grid"] .hero__plate__layer {
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 calc(33.33% - 1px), var(--bg) calc(33.33% - 1px) 33.33%),
    repeating-linear-gradient(90deg, transparent 0 calc(33.33% - 1px), var(--bg) calc(33.33% - 1px) 33.33%),
    repeating-linear-gradient(135deg, color-mix(in oklab, var(--fg) 4%, transparent) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, var(--bg-sunk), var(--bg-elev));
}
[data-hero="reel"] .hero__plate__caption b::after { content: " · 02:14 LOOP"; color: var(--fg-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero__meta { grid-template-columns: repeat(2, 1fr); }
  .hero__sub { grid-template-columns: 1fr; }
  .section__head { grid-template-columns: 1fr; }
  .works { grid-template-columns: repeat(6, 1fr); }
  .work--lg, .work--md, .work--full, .work--half, .work--third { grid-column: span 6; }
  .case { grid-template-columns: 1fr; }
  .case__aside { position: static; }
  .case__breakdown { grid-template-columns: 1fr 1fr; }
  .case__metrics { grid-template-columns: 1fr 1fr; }
  .case__metric:nth-child(2) { border-right: 0; }
  .tech { grid-template-columns: 1fr; }
  .ledger__row { grid-template-columns: 80px 1fr 1fr; }
  .ledger__role, .ledger__cta { display: none; }
  .about { grid-template-columns: 1fr; }
  .topbar__nav { display: none; }
}
