/* ============================================================
   Kevin Gandy Portfolio V4 — "ON AIR"
   The site behaves like a live broadcast: rundown navigation,
   scroll timecode, pinned cinematic scenes, ghost-year timeline.
   Cinema black + master-control amber. GSAP-driven, vendored.
   ============================================================ */

:root {
  --black: #0a0a0b;
  --black-2: #101012;
  --black-3: #17171a;
  --ivory: #efeade;
  --muted: rgba(239, 234, 222, 0.6);
  --faint: rgba(239, 234, 222, 0.34);
  --line: rgba(239, 234, 222, 0.14);
  --amber: #e0a458;
  --amber-deep: #b97f35;
  --amber-ink: #14100a;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --pad: clamp(1.25rem, 4vw, 4.5rem);
  --rail-w: 240px;
  --nav-h: 106px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@view-transition {
  navigation: auto;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }

body {
  margin: 0;
  background: var(--black);
  color: var(--ivory);
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 0; left: 1rem; z-index: 300;
  padding: 0.75rem 1.25rem; background: var(--ivory); color: var(--black);
  font-weight: 700; text-decoration: none; transform: translateY(-120%);
}
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }

/* ------------------------------------------------------------
   Top bar: wordmark + timecode + menu
   ------------------------------------------------------------ */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 120;
  padding: 0 var(--pad);
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(14px);
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.topbar.solid {
  background: rgba(10, 10, 11, 0.88);
  border-bottom-color: var(--line);
}
.topbar-row {
  height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}

/* Timeline-style persistent tab navigation under the name */
.tabbar {
  display: flex; align-items: stretch; gap: clamp(1.1rem, 2.4vw, 2.4rem);
  border-top: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar a {
  position: relative; flex: 0 0 auto;
  display: flex; align-items: center;
  height: 46px; padding-top: 2px;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  transition: color 0.2s ease;
}
.tabbar a::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0;
  height: 2px; background: transparent; transition: background 0.2s ease;
}
.tabbar a::after {
  content: ""; position: absolute; top: -1px; left: 50%;
  width: 1px; height: 5px; background: var(--line);
}
.tabbar a:hover { color: var(--ivory); }
.tabbar a:hover::before { background: rgba(224, 164, 88, 0.4); }
.tabbar a[aria-current="page"] { color: var(--amber); }
.tabbar a[aria-current="page"]::before { background: var(--amber); }
.tabbar a[aria-current="page"]::after { background: var(--amber); }
.wordmark {
  font-weight: 700; letter-spacing: -0.01em; text-decoration: none; font-size: 1.05rem;
}
.wordmark i { font-style: normal; color: var(--amber); }

.timecode {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.08em; color: var(--muted);
  display: flex; align-items: center; gap: 0.6rem;
}
.timecode b { color: var(--amber); font-weight: 500; }

.menu-btn {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.55rem 1rem; border: 1px solid var(--line);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.menu-btn:hover { border-color: var(--amber); color: var(--amber); }

/* Full-screen menu overlay */
.menu-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 10, 11, 0.97); backdrop-filter: blur(18px);
  display: none; flex-direction: column; justify-content: center;
  padding: var(--pad);
}
.menu-overlay.open { display: flex; }
.menu-close {
  position: absolute; top: 0.9rem; right: var(--pad);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.55rem 1rem; border: 1px solid var(--line);
}
.menu-close:hover { border-color: var(--amber); color: var(--amber); }
.menu-list { list-style: none; margin: 0; padding: 0; max-width: 1100px; }
.menu-list a {
  display: flex; align-items: baseline; gap: 1.5rem;
  font-size: clamp(2rem, 6vw, 4.5rem); font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.15; text-decoration: none; padding: 0.35rem 0;
  transition: color 0.2s ease, padding-left 0.3s var(--ease);
}
.menu-list a:hover { color: var(--amber); padding-left: 1rem; }
.menu-list a small {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
}
.menu-contact { margin-top: 2.5rem; display: flex; gap: 2.5rem; flex-wrap: wrap; }
.menu-contact a {
  font-family: var(--mono); font-size: 0.85rem; color: var(--muted);
  text-decoration: none;
}
.menu-contact a:hover { color: var(--amber); }

/* ------------------------------------------------------------
   Rundown rail (desktop section nav)
   ------------------------------------------------------------ */

