/* ==========================================================================
   Portfolio styles: Lemuel Derwin Guballa

   Contents
   1. Design tokens (colors, fonts)
   2. Base, film grain and layout helpers
   3. Intro, progress bar and cursor
   4. Sticky header and navigation
   5. Hero, floating phones and showreel
   6. Marquee and film strip
   7. Video rails and slots (where your ads go)
   8. Lightbox (larger player)
   9. Workflow, timeline and background sections
   10. Contact and footer
   11. Small screens, pause switch and reduced motion
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Design tokens
   Change colors here and the whole site updates.
   -------------------------------------------------------------------------- */
:root {
  /* Deep, cinema-dark palette (built from the slate in your resume sidebar) */
  --ink: #0d0f17;         /* page background */
  --raised: #131624;      /* alternating section background */
  --panel: #1b1f31;       /* empty video slots */
  --line: #2b3047;        /* borders and dividers */
  --text: #f1f2f8;        /* main text */
  --muted: #a3a9c0;       /* secondary text */

  /* Accents: pink is the "playhead" color, periwinkle marks AI work */
  --playhead: #ff4d8d;
  --ai: #9aabff;
  --amber: #ffb86b;

  /* Fonts (loaded from Google Fonts in index.html, with safe fallbacks) */
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Layout */
  --content-width: 1120px;
  --header-height: 4rem;
  --cinema-ratio: 21 / 9;  /* shape of the showreel. Use 16 / 9 if you don't want any cropping */

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}


/* --------------------------------------------------------------------------
   2. Base, film grain and layout helpers
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
/* Stops the page behind the lightbox from scrolling */
html.lightbox-open { overflow: hidden; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--ink);
  color: var(--text);
  overflow-x: clip;
}

/* Film grain over the whole page for a cinematic texture. It jitters in
   steps like real grain, and ignores clicks so it never blocks anything. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 30;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -1%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.1;
}
p { margin: 0; }
a { color: inherit; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--ai);
  outline-offset: 3px;
}

/* Centered content column */
.wrap {
  width: min(100% - 2.5rem, var(--content-width));
  margin-inline: auto;
}

/* Vertical rhythm between page sections */
.section {
  padding-block: clamp(4rem, 9vw, 7rem);
}
/* Alternate section background, so long pages have visible chapters */
.theme-raised { background: var(--raised); }

/* Anchor links stop below the sticky header instead of under it */
[id] { scroll-margin-top: calc(var(--header-height) + 0.5rem); }

.section__title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.section__title--xl {
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.02;
}

.section__lead {
  max-width: 60ch;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Small mono label above headings, like a timecode: "03 — Process" */
.eyebrow {
  display: block;
  margin-bottom: 0.9rem;
  color: var(--playhead);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Blinking record dot, reused in the header, hero and showreel */
.rec {
  display: inline-block;
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--playhead);
  box-shadow: 0 0 10px var(--playhead);
  animation: blink 1.4s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

/* Link for keyboard users to jump past the header */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 120;
  padding: 0.6rem 1rem;
  background: var(--playhead);
  color: var(--ink);
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Buttons */
.btn {
  position: relative;
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;   /* a long email address wraps instead of overflowing */
  max-width: 100%;
  transition: background-color 0.15s, border-color 0.15s, transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.btn:hover { transform: translateY(-3px); }
.btn--primary { background: var(--playhead); color: var(--ink); }
.btn--primary:hover { background: #ff6fa3; box-shadow: 0 10px 30px rgba(255, 77, 141, 0.4); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--muted); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

/* Scroll reveal: things start slightly low and transparent, then settle in
   when they reach the screen. Only when JS is running (see the head script). */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }


/* --------------------------------------------------------------------------
   3. Intro, progress bar and cursor
   -------------------------------------------------------------------------- */

/* Film-leader countdown. Hidden unless JS runs, so it can never trap a visitor. */
.preloader {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  place-items: center;
  align-content: center;
  gap: 1.25rem;
  background:
    linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat,
    linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat,
    var(--ink);
  transition: transform 0.9s cubic-bezier(0.77, 0, 0.18, 1), visibility 0s 0.9s;
}
.js .preloader { display: grid; }
.is-loaded .preloader { transform: translateY(-100%); visibility: hidden; pointer-events: none; }

.preloader__leader {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--ink);   /* hides the crosshair lines behind the ring */
}
.preloader__ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.preloader__track,
.preloader__bar { fill: none; stroke-width: 3; }
.preloader__track { stroke: var(--line); }
.preloader__bar {
  stroke: var(--playhead);
  stroke-linecap: round;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 339.3;
}
.preloader__num {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  letter-spacing: 0.04em;
}
.preloader__label {
  background: var(--ink);
  padding-inline: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* Scroll progress: a thin playhead line along the very top */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--playhead), var(--ai));
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  pointer-events: none;
}

