/* ==========================================================================
   Ahmad Audi — personal site
   Dark-first, thermal "Ironbow" accent. Fonts: Fraunces (display, roman and
   italic), Instrument Sans (body), IBM Plex Mono (labels, readouts).
   Two pages share this file: index.html and projects.html.
   ========================================================================== */

:root {
  --bg: #0b0f13;
  --bg-raise: #121820;
  --bg-sunk: #070a0d;
  --line: rgba(200, 220, 240, 0.10);
  --line-strong: rgba(200, 220, 240, 0.22);
  --fg: #e8edf2;
  --fg-muted: #a4afbb;
  --fg-faint: #717d8a;
  --accent: #5ee7d6;
  --accent-hot: #8ff5e8;
  --accent-ink: #04201d;
  --accent-soft: rgba(94, 231, 214, 0.12);
  --det: #b6f36a;
  --track: #ffb547;
  --key: #f06bd0;
  --hud: #5ee7d6;
  --screen: #070a0d;
  --screen-fg: rgba(232, 237, 242, 0.88);

  --turbo: linear-gradient(90deg, #30123b 0%, #4662d7 14%, #36aaf9 28%, #1ae4b6 42%, #72fe5e 56%, #c8ef34 70%, #faba39 82%, #f66b19 92%, #ca2a04 100%);
  --turbo-text: linear-gradient(100deg, #36aaf9 0%, #1ae4b6 50%, #c8ef34 100%);
  --ironbow: linear-gradient(135deg, #1d0638 0%, #6a0f8e 28%, #c2378a 48%, #ff6a2a 68%, #ffb547 84%, #fff1c4 100%);
  --ironbow-text: linear-gradient(100deg, #e0479a 0%, #ff7a35 45%, #ffc861 100%);

  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef1f4;
  --bg-raise: #ffffff;
  --bg-sunk: #e2e7ec;
  --line: rgba(14, 20, 25, 0.10);
  --line-strong: rgba(14, 20, 25, 0.22);
  --fg: #0e1419;
  --fg-muted: #4a5663;
  --fg-faint: #74808c;
  --accent: #0b8f85;
  --accent-hot: #0a7a71;
  --accent-ink: #ffffff;
  --accent-soft: rgba(11, 143, 133, 0.10);
  --det: #4b8f1f;
  --track: #b86a00;
  --key: #b2278f;
  --hud: #0b8f85;

  color-scheme: light;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

img, canvas, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

p { margin: 0 0 1em; }

h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; font-variation-settings: "opsz" 144; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font: inherit; color: inherit; cursor: pointer; }

em {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  color: var(--accent);
  letter-spacing: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.container {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.muted { color: var(--fg-faint); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 22px;
  height: 22px;
  position: relative;
  background:
    linear-gradient(var(--accent), var(--accent)) left top / 7px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left top / 1.5px 7px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 7px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 1.5px 7px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 7px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 1.5px 7px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 7px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 1.5px 7px no-repeat;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--det);
}

.brand-name {
  font-family: var(--f-body);
  font-weight: 700;
  font-stretch: 100%;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.site-nav ul { display: flex; gap: 4px; position: relative; }
.nav-pill { position: absolute; top: 0; left: 0; height: 100%; width: 0; border-radius: 999px; background: var(--accent-soft); opacity: 0; pointer-events: none; transition: left .45s var(--ease), width .45s var(--ease), opacity .3s; }

.site-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color .2s, background-color .2s;
}
.site-nav a { position: relative; z-index: 1; }
.site-nav a:hover { color: var(--fg); background: var(--accent-soft); }
.site-nav a[aria-current="true"],
.site-nav a[aria-current="page"] { color: var(--fg); }
.site-nav a[aria-current="page"] { background: var(--accent-soft); }
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--turbo); z-index: 60; pointer-events: none; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  transition: border-color .2s, background-color .2s;
}
.icon-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}
.icon-moon { fill: currentColor !important; stroke: none !important; }
:root[data-theme="dark"] .icon-moon,
:root:not([data-theme="light"]) .icon-moon { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }
:root[data-theme="light"] .icon-sun { display: none; }

.menu-toggle {
  display: none;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--f-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .menu-toggle { display: inline-block; }
  .site-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a { display: block; padding: 12px 10px; font-size: 14px; }
  .nav-pill { display: none; }
  .site-nav a[aria-current="true"] { background: var(--accent-soft); }
}

/* ---------- Shared bits ---------- */

.label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.label-n { color: var(--accent); }
.label-n::before { content: "[ "; color: var(--fg-faint); }
.label-n::after { content: " ]"; color: var(--fg-faint); }

.section { padding: clamp(72px, 11vw, 140px) 0 0; }

.section-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 500;
  font-stretch: 100%;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 18px;
}
.section-title em { font-size: 1em; letter-spacing: -0.02em; }

.section-lede {
  max-width: 60ch;
  color: var(--fg-muted);
  margin-bottom: 44px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15.5px;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hot); }
.btn-ghost { border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-weight: 600;
  font-size: 15px;
  transition: border-color .2s, background-color .2s, color .2s, transform .2s var(--ease);
}
.pill:hover { border-color: var(--accent); transform: translateY(-1px); }
.pill-fill { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pill-fill:hover { background: var(--accent-hot); border-color: var(--accent-hot); }
.pill-lg { height: 50px; padding: 0 26px; font-size: 16px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 32px;
  margin-bottom: 18px;
}
.section-head .section-title { margin-bottom: 0; }
.section-head .section-lede { margin-bottom: 0; max-width: 46ch; }
.section-head + .section-lede { margin-top: 10px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-strong);
  transition: color .2s, border-color .2s;
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.3;
}
.chips-sm li { font-size: 12px; padding: 4px 10px; }

/* Reveal on scroll. Only hidden when JS is running. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }
/* Readout wipe: titles are revealed left to right, like a line being written. */
.js .reveal.wipe { opacity: 1; transform: none; position: relative; }
.js .reveal.wipe::after { content: ""; position: absolute; inset: -8% -3%; background: var(--bg); transform-origin: right center; transform: scaleX(1); transition: transform 1.1s var(--ease); pointer-events: none; }
.js .reveal.wipe.in::after { transform: scaleX(0); }
.js .see-panel .reveal.wipe::after { background: var(--bg-raise); }