.rundown {
  position: fixed; right: clamp(1rem, 2.5vw, 2.5rem); top: 50%; z-index: 110;
  translate: 0 -50%;
  width: var(--rail-w);
  font-family: var(--mono);
  display: none;
  padding: 0.9rem 1rem 0.4rem;
  background: rgba(10, 10, 11, 0.55);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
}
.rundown-title {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--faint);
  padding-bottom: 0.7rem; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.rundown-title i {
  font-style: normal; width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 10px var(--amber);
}
.rundown ol { list-style: none; margin: 0; padding: 0; }
.rundown li { border-bottom: 1px solid var(--line); }
.rundown a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.65rem 0.15rem;
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; text-decoration: none; color: var(--muted);
  transition: color 0.2s ease, padding-left 0.25s var(--ease);
}
.rundown a .tc-in { font-size: 0.62rem; color: var(--faint); letter-spacing: 0.05em; }
.rundown li.live a { color: var(--amber); padding-left: 0.6rem; }
.rundown li.live a .tc-in { color: var(--amber); }
.rundown li.live { border-bottom-color: rgba(224, 164, 88, 0.5); }
.rundown a:hover { color: var(--ivory); }

@media (min-width: 1180px) {
  .rundown { display: block; }
  .has-rail .scene-inner, .has-rail .slab { padding-right: calc(var(--rail-w) + 3rem); }
  .has-rail .pan-head { padding-right: calc(var(--rail-w) + 3rem); }
  .has-rail .pan-wrap {
    width: calc(100% - var(--rail-w) - clamp(1rem, 2.5vw, 2.5rem) - 1rem);
  }
  .has-rail .pan-wrap .panel {
    max-width: calc(100vw - var(--rail-w) - clamp(1rem, 2.5vw, 2.5rem) - 1rem - var(--pad) - var(--pad));
  }
}

/* ------------------------------------------------------------
   Type
   ------------------------------------------------------------ */

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }

.display-xl {
  font-size: clamp(2.7rem, 7.4vw, 7.8rem);
  font-weight: 800; line-height: 0.96; letter-spacing: -0.03em;
}
.display-lg {
  font-size: clamp(2rem, 4.6vw, 4.2rem);
  font-weight: 750; line-height: 1; letter-spacing: -0.025em;
}
.display-md {
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  font-weight: 700; line-height: 1.1;
}
.amber { color: var(--amber); }
.outline-text { color: transparent; -webkit-text-stroke: 1.5px var(--ivory); }

.lede {
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  color: var(--muted); max-width: 34em; margin: 0; font-weight: 400;
}

.meta-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--faint);
}
.meta-row b { color: var(--ivory); font-weight: 500; }

/* Text stays visible and static with or without JavaScript. */
.reveal { opacity: 1; translate: 0 0; }
.mask-line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.mask-line > span { display: block; translate: 0 0; }

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; gap: 0.9rem;
  padding: 1rem 1.6rem; text-decoration: none;
  font-weight: 700; font-size: 0.86rem; letter-spacing: 0.05em;
  text-transform: uppercase; white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn-fill { background: var(--amber); color: var(--amber-ink); }
.btn-fill:hover { background: var(--ivory); }
.btn-ghost { border: 1px solid var(--line); color: var(--ivory); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

.text-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--ivory); font-weight: 600; font-size: 0.92rem;
  text-decoration: none; border-bottom: 1px solid var(--line);
  padding-bottom: 0.2rem; transition: color 0.2s ease, border-color 0.2s ease;
}
.text-link:hover { color: var(--amber); border-color: var(--amber); }

/* ------------------------------------------------------------
   Scenes
   ------------------------------------------------------------ */

.scene { position: relative; }
.scene-inner { padding: clamp(3.75rem, 9vh, 6.75rem) var(--pad); max-width: 1500px; margin: 0 auto; }
.slab { padding: clamp(3rem, 6.75vh, 4.875rem) var(--pad); max-width: 1500px; margin: 0 auto; }

/* ------------------------------------------------------------
   Hero: oscilloscope canvas + optional generated video layer
   ------------------------------------------------------------ */