/* Soft ring that follows the mouse (desktop only, added by JS).
   The normal cursor stays visible, so nothing is hidden from anyone. */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.cursor.is-on { opacity: 1; }
.cursor span {
  display: grid;
  place-items: center;
  /* Drawn at full PLAY size (84px) and scaled down, so growing it is a
     cheap transform instead of a layout change on every frame. */
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border: 3.7px solid var(--playhead);  /* about 1.5px once scaled down */
  border-radius: 50%;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  transform: scale(0.405);  /* 34px */
  transition: transform 0.3s var(--ease-out), background-color 0.2s;
}
.cursor.is-link span { transform: scale(0.643); background: rgba(255, 77, 141, 0.15); }  /* 54px */
.cursor.is-play span { transform: scale(1); background: var(--playhead); }  /* 84px */
.cursor.is-play span::after { content: "PLAY"; }


/* --------------------------------------------------------------------------
   4. Sticky header and navigation
   Transparent at the top of the page; frosted once you scroll (JS adds
   .is-scrolled). The link for the section you're reading gets
   aria-current="true" from JS.
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s, border-color 0.25s;
}
.site-header.is-scrolled {
  background: rgba(13, 15, 23, 0.82);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(100% - 2.5rem, var(--content-width));
  height: var(--header-height);
  margin-inline: auto;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand__short { display: none; }  /* shown on small screens */

/* Live timecode that ticks in the header */
.hud-tc {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.site-nav { display: flex; gap: 1.75rem; }

.site-nav a {
  position: relative;
  padding-block: 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.15s;
}
/* The underline slides in from the left, like a playhead moving */
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--playhead);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.35s var(--ease-out);
}
.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after,
.site-nav a[aria-current="true"]::after { transform: scaleX(1); }
.site-nav a[aria-current="true"] { color: var(--text); }


/* --------------------------------------------------------------------------
   5. Hero, floating phones and showreel
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  /* Slides up behind the transparent header so the spotlight has no seam */
  margin-top: calc(var(--header-height) * -1);
  padding-block: calc(var(--header-height) + clamp(2.5rem, 7vw, 5rem)) clamp(3.5rem, 8vw, 6rem);
  /* Two soft spotlights: pink from the top right, periwinkle from the bottom left */
  background:
    radial-gradient(ellipse 70% 55% at 88% -8%, rgba(255, 77, 141, 0.22), transparent 68%),
    radial-gradient(ellipse 50% 40% at 0% 45%, rgba(154, 171, 255, 0.1), transparent 70%);
}
/* Faint dot grid, like the canvas of an editing app, fading out downward */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 75%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 75%);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.hero__role {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
  color: var(--playhead);
  font-weight: 600;
  font-size: 1.05rem;
}

/* Headline: each line slides up out of its own mask once the intro ends */
.hero__title {
  font-size: clamp(2.3rem, 6.2vw, 5.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  white-space: nowrap;
}
.line > span { display: inline-block; }
.line--accent { color: var(--playhead); }
.js .line > span { transform: translateY(115%); }
.js.is-loaded .line > span {
  transform: none;
  transition: transform 1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms + 250ms);
}

.hero__lead {
  max-width: 56ch;
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.25rem);
}
.js .hero__role,
.js .hero__lead,
.js .hero .actions,
.js .hud { opacity: 0; transform: translateY(18px); }
.js.is-loaded .hero__role,
.js.is-loaded .hero__lead,
.js.is-loaded .hero .actions,
.js.is-loaded .hud {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.js.is-loaded .hero__role { transition-delay: 0.1s; }
.js.is-loaded .hero__lead { transition-delay: 0.7s; }
.js.is-loaded .hero .actions { transition-delay: 0.85s; }
.js.is-loaded .hud { transition-delay: 1s; }

/* Quick facts row with counting numbers */
.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 2.5rem 0 0;
  padding: 0;
}
.hud > div {
  display: flex;
  flex-direction: column;
  padding-top: 0.8rem;
  border-top: 1.5px solid var(--line);
}
.hud dt {
  order: 2;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}