/* ---------- Hero: the scene fills the viewport ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - 64px);
  display: flex;
  padding: 0;
  background: var(--screen);
}
.hero-stage {
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.hero-stage.is-dragging { cursor: grabbing; }
.hero-stage canvas { width: 100%; height: 100%; display: block; }
.hero::after {
  /* scrim for the copy, bottom left */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(7, 10, 13, 0.92) 0%, rgba(7, 10, 13, 0.55) 28%, rgba(7, 10, 13, 0) 55%),
    linear-gradient(to right, rgba(7, 10, 13, 0.55) 0%, rgba(7, 10, 13, 0) 45%);
  pointer-events: none;
}
.hero-ui {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 22px var(--gutter) 0;
  pointer-events: none;
}
.hero-ui a, .hero-ui button { pointer-events: auto; }
/* The hero is always a dark feed, whatever the theme. */
.hero .pill { color: #e8edf2; border-color: rgba(232, 237, 242, 0.35); }
.hero .pill:hover { border-color: var(--accent); }
.hero .pill-fill { color: var(--accent-ink); border-color: var(--accent); }
.hero .eyebrow { color: rgba(232, 237, 242, 0.7); }
.hero .wordmark .accent { color: var(--accent); }

.eyebrow {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--det);
  box-shadow: 0 0 0 0 rgba(182, 243, 106, 0.6);
  animation: pulse 2.4s infinite;
  flex: none;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(182, 243, 106, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(182, 243, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(182, 243, 106, 0); }
}
.hero-hint {
  position: absolute;
  left: 50%;
  top: 56px;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11, 15, 19, 0.7);
  border: 1px solid rgba(232, 237, 242, 0.18);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(232, 237, 242, 0.75);
  white-space: nowrap;
  transition: opacity .5s var(--ease);
}
.hero-hint span { color: var(--accent); margin-right: 4px; }
.hero-hint.is-done { opacity: 0; }

.hero-main {
  align-self: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px 40px;
  padding: clamp(120px, 22vh, 220px) 0 26px;
}
.hero-copy { min-width: 0; max-width: 780px; }
.wordmark {
  font-size: clamp(3rem, 7.2vw, 6.6rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.98;
  margin-bottom: 18px;
  font-variation-settings: "opsz" 144;
  color: #f3f6f9;
}
.wordmark em { color: #f3f6f9; font-weight: 400; letter-spacing: -0.02em; }
.accent { color: var(--accent); }
.hero-role {
  max-width: 34ch;
  font-family: var(--f-display);
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #e8edf2;
  margin-bottom: 14px;
}
.hero-sub { max-width: 60ch; font-size: 14px; color: rgba(232, 237, 242, 0.7); margin-bottom: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.hero-side { display: grid; gap: 14px; justify-items: end; }
.layers {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(11, 15, 19, 0.72);
  border: 1px solid rgba(232, 237, 242, 0.16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.layer {
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(232, 237, 242, 0.7);
  transition: background-color .2s, color .2s;
}
.layer:hover { color: #fff; }
.layer[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.hero-dials { display: flex; gap: 22px; margin: 0; font-family: var(--f-mono); }
.hero-dials dt { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(232, 237, 242, 0.5); }
.hero-dials dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; color: #e8edf2; font-variant-numeric: tabular-nums; min-width: 5.5ch; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.3fr);
  gap: 0 28px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 16px var(--gutter) 18px;
  border-top: 1px solid rgba(232, 237, 242, 0.14);
  background: rgba(7, 10, 13, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--f-mono);
}
.hero-stats li { display: grid; gap: 4px; min-width: 0; }
.hero-stats b {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -0.02em;
  background: var(--turbo-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}
.hero-stats span { font-size: 11px; letter-spacing: 0.02em; line-height: 1.45; color: rgba(232, 237, 242, 0.65); }
.hero-stats .hero-fig { justify-self: end; text-align: right; align-self: end; }
.hero-stats .hero-fig span { color: rgba(232, 237, 242, 0.45); }

/* Viewfinder */

.viewfinder { margin: 0; min-width: 0; }

.vf-screen {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--screen);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 30px 80px -30px rgba(255, 110, 40, 0.28);
  cursor: crosshair;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.vf-screen canvas { width: 100%; height: 100%; }

.vf-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0 solid rgba(255, 246, 236, 0.75);
  pointer-events: none;
}
.vf-corner.tl { top: 12px; left: 12px; border-top-width: 2px; border-left-width: 2px; }
.vf-corner.tr { top: 12px; right: 12px; border-top-width: 2px; border-right-width: 2px; }
.vf-corner.bl { bottom: 12px; left: 12px; border-bottom-width: 2px; border-left-width: 2px; }
.vf-corner.br { bottom: 12px; right: 12px; border-bottom-width: 2px; border-right-width: 2px; }

.vf-top,
.vf-bottom {
  position: absolute;
  left: 44px;
  right: 44px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--screen-fg);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  white-space: nowrap;
}
.vf-top { top: 15px; }
.vf-bottom { bottom: 15px; }
.vf-bottom b, .vf-top b { font-weight: 500; color: #fff; }

.vf-rec { display: inline-flex; align-items: center; gap: 6px; }
.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4d3d;
  animation: blink 1.2s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.vf-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.stage {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--fg-faint);
  transition: color .2s, border-color .2s, background-color .2s;
}
.stage-n {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--line);
  font-size: 10.5px;
  color: var(--fg-faint);
}
.stage[aria-pressed="true"] {
  color: var(--fg);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.stage[aria-pressed="true"] .stage-n { background: var(--accent); color: var(--accent-ink); }
.stage:hover { border-color: var(--accent); }
.stage-replay { margin-left: auto; color: var(--fg-muted); }

.vf-status {
  margin: 12px 0 6px;
  min-height: 1.5em;
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--accent);
}
.vf-status::before { content: "› "; color: var(--fg-faint); }

.viewfinder figcaption {
  font-size: 14px;
  color: var(--fg-faint);
  max-width: 62ch;
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.about-main { min-width: 0; }

.statement {
  max-width: 26ch;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.statement em {
  font-size: 1em;
  letter-spacing: -0.015em;
  color: var(--fg);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: 0 92%;
  padding-bottom: 2px;
}

.about-text { max-width: 62ch; font-size: 18px; }
.about-text p:not(.muted) { color: var(--fg-muted); }
.about-text p:first-child { color: var(--fg); }

.toolchain { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.tool-label {
  margin: 0 0 14px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.tool-rows { margin: 0; display: grid; gap: 10px; }
.tool-rows div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.tool-rows dt { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); padding-top: 2px; }
.tool-rows dd { margin: 0; font-size: 15px; color: var(--fg-muted); }

.portrait { margin: 0; width: 100%; max-width: 380px; justify-self: end; position: sticky; top: 96px; }
.portrait-frame {
  position: relative;
  aspect-ratio: 24 / 25;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-raise);
  box-shadow: 0 0 0 1px var(--line-strong);
  padding: 14px;
}
.portrait-img {
  position: absolute;
  inset: 14px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 10px);
  filter: grayscale(0.85) contrast(1.05) sepia(0.12);
  transition: opacity .5s var(--ease), transform .8s var(--ease);
}
.portrait-frame:hover .portrait-img,
.portrait-frame:focus-visible .portrait-img { transform: scale(1.02); }
.portrait-frame .wm-corner { width: 16px; height: 16px; margin: 20px; z-index: 1; }
.portrait-tag {
  position: absolute;
  left: 26px;
  bottom: 26px;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(7, 6, 5, 0.72);
  border: 1px solid rgba(255, 246, 236, 0.2);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 246, 236, 0.9);
}
.portrait figcaption {
  margin-top: 12px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-faint);
}
.portrait figcaption span { color: var(--accent); margin-right: 6px; }

/* ---------- Projects ---------- */

.projects { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 44px); }

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-areas: "media body" "extra body";
  column-gap: clamp(24px, 4vw, 52px);
  row-gap: 14px;
  align-items: center;
  padding: clamp(14px, 1.6vw, 18px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: var(--bg-raise);
}
.project:nth-child(even) { grid-template-areas: "body media" "body extra"; }
.project-media { grid-area: media; align-self: end; }
.project-body { grid-area: body; }
.project-extra { grid-area: extra; align-self: start; }

/* Real material from the project, under the animation. */
.extra-label {
  margin: 2px 0 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.extra-label::after { content: ""; display: inline-block; width: 28px; height: 1px; margin-left: 10px; vertical-align: middle; background: var(--line-strong, var(--line)); }
.shots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.shots.shots-1 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.shots.shots-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--screen);
  box-shadow: 0 0 0 1px var(--line);
  cursor: zoom-in;
  text-align: left;
  color: var(--screen-fg);
  transition: box-shadow .2s, transform .25s var(--ease);
}
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.shot:hover, .shot:focus-visible { box-shadow: 0 0 0 1.5px var(--accent); outline: none; }
.shot:hover img { transform: scale(1.04); }
.shot-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 9px 7px;
  background: linear-gradient(transparent, rgba(7, 6, 5, 0.82));
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  line-height: 1.3;
  color: rgba(255, 246, 236, 0.9);
  pointer-events: none;
}
.shot-zoom {
  position: absolute;
  top: 7px; right: 7px;
  width: 20px; height: 20px;
  border-radius: 5px;
  background: rgba(7, 6, 5, 0.7);
  color: rgba(255, 246, 236, 0.85);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  pointer-events: none;
}