.hero {
  position: relative; min-height: 100dvh;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero-scope, .hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.hero-scope { z-index: 1; }
.hero-video {
  z-index: 2; object-fit: cover; opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-video.on { opacity: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 3;
  background:
    linear-gradient(to top, rgba(10, 10, 11, 0.94) 0%, rgba(10, 10, 11, 0.78) 38%, rgba(10, 10, 11, 0.72) 70%, rgba(10, 10, 11, 0.7) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative; z-index: 4;
  padding: calc(var(--nav-h) + 2rem) var(--pad) clamp(3rem, 9vh, 5.5rem);
  width: 100%; max-width: 1500px; margin: 0 auto;
}
.hero-content .lede { margin: 1.8rem 0 2.4rem; color: var(--ivory); }
.hero-actions { display: flex; align-items: center; gap: 1.9rem; flex-wrap: wrap; }

/* ------------------------------------------------------------
   Reel
   ------------------------------------------------------------ */

.reel-head {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 1.5rem 3rem;
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}
.reel-head p { max-width: 30em; color: var(--muted); margin: 0; }

.video-frame {
  position: relative; aspect-ratio: 16 / 9;
  background: var(--black-2); border: 1px solid var(--line);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reel-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding-top: 1rem; font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}

/* ------------------------------------------------------------
   Work: horizontal pan (pinned on desktop, stacked on mobile)
   ------------------------------------------------------------ */

.pan-head { padding: clamp(3rem, 6.75vh, 4.5rem) var(--pad) 0; max-width: 1500px; margin: 0 auto; }
.pan-head p { color: var(--muted); max-width: 36em; margin: 1rem 0 0; }

.pan-wrap { position: relative; overflow-x: auto; }
.pan-wrap.is-panning { overflow: hidden; }
.pan-wrap:not(.is-panning) .pan-track { flex-direction: column; }
.pan-wrap:not(.is-panning) .panel { width: 100%; }
.pan-track {
  display: flex; align-items: stretch;
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: clamp(1.875rem, 4.5vh, 3rem) var(--pad);
}
.panel {
  flex: 0 0 auto;
  width: min(72vw, 860px);
  display: grid; grid-template-rows: auto 1fr;
  border: 1px solid var(--line); background: var(--black-2);
  text-decoration: none;
  transition: border-color 0.3s ease;
}
.panel:hover { border-color: rgba(224, 164, 88, 0.55); }
.panel-media { position: relative; aspect-ratio: 16 / 8.5; overflow: hidden; }
.panel-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: scale 0.9s var(--ease);
}
.panel:hover .panel-media img { scale: 1.05; }
.panel-body {
  padding: clamp(1.4rem, 2.5vw, 2.25rem);
  display: flex; flex-direction: column; gap: 1rem; justify-content: space-between;
}
.panel-body h3 { font-size: clamp(1.3rem, 2.2vw, 1.9rem); }
.panel-body .meta-row { margin-bottom: 0.2rem; }
.panel-body p { color: var(--muted); margin: 0; font-size: 0.96rem; max-width: 40em; }
.panel-cta {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.panel-cta span { color: var(--amber); transition: translate 0.3s var(--ease); }
.panel:hover .panel-cta span { translate: 6px 0; }

@media (max-width: 959px) {
  .pan-track { flex-direction: column; padding-inline: var(--pad); }
  .panel { width: 100%; }
}

/* ------------------------------------------------------------
   Method (stacked statements)
   ------------------------------------------------------------ */

.method-row {
  display: grid; grid-template-columns: minmax(140px, 0.28fr) 1fr;
  gap: 1rem 3rem; align-items: start;
  border-top: 1px solid var(--line);
  padding: clamp(2rem, 5vh, 3.25rem) 0;
}
.method-row b {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber);
  padding-top: 0.6rem;
}
.method-row h3 { font-size: clamp(1.6rem, 3.4vw, 2.9rem); letter-spacing: -0.02em; }
.method-row p { color: var(--muted); margin: 0.9rem 0 0; max-width: 40em; }

/* ------------------------------------------------------------
   Timeline with ghost years
   ------------------------------------------------------------ */

.era { position: relative; }
.ghost-year {
  position: sticky; top: 22vh; z-index: 0;
  height: 0; overflow: visible; pointer-events: none;
  display: flex; justify-content: flex-end;
  padding-right: clamp(0rem, 4vw, 4rem);
}
.ghost-year span {
  font-size: clamp(7rem, 24vw, 22rem); font-weight: 800; line-height: 1;
  letter-spacing: -0.04em; color: transparent;
  -webkit-text-stroke: 1.5px rgba(224, 164, 88, 0.22);
}
.era-entries { position: relative; z-index: 1; list-style: none; margin: clamp(2.5rem, 6vh, 4rem) 0 0; padding: 0; }
.era-entry {
  display: grid; grid-template-columns: minmax(110px, 0.26fr) 1fr;
  gap: 0.75rem 3rem;
  border-top: 1px solid var(--line);
  padding: clamp(2.25rem, 7vh, 4rem) 0;
}
.era-entry time {
  font-family: var(--mono); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.08em; color: var(--amber); padding-top: 0.5rem;
}
.era-entry h3 { font-size: clamp(1.5rem, 2.8vw, 2.4rem); }
.era-entry p { color: var(--muted); margin: 0.7rem 0 0; max-width: 44em; }

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

.contact { border-top: 1px solid var(--line); }
.contact .scene-inner { padding-block: clamp(4.5rem, 12vh, 8.25rem); }
.contact .display-xl { max-width: 11.5em; }
.contact-actions {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
}
.contact-phone {
  font-family: var(--mono); font-size: 0.95rem; color: var(--muted); text-decoration: none;
}
.contact-phone:hover { color: var(--ivory); }

.site-footer {
  padding: 1.9rem var(--pad); border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--faint);
}

/* ------------------------------------------------------------
   Case pages: segment slate + article blocks
   ------------------------------------------------------------ */

.slate {
  padding: calc(var(--nav-h) + clamp(2.625rem, 7.5vh, 4.875rem)) var(--pad) clamp(1.875rem, 4.5vh, 3rem);
  max-width: 1500px; margin: 0 auto;
}
.slate .meta-row { margin-top: 1.9rem; }
.slate-rule {
  height: 2px; background: var(--amber); width: 100%;
  transform-origin: left center; scale: 1 1;
  margin-top: clamp(1.75rem, 4vh, 2.75rem);
}
.slate-rule.in { animation: rule-in 1.1s var(--ease) 0.25s backwards; }
@keyframes rule-in { from { scale: 0 1; } to { scale: 1 1; } }
.slate .cv-actions { margin-top: 2.25rem; }

.case-banner { margin: 0 var(--pad); max-width: 1500px; }
@media (min-width: 1560px) { .case-banner { margin: 0 auto; } }
.case-banner .banner-media {
  aspect-ratio: 21 / 9; overflow: hidden; border: 1px solid var(--line);
}
.case-banner.tall .banner-media { aspect-ratio: 2 / 1; }
.banner-media img { width: 100%; height: 100%; object-fit: cover; }

/* Brand statement strip (typographic banner, caption cropped via aspect box) */
.brand-strip { margin: 0 var(--pad); max-width: 1500px; }
@media (min-width: 1560px) { .brand-strip { margin: 0 auto; } }
.brand-strip .strip-media {
  aspect-ratio: 1800 / 332; overflow: hidden; border: 1px solid var(--line);
}
.brand-strip img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
@media (max-width: 700px) { .brand-strip .strip-media { aspect-ratio: 1800 / 417; } .brand-strip img { object-fit: contain; background: #000; } }

.article { max-width: 900px; }
.article .display-md { max-width: 24em; }
.article p { color: var(--muted); max-width: 66ch; font-size: 1.03rem; }

.callout {
  border-left: 2px solid var(--amber);
  padding: 1.4rem clamp(1.5rem, 3vw, 2.25rem);
  background: var(--black-2);
  max-width: 860px; margin-top: clamp(2rem, 5vh, 3rem);
}
.callout b { font-weight: 700; }
.callout p { color: var(--muted); margin: 0.5rem 0 0; }

/* Credits */
.credits-note { margin: 1.25rem 0 0; font-size: 0.875rem; line-height: 1.6; color: var(--muted); max-width: 66ch; }
.big-list { list-style: none; margin: clamp(2rem, 5vh, 3.25rem) 0 0; padding: 0; }
.big-list li {
  border-top: 1px solid var(--line);
  padding: clamp(1.2rem, 3vh, 1.9rem) 0;
  display: flex; align-items: baseline; justify-content: space-between; gap: 2rem;
  transition: padding-left 0.35s var(--ease);
}
.big-list li:hover { padding-left: 1.25rem; }
.big-list .row-title {
  font-weight: 750; font-size: clamp(1.6rem, 4.2vw, 3.2rem); letter-spacing: -0.025em; line-height: 1.05;
}
.big-list li:hover .row-title { color: var(--amber); }
.big-list .row-note {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint); white-space: nowrap;
}

/* Stations */
.station-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  margin-top: clamp(2rem, 5vh, 3.25rem);
}
.station { border: 1px solid var(--line); padding: 1.5rem 1.6rem; background: var(--black-2); }
.station h3 { font-size: 1.12rem; }
.station p { color: var(--muted); font-size: 0.94rem; margin: 0.55rem 0 0; }

/* Gallery + chapter */
.gallery-offset {
  display: grid; grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start;
}
.gallery-offset figure { margin: 0; }
.gallery-offset figure:nth-child(2) { margin-top: clamp(2.5rem, 9vh, 6.5rem); }
.gallery-offset .g-media { aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); }
.g-media img { width: 100%; height: 100%; object-fit: cover; }
.gallery-offset figcaption {
  margin-top: 0.8rem; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}