.hud dd {
  order: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1;
}

/* ---- The floating stage: three phones, a clapperboard and sparkles ---- */
.stage {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
  aspect-ratio: 1 / 1.08;
}
/* Each item drifts a little with the mouse (--mx, --my) and the scroll (--sy).
   --dx, --sp and --r are set per item in the HTML. */
.stage__item {
  position: absolute;
  transform:
    translate3d(
      calc(var(--mx, 0) * var(--dx, 0) * 1px),
      calc(var(--my, 0) * var(--dx, 0) * 1px - var(--sy, 0) * var(--sp, 0) * 1px),
      0)
    rotate(var(--r, 0deg));
  transition: transform 0.6s var(--ease-out);
  will-change: transform;
}
.stage__item--a { left: 28%; top: 2%; width: 44%; z-index: 3; }
.stage__item--b { left: -2%; top: 22%; width: 34%; z-index: 2; }
.stage__item--c { left: 68%; top: 26%; width: 32%; z-index: 1; }
.stage__item--clap { left: 6%; bottom: 0; width: 31%; z-index: 4; }

.js .stage { opacity: 0; transform: scale(0.94) translateY(24px); }
.js.is-loaded .stage {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s var(--ease-out) 0.5s, transform 1.1s var(--ease-out) 0.5s;
}

.phone {
  width: 100%;
  aspect-ratio: 9 / 16;
  padding: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: #090a10;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  animation: float 6s ease-in-out infinite;
}
.stage__item--b .phone { animation-duration: 7.5s; animation-delay: -2s; }
.stage__item--c .phone { animation-duration: 8.5s; animation-delay: -4s; }
@keyframes float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -12px; }
}