/* Slideshow inside the media area: photos first, a 3D preview where one exists. */
.slides .slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity .6s var(--ease);
  pointer-events: none;
}
.slides .slide.is-active { opacity: 1; pointer-events: auto; }
.slides .slide img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; transition: filter .5s var(--ease); }
.slides .slide video { transition: filter .5s var(--ease); }
.slides .slide[data-fit="contain"] { background: var(--screen); }
.slides .slide[data-fit="contain"] img { object-fit: contain; }
.shots.shots-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shots.shots-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.slides .slide canvas { width: 100%; height: 100%; display: block; }
.slides .slide video { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; background: var(--screen); }
.slides .slide[data-fit="contain"] video { object-fit: contain; }
.lightbox video { max-width: min(1500px, 94vw); max-height: 78dvh; width: auto; height: auto; border-radius: var(--radius-sm); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); background: #000; }
.lightbox video[hidden], .lightbox img[hidden] { display: none; }
.wcard-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 30px 60px 12px 14px;
  background: linear-gradient(transparent, rgba(7, 6, 5, 0.86));
  font-family: var(--f-mono);
  font-size: 11.5px;
  line-height: 1.45;
  color: rgba(255, 246, 236, 0.92);
  pointer-events: none;
}
.slides[data-kind="canvas"] .slide-cap { display: none; }
.media-open {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 246, 236, 0.3);
  background: rgba(7, 6, 5, 0.72);
  color: var(--screen-fg);
  font-size: 15px;
  line-height: 1;
  cursor: zoom-in;
  display: grid; place-items: center;
  transition: border-color .2s, background-color .2s;
}
.media-open:hover { border-color: #ff8f3f; background: rgba(40, 18, 6, 0.85); }
.media-open[hidden], .media-replay[hidden] { display: none; }
.shot[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); cursor: default; }
.shot[aria-pressed="true"] img { transform: none; }
.shot[data-slide] { cursor: pointer; }
.shot-canvas { display: block; width: 100%; height: 100%; }
.shot-badge {
  position: absolute;
  top: 7px; left: 7px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #070605;
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  pointer-events: none;
}

/* Small benchmark table, used where a number is the material. */
.project-media, .project-extra { min-width: 0; }
.bench-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bench {
  width: 100%;
  min-width: 320px;
  border-collapse: collapse;
  font-family: var(--f-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.bench th, .bench td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--line); }
