:root {
  --bg: #f7f7f7;
  --ink: #000;
  --muted: #9b9c96;
  --muted-2: #767773;
  --chip: #f1f1f1;
  --dark: #0b0b0b;
  --dark-chip: #1b1b1b;
  --red: #d6251e;
  --yellow: #f8cf5b;

  --gutter: 60px;
  --gap: 10px;
  --row-gap: 120px;
  --section-gap: 220px;

  --display: 62px;
  --display-lh: .85;
  --display-ls: -0.035em;

  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* SMPTE color bars — the "TV" in TMTV */
  --bars: linear-gradient(90deg,
    #c0c0c0 0 14.28%, #c0c000 0 28.57%, #00c0c0 0 42.85%, #00c000 0 57.14%,
    #c000c0 0 71.42%, #c00000 0 85.71%, #0000c0 0 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: 100px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--red); color: #fff; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------- Wordmark ---------- */
.wordmark {
  font-weight: 900;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.02em;
  line-height: .88;
  white-space: nowrap;
}
.wordmark .tv { position: relative; display: inline-block; }
.wordmark .tv::after {
  content: "TV";
  position: absolute; inset: 0;
  background: var(--bars);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  opacity: 0;
  transition: opacity .15s steps(2);
}
.wordmark:hover .tv::after,
.wordmark:focus-visible .tv::after { opacity: 1; animation: jitter .4s steps(3) infinite; }
@keyframes jitter {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-0.02em, 0.01em); }
  66% { transform: translate(0.015em, -0.01em); }
  100% { transform: translate(0, 0); }
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: grid;
  grid-template-columns: 230px 1fr auto;
  align-items: center;
  padding: 20px var(--gutter);
  color: #fff;
  mix-blend-mode: difference;
  transition: transform .5s var(--ease), opacity .3s var(--ease);
}
.site-header.is-hidden { transform: translateY(-100%); opacity: 0; }
.site-header .wordmark { font-size: 44px; justify-self: start; }
.nav { display: flex; gap: 28px; }
.nav a, .contact-link {
  font-size: 20px; letter-spacing: -0.03em;
  transition: opacity .25s var(--ease);
}
.nav a:hover, .contact-link:hover { opacity: .55; }
.nav a:active, .contact-link:active { opacity: .35; }
.menu-btn { display: none; }