.chapter {
  display: grid; grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 5rem); align-items: center;
}
.chapter .g-media { aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); }
.chapter-copy p { color: var(--muted); max-width: 34em; }

.video-duo {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(2rem, 5vh, 3.25rem);
}
.video-duo figure { margin: 0; }
.video-duo figcaption {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-top: 0.8rem; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}
.video-duo figcaption a { color: var(--muted); text-decoration: none; }
.video-duo figcaption a:hover { color: var(--ivory); }

/* Flow, ledger, loop, dispatches */
.flow { list-style: none; margin: clamp(2rem, 5vh, 3.25rem) 0 0; padding: 0; }
.flow li {
  display: grid; grid-template-columns: minmax(150px, 0.28fr) 0.36fr 1fr;
  gap: 0.9rem 2.5rem; border-top: 1px solid var(--line);
  padding: 1.6rem 0;
}
.flow .flow-role {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber);
}
.flow b { font-weight: 700; font-size: 1.15rem; }
.flow p { margin: 0; color: var(--muted); font-size: 0.96rem; }

.ledger {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(2rem, 5vh, 3.25rem);
}
.ledger article { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.ledger .ledger-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.ledger b { font-weight: 700; font-size: 1.15rem; }
.ledger .ledger-state {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--amber);
}
.ledger p { color: var(--muted); font-size: 0.95rem; margin: 0.65rem 0 0; }