.bench td { white-space: nowrap; }
.bench th:first-child, .bench td:first-child { text-align: left; color: var(--fg-muted); }
.bench thead th { font-weight: 500; color: var(--fg-faint); letter-spacing: 0.04em; font-size: 10.5px; text-transform: uppercase; vertical-align: bottom; line-height: 1.3; }
.bench td.hi { color: var(--accent); }
.bench-note { margin: 8px 0 0; font-family: var(--f-mono); font-size: 11px; color: var(--fg-faint); line-height: 1.45; }

/* Lightbox */
.lightbox {
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff6ec;
}
.lightbox::backdrop { background: rgba(4, 3, 2, 0.9); backdrop-filter: blur(4px); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; max-width: min(1500px, 94vw); display: grid; justify-items: center; gap: 12px; }
.lightbox img { max-width: min(1500px, 94vw); max-height: 78dvh; width: auto; height: auto; border-radius: var(--radius-sm); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.lightbox figcaption { font-family: var(--f-mono); font-size: 12.5px; line-height: 1.5; color: rgba(255, 246, 236, 0.8); max-width: 70ch; text-align: center; padding: 0 16px; }
.lb-btn {
  position: fixed;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 246, 236, 0.25);
  background: rgba(7, 6, 5, 0.7);
  color: #fff6ec;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .2s, background-color .2s;
}
.lb-btn:hover { border-color: var(--accent); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: fixed; top: 28px; left: 20px; font-family: var(--f-mono); font-size: 12px; color: rgba(255, 246, 236, 0.6); }
.lightbox.single .lb-prev, .lightbox.single .lb-next, .lightbox.single .lb-count { display: none; }

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--screen);
  box-shadow: 0 0 0 1px var(--line);
}
.project-media canvas,
.project-media img { width: 100%; height: 100%; object-fit: cover; }

.media-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(7, 6, 5, 0.72);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--screen-fg);
  pointer-events: none;
}

.media-replay {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 246, 236, 0.3);
  background: rgba(7, 6, 5, 0.72);
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--screen-fg);
  transition: border-color .2s, background-color .2s;
}
.media-replay:hover { border-color: #ff8f3f; background: rgba(40, 18, 6, 0.85); }

.project-body { padding: clamp(4px, 1vw, 12px) clamp(4px, 1.5vw, 18px) clamp(4px, 1vw, 12px) 0; }
.project:nth-child(even) .project-body { padding-left: clamp(4px, 1.5vw, 18px); padding-right: 0; }

.project-tags {
  margin-bottom: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.project h3 {
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  font-stretch: 100%;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.project-body > p:not(.project-tags) { color: var(--fg-muted); }

.project-facts { margin: 20px 0; display: grid; gap: 12px; }
.project-facts div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.project-facts dt {
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
  padding-top: 3px;
}
.project-facts dd { margin: 0; font-size: 15.5px; }
.project-facts a,
.paper a {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: color .2s, background-size .3s var(--ease);
}
.project-facts a:hover,
.paper a:hover { color: var(--accent); }

/* ---------- Work: annotated rows + index (index.html) ---------- */

.rows { display: grid; gap: clamp(40px, 7vw, 96px); margin: clamp(8px, 2vw, 24px) 0 clamp(48px, 7vw, 88px); }
.row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}
.row:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.row:nth-child(even) .row-media { order: 2; }
.row-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--screen);
  overflow: hidden;
}
.row:nth-child(odd) .row-media { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.row:nth-child(even) .row-media { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.row-media img, .row-media video, .row-media canvas { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .5s var(--ease), transform .8s var(--ease); }
.row-media::before {
  /* dataset-style class label */
  content: attr(data-cls);
  position: absolute;
  left: 18px;
  top: 16px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 4px;
  background: rgba(11, 15, 19, 0.78);
  border: 1px solid rgba(182, 243, 106, 0.5);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--det);
  max-width: calc(100% - 36px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-media-3d::before { left: auto; right: 18px; top: 16px; }
.row-corner { position: absolute; width: 18px; height: 18px; border: 0 solid var(--det); z-index: 2; pointer-events: none; }
.row-corner.tl { left: 10px; top: 10px; border-top-width: 2px; border-left-width: 2px; }
.row-corner.tr { right: 10px; top: 10px; border-top-width: 2px; border-right-width: 2px; }
.row-corner.bl { left: 10px; bottom: 10px; border-bottom-width: 2px; border-left-width: 2px; }
.row-corner.br { right: 10px; bottom: 10px; border-bottom-width: 2px; border-right-width: 2px; }
.row-media .media-replay { z-index: 3; }
.row-body { padding: 0 var(--gutter); }
.row:nth-child(odd) .row-body { padding-right: max(var(--gutter), calc((100vw - var(--max)) / 2)); }
.row:nth-child(even) .row-body { padding-left: max(var(--gutter), calc((100vw - var(--max)) / 2)); }
.row-cat { margin: 0 0 12px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.row h3 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; margin-bottom: 14px; max-width: 20ch; }
.row h3 a { transition: color .2s; }
.row h3 a:hover { color: var(--accent); }
.row-body > p:not(.row-cat):not(.row-result) { margin: 0 0 16px; max-width: 50ch; color: var(--fg-muted); }
.row-result { margin: 0 0 18px; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--track); }
.row-result::before { content: "▸ "; color: var(--fg-faint); }

.index-head { margin: 0 0 10px; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); }
.index-head span { color: var(--fg); }
.index { border-top: 1px solid var(--line); }
.idx-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1fr) 24px;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transition: background-color .2s, padding-left .25s var(--ease);
}
.idx-row:hover { background: var(--accent-soft); padding-left: 8px; }
.idx-n { font-family: var(--f-mono); font-size: 12px; color: var(--fg-faint); }
.idx-cls { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--det); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idx-title { font-family: var(--f-display); font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; }
.idx-res { font-family: var(--f-mono); font-size: 11.5px; color: var(--track); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idx-go { font-family: var(--f-mono); color: var(--fg-faint); text-align: right; transition: color .2s, transform .25s var(--ease); }
.idx-row:hover .idx-go { color: var(--accent); transform: translateX(4px); }

/* ---------- (legacy) featured + bento ---------- */

.featured {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.wcard {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-raise);
  overflow: hidden;
  transition: border-color .25s, transform .3s var(--ease), box-shadow .3s var(--ease);
}
.wcard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--ironbow); opacity: 0; transition: opacity .3s; z-index: 1; }
.wcard { position: relative; }
.wcard:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.7); }
.wcard:hover::before { opacity: 1; }
.wcard-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--screen);
  overflow: hidden;
}
.wcard-lg .wcard-media { aspect-ratio: 16 / 9.4; }
.wcard-media img, .wcard-media canvas { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease), filter .5s var(--ease); }
.wcard-media video { transition: filter .5s var(--ease); }
.wcard:hover .wcard-media img { transform: scale(1.03); }
.wcard-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(7, 6, 5, 0.7);
  border: 1px solid rgba(255, 246, 236, 0.22);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 246, 236, 0.9);
}
.wcard-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.wcard-cat {
  margin: 0 0 10px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.wcard h3 { font-size: 1.3rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 8px; }
.wcard-lg h3 { font-size: clamp(1.45rem, 2.1vw, 1.8rem); }
.wcard-body > p:not(.wcard-cat) { margin: 0 0 16px; font-size: 15px; line-height: 1.5; color: var(--fg-muted); }
.wcard-result {
  margin-top: auto;
  align-self: flex-start;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 143, 63, 0.3);
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--accent-hot);
  line-height: 1.35;
}
:root[data-theme="light"] .wcard-result { color: var(--accent); }
.work-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 32px; }
.work-foot-note { margin: 0; font-size: 14.5px; color: var(--fg-faint); max-width: 52ch; }
.soon { display: flex; align-items: flex-start; gap: 12px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--fg-muted); font-size: 15px; }
.soon p { margin: 0; line-height: 1.55; }
.soon .live-dot { margin-top: 0.5em; }
.soon b { color: var(--fg); font-weight: 600; }