/* ---------- Layout ---------- */
main { padding: 124px var(--gutter) 0; }
.display {
  font-size: var(--display);
  line-height: var(--display-lh);
  letter-spacing: var(--display-ls);
  font-weight: 400;
  margin: 0;
}
.muted { color: var(--muted); }
.link-muted { color: var(--muted); transition: color .25s var(--ease); }
.link-muted:hover { color: var(--ink); }
.link-muted:active { opacity: .6; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: block;
  width: min(1116px, 100%);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: var(--red);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.hero:active { opacity: .9; }

@keyframes tune {
  0%   { opacity: .95; transform: translateX(0); }
  20%  { opacity: .55; transform: translateX(-1.5%); }
  40%  { opacity: 1;   transform: translateX(1%); }
  60%  { opacity: .7;  transform: translateX(-.5%); }
  80%  { opacity: .9;  transform: translateX(2%); }
  100% { opacity: .95; transform: translateX(0); }
}

/* ---------- Intro ---------- */
.intro {
  display: grid; grid-template-columns: auto minmax(0, auto); justify-content: space-between; gap: 24px 56px; align-items: center;
  width: min(1116px, 100%); margin: 72px auto 0;
}
.intro-slogan {
  margin: 0; font-weight: 400;
  font-size: clamp(64px, 8.4vw, 124px); line-height: .85; letter-spacing: -0.045em;
}
.intro-print {
  margin: 0; max-width: 24ch;
  font-size: 36px; line-height: 1.15; letter-spacing: -0.025em; color: var(--muted-2);
  text-wrap: pretty;
}
/* Client names in full ink so they stand out from the grey */
.intro-print b { font-weight: 400; color: var(--ink); }

/* ---------- Section header (title + list) ---------- */
.section-head {
  display: grid;
  grid-template-columns: 335px 1fr auto;
  align-items: start;
  margin: var(--section-gap) 0 160px;
}
.section-head .view-all { font-size: 20px; letter-spacing: -0.03em; padding-top: 6px; }
.list {
  display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: 10px;
  font-size: 20px; line-height: .88; letter-spacing: -0.03em;
  margin-right: 202px;
}
.list dt { color: var(--ink); }
.list dd { margin: 0; color: var(--muted); display: flex; flex-direction: column; }

/* ---------- Channel bar: red hairline + CH number (TV channel guide) ---------- */
.ch {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  border-top: 1px solid var(--red);
  padding-top: 10px; margin-bottom: 64px;
  font-family: var(--mono); font-size: 13px; line-height: 1; text-transform: uppercase;
  color: var(--red);
}
.ch span:last-child { color: var(--muted-2); }
.stop-motion .ch span:last-child { color: #6f706b; }

/* ---------- On-air crawl ---------- */
.crawl {
  position: relative;
  margin: var(--section-gap) calc(var(--gutter) * -1) 0;
  background: var(--red); color: #fff;
  overflow: hidden;
}
.crawl + .stop-motion { margin-top: 0; }
.crawl-label {
  position: absolute; inset: 0 auto 0 0; z-index: 1;
  display: flex; align-items: center; gap: 9px;
  padding: 0 22px 0 var(--gutter);
  background: var(--red);
  box-shadow: 18px 0 18px -6px var(--red);
  font-family: var(--mono); font-size: 13px; text-transform: uppercase;
}
.crawl-label::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: #fff;
  animation: blink 1.2s steps(2) infinite;
}
.crawl-track {
  display: flex; width: max-content;
  padding: 15px 0 14px;
  animation: crawl 48s linear infinite;
}
.crawl:hover .crawl-track { animation-play-state: paused; }
.crawl-track span {
  display: flex; align-items: center;
  font-size: 20px; letter-spacing: -0.03em; white-space: nowrap;
}
.crawl-track span::after {
  content: ""; width: 6px; height: 6px; margin: 0 26px; border-radius: 50%;
  background: currentColor; opacity: .55;
}
@keyframes crawl { to { transform: translateX(-50%); } }

/* ---------- Grid size toggle ---------- */
.view-toggle {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 20px; letter-spacing: -0.03em; padding-top: 6px;
  color: var(--muted);
}
.view-toggle span { margin-right: 8px; }
.view-toggle i { font-style: normal; }
.view-toggle button { color: inherit; transition: color .25s var(--ease), opacity .25s var(--ease); }
.view-toggle button:hover, .view-toggle button[aria-pressed="true"] { color: var(--ink); }
.view-toggle button:active { opacity: .5; }
.stop-motion .view-toggle { color: #6f706b; padding-top: 45px; } /* lines up with the title, under the "Frame by frame" label */
.stop-motion .view-toggle button:hover, .stop-motion .view-toggle button[aria-pressed="true"] { color: #fff; }

/* ---------- Work grid ---------- */
.row { display: grid; gap: var(--gap); align-items: start; margin-bottom: var(--row-gap); }
.row-full { grid-template-columns: 1fr; }
/* Same footprint as the hero reel */
.row-hero { grid-template-columns: 1fr; width: min(1116px, 100%); margin-inline: auto; }
.row-center { grid-template-columns: 1fr; width: min(1100px, 100%); margin-inline: auto; }
/* Column widths proportional to aspect ratios (2:1 and 4:5) so both tiles share one height and captions line up */
.row-pair { grid-template-columns: 2fr .8fr; }
.row-three { grid-template-columns: repeat(3, 1fr); }

.avalon-stage video { width: 100%; height: auto; aspect-ratio: 21 / 9; object-fit: contain; }

.tile { margin: 0; }
.tile-btn {
  display: block; width: 100%;
  border-radius: 4px; overflow: hidden;
  background: #e6e6e3;
  cursor: pointer;
}
.tile-btn video, .tile-btn img {
  width: 100%; height: auto;
  aspect-ratio: var(--ar);
  object-fit: cover;
  transform: scale(1);
  transition: transform .9s var(--ease), opacity .4s var(--ease);
}
.tile-btn:hover video { transform: scale(1.015); }
.tile-btn:active video { transform: scale(.995); }
.tile figcaption { padding-top: 22px; }
.tile h3 {
  margin: 0 0 12px;
  font-size: 16px; font-weight: 400; letter-spacing: -0.02em;
  color: var(--muted-2);
}
.tile h3 b { font-weight: 400; color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; list-style: none; }
.tags li {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0;
  text-transform: uppercase;
  padding: 6px 7px 5px;
  background: var(--chip);
  color: var(--muted-2);
  border-radius: 2px;
}

/* ---------- Stop Motion (dark room) ---------- */
.stop-motion {
  margin: var(--section-gap) calc(var(--gutter) * -1) 0;
  padding: 160px var(--gutter) 40px;
  background: var(--dark);
  color: #fff;
}
.stop-motion .section-head { margin-top: 0; }
.stop-motion .list dt { color: #fff; }
.stop-motion .list dd, .stop-motion .muted { color: #6f706b; }
.stop-motion .link-muted { color: #6f706b; }
.stop-motion .link-muted:hover { color: #fff; }
.stop-motion .tile h3 { color: #8a8b86; }
.stop-motion .tile h3 b { color: #fff; }
.stop-motion .tags li { background: var(--dark-chip); color: #8a8b86; }
.stop-motion .tile-btn { background: #161616; }
.rec {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; text-transform: uppercase;
  color: #8a8b86; margin-bottom: 26px;
}
.rec::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--red);
  animation: blink 1.2s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.sm-hero { width: min(760px, 100%); margin: 0 auto var(--row-gap); }
/* Square, 3:4, square: column widths follow the aspect ratios so all three share one height */
.sm-squares { display: grid; grid-template-columns: 1fr .75fr 1fr; width: min(1010px, 100%); margin: 0 auto 80px; gap: var(--gap); }
.sm-verticals { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap); margin-bottom: var(--row-gap); }
.sm-verticals[data-cols="2"] { grid-template-columns: repeat(2, 1fr); row-gap: 56px; }
.sm-verticals[data-cols="3"] { grid-template-columns: repeat(3, 1fr); row-gap: 48px; }
.sm-verticals[data-cols="6"] { grid-template-columns: repeat(6, 1fr); }
.sm-verticals[data-cols="2"] .tile h3 { font-size: 16px; }
.sm-verticals .tile h3 { font-size: 14px; }
.sm-verticals figcaption { padding-top: 14px; }

/* ---------- Capabilities ---------- */
.capabilities { display: grid; grid-template-columns: 1fr auto; align-items: start; margin: var(--section-gap) 0 0; }
.capabilities .list { margin-right: 236px; }

/* ---------- Contact ---------- */
.contact { margin: var(--section-gap) 0 0; }
.contact a { display: inline-block; }

/* ---------- Footer ---------- */
.site-footer { padding: 220px var(--gutter) 20px; }
.footer-mark {
  position: relative;
  display: block;
  width: fit-content;
  font-size: calc((100vw - var(--gutter) * 2) * 0.27);
}
/* Hover: whole wordmark tunes into color bars with scanlines, same glitch as the hero reel */
.footer-mark .tv::after { content: none; }
.footer-mark::after {
  content: "TMTV";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 2px, transparent 2px 5px),
    var(--bars);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s steps(2);
}
.footer-mark:hover::after,
.footer-mark:focus-visible::after { opacity: 1; animation: tune .5s steps(1) infinite; }
.footer-meta {
  display: grid; grid-template-columns: 660px 330px 1fr;
  margin-top: 24px;
  font-size: 16px; line-height: 1; letter-spacing: -0.02em;
}
.footer-meta ul { list-style: none; margin: 0; padding: 0; }
.footer-meta a { transition: opacity .25s var(--ease); }
.footer-meta a:hover { opacity: .55; }


/* ---------- Player (lightbox) ---------- */
.player {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #0b0b0b;
  color: #fff;
}
.player::backdrop { background: transparent; }
.player[open] { display: grid; grid-template-rows: auto 1fr; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.player-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px var(--gutter);
  font-size: 20px; letter-spacing: -0.03em;
}
.player-bar span { color: #8a8b86; }
.player-bar button { transition: opacity .25s var(--ease); }
.player-bar button:hover { opacity: .55; }
.player { overflow: hidden; }
.player-stage { display: grid; place-items: center; padding: 0 var(--gutter) 32px; min-height: 0; }
/* Every video (vertical, square or wide) fits the screen with no scrolling: viewport minus the 62px bar and bottom padding */
.player-stage video {
  width: auto; height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 62px - 32px);
  border-radius: 4px; background: #000;
}

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  :root { --display: 48px; }
  .site-header { grid-template-columns: auto 1fr auto; gap: 40px; }
  .list, .capabilities .list { margin-right: 0; }
  .section-head { grid-template-columns: 1fr auto; }
  .section-head .view-all { display: none; }
  .sm-verticals { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
  .footer-meta { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 720px) {
  :root { --gutter: 20px; --display: 28px; --display-lh: .92; --row-gap: 56px; --section-gap: 120px; }
  .site-header { grid-template-columns: 1fr auto; }
  .site-header .wordmark { font-size: 36px; }
  .nav, .site-header .contact-link { display: none; }
  .menu-btn {
    display: grid; place-items: center;
    width: 52px; height: 32px; border-radius: 16px;
    background: rgba(255, 255, 255, .12);
  }
  .menu-btn span { width: 18px; height: 2px; background: #fff; box-shadow: 0 6px 0 #fff; transform: translateY(-3px); }
  main { padding-top: 104px; }
  /* Phones: keep the films' wide shape and show each one whole (thin black bars on the few that aren't exactly 16:9) */
  .hero { background: #000; }
  .hero video { object-fit: contain; }
  .intro { grid-template-columns: 1fr; margin-top: 48px; }
  .intro-print { font-size: 24px; }
  .section-head { grid-template-columns: 1fr; gap: 28px; margin-bottom: 56px; }
  .list { font-size: 16px; }
  .row-pair, .row-three { grid-template-columns: 1fr; }
  .avalon-stage video { aspect-ratio: 16 / 9; }
  .row { row-gap: 40px; }
  .stop-motion { padding-top: 100px; }
  .sm-squares { grid-template-columns: 1fr; row-gap: 40px; }
  .sm-verticals, .sm-verticals[data-cols] { grid-template-columns: 1fr 1fr; }
  .view-toggle { display: none; }
  .ch { margin-bottom: 36px; font-size: 12px; }
  .crawl-track span { font-size: 16px; }
  .crawl-track { padding: 12px 0 11px; }
  .capabilities { grid-template-columns: 1fr; gap: 28px; }
  .site-footer { padding-top: 120px; }
  .footer-meta { grid-template-columns: 1fr; gap: 16px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Sub-pages ---------- */
.section-head.page-head { margin-top: 40px; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
/* Stop Motion link lands flush on the dark section */
#stop-motion { scroll-margin-top: 0; }
/* 3D Design link: land so the full Foams tile + caption fits on screen */
[id="3d-design"] { scroll-margin-top: 30px; }

/* ---------- Index page: channel guide (work.html) ---------- */
.page-guide { background: var(--dark); color: #fff; }
.page-guide .link-muted { color: #6f706b; }
.page-guide .link-muted:hover { color: #fff; }
.page-guide .ch span:last-child { color: #6f706b; }

/* The "TV": fixed behind everything, shows the hovered channel */
.guide-stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #000; pointer-events: none; transition: opacity .4s var(--ease); }
.guide-stage video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; transition: opacity .35s var(--ease);
}
/* Vertical and square films sit to the right of the list instead of being cropped */
.guide-stage video[data-fit="contain"] { object-fit: contain; object-position: 82% 50%; }
.guide-stage.has-signal video { opacity: 1; }
/* Standby: dim color bars, like a channel with no signal */
.guide-bars {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .35) 0 2px, transparent 2px 5px), var(--bars);
  opacity: .1; transition: opacity .35s var(--ease);
}
.guide-stage.has-signal .guide-bars, .guide-stage.is-live .guide-bars { opacity: 0; }
.guide-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .25) 55%, rgba(0, 0, 0, .1) 100%),
    linear-gradient(to top, rgba(0, 0, 0, .6), transparent 40%);
}
/* Channel-change burst: bars + scanlines + noise, jittering for a split second */
.guide-static {
  position: absolute; inset: -40px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .4) 0 2px, transparent 2px 4px),
    var(--bars);
  opacity: 0;
}
.guide-stage.is-tuning .guide-static { opacity: .9; animation: tune-static .24s steps(4) infinite; }
@keyframes tune-static {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-18px, 9px); }
  50% { transform: translate(12px, -14px); }
  75% { transform: translate(-6px, 16px); }
  100% { transform: translate(0, 0); }
}
/* On-screen display, top right, like a TV's channel readout */
.guide-osd {
  position: absolute; top: 96px; right: var(--gutter);
  display: grid; justify-items: end; gap: 8px;
  font-family: var(--mono); text-transform: uppercase; color: #fff;
  text-shadow: 0 0 12px rgba(0, 0, 0, .5);
}
.guide-osd-ch { font-size: 30px; line-height: 1; }
.guide-osd-name { font-size: 13px; color: rgba(255, 255, 255, .7); }

.guide { position: relative; z-index: 1; }
.guide-head { display: grid; grid-template-columns: 1fr auto; align-items: end; margin: 40px 0 72px; }
.guide-head .display { font-size: clamp(64px, 10vw, 150px); }
.guide-hint { margin: 0; font-size: 20px; letter-spacing: -0.03em; color: #8a8b86; padding-bottom: 6px; }

.guide-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.guide-row {
  display: grid; grid-template-columns: 90px auto 1fr; align-items: baseline;
  width: 100%; padding: 14px 0 12px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  text-align: left; cursor: pointer;
  transition: opacity .3s var(--ease);
}
.guide-num { font-family: var(--mono); font-size: 13px; color: #8a8b86; transition: color .2s var(--ease); }
.guide-title {
  font-size: clamp(28px, 3.4vw, 48px); line-height: 1; letter-spacing: -0.035em;
  color: rgba(255, 255, 255, .62);
  transition: transform .5s var(--ease);
}
.guide-title b { font-weight: 400; color: #fff; }
.guide-tags { margin-left: 28px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: #8a8b86; }
/* While surfing: the live channel stays bright, the rest fade back */
.guide-list.is-surfing .guide-row { opacity: .28; }
.guide-list.is-surfing .guide-row.is-on { opacity: 1; }
.guide-row.is-on .guide-num { color: var(--red); }
.guide-row.is-on .guide-title { transform: translateX(14px); }
.guide-row:active .guide-title { transform: translateX(8px); }
.guide-row:focus-visible { outline-offset: -2px; }
.page-guide .contact { position: relative; }

@media (max-width: 720px) {
  .guide-head { grid-template-columns: 1fr; gap: 16px; margin-bottom: 40px; }
  .guide-hint { font-size: 16px; }
  .guide-row { grid-template-columns: 44px 1fr; row-gap: 6px; }
  .guide-tags { grid-column: 2; margin-left: 0; }
  .guide-osd { top: 84px; }
  .guide-osd-ch { font-size: 22px; }
  .guide-stage video[data-fit="contain"] { object-position: 50% 50%; }
  .guide-scrim { background: rgba(0, 0, 0, .6); }
  .guide-list.is-surfing .guide-row { opacity: .4; }
}

/* ---------- Project page (latte.html): MW.S Seed structure + Avalanche credits/pager ---------- */
.proj-head { margin: 40px 0 0; min-height: 34vh; }
.proj-title {
  margin: 0; font-weight: 400;
  font-size: clamp(40px, 6.1vw, 92px); line-height: .9; letter-spacing: -0.04em;
  text-wrap: balance;
}
.proj-title span { display: block; }
.proj-title span + span { transition-delay: .12s; }

.proj-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin: 0 0 32px; padding-top: 12px;
  border-top: 1px solid var(--ink);
  font-size: 16px; line-height: 1.15; letter-spacing: -0.02em;
}
.proj-meta dt { color: var(--muted); }
.proj-meta dd { margin: 0; }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; background: var(--c); vertical-align: 0; }

.proj-film { position: relative; display: block; width: 100%; border-radius: 4px; overflow: hidden; background: #111; cursor: pointer; }
.proj-film video { width: 100%; aspect-ratio: var(--ar, 16 / 9); object-fit: cover; transition: transform .9s var(--ease); }
.proj-film:hover video { transform: scale(1.01); }
.play-pill {
  position: absolute; left: 50%; top: 50%;
  padding: 12px 22px; border-radius: 999px;
  background: rgba(255, 255, 255, .22); color: #fff;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: 16px; letter-spacing: -0.02em;
  transform: translate(-50%, -50%);
  transition: transform .4s var(--ease), opacity .3s var(--ease);
}
.proj-film:hover .play-pill { transform: translate(-50%, -50%) scale(1.08); }
.proj-film:active .play-pill { transform: translate(-50%, -50%) scale(.96); }

/* Chapters: one centered statement, a "+" to read more, then the media */
.chapter { margin-top: var(--section-gap); }
.chapter-title {
  max-width: 1120px; margin: 0 auto; text-align: center; font-weight: 400;
  font-size: clamp(34px, 5vw, 76px); line-height: .95; letter-spacing: -0.04em;
  text-wrap: balance;
}
.more {
  display: grid; place-items: center;
  width: 46px; height: 46px; margin: 28px auto 0; border-radius: 50%;
  background: #ebebe8;
  transition: transform .4s var(--ease), background-color .25s var(--ease);
}
.more span, .more span::after { display: block; width: 14px; height: 1.5px; background: var(--ink); }
.more span::after { content: ""; transform: rotate(90deg); transition: transform .4s var(--ease); }
.more:hover { transform: scale(1.08); }
.more:active { transform: scale(.94); }
.more[aria-expanded="true"] span::after { transform: rotate(0deg); }
.chapter-more {
  max-width: 560px; margin: 22px auto 0; text-align: center;
  font-size: 20px; line-height: 1.35; letter-spacing: -0.02em; color: var(--muted-2);
  animation: rise .6s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.media { margin: 0; border-radius: 4px; overflow: hidden; background: #e6e6e3; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media-full { margin-top: 120px; }
.media-full img { aspect-ratio: 16 / 9; }

.split { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); margin-top: 120px; align-items: stretch; }
.media-full + .split { margin-top: var(--gap); }
.split > .media img { aspect-ratio: 4 / 3; }
.split-side { display: grid; grid-template-rows: auto 1fr; gap: var(--gap); }
.split-side .media img { aspect-ratio: 4 / 3; }
.split-even { grid-template-columns: 1fr 1fr; }
.split-even > .media img { aspect-ratio: 1 / 1; }
.split-even .split-side .media img { aspect-ratio: 16 / 10; }
/* 16:9 still beside a 9:16 film, columns sized so both share one height */
.split-film { grid-template-columns: 1.7778fr .5625fr; }
.split-film > .media img { aspect-ratio: 16 / 9; }
.media-btn { display: block; padding: 0; cursor: pointer; }
.media-btn video { aspect-ratio: 9 / 16; transition: transform .9s var(--ease); }
.media-btn:hover video { transform: scale(1.02); }

.card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  min-height: 220px; padding: 32px 36px 28px;
  border-radius: 14px; background: #fff;
  box-shadow: 0 1px 2px rgba(70, 38, 25, .04), 0 12px 32px -18px rgba(70, 38, 25, .18);
}
.card p { margin: 0; font-size: 22px; line-height: 1.1; letter-spacing: -0.03em; }
.card span { font-size: 14px; color: var(--muted); }
.card-wide { min-height: 0; margin-top: var(--gap); flex-direction: row; align-items: end; }

/* "Too ___": a pinned scene, 7 beats long. Espresso dark until the latte floods up from the bottom */
.too { position: relative; height: 640vh; margin: var(--section-gap) calc(var(--gutter) * -1) 0; }
.too-sticky {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: grid; place-items: center;
  background: #462619; color: #f7ebdd;
}
.too-flood {
  position: absolute; inset: 0; background: #cbaa87;
  transform: scaleY(0); transform-origin: 50% 100%;
  transition: transform 1.3s cubic-bezier(.7, 0, .2, 1);
}
.too.is-flooded .too-flood { transform: scaleY(1); }
.too-line {
  position: absolute; margin: 0; text-align: center;
  font-size: clamp(56px, 11vw, 168px); line-height: .9; letter-spacing: -0.05em;
  opacity: 0; transform: translateY(60px);
  transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.too-line.is-on { opacity: 1; transform: none; }
.too-line.is-past { opacity: 0; transform: translateY(-60px); }
.too.is-flooded .too-line { color: #462619; }
.too-latte { font-size: clamp(96px, 21vw, 320px); }
/* The four "Too ___" lines sit left; their paint chip lands to the right */
.too-line[data-beat="0"], .too-line[data-beat="1"], .too-line[data-beat="2"], .too-line[data-beat="3"] {
  left: 8vw; text-align: left; font-size: clamp(56px, 9vw, 150px);
}
.too-latte small { display: block; margin-top: 18px; font-family: var(--mono); font-size: 16px; letter-spacing: 0; }
/* Paint chips: each one drops in behind its line, then gets flicked away */
.too-chip {
  position: absolute; right: 12vw; top: 50%;
  width: min(300px, 46vw); aspect-ratio: 3 / 4; padding: 0 0 18px;
  display: flex; align-items: end; justify-content: center;
  border-radius: 6px; background: var(--c);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55);
  font-family: var(--mono); font-size: 13px; text-transform: uppercase; color: rgba(0, 0, 0, .55);
  opacity: 0; transform: translate(0, 10%) rotate(10deg);
  transition: opacity .45s var(--ease), transform .8s var(--ease);
}
.too-chip.is-on { opacity: 1; transform: translate(0, -50%) rotate(-4deg); }
.too-chip.is-past { opacity: 0; transform: translate(60%, -90%) rotate(22deg); }

/* Palette: Latte / Espresso sets crossfade */
.palette { position: relative; margin-top: 120px; aspect-ratio: 2820 / 2236; border-radius: 4px; overflow: hidden; }
.palette-set {
  position: absolute; inset: 0;
  display: grid; grid-template-rows: 62.5fr 18.75fr 6.25fr;
  opacity: 0; transition: opacity .7s var(--ease);
}
.palette[data-mode="latte"] [data-set="latte"],
.palette[data-mode="espresso"] [data-set="espresso"] { opacity: 1; z-index: 1; }
.sw { position: relative; background: var(--c); }
.sw span, .sw code {
  position: absolute; left: 24px; bottom: 20px;
  font-size: 14px; color: rgba(0, 0, 0, .6);
}
.sw code { left: auto; right: 24px; font-family: var(--mono); font-size: 12px; opacity: 0; transition: opacity .25s var(--ease); }
.sw-main span { font-size: 22px; letter-spacing: -0.03em; }
.sw-main code, .sw:hover code { opacity: 1; }
[data-set="espresso"] .sw-main span, [data-set="espresso"] .sw-main code,
.sw[style*="#462619"] span, .sw[style*="#7a4c38"] span, .sw[style*="#7a4c38"] code { color: rgba(247, 235, 221, .8); }
.sw-row { display: grid; grid-template-columns: 1fr 1fr; }
.sw-strip { display: grid; grid-template-columns: 1fr 2fr 3fr 4fr 2fr 3fr 5fr 3fr; }
.sw-strip code { right: 50%; bottom: 50%; transform: translate(50%, 50%); white-space: nowrap; font-size: 10px; }
.palette-switch {
  position: absolute; z-index: 2; top: 20px; right: 20px;
  display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.palette-switch button {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; color: rgba(0, 0, 0, .65);
  transition: opacity .25s var(--ease), transform .3s var(--ease);
}
.palette-switch button[aria-pressed="true"] { background: #fff; color: #000; }
.palette[data-mode="espresso"] .palette-switch button[aria-pressed="false"] { color: rgba(247, 235, 221, .8); }
.palette-switch button:hover { opacity: .75; }
.palette-switch button:active { transform: scale(.95); }

.perfect { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--gap); }
.perfect-card {
  display: flex; align-items: end; justify-content: center;
  aspect-ratio: 2800 / 2768; padding-bottom: 6%;
  border-radius: 4px; background: var(--c);
  font-size: clamp(11px, 1vw, 15px); line-height: 1.2; letter-spacing: .06em; text-transform: uppercase; text-align: center;
  color: #fff;
}

/* Description + credits (Avalanche-style rows) */
.proj-info { display: grid; grid-template-columns: 1fr 1fr; column-gap: 120px; margin-top: var(--section-gap); }
.proj-copy p { margin: 0 0 1.1em; max-width: 620px; font-size: 20px; line-height: 1.35; letter-spacing: -0.02em; }
.proj-copy p:last-child { margin-bottom: 0; }
.credits { margin: 0; align-self: start; border-bottom: 1px solid #dcdcd8; }
.credits div { display: grid; grid-template-columns: 1fr 1fr; padding: 14px 0 12px; border-top: 1px solid #dcdcd8; font-size: 16px; letter-spacing: -0.02em; }
.credits dt { color: var(--muted); }
.credits dd { margin: 0; text-align: right; }
.credits .tbc { color: var(--muted); font-style: italic; }

/* Giant Previous / Next */
.pager { display: flex; justify-content: space-between; gap: 40px; margin-top: var(--section-gap); }
.pager-link {
  display: grid; gap: 8px;
  font-size: clamp(40px, 6vw, 96px); line-height: .9; letter-spacing: -0.045em;
  color: var(--muted);
  transition: color .3s var(--ease), transform .5s var(--ease);
}
.pager-link span { font-size: 16px; letter-spacing: -0.02em; }
.pager-next { text-align: right; }
.pager-link:hover { color: var(--ink); transform: translateX(-8px); }
.pager-next:hover { transform: translateX(8px); }
.pager-link:active { opacity: .6; }

@media (max-width: 1100px) {
  .proj-meta { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .proj-info { grid-template-columns: 1fr; row-gap: 56px; }
}
@media (max-width: 720px) {
  .proj-head { min-height: 0; margin-bottom: 72px; }
  .split, .split-even, .split-film { grid-template-columns: 1fr; margin-top: 56px; }
  .media-full { margin-top: 56px; }
  .palette { margin-top: 56px; aspect-ratio: 3 / 4; }
  .card { min-height: 0; gap: 28px; padding: 24px; }
  .card p { font-size: 18px; }
  .card-wide { flex-direction: column; align-items: start; }
  .too-chip { right: auto; left: var(--gutter); top: 18%; width: 38vw; }
  .too-line[data-beat="0"], .too-line[data-beat="1"], .too-line[data-beat="2"], .too-line[data-beat="3"] { left: var(--gutter); top: 62%; }
  .perfect { grid-template-columns: 1fr; }
  .pager { flex-direction: column; }
  .pager-next { text-align: left; }
}
/* ---------- Night project page (halloween-stop-motion.html): the stop-motion dark room, carried onto its own page ---------- */
.page-night { background: var(--dark); color: #fff; }
.page-night .proj-meta { border-top-color: rgba(255, 255, 255, .5); }
.page-night .proj-meta dt, .page-night .credits dt, .page-night .card span, .page-night .pager-link { color: #6f706b; }
.page-night .chapter-more { color: #8a8b86; }
.page-night .more { background: var(--dark-chip); }
.page-night .more span, .page-night .more span::after { background: #fff; }
.page-night .media, .page-night .proj-film { background: #161616; }
.page-night .card { background: #161616; box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -22px rgba(0, 0, 0, .8); }
.page-night .credits, .page-night .credits div { border-color: rgba(255, 255, 255, .14); }
.page-night .credits .tbc { color: #6f706b; }
.page-night .pager-link:hover { color: #fff; }
.page-night .link-muted { color: #6f706b; }
.page-night .link-muted:hover { color: #fff; }
.page-night .ch span:last-child { color: #6f706b; }

/* 3:4 film, sized to fit the screen height */
.proj-film-tall { width: min(100%, calc(86vh * .75)); margin-inline: auto; }
.proj-film-tall video { aspect-ratio: 3 / 4; }
/* 16:9 still beside a note card */
.split-wide > .media img { aspect-ratio: 16 / 9; }
/* Three 3:4 stills in story order */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-top: 120px; }
.trio .media img { aspect-ratio: 3 / 4; }
.trio .media:nth-child(2) { transition-delay: .1s; }
.trio .media:nth-child(3) { transition-delay: .2s; }
@media (max-width: 720px) {
  .trio { grid-template-columns: 1fr; margin-top: 56px; }
  .proj-film-tall { width: 100%; }
}

/* ---------- Campaign page (halloween-haul.html): two films, stills at their native ratios ---------- */
.chapter-more + .pair, .chapter-more + .proj-film { margin-top: 120px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--gap); }
.pair .media img, .duo .media img, .media-native img { height: auto; aspect-ratio: auto; }
.pair + .trio, .trio + .media-full, .pair + .media-full, .media-full + .duo { margin-top: var(--gap); }
/* The candy mountain: after a beat, someone peeks out from behind it */
.peek { position: relative; }
.peek img + img { position: absolute; inset: 0; height: 100%; opacity: 0; transition: opacity 1.2s var(--ease) .9s; }
.peek.is-peeking img + img { opacity: 1; }
/* Wide pack shot beside a 2:3 phone photo, columns sized so both share one height */
.duo { display: grid; grid-template-columns: 1.4564fr .6667fr; gap: var(--gap); }
.media-close { margin-top: var(--section-gap); }
@media (max-width: 720px) {
  .chapter-more + .pair, .chapter-more + .proj-film { margin-top: 56px; }
  .pair, .duo { grid-template-columns: 1fr; }
}

/* Tiles that open a project page instead of the player */
.case-link { margin-left: 10px; color: var(--muted); white-space: nowrap; transition: color .25s var(--ease); }
.case-link:hover { color: var(--ink); }
.case-link:active { opacity: .6; }