.phone__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 19px;
  background: linear-gradient(160deg, var(--g1), var(--g2));
  background-size: 160% 160%;
  animation: screen-shift 8s ease-in-out infinite alternate;
}
@keyframes screen-shift {
  from { background-position: 0% 0%; }
  to   { background-position: 100% 100%; }
}
/* A soft glowing blob drifting around, so every screen looks "alive" */
.phone__screen::before {
  content: "";
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  left: 15%;
  top: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5), transparent 68%);
  animation: blob 7s ease-in-out infinite alternate;
}
@keyframes blob {
  from { transform: translate(-12%, -8%) scale(0.9); }
  to   { transform: translate(14%, 16%) scale(1.15); }
}
.phone--hook { --g1: #ff4d8d; --g2: #5b2a86; }
.phone--ai   { --g1: #9aabff; --g2: #1c2a6b; }
.phone--cta  { --g1: #ffb86b; --g2: #ff4d8d; }

/* The AI phone gets a scrolling grid, like a generated scene taking shape */
.phone--ai .phone__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  animation: grid-scroll 3s linear infinite;
}
@keyframes grid-scroll { to { background-position: 0 22px, 22px 0; } }

.phone__tag {
  position: absolute;
  left: 8%;
  top: 5%;
  z-index: 2;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(13, 15, 23, 0.7);
  font-family: var(--font-mono);
  font-size: clamp(0.5rem, 1.1vw, 0.68rem);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
/* Fake captions that pulse like words popping on screen */
.phone__caps {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 14%;
  z-index: 2;
  display: grid;
  gap: 6px;
  justify-items: center;
}
.phone__caps i {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  animation: caption 2.4s ease-in-out infinite;
}
.phone__caps i:nth-child(1) { width: 78%; }
.phone__caps i:nth-child(2) { width: 52%; animation-delay: 0.4s; }
@keyframes caption {
  0%, 100% { transform: scaleX(0.5); opacity: 0.5; }
  35%, 70% { transform: scaleX(1); opacity: 1; }
}
.phone__button {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 16%;
  z-index: 2;
  height: 12%;
  border-radius: 999px;
  background: var(--ink);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}
/* Progress line along the bottom of each phone, like a video scrubbing */
.phone__progress {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 6%;
  z-index: 2;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.phone__progress i {
  display: block;
  height: 100%;
  background: #fff;
  transform-origin: 0 50%;
  animation: scrub 6s linear infinite;
}
.stage__item--b .phone__progress i { animation-duration: 7s; }
.stage__item--c .phone__progress i { animation-duration: 5s; }
@keyframes scrub {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Clapperboard: the top arm claps shut every few seconds */
.clap { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.45)); }
.clap__arm {
  transform-box: view-box;
  transform-origin: 8px 38px;
  animation: clap 4s ease-in-out infinite;
}
@keyframes clap {
  0%, 55%  { transform: rotate(-26deg); }
  62%      { transform: rotate(0deg); }
  66%      { transform: rotate(-4deg); }
  70%      { transform: rotate(0deg); }
  88%, 100% { transform: rotate(-26deg); }
}

.chip {
  position: absolute;
  z-index: 5;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(13, 15, 23, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  animation: float 6.5s ease-in-out infinite;
}
.chip--hook { right: 2%; top: 8%; color: var(--playhead); border-color: rgba(255, 77, 141, 0.5); }
.chip--ai   { right: 6%; bottom: 14%; color: var(--ai); border-color: rgba(154, 171, 255, 0.5); animation-delay: -3s; }

.spark { position: absolute; z-index: 5; animation: twinkle 3.2s ease-in-out infinite; }
.spark--1 { left: 4%; top: 6%; }
.spark--2 { left: 54%; bottom: 4%; animation-delay: -1s; }
.spark--3 { right: 0; top: 52%; animation-delay: -2s; }
@keyframes twinkle {
  0%, 100% { transform: scale(0.5) rotate(0deg); opacity: 0.4; }
  50%      { transform: scale(1.1) rotate(45deg); opacity: 1; }
}

.hero__reel { margin-top: clamp(3rem, 7vw, 5rem); }


/* --------------------------------------------------------------------------
   6. Marquee and film strip
   -------------------------------------------------------------------------- */

/* Two identical groups side by side; sliding left by exactly one group
   (half the track) makes a seamless loop. Hover to pause. */
.marquee {
  overflow: hidden;
  padding-block: 1rem;
  border-block: 1px solid var(--line);
  background: var(--raised);
  user-select: none;
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group {
  display: flex;
  flex: none;
  min-width: 100vw;
  justify-content: space-around;
  gap: 2.5rem;
  padding-right: 2.5rem;
}
.marquee__group span {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee__group span::after { content: "✦"; color: var(--playhead); font-size: 0.7em; }
.marquee__group span:nth-child(even) {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--text);
}
@keyframes marquee { to { transform: translateX(-50%); } }

.marquee--bold { margin-bottom: clamp(3rem, 6vw, 5rem); background: transparent; border-top: 0; }
.marquee--bold .marquee__group span { font-size: clamp(3rem, 9vw, 7rem); }
.marquee--bold .marquee__track { animation-duration: 55s; }
.marquee--rev .marquee__track { animation-direction: reverse; }

/* A strip of film with sprocket holes, scrolling slowly between sections */
.filmstrip {
  height: 38px;
  background:
    linear-gradient(90deg, var(--line) 14px, transparent 14px) 0 7px / 32px 8px repeat-x,
    linear-gradient(90deg, var(--line) 14px, transparent 14px) 0 23px / 32px 8px repeat-x,
    #090a10;
  animation: strip 3s linear infinite;
}
@keyframes strip {
  to { background-position: 32px 7px, 32px 23px, 0 0; }
}


/* --------------------------------------------------------------------------
   7. Video rails and slots
   A rail is a horizontally scrolling row of slots.
   Each slot is an empty placeholder until you drop a video into it.
   -------------------------------------------------------------------------- */
.reels {
  padding-block: clamp(3rem, 7vw, 5rem) clamp(4rem, 9vw, 7rem);
}

.rail-block + .rail-block {
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
}

/* Heading row above each rail, with the left/right buttons */
.rail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2.5rem, var(--content-width));
  margin: 0 auto 1.75rem;
}
.rail-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.rail-head p { max-width: 52ch; margin-top: 0.6rem; color: var(--muted); }

.rail-controls { display: flex; gap: 0.5rem; }

.rail-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.2s, color 0.2s, transform 0.25s var(--ease-out);
}
.rail-btn:hover:not(:disabled) { border-color: var(--playhead); background: var(--playhead); color: var(--ink); transform: scale(1.08); }
.rail-btn:disabled { opacity: 0.35; cursor: default; }

/* The scrolling row itself. The side padding lines the first slot up with
   the page content, while the row still bleeds to the screen edges. */
.rail {
  --gutter: max(1.25rem, calc((100% - var(--content-width)) / 2));
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 0.5rem var(--gutter) 1rem;
  counter-reset: slot;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
/* While dragging with the mouse, snapping would fight the movement */
.rail.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.rail.is-dragging * { pointer-events: none; }

/* Thin scroll bar under each row that shows where you are */
.rail-progress {
  width: min(100% - 2.5rem, var(--content-width));
  height: 3px;
  margin: 0.25rem auto 0;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.rail-progress[hidden] { display: none; }
.rail-progress i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--playhead);
  transition: transform 0.12s linear;
}

/* One video slot. Its width comes from the --slot-w variable below. */
.slot {
  position: relative;
  flex: 0 0 auto;
  width: var(--slot-w);
  scroll-snap-align: start;
  counter-increment: slot;
}

/* Pink glow behind a filled slot on hover. The shadow is drawn once and only
   its opacity fades, which every browser (Firefox included) can do cheaply.
   JS toggles .is-hover on the slot. */
.slot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: var(--slot-ratio, 16 / 9);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(255, 77, 141, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.slot.is-hover::before { opacity: 1; }
.slot--cinema::before { border-radius: 18px; box-shadow: 0 30px 80px rgba(255, 77, 141, 0.25); }

/* Slot shapes. Add one of these classes to the <article class="slot"> */
.slot--vertical { --slot-w: clamp(200px, 23vw, 260px); }  /* 9:16 TikTok, Reels, Shorts */
.slot--square   { --slot-w: clamp(250px, 30vw, 340px); }  /* 1:1 feed */
.slot--wide     { --slot-w: clamp(310px, 40vw, 480px); }  /* 16:9 YouTube */
.slot--cinema   { --slot-w: 100%; }                       /* wide showreel in the hero */

/* The box that holds the video (or the empty placeholder).
   JS sets --rx and --ry so filled slots tilt toward the mouse. */
.slot__media {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  overflow: hidden;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: var(--panel);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.4s var(--ease-out), border-color 0.3s;
}
/* While hovered, keep the tilting card on its own GPU layer so tilting
   doesn't repaint the video and rounded corners every frame. */
.slot.is-hover .slot__media { will-change: transform; }
.slot--vertical { --slot-ratio: 9 / 16; }
.slot--vertical .slot__media { aspect-ratio: 9 / 16; }
.slot--square   { --slot-ratio: 1 / 1; }
.slot--square   .slot__media { aspect-ratio: 1 / 1; }
.slot--wide     { --slot-ratio: 16 / 9; }
.slot--wide     .slot__media { aspect-ratio: 16 / 9; }
.slot--cinema   { --slot-ratio: var(--cinema-ratio); }
.slot--cinema   .slot__media {
  aspect-ratio: var(--cinema-ratio);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

/* Empty slots: a shimmer sweeping across, with viewfinder corners */
.slot__media:not(:has(video, iframe, img)) {
  background:
    linear-gradient(105deg, transparent 35%, rgba(154, 171, 255, 0.08) 50%, transparent 65%) 0 0 / 250% 100% no-repeat,
    var(--panel);
  animation: shimmer 3.2s ease-in-out infinite;
}
@keyframes shimmer {
  from { background-position: 120% 0, 0 0; }
  to   { background-position: -120% 0, 0 0; }
}
.slot__media:not(:has(video, iframe, img))::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  opacity: 0.55;
  background:
    linear-gradient(var(--muted), var(--muted)) top left / 16px 1.5px no-repeat,
    linear-gradient(var(--muted), var(--muted)) top left / 1.5px 16px no-repeat,
    linear-gradient(var(--muted), var(--muted)) top right / 16px 1.5px no-repeat,
    linear-gradient(var(--muted), var(--muted)) top right / 1.5px 16px no-repeat,
    linear-gradient(var(--muted), var(--muted)) bottom left / 16px 1.5px no-repeat,
    linear-gradient(var(--muted), var(--muted)) bottom left / 1.5px 16px no-repeat,
    linear-gradient(var(--muted), var(--muted)) bottom right / 16px 1.5px no-repeat,
    linear-gradient(var(--muted), var(--muted)) bottom right / 1.5px 16px no-repeat;
}
/* The empty showreel gets a dim color-bar test pattern */
.slot--cinema .slot__media:not(:has(video, iframe, img))::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background: linear-gradient(90deg, #e8e8e8 0 14.28%, #e5d94a 0 28.57%, #4ad6d6 0 42.85%, #5bd65b 0 57.14%, #d65bd6 0 71.42%, #d65b5b 0 85.71%, #5b5bd6 0);
  -webkit-mask-image: linear-gradient(to top, #000 0 28%, transparent 28% 100%);
  mask-image: linear-gradient(to top, #000 0 28%, transparent 28% 100%);
}

/* Empty state: a play icon above a short label */
.slot__empty {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.slot__empty::before {
  content: "";
  width: 2.75rem;
  height: 2.75rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none'%3E%3Ccircle cx='24' cy='24' r='22.5' stroke='%23a3a9c0' stroke-width='1.5'/%3E%3Cpath d='M19 16l15 8-15 8z' fill='%23a3a9c0'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: pulse 2.4s ease-in-out infinite;
}
.slot--cinema .slot__empty { font-size: 1.05rem; }
.slot--cinema .slot__empty::before { width: 4.5rem; height: 4.5rem; }

/* Timecode in the corner of the empty showreel */
.slot__hud {
  position: absolute;
  left: 1.6rem;
  top: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

/* Anything you place inside a slot fills it completely */
.slot__media video,
.slot__media iframe,
.slot__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

/* Once a video is in, drop the dashed border and the placeholder */
.slot__media:has(video, iframe, img) {
  border-style: solid;
  border-color: transparent;
}
.slot__media:has(video, iframe, img) .slot__empty { display: none; }
.slot.is-hover .slot__media:has(video, iframe, img) { border-color: rgba(255, 77, 141, 0.7); }

/* Invisible button laid over a filled slot. Clicking it (or pressing Enter)
   opens the larger player. JS adds it. */
.slot__open {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.slot__open:focus-visible { outline-offset: -4px; }

/* Preview progress line along the bottom while a video plays on hover. JS adds it. */
.slot__scrub {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.slot__scrub i {
  display: block;
  height: 100%;
  background: var(--playhead);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.slot__media.is-playing .slot__scrub { opacity: 1; }

/* Sound button, shown on hover or keyboard focus. JS adds it to video slots. */
.slot__sound {
  position: absolute;
  right: 0.6rem;
  bottom: 0.9rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(13, 15, 23, 0.72);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.slot__media:hover .slot__sound,
.slot__media:focus-within .slot__sound { opacity: 1; }
.slot__sound[aria-pressed="true"] { background: var(--playhead); color: var(--ink); border-color: var(--playhead); }
/* Show only the icon for the current state */
.slot__sound .icon-on { display: none; }
.slot__sound[aria-pressed="true"] .icon-on  { display: block; }
.slot__sound[aria-pressed="true"] .icon-off { display: none; }

.slot__title { margin-top: 0.9rem; font-size: 1.05rem; font-weight: 600; }
.slot__meta  { margin-top: 0.15rem; color: var(--muted); font-size: 0.9rem; }
/* Reel numbers (01, 02...) in front of each title inside a row */
.rail .slot__title::before {
  content: counter(slot, decimal-leading-zero);
  display: block;
  margin-bottom: 0.2rem;
  color: var(--playhead);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.1em;
}


/* --------------------------------------------------------------------------
   8. Lightbox (the larger player)
   Uses the browser's built-in <dialog>, so Escape closes it and focus
   returns to the slot you opened.
   -------------------------------------------------------------------------- */
.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop {
  background: rgba(5, 6, 10, 0.9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.lightbox[open]::backdrop { animation: fade-in 0.3s ease; }
.lightbox[open] .lightbox__inner { animation: lightbox-in 0.45s var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes lightbox-in { from { opacity: 0; transform: scale(0.94) translateY(16px); } }

.lightbox__inner {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  padding: 3.5rem 1rem 1.5rem;
}

/* --rw and --rh (the shape) are set by JS to match the slot you clicked */
.lightbox__media {
  --rw: 16;
  --rh: 9;
  width: min(92vw, calc(78vh * var(--rw) / var(--rh)));
  aspect-ratio: var(--rw) / var(--rh);
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}
.lightbox__media video,
.lightbox__media iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.lightbox__title { font-family: var(--font-display); font-weight: 600; }

.lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: rgba(13, 15, 23, 0.8);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.3s var(--ease-out);
}
.lightbox__close:hover { border-color: var(--muted); transform: rotate(90deg); }


/* --------------------------------------------------------------------------
   9. Workflow, timeline and background sections
   -------------------------------------------------------------------------- */

/* Editing timeline: the structure of a 30-second ad, as an editor sees it.
   It's decorative (hidden from screen readers). */
.timeline {
  position: relative;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* Timecodes along the top */
.timeline__ruler {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.6rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.timeline__track {
  position: relative;
  height: 2.75rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

/* A clip is placed with two custom properties set in the HTML:
   --start (where it begins) and --len (how long), both as % of the track */
.clip {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: calc(var(--start) * 1%);
  width: calc(var(--len) * 1% - 4px);
  display: flex;
  align-items: center;
  padding-inline: 0.6rem;
  overflow: hidden;
  border-radius: 6px;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}
.clip--hook  { background: var(--playhead); }
.clip--body  { background: #d9def0; }
.clip--cta   { background: var(--ai); }
.clip--ai    { background: rgba(154, 171, 255, 0.18); border: 1px solid var(--ai); color: var(--ai); }
/* Audio clips carry a waveform that scrolls once the timeline plays */
.clip--audio {
  border: 1px solid var(--line);
  color: var(--muted);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='20' viewBox='0 0 72 20' fill='%23a3a9c0' fill-opacity='.35'%3E%3Crect x='0' y='7' width='3' height='6' rx='1.5'/%3E%3Crect x='6' y='3' width='3' height='14' rx='1.5'/%3E%3Crect x='12' y='6' width='3' height='8' rx='1.5'/%3E%3Crect x='18' y='1' width='3' height='18' rx='1.5'/%3E%3Crect x='24' y='5' width='3' height='10' rx='1.5'/%3E%3Crect x='30' y='2' width='3' height='16' rx='1.5'/%3E%3Crect x='36' y='7' width='3' height='6' rx='1.5'/%3E%3Crect x='42' y='0' width='3' height='20' rx='1.5'/%3E%3Crect x='48' y='4' width='3' height='12' rx='1.5'/%3E%3Crect x='54' y='6' width='3' height='8' rx='1.5'/%3E%3Crect x='60' y='2' width='3' height='16' rx='1.5'/%3E%3Crect x='66' y='7' width='3' height='6' rx='1.5'/%3E%3C/svg%3E") 0 center / 72px 100% repeat-x,
    var(--panel);
}
.timeline.is-playing .clip--audio { animation: wave 2.4s linear infinite; }
@keyframes wave { to { background-position: -72px center, 0 0; } }

/* Clips pop onto the tracks one by one as the timeline scrolls into view */
.js .timeline .clip {
  opacity: 0;
  transform: scaleX(0.6);
  transform-origin: 0 50%;
}
.js .timeline.is-playing .clip {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: calc(var(--start) * 30ms);
}

/* The playhead waits at the start. When the timeline scrolls into view,
   JS adds .is-playing and it sweeps across once, then fades out. */
.timeline__playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--playhead);
  box-shadow: 0 0 14px var(--playhead);
}
/* Small triangle on top of the playhead line */
.timeline__playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border: 6px solid transparent;
  border-top-color: var(--playhead);
}
.timeline.is-playing .timeline__playhead {
  animation: playhead-sweep 4.5s cubic-bezier(0.45, 0.05, 0.3, 1) 0.2s both;
}
@keyframes playhead-sweep {
  0%   { left: 0;    opacity: 1; }
  90%  { left: 100%; opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.workflow__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: 3rem;
}

/* The workflow really is a sequence, so these steps are numbered */
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
  counter-increment: step;
}
/* A pink line draws across the top of each step as it appears */
.steps li::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 1px;
  background: var(--playhead);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1s var(--ease-out);
  transition-delay: calc(var(--d, 0ms) + 200ms);
}
.steps li.is-in::after { transform: scaleX(1); opacity: 0; transition: transform 1s var(--ease-out) calc(var(--d, 0ms) + 200ms), opacity 0.6s 1.4s; }
.steps li::before {
  content: counter(step);
  color: var(--playhead);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  transition: transform 0.3s var(--ease-out);
}
.steps li:hover::before { transform: translateX(6px); }
.steps h3 { font-size: 1.2rem; }
.steps p  { margin-top: 0.25rem; color: var(--muted); }

.tools h3 { font-size: 1.2rem; }
.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.tool-list li {
  padding: 0.35rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 0.95rem;
  transition: border-color 0.2s, color 0.2s, transform 0.25s var(--ease-out), background-color 0.2s;
}
.tool-list li:hover {
  border-color: var(--ai);
  color: var(--ai);
  background: rgba(154, 171, 255, 0.08);
  transform: translateY(-3px) rotate(-2deg);
}
.tools p { margin-top: 1.25rem; color: var(--muted); }

/* Background: groups of rows (experience, projects, skills) */
.group { margin-top: 3.5rem; }
.group__title { font-size: 1.5rem; }

.row {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 0.5rem 2rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
  transition: background-color 0.3s, padding-inline 0.3s var(--ease-out);
}
.row:hover {
  padding-inline: 0.75rem;
  background: linear-gradient(90deg, rgba(255, 77, 141, 0.07), transparent 70%);
}
.group__title + .row { margin-top: 1rem; }
.row__label { color: var(--muted); font-size: 0.95rem; }
.row__body h4 { margin: 0; font-family: var(--font-display); font-size: 1.1rem; }
.row__body p  { margin-top: 0.3rem; max-width: 66ch; }


/* --------------------------------------------------------------------------
   10. Contact and footer
   -------------------------------------------------------------------------- */
.contact { overflow: hidden; padding-top: clamp(2.5rem, 5vw, 4rem); }
.contact__location { margin-top: 1.5rem; color: var(--muted); }

.site-footer {
  padding-block: 1.5rem 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 0.3em; }

.motion-btn {
  padding: 0.1rem 0.7rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.motion-btn:hover { border-color: var(--muted); }
.motion-btn[aria-pressed="true"] { color: var(--playhead); border-color: var(--playhead); }


/* --------------------------------------------------------------------------
   11. Small screens, pause switch and reduced motion
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hud-tc { display: none; }
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .stage { max-width: 380px; margin-top: 1.5rem; }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .workflow__grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .clip { font-size: 0.7rem; padding-inline: 0.35rem; }

  /* Header: use initials so brand and links fit on one line */
  .brand__full  { display: none; }
  .brand__short { display: inline; }
  .site-nav { gap: 1.1rem; }
  .site-nav a { font-size: 0.9rem; }

  /* Showreel: a taller frame reads better on a narrow screen */
  :root { --cinema-ratio: 16 / 9; }
}

/* Very narrow phones: tighten the header so brand and links still fit */
@media (max-width: 400px) {
  .site-header__inner { gap: 0.75rem; }
  .site-nav { gap: 0.8rem; }
  .site-nav a { font-size: 0.85rem; }
}

/* Smallest phones (320px wide) */
@media (max-width: 360px) {
  .site-header__inner { gap: 0.5rem; }
  .site-nav { gap: 0.6rem; }
  .site-nav a { font-size: 0.78rem; }
}

/* Touch screens have no hover, so the sound button isn't needed there
   (tapping a video opens the larger player with full controls) */
@media (hover: none) {
  .slot__sound { display: none; }
  .btn:hover { transform: none; }
}

/* The "Motion: On/Off" switch in the footer freezes every animation */
.is-paused *,
.is-paused *::before,
.is-paused *::after { animation-play-state: paused !important; }

/* Visitors who ask their device for less motion get a still page:
   no intro, no looping animation, everything simply visible. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .preloader { display: none !important; }
  .js [data-reveal],
  .js .line > span,
  .js .hero__role,
  .js .hero__lead,
  .js .hero .actions,
  .js .hud,
  .js .stage,
  .js .timeline .clip { opacity: 1; transform: none; }
  .timeline__playhead { left: 18%; }
  .steps li::after { display: none; }
  body::after { display: none; }
}