/* Jump list on projects.html */
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: -16px 0 40px; }
.jump a {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-muted);
  transition: border-color .2s, color .2s;
}
.jump a:hover { border-color: var(--accent); color: var(--fg); }
.page-work .project { scroll-margin-top: 84px; }
.page-work { padding-top: clamp(36px, 5vw, 64px); }

/* ---------- Services: three offers ---------- */

.services {
  position: relative;
  isolation: isolate;
  margin-top: clamp(48px, 7vw, 96px);
  padding-top: clamp(56px, 8vw, 110px);
  padding-bottom: clamp(56px, 8vw, 110px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
}
.services::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 60% at 50% 40%, transparent 30%, var(--bg) 100%);
}
.reproj { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.rp-ring { fill: none; stroke: var(--accent); stroke-width: 1; opacity: 0.45; }
.rp-dot { fill: var(--key); opacity: 0.8; }
.services .chain { margin-bottom: clamp(40px, 6vw, 72px); }
.offers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.offer {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 6px 28px 6px 26px;
  border-left: 1px solid var(--line-strong);
  transition: border-color .25s;
}
.offer:hover { border-left-color: var(--accent); }
.offer-n { margin: 0 0 10px; font-family: var(--f-display); font-size: 2.6rem; font-weight: 300; line-height: 1; letter-spacing: -0.02em; color: var(--accent); }
.offer h3 { font-size: 1.55rem; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 10px; }
.offer-lede { margin: 0 0 16px; font-size: 15.5px; color: var(--fg); line-height: 1.5; }
.offer-list { margin: 0 0 22px; display: grid; gap: 8px; }
.offer-list li { position: relative; padding-left: 18px; font-size: 14.5px; line-height: 1.5; color: var(--fg-muted); }
.offer-list li::before { content: "›"; position: absolute; left: 2px; top: -1px; color: var(--accent); font-family: var(--f-mono); }
.offer-meta { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.offer-meta span { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 4px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--fg-muted); }
.offers-note { margin: 22px 0 0; max-width: 70ch; font-size: 14.5px; color: var(--fg-faint); }

/* ---------- The chain: five nodes on one line ---------- */

.chain {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 18px;
  padding-top: 26px;
}
.chain::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 1px;
  background: linear-gradient(90deg, var(--line) 0, var(--accent) 50%, var(--line) 100%);
}
.chain-step { position: relative; padding-top: 6px; }
.chain-node {
  position: absolute;
  left: 0;
  top: -26px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.chain-node::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.chain-n { margin: 0 0 6px; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--accent); }
.chain-step h3 { font-size: 1.6rem; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 8px; }
.chain-step > p:not(.chain-n) { margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; color: var(--fg-muted); }
.chain-ex { display: flex; flex-wrap: wrap; gap: 5px; }
.chain-ex li { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--f-mono); font-size: 10.5px; color: var(--fg-faint); }
.chain-note { margin: 28px 0 0; font-family: var(--f-mono); font-size: 12.5px; color: var(--fg-faint); }
.chain-note::before { content: "↺ "; color: var(--accent); }

/* ---------- See: closing panel with the viewfinder ---------- */