.loop-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
  margin-top: clamp(2.25rem, 6vh, 3.5rem);
}
.loop-step { border-top: 2px solid var(--line); padding-top: 1.3rem; }
.loop-step.loop-final { border-top-color: var(--amber); }
.loop-step b { display: block; font-weight: 700; font-size: 1.12rem; }
.loop-step p { color: var(--muted); font-size: 0.93rem; margin: 0.55rem 0 0; }

.dispatch-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(2rem, 4vh, 3rem);
}
.dispatch { border: 1px solid var(--line); background: var(--black-2); padding: 1.6rem; display: flex; flex-direction: column; gap: 0.9rem; }
.dispatch .dispatch-state {
  font-family: var(--mono); font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.dispatch h3 { font-size: 1.16rem; }
.dispatch p { color: var(--muted); font-size: 0.93rem; margin: 0; }

/* Product grid (AI portfolio page) */
.product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(2rem, 5vh, 3.25rem);
}
.card-links { display: flex; align-items: center; gap: 1.75rem; padding: 0 1.5rem; flex-wrap: wrap; }
.card-links .card-link { padding: 0; text-decoration: none; }
.card-link.primary::after { content: ""; position: absolute; inset: 0; }
.card-links a.demo { position: relative; z-index: 1; }
.card-link.primary:focus-visible::after { outline: 2px solid var(--amber); outline-offset: 4px; }
.card-links .card-link.demo span { color: var(--ivory); }
.card-links .card-link.demo:hover span { color: var(--amber); }
.product-card {
  position: relative;
  display: flex; flex-direction: column; gap: 0.9rem;
  border: 1px solid var(--line); background: var(--black-2);
  padding-bottom: 1.6rem; text-decoration: none;
  transition: border-color 0.3s ease;
}
.product-card:hover { border-color: rgba(224, 164, 88, 0.55); }
.product-media { aspect-ratio: 16 / 9; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.8s var(--ease); }
.product-card:hover .product-media img { scale: 1.05; }
.product-card h3 { font-size: 1.3rem; padding: 0.4rem 1.5rem 0; }
.product-card p { color: var(--muted); font-size: 0.94rem; margin: 0; padding: 0 1.5rem; flex: 1; }
.card-link {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0 1.5rem;
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.card-link span { color: var(--amber); transition: translate 0.3s var(--ease); }
.product-card:hover .card-link span { translate: 6px 0; }

/* Build diary entries */
.diary-entry {
  border-top: 1px solid var(--line);
  padding: clamp(1.6875rem, 4.5vh, 2.8125rem) 0;
}
.diary-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem 2rem; flex-wrap: wrap;
}
.diary-head h3 { font-size: clamp(1.6rem, 3.2vw, 2.6rem); letter-spacing: -0.02em; }
.status-chip {
  font-family: var(--mono); font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--amber); border: 1px solid rgba(224, 164, 88, 0.45);
  padding: 0.35rem 0.7rem; white-space: nowrap;
}
.diary-entry > p { color: var(--muted); max-width: 66ch; font-size: 1.02rem; }
.diary-media {
  display: grid; grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(1rem, 2.5vw, 2rem);
  margin: clamp(1.5rem, 4vh, 2.5rem) 0;
}
.diary-media.single { grid-template-columns: 1fr; }
.diary-media figure { margin: 0; }
.diary-media .shot {
  aspect-ratio: 16 / 9.5; overflow: hidden; border: 1px solid var(--line);
  background: var(--black-2);
}
.diary-media .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.diary-media figcaption {
  margin-top: 0.7rem; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}
.wiring {
  display: flex; align-items: baseline; gap: 1.25rem;
  margin-top: clamp(1.25rem, 3vh, 1.9rem); flex-wrap: wrap;
}
.wiring > b {
  font-family: var(--mono); font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber);
  flex: 0 0 auto; padding-top: 0.45rem;
}
.wiring .tag-list { flex: 1 1 300px; }
.diary-entry .text-link { margin-top: 1.4rem; display: inline-flex; }
@media (max-width: 960px) {
  .diary-media { grid-template-columns: 1fr; }
}

/* League motion gallery: one asset at a time, selected with a manual rail. */
.diary-media .league-screenshot { aspect-ratio: auto; }
.diary-media .league-screenshot img { height: auto; object-fit: contain; }
.gif-carousel { min-width: 0; margin: 2rem 0; border: 1px solid var(--line); background: var(--black-2); }
.gif-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.gif-heading h4 { margin: 0; font-size: 1.05rem; }
.gif-counter { font-family: var(--mono); color: var(--amber); font-size: 0.8rem; white-space: nowrap; }
.gif-carousel figure { margin: 0; }
.gif-viewport { position: relative; }
.gif-image-nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; padding: 0; background: rgba(10, 10, 11, 0.92); color: var(--amber); font-size: 1.3rem; z-index: 1; }
.gif-image-prev { left: 0.6rem; }
.gif-image-next { right: 0.6rem; }
.gif-stage { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--black); cursor: pointer; }
.gif-stage:disabled { cursor: default; }
.gif-stage img { width: 100%; height: 100%; object-fit: contain; }
.gif-stage:focus-visible { outline-offset: -4px; }
.gif-caption { padding: 1.25rem; min-height: 7.5rem; border-bottom: 1px solid var(--line); }
.gif-caption h5 { font-size: 1.15rem; margin: 0 0 0.6rem; }
.gif-caption p { color: var(--muted); font-size: 0.95rem; line-height: 1.6; margin: 0; max-width: 66ch; }
.gif-controls { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 1rem 1.25rem 0; flex-wrap: wrap; }
.gif-control { padding: 0.65rem 0.8rem; min-height: 44px; border: 1px solid var(--line); font-size: 0.85rem; }
.gif-control:disabled, .gif-selector:disabled { cursor: default; }
.gif-control:hover { border-color: var(--amber); color: var(--amber); }
.gif-play { color: var(--amber); }
.gif-rail { display: flex; gap: 0.6rem; overflow-x: auto; padding: 1rem 1.25rem; scrollbar-width: thin; }
.gif-selector { flex: 0 0 auto; min-height: 44px; padding: 0.65rem 0.85rem; border: 1px solid var(--line); font-size: 0.8rem; white-space: nowrap; }
.gif-selector span { font-family: var(--mono); color: var(--faint); margin-right: 0.45rem; }
.gif-selector[aria-pressed="true"] { background: var(--amber); color: var(--black); border-color: var(--amber); }
.gif-selector[aria-pressed="true"] span { color: var(--black); }
.gif-help { display: none; margin: 0; padding: 0 1.25rem 1rem; color: var(--faint); font-size: 0.8rem; }
.gif-carousel.is-ready .gif-fallback { display: none; }
.gif-carousel.is-ready .gif-help { display: block; }
.gif-fallback { padding: 1.25rem; }
.gif-fallback ul { padding-left: 1.25rem; }
.gif-fallback li { margin-top: 0.8rem; }
@media (max-width: 480px) {
  .gif-heading, .gif-caption { padding: 1rem; }
  .gif-controls { padding: 1rem 1rem 0; }
  .gif-control { font-size: 0.78rem; padding-inline: 0.6rem; }
  .gif-rail { padding: 1rem; }
  .gif-caption { min-height: 10rem; }
}