.see-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(20px, 3vw, 40px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(90% 80% at 100% 100%, rgba(255, 143, 63, 0.14), transparent 60%),
    var(--bg-raise);
}
.see-copy { min-width: 0; }
/* The isotherm lines sit behind the panel content, outside the grid flow. */
.see-panel > .isotherm { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.see-title { margin-bottom: 20px; font-size: clamp(2rem, 3.6vw, 3rem); }
.see-text { max-width: 44ch; color: var(--fg-muted); font-size: 17px; }
.see-text.muted { font-size: 14.5px; margin: 0; }

/* ---------- More ---------- */

.more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 36px;
}
.more-group {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.more-group > h3 {
  margin-bottom: 18px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.more-group li + li { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.more-meta {
  margin-bottom: 6px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-faint);
}
.more-group h4 { font-size: 1.3rem; font-weight: 600; margin-bottom: 8px; line-height: 1.25; }
.more-group li p:last-child { margin: 0; font-size: 15.5px; color: var(--fg-muted); }

/* ---------- Papers ---------- */

.paper-list { margin-top: 36px; border-top: 1px solid var(--line); }
.paper {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 220px;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.paper { position: relative; }
.paper-year { font-family: var(--f-mono); font-size: 14px; color: var(--key); }
.paper-year::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: var(--key); box-shadow: 0 0 0 3px rgba(240, 107, 208, 0.18); vertical-align: 1px; }
.paper h3 { font-size: 1.3rem; font-weight: 500; line-height: 1.35; margin-bottom: 8px; }
.paper-authors { margin: 0; font-size: 15px; color: var(--fg-faint); }
.paper-authors strong { color: var(--fg-muted); font-weight: 600; }
.paper-venue {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--fg-muted);
  text-align: right;
}

/* ---------- Experience: timeline ---------- */

.log-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.log-head { position: sticky; top: 96px; }
.log-head .section-lede { margin-bottom: 26px; }

.flight { position: relative; padding-left: 72px; }
.flightpath { position: absolute; left: 0; top: 0; width: 64px; overflow: visible; pointer-events: none; }
.fp-line { fill: none; stroke: var(--line-strong); stroke-width: 1.2; }
.fp-glow { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: 0.9; }
.fp-wp { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1.5; }
.fp-wp.fp-now { stroke: var(--accent); }
.fp-dot { fill: var(--fg-faint); }
.fp-drone line { stroke: var(--accent); stroke-width: 1.2; }
.fp-drone circle { fill: none; stroke: var(--accent); stroke-width: 1; }
.fp-drone rect { fill: var(--accent); }
.timeline { position: relative; }
.tl-item { position: relative; padding: 0; }
.tl-dot { display: none; }
.tl-card {
  padding: 20px 14px 22px;
  border-top: 1px solid var(--line);
  transition: background-color .25s;
}
.tl-item:last-child .tl-card { border-bottom: 1px solid var(--line); }
.tl-card:hover { background: var(--accent-soft); }
.tl-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--fg-muted);
}
.tl-wp {
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  font-size: 11px;
  color: var(--fg-faint);
}
.tl-item:first-child .tl-wp { border-color: var(--accent); color: var(--accent); }
.log .more { margin-top: clamp(48px, 7vw, 88px); }
.log .more .more-grid { margin-top: 18px; }
.tl-card h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.25; margin-bottom: 5px; }
.log-org { font-family: var(--f-body); font-size: 0.78em; font-weight: 400; letter-spacing: 0; color: var(--fg-faint); }
.tl-card p:last-child { margin: 0; font-size: 15.5px; color: var(--fg-muted); }
.tl-card a { color: var(--fg); border-bottom: 1px solid var(--accent); }

/* ---------- Contact card ---------- */

.contact { padding-bottom: clamp(48px, 7vw, 96px); }
.contact-card {
  padding: clamp(28px, 5vw, 64px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(94, 231, 214, 0.1), transparent 55%),
    var(--bg-raise);
}
.contact-panel { padding: clamp(8px, 2vw, 24px) 0 0; border-top: 1px solid var(--line); }
.pc-wrap { position: relative; margin-bottom: 26px; }
.pc-wrap .contact-email { opacity: 0; transition: opacity .9s var(--ease); margin-bottom: 0; }
.pc-wrap.is-done .contact-email { opacity: 1; }
.pointcloud { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .9s var(--ease); }
.pc-wrap.is-done .pointcloud { opacity: 0; }
.contact-card .label { margin-bottom: 28px; }
.contact-title {
  max-width: 18ch;
  font-size: clamp(2.4rem, 5.6vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 0.96;
  margin-bottom: 22px;
}
.contact-title em { font-size: 1em; }
.contact-lede { max-width: 56ch; color: var(--fg-muted); font-size: 18px; margin-bottom: 36px; }

.contact-email {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  max-width: 100%;
  margin-bottom: 26px;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(1.7rem, 4.2vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--fg);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 6px;
  overflow-wrap: anywhere;
  transition: color .2s, gap .3s var(--ease);
}
.contact-email span { font-style: normal; font-family: var(--f-mono); font-size: 0.55em; color: var(--accent); }
.contact-email { border-bottom-color: var(--accent); }
.contact-email:hover { color: var(--accent); gap: 22px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 36px; }
.contact-links a {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 13px;
  transition: border-color .2s, background-color .2s;
}
.contact-links a:hover { border-color: var(--accent); background: var(--accent-soft); }

.contact-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 32px;
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.contact-fields dt { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-faint); }
.contact-fields dd { margin: 6px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.contact-fields dd a { border-bottom: 1px solid var(--line-strong); }
.contact-fields dd a:hover { border-color: var(--accent); color: var(--accent); }
.signature { font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: 28px; line-height: 1; color: var(--fg); }
.contact-card-sm .contact-title { font-size: clamp(2.2rem, 5vw, 4rem); }
.contact-card-sm .contact-links { margin-bottom: 0; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; }
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px 32px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--fg-faint);
}
.footer-inner p { margin: 0; }
.footer-note { grid-column: 1 / -1; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a { color: var(--fg-muted); }
.footer-links a:hover, .footer-top:hover { color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .hero-main { grid-template-columns: 1fr; padding-top: 140px; }
  .hero-side { justify-items: start; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
  .hero-stats .hero-fig { grid-column: 1 / -1; justify-self: start; text-align: left; }
  .row, .row:nth-child(even) { grid-template-columns: 1fr; gap: 20px; }
  .row:nth-child(even) .row-media { order: 0; }
  .row:nth-child(odd) .row-media, .row:nth-child(even) .row-media { border-radius: 0; }
  .row:nth-child(odd) .row-body, .row:nth-child(even) .row-body { padding: 0 var(--gutter); }
  .idx-row { grid-template-columns: 36px minmax(0, 1fr) 24px; }
  .idx-cls { grid-column: 2; }
  .idx-title { grid-column: 2; }
  .idx-res { grid-column: 2; }
  .idx-go { grid-column: 3; grid-row: 1; }
  .offers { grid-template-columns: 1fr; gap: 28px; }
  .chain { grid-template-columns: 1fr; gap: 22px; padding-top: 0; padding-left: 28px; }
  .chain::before { left: 7px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; background: linear-gradient(var(--accent), var(--line)); }
  .chain-node { left: -28px; top: 4px; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { position: static; justify-self: start; max-width: 340px; }
  .log-grid { grid-template-columns: 1fr; }
  .log-head { position: static; }
  .featured { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offers { grid-template-columns: 1fr; }
  .see-panel { grid-template-columns: 1fr; }
  .see-copy { order: -1; }
  .more-grid { grid-template-columns: 1fr; }
  .project, .project:nth-child(even) { grid-template-columns: 1fr; grid-template-areas: "media" "extra" "body"; }
  .project-extra { margin-bottom: 6px; }
  .project-body,
  .project:nth-child(even) .project-body { padding: 4px 8px 8px; }
  .paper { grid-template-columns: 70px minmax(0, 1fr); }
  .paper-venue { grid-column: 2; text-align: left; }
  .footer-inner { grid-template-columns: 1fr auto; }
  .footer-links { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wordmark { font-size: clamp(2.6rem, 11vw, 4rem); }
  .hero { min-height: calc(100svh - 64px); }
  .hero-main { padding-top: 120px; }
  .hero-hint { display: none; }
  .layers { flex-wrap: wrap; border-radius: 14px; }
  .layer { padding: 6px 10px; font-size: 10.5px; }
  .hero-dials { gap: 16px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .hero-stats b { font-size: 1.15rem; }
  .flight { padding-left: 52px; }
  .flightpath { width: 44px; }
  .stat-what { font-size: 15px; }
  .tool-rows div { grid-template-columns: 1fr; gap: 2px; }
  .tl-card { padding: 16px 16px 18px; }
  .bento { grid-template-columns: 1fr; }
  .project-facts div { grid-template-columns: 1fr; gap: 4px; }
  .project-media { aspect-ratio: 4 / 3; }
  .shot-cap { font-size: 9.5px; padding: 14px 7px 6px; }
  .shots.shots-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shots.shots-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slide-cap { font-size: 10.5px; padding: 24px 56px 10px 12px; }
  .lb-prev { left: 8px; top: auto; bottom: 16px; transform: none; }
  .lb-next { right: 8px; top: auto; bottom: 16px; transform: none; }
  .lightbox img { max-height: 70dvh; }
  .paper { grid-template-columns: 1fr; gap: 6px; }
  .paper-venue { grid-column: 1; }
  .vf-top, .vf-bottom { left: 16px; right: 16px; font-size: 9.5px; }
  .vf-top { top: 30px; }
  .vf-bottom { bottom: 30px; }
  .vf-frame { display: none; }
  .stage-replay { margin-left: 0; }
  .contact-fields { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Work: all thirteen as cards (home page) ---------- */

.pgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: clamp(8px, 2vw, 20px) 0 0;
}
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raise);
  overflow: hidden;
  transition: border-color .25s, transform .3s var(--ease), box-shadow .3s var(--ease);
}
.pcard:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.7); }
.pcard-feat { grid-column: 1 / -1; flex-direction: row; }
.pcard-feat .pcard-media { flex: 0 0 58%; aspect-ratio: auto; min-height: 380px; }
.pcard-feat .pcard-body { padding: 30px 32px; justify-content: center; }
.pcard-feat h3 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); max-width: 18ch; }
.pcard-feat .pcard-result { margin-top: 18px; }
.pcard-media:has(canvas)::before { display: none; }
.pcard-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--screen);
  overflow: hidden;
}
.pcard-media img, .pcard-media video, .pcard-media canvas { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .5s var(--ease), transform .8s var(--ease); }
/* No chip on clips that carry their own burnt-in labels. */
.pcard-media:not([data-cls])::before, .row-media:not([data-cls])::before { content: none; display: none; }
.pcard-media::before {
  content: attr(data-cls);
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(11, 15, 19, 0.78);
  border: 1px solid rgba(182, 243, 106, 0.5);
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--det);
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcard-media .row-corner { width: 14px; height: 14px; }
.pcard-media .row-corner.tl { left: 8px; top: 8px; } .pcard-media .row-corner.tr { right: 8px; top: 8px; }
.pcard-media .row-corner.bl { left: 8px; bottom: 8px; } .pcard-media .row-corner.br { right: 8px; bottom: 8px; }
.pcard-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.pcard-cat { margin: 0 0 8px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.pcard h3 { font-size: 1.2rem; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 8px; }
.pcard-body > p:not(.pcard-cat):not(.pcard-result) { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--fg-muted); }
.pcard-result { margin: auto 0 0; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.03em; color: var(--track); }
.pcard-result::before { content: "▸ "; color: var(--fg-faint); }

@media (max-width: 1000px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pcard-feat { flex-direction: column; }
  .pcard-feat .pcard-media { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .pcard-feat .pcard-body { padding: 18px 20px 20px; }
}
@media (max-width: 640px) {
  .pgrid { grid-template-columns: 1fr; gap: 14px; }
}

/* ---------- Before / after comparison ---------- */

.compare {
  --split: 50%;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--screen);
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  cursor: ew-resize;
}
.pcard-media-cmp .compare, .slides .slide[data-kind="compare"] .compare { position: absolute; inset: 0; aspect-ratio: auto; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; cursor: ew-resize; filter: none !important; transition: none !important; }
.compare .cmp-b { clip-path: inset(0 0 0 var(--split)); }
.compare::before {
  /* divider */
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: var(--split);
  width: 2px;
  margin-left: -1px;
  background: var(--hud);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  z-index: 3;
  pointer-events: none;
}
.compare .cmp-handle {
  position: absolute;
  top: 50%; left: var(--split);
  transform: translate(-50%, -50%);
  padding: 3px 9px 5px;
  border-radius: 999px;
  background: var(--hud);
  color: #04201d;
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.15em;
  white-space: nowrap;
  z-index: 4;
  pointer-events: none;
}
.compare .cmp-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 5;
}
.compare .cmp-range:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: -2px; background: transparent; }
.compare .cmp-tag {
  position: absolute;
  bottom: 12px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(11, 15, 19, 0.75);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 237, 242, 0.9);
  pointer-events: none;
}
.compare .cmp-tag-a { left: 12px; }
.compare .cmp-tag-b { right: 12px; color: var(--hud); }
/* In the project slideshows the caption owns the bottom edge and the card tag the top-left corner. */
.slides .slide[data-kind="compare"] .cmp-tag { bottom: auto; top: 40px; }
.slides .slide[data-kind="compare"] { cursor: default; }
.pcard-feat.pcard-feat-alt { flex-direction: row-reverse; }
@media (max-width: 1000px) {
  .pcard-feat.pcard-feat-alt { flex-direction: column; }
}