/* Compact page rhythm (résumé) */
.compact .scene-inner { padding-block: clamp(1.6875rem, 3.75vh, 2.625rem); }
.compact .slate { padding-bottom: clamp(1.125rem, 3vh, 1.875rem); }
.compact .cv-entries { margin-top: clamp(1.25rem, 3vh, 2rem); }

/* Commercial teaser under the reel */
.commercial-teaser {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(1.75rem, 4vw, 4rem); align-items: center;
  margin-top: clamp(2.5rem, 7vh, 4.5rem);
  border-top: 1px solid var(--line);
  padding-top: clamp(2rem, 5vh, 3.25rem);
}
.commercial-teaser .teaser-copy h3 { font-size: clamp(1.4rem, 2.6vw, 2.1rem); }
.commercial-teaser .teaser-copy p { color: var(--muted); margin: 0.9rem 0 1.8rem; max-width: 34em; }
@media (max-width: 960px) { .commercial-teaser { grid-template-columns: 1fr; } }

/* Dual exit (last stop offers two directions) */
.next-duo { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.next-duo .next-case { border-top: 0; }
.next-duo .next-case + .next-case { border-left: 1px solid var(--line); }

/* Next case footer */
.next-case {
  display: block; text-decoration: none;
  border-top: 1px solid var(--line);
  padding: clamp(2.625rem, 8.25vh, 5.25rem) var(--pad);
  transition: background 0.3s ease;
}
.next-case:hover { background: var(--black-2); }
.next-case .next-label {
  display: block; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 1.1rem;
}
.next-case .display-lg { transition: color 0.25s ease; }
.next-case:hover .display-lg { color: var(--amber); }

/* ------------------------------------------------------------
   Résumé page
   ------------------------------------------------------------ */

.cv-actions { display: flex; align-items: center; gap: 1.9rem; flex-wrap: wrap; }

.cv-entries { margin-top: clamp(2rem, 5vh, 3.25rem); position: relative; z-index: 1; }
.cv-entry {
  display: grid; grid-template-columns: minmax(190px, 0.3fr) 1fr;
  gap: 0.9rem 3rem;
  border-top: 1px solid var(--line);
  padding: clamp(1.7rem, 4.5vh, 2.75rem) 0;
}
.cv-when time {
  display: block; font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.08em; color: var(--amber); margin-bottom: 0.55rem;
}
.cv-when span {
  display: block; font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.06em; line-height: 1.7; color: var(--muted);
  text-transform: uppercase;
}
.cv-what h3 { font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
.cv-what ul { margin: 1rem 0 0; padding: 0; list-style: none; }
.cv-what li {
  position: relative; padding-left: 1.4rem; margin-top: 0.65rem;
  color: var(--muted); font-size: 0.97rem; max-width: 60ch;
}
.cv-what li::before {
  content: ""; position: absolute; left: 0; top: 0.64em;
  width: 0.55rem; height: 1px; background: var(--amber);
}

.cv-skills {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3.5vw, 3rem);
  margin-top: clamp(2rem, 4vh, 3rem);
}
.cv-skill-group { border-top: 1px solid var(--line); padding-top: 1.4rem; }
.cv-skill-group h3 { font-size: 1.15rem; margin-bottom: 1.1rem; }
.tag-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.55rem; }
.tag-list li {
  border: 1px solid var(--line); padding: 0.4rem 0.8rem;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em;
  color: var(--muted); transition: border-color 0.2s ease, color 0.2s ease;
}
.tag-list li:hover { border-color: var(--amber); color: var(--ivory); }

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

@media (max-width: 960px) {
  .timecode { display: none; }
  .chapter, .gallery-offset { grid-template-columns: 1fr; }
  .gallery-offset figure:nth-child(2) { margin-top: 0; }
  .method-row, .era-entry, .cv-entry, .flow li { grid-template-columns: 1fr; gap: 0.5rem; }
  .loop-grid { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .dispatch-grid, .cv-skills { grid-template-columns: 1fr; }
  .ghost-year span { -webkit-text-stroke-width: 1px; }
}

@media (max-width: 700px) {
  .station-grid, .ledger, .video-duo, .loop-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .next-duo { grid-template-columns: 1fr; }
  .next-duo .next-case + .next-case { border-left: 0; border-top: 1px solid var(--line); }
  .big-list li { flex-direction: column; gap: 0.4rem; }
  .case-banner .banner-media, .case-banner.tall .banner-media { aspect-ratio: 16 / 9; }
}

/* ------------------------------------------------------------
   Print (résumé reads as a document)
   ------------------------------------------------------------ */

@media print {
  body { background: #ffffff; color: #111111; }
  .topbar, .site-footer, .next-case, .skip-link, .rundown,
  .menu-overlay, .cv-actions, .contact, .ghost-year { display: none !important; }
  .slate { padding-top: 1rem; }
  .slate-rule { scale: 1 1; background: #111111; height: 1px; }
  .display-xl, .display-lg, .display-md { color: #111111; }
  .outline-text { -webkit-text-stroke: 0; color: #111111; }
  .meta-row, .cv-when time { color: #444444; }
  .cv-when span, .cv-what li, .article p, .tag-list li { color: #333333; }
  .cv-entry, .cv-skill-group, .tag-list li { border-color: #cccccc; }
  .cv-entry { break-inside: avoid; }
  .reveal.in, .mask-line.in > span, .slate-rule.in { animation: none; }
  .reveal, .mask-line > span { opacity: 1 !important; translate: 0 0 !important; }
}

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .reveal.in, .mask-line.in > span, .slate-rule.in { animation: none; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; translate: 0 0; transition: none; }
  .mask-line > span { translate: 0 0; transition: none; }
  .slate-rule { scale: 1 1; transition: none; }
  /* .hero-video is never injected under reduced motion; app.js governs it */
  .panel-media img, .btn, .big-list li { transition: none; }
  * { view-transition-name: none !important; }
}

/* Approved copy: keep the two tool cards within the existing responsive grid. */
.copy-tools .panel { width: 100%; }

/* Synchronized video reveal, with fixed-size stills before media is ready. */
.video-comparison { margin: 1.75rem 0; border: 1px solid var(--line); background: var(--black-2); }
.compare-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; padding: 1rem 1.25rem; }
.compare-heading h4 { margin: 0; font-size: 1.1rem; }
.compare-heading > span { font-family: var(--mono); font-size: 0.7rem; color: var(--amber); }
.compare-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; touch-action: pan-y; cursor: col-resize; background: var(--black); }
.compare-stage > img, .compare-generated > img, .comparison-video { display: block; width: 100%; height: 100%; object-fit: contain; }
.comparison-video { position: absolute; inset: 0; opacity: 0; }
.compare-stage.is-video .comparison-video { opacity: 1; }
.compare-generated { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--reveal)); }
.compare-label { position: absolute; top: 0.75rem; padding: 0.35rem 0.65rem; font-family: var(--mono); font-size: 0.7rem; background: rgba(10, 10, 11, 0.9); color: var(--ivory); pointer-events: none; }
.compare-label-previz { left: 0.75rem; }
.compare-label-generated { right: 0.75rem; }
.compare-divider { position: absolute; top: 0; bottom: 0; left: var(--reveal); width: 2px; background: var(--amber); box-shadow: 0 0 0 1px rgba(10,10,11,0.45); pointer-events: none; }
.compare-divider > span { position: absolute; top: 50%; left: -19px; translate: 0 -50%; display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--amber); border-radius: 50%; background: var(--black); color: var(--amber); }
.compare-controls { padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
.compare-reveal-control { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.compare-reveal-control label { font-family: var(--mono); font-size: 0.75rem; color: var(--ivory); }
.compare-controls input[type="range"] { accent-color: var(--amber); min-height: 44px; margin: 0; cursor: pointer; }
.compare-reveal-control input { flex: 1 1 140px; min-width: 0; }
.compare-playback { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 0.65rem; }
.compare-playback input { flex: 1 1 120px; min-width: 0; }
.compare-playback [role="status"] { flex: 1 1 180px; color: var(--muted); font-size: 0.8rem; }
.video-comparison figcaption { margin: 0; padding: 0 1.25rem; max-width: 66ch; font-size: 0.9rem; color: var(--muted); }
.compare-hint { display: none; padding: 0 1.25rem; font-size: 0.8rem; color: var(--faint); }
.video-comparison.is-enhanced .compare-hint { display: block; }
.compare-links { display: flex; gap: 1.25rem; flex-wrap: wrap; padding: 1rem 1.25rem; font-size: 0.85rem; }
@media (max-width: 480px) { .compare-heading, .compare-controls { padding: 1rem; } .compare-reveal-control label { font-size: 0.7rem; } }