/* ---------- Rotating stills on the home cards ---------- */

.pcard-media .rot { position: absolute; inset: 0; }
.pcard-media .rot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--ease), filter .5s var(--ease); }
.pcard-media .rot img.is-on { opacity: 1; }
.pcard-media .rot-dots { position: absolute; left: 14px; bottom: 14px; z-index: 2; display: flex; gap: 5px; pointer-events: none; }
.pcard-media .rot-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(232, 237, 242, 0.35); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); transition: background .3s; }
.pcard-media .rot-dots i.is-on { background: var(--det); }
.pcard-media canvas.preview-canvas { width: 100%; height: 100%; display: block; }
.pcard-media .vrot { position: absolute; inset: 0; }
.pcard-media .vrot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--ease), filter .5s var(--ease); }
.pcard-media .vrot video.is-on { opacity: 1; }

/* ---------- Click-to-play YouTube slide ---------- */
.yt-facade { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.9; cursor: pointer; transition: opacity .25s; }
.slides .slide.is-active .yt-facade img:hover { filter: none; }
.yt-facade:hover img, .yt-facade:focus-visible img { opacity: 1; }
.yt-facade:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); border-radius: 12px; background: rgba(11, 15, 19, 0.84); border: 1px solid rgba(255, 255, 255, 0.28); transition: background .2s, border-color .2s; }
.yt-play::before { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.yt-facade:hover .yt-play, .yt-facade:focus-visible .yt-play { background: var(--accent); border-color: var(--accent); }
.yt-note { position: absolute; right: 12px; top: 12px; padding: 3px 8px; border-radius: 4px; background: rgba(11, 15, 19, 0.8); font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.06em; color: rgba(232, 237, 242, 0.88); }
.slides .slide .yt-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.slides.is-playing .slide-cap, .slides.is-playing .media-tag { display: none; }

/* ---------- Ambient music button (js/ambient.js) ---------- */
.sound-toggle .icon-sound-on { display: none; }
.sound-toggle[aria-pressed="true"] .icon-sound-on { display: block; }
.sound-toggle[aria-pressed="true"] .icon-sound-off { display: none; }
.sound-toggle[aria-pressed="false"] { color: var(--fg-muted); }
.sound-toggle[aria-pressed="true"] { border-color: color-mix(in srgb, var(--fg) 45%, transparent); }

/* Experience: a plain list now that the flight path is gone. */
.timeline-wrap { min-width: 0; }

/* ---------- Worked with: a slowly scrolling row of logos ---------- */
.logos { padding: clamp(28px, 4vw, 52px) 0 0; }
.logos-label { margin: 0 0 18px; font-family: var(--f-body); font-size: 14px; font-weight: 500; color: var(--fg-muted); text-align: center; }
.logos-strip { position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.logos-track { display: flex; align-items: center; width: max-content; animation: logos-scroll 18s linear infinite; }
.logos-strip:hover .logos-track { animation-play-state: paused; }
.logos-list { display: flex; align-items: center; gap: clamp(40px, 5vw, 72px); margin: 0; padding: 0 clamp(20px, 2.5vw, 36px); list-style: none; }
.logos-list li { flex: none; display: flex; align-items: center; height: 64px; }
/* Same visual weight for every logo: each has its own height (--h, set from its proportions); one colour, the text colour. */
.logos-list img { display: block; height: var(--h, 30px); width: auto; max-width: 200px; object-fit: contain;
  filter: brightness(0) invert(1); opacity: 0.6; transition: opacity .25s; }
:root[data-theme="light"] .logos-list img { filter: brightness(0); opacity: 0.55; }
.logos-list li:hover img { opacity: 1; }
@keyframes logos-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .logos-track { animation: none; width: auto; justify-content: center; }
  .logos-list { flex-wrap: wrap; justify-content: center; row-gap: 18px; }
  .logos-list[aria-hidden="true"] { display: none; }
  .logos-strip { -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 640px) { .logos-list li { height: 52px; } .logos-list img { height: calc(var(--h, 30px) * 0.8); } }

/* ---------- Hero: all of a project's clips at once (js/herowall.js, wide screens) ---------- */
.hw-multi { position: absolute; inset: 0; z-index: 1; display: grid; gap: 3px; background: var(--screen); }
.hm-tile { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #000000; }
.hm-tile img, .hm-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-label { position: absolute; right: 8px; top: 8px; z-index: 1; padding: 2px 8px; border-radius: 5px; background: rgba(0, 0, 0, 0.6); color: #ffffff; font-family: var(--f-body); font-size: 12px; font-weight: 500; line-height: 1.5; }
.hm-label.tl { right: auto; left: 8px; }
.hw-multi.n-2 { grid-template-columns: 1fr 1fr; }
/* Three: one large on the left, two on the right. */
.hw-multi.n-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.hw-multi.n-3 .hm-tile:first-child { grid-row: span 2; }
/* Four: two by two, each tile 16:9 like the frame. */
.hw-multi.n-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
/* Five: two wide on top, three below. */
.hw-multi.n-5 { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: 1fr 1fr; }
.hw-multi.n-5 .hm-tile:nth-child(-n+2) { grid-column: span 3; }
.hw-multi.n-5 .hm-tile:nth-child(n+3) { grid-column: span 2; }
/* The main clip fades in once it plays; the grid's clips are visible from the start (poster first). */
.hw-main .hm-tile video { opacity: 1; transition: none; }
