/* ==========================================================================
   Crazy Family Productions — site styles
   Bright and warm: off-white paper, black type, and the two logo colours —
   mustard (fills, always with black text) and teal (fills; deep teal for text).
   ========================================================================== */

:root {
  --bg: #f7f4ee;          /* warm off-white */
  --surface: #fffdf9;
  --surface-2: #efeae0;
  --line: #ddd6c9;
  --text: #141414;
  --muted: #5e5a53;       /* 6.2:1 on --bg */
  --accent: #f9a621;      /* logo mustard — fills only (too light for text) */
  --accent-hover: #ffb847;
  --on-accent: #141414;   /* 8:1 on mustard */
  --teal: #00b7af;        /* logo teal — fills */
  --teal-ink: #007a71;    /* teal for text on --bg, 4.8:1 */
  --teal-deep: #0b4f4a;   /* dark teal panels, white text 9.4:1 */
  --focus: #007a71;
  --shadow: 0 18px 40px rgba(60, 45, 20, .14);

  --font-display: 'Archivo', 'Noto Sans TC', system-ui, sans-serif;
  --font-body: 'Space Grotesk', 'Noto Sans TC', system-ui, sans-serif;

  --gutter: clamp(44px, 4vw, 56px); /* wide enough to clear the left perforations */
  --max: 1320px;
  --radius: 14px;
  --radius-sm: 10px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --t-fast: 180ms;
  --t-med: 420ms;
  --t-slow: 900ms;

  --z-wall: 0;
  --z-content: 10;
  --z-top: 40;
  --z-menu: 50;
  --z-cursor: 90;
  --z-grain: 100;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang^="zh"] body { line-height: 1.75; letter-spacing: .02em; }
img { display: block; max-width: 100%; }
svg { width: 1.25em; height: 1.25em; flex: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
em { font-style: normal; color: var(--teal-ink); }
::selection { background: var(--accent); color: var(--on-accent); }

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

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--on-accent); padding: 10px 16px;
  border-radius: 8px; font-weight: 700; text-decoration: none;
  transition: top var(--t-fast);
}
.skip:focus { top: 16px; }

.label {
  margin: 0;
  font: 500 .75rem/1.4 var(--font-body);
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.label > span:first-child:not(:only-child) { color: var(--teal-ink); margin-right: .4em; }
html[lang^="zh"] .label { letter-spacing: .08em; font-size: .8125rem; }

/* ---------- buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  min-height: 44px; padding: 0 1.15em;
  border: 1px solid transparent; border-radius: 999px;
  font-weight: 700; font-size: .9375rem; text-decoration: none; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease-out);
  touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--text); }

.ctl {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  border: 0; background: var(--surface-2); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.ctl:hover { background: var(--line); }
.ctl:active { transform: scale(.94); }
.ctl svg { width: 20px; height: 20px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-top);
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px var(--gutter);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar::before {
  content: ''; position: absolute; inset: 0 0 -24px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(247,244,238,.94) 55%, rgba(247,244,238,0));
  opacity: 0; transition: opacity var(--t-med);
}
.topbar.solid::before { opacity: 1; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-family: var(--font-display); font-size: 1.125rem;
  min-height: 44px; padding: 6px 16px 6px 6px; border-radius: 18px;
  background: rgba(255,253,249,.8); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
@media (max-width: 640px) { .logo { padding: 6px; } }
.logo-mark { width: 44px; height: 44px; transition: transform var(--t-slow) var(--ease-out); }
.logo:hover .logo-mark { transform: rotate(-10deg) scale(1.06); }
.logo-word { display: grid; line-height: 1.05; }
.logo-word b { font-weight: 800; font-stretch: 90%; text-transform: uppercase; letter-spacing: .01em; }
.logo-word small { font: 600 .6875rem var(--font-body); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }

.controls {
  display: flex; align-items: center; gap: 6px;
  padding: 6px; border-radius: 18px;
  background: rgba(255,253,249,.8); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.ctl-cta { min-height: 44px; border-radius: 12px; }
.lang { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 2px; }
.lang button {
  min-width: 40px; height: 36px; border: 0; border-radius: 9px; background: transparent;
  font-weight: 700; font-size: .875rem; color: var(--muted); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.lang button:hover:not([aria-pressed="true"]) { color: var(--text); }
.ctl-sound .wave { opacity: .25; transition: opacity var(--t-fast); }
.ctl-sound[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.ctl-sound[aria-pressed="true"] .wave { opacity: 1; }
.ctl-menu[aria-expanded="true"] { background: var(--text); color: var(--bg); }

@media (max-width: 640px) {
  .ctl-cta { display: none; }
  .logo-word { display: none; }
}

/* ---------- menu overlay ---------- */
.menu {
  position: fixed; inset: 0; z-index: var(--z-menu);
  background: rgba(247,244,238,.97);
  display: grid; align-content: center; padding: 96px var(--gutter) 48px;
  backdrop-filter: blur(8px);
}
.menu[hidden] { display: none; }
.menu ol { list-style: none; margin: 0 auto; padding: 0; width: min(100%, var(--max)); }
.menu li { border-bottom: 1px solid var(--line); overflow: hidden; }
.menu a {
  display: flex; align-items: baseline; gap: 18px; padding: 10px 0;
  text-decoration: none; font: 800 clamp(2.2rem, 7vw, 5.5rem)/1.05 var(--font-display);
  font-stretch: 80%; text-transform: uppercase;
  animation: menuIn var(--t-med) var(--ease-out) both;
  transition: color var(--t-fast), padding var(--t-med) var(--ease-out);
}
.menu li:nth-child(2) a { animation-delay: 40ms; } .menu li:nth-child(3) a { animation-delay: 80ms; }
.menu li:nth-child(4) a { animation-delay: 120ms; } .menu li:nth-child(5) a { animation-delay: 160ms; }
.menu li:nth-child(6) a { animation-delay: 200ms; }
.menu a small { font: 500 .8rem var(--font-body); color: var(--teal-ink); letter-spacing: .1em; }
.menu a:hover { color: var(--teal-ink); padding-left: 12px; }
html[lang^="zh"] .menu a { font-family: 'Noto Sans TC', sans-serif; font-weight: 900; }
@keyframes menuIn { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- background motion (after the hero) ---------- */
.scroll-bg {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden;
  opacity: 0; transition: opacity var(--t-slow) var(--ease-out);
}
.scroll-bg.on { opacity: 1; }
.bg-reel { position: absolute; fill: currentColor; will-change: rotate; }
.bg-reel-1 { width: min(52vw, 640px); height: min(52vw, 640px); right: max(-18vw, -220px); top: 8vh; color: var(--accent); opacity: .13; }
/* composition: the big reel is cropped off the top-right corner and the big clapboard off the
   bottom-left, balancing on a diagonal; the small director's chair sits bottom-right on --set-floor */
.scroll-bg { --set-floor: 3vh; }
/* small chair standing on the set floor, bottom-right; sways gently with scroll */
.bg-chair { position: absolute; right: 7vw; bottom: var(--set-floor); width: min(11vw, 17vh, 140px); height: auto; aspect-ratio: 100 / 170; transform-origin: 50% 100%; color: #5e5a53; opacity: .14; will-change: transform; }
/* 35mm perforations down the left edge of the page. Tiles keep a 2:3 ratio so the
   hole scales evenly; --perf-pitch must match the tile height so main.js can loop
   the offset seamlessly. Each size stays inside the page gutter. */
.perfs {
  --perf-w: 20px; --perf-pitch: 30px; --perf-inset: 12px;
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
}
.perfs::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: var(--perf-inset); width: var(--perf-w);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 30'%3E%3Crect y='8' width='20' height='14' rx='3.5' fill='%23ddd6c9'/%3E%3C/svg%3E") 0 var(--perf-y, 0px) / var(--perf-w) var(--perf-pitch) repeat-y;
}
@media (max-width: 900px) { .perfs { --perf-w: 14px; --perf-pitch: 21px; --perf-inset: 8px; } }
@media (max-width: 640px) { .perfs { --perf-w: 10px; --perf-pitch: 15px; --perf-inset: 3px; } }
@media (max-width: 900px) { :root { --gutter: 36px; } }
@media (max-width: 640px) { :root { --gutter: 24px; } }
/* foreground prop caught at the edge of frame: the striped sticks stay in view, the slate runs off the bottom */
.bg-clap { position: absolute; left: -4vw; top: 30vh; width: min(60vw, 88vh, 820px); height: auto; aspect-ratio: 100 / 90; overflow: visible; /* the open arm swings above the viewBox */ rotate: -7deg; color: #8f897f; opacity: .15; }
.clap-arm { transform-box: view-box; transform-origin: 6px 20px; rotate: -18deg; }
.bg-clap.snap .clap-arm { animation: clap 900ms var(--ease-out); }
@keyframes clap {
  0% { rotate: -18deg; }
  18% { rotate: 0deg; }      /* clap! */
  28% { rotate: -3deg; }
  36% { rotate: 0deg; }
  100% { rotate: -18deg; }
}
@media (max-width: 640px) { .bg-clap { left: -12vw; top: auto; bottom: -10vh; width: 88vw; } }
@media (max-width: 640px) { .bg-chair { display: none; } }

/* ---------- progress / grain / cursor ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: var(--z-grain); }
.progress span { display: block; height: 100%; background: var(--teal); transform-origin: 0 50%; transform: scaleX(0); }

.grain {
  position: fixed; inset: -50%; z-index: var(--z-grain); pointer-events: none; opacity: .045; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 20% { transform: translate(-4%,3%); } 40% { transform: translate(3%,-5%); }
  60% { transform: translate(-6%,-2%); } 80% { transform: translate(5%,4%); } 100% { transform: translate(0,0); }
}

.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: grid; place-items: center;
    position: fixed; left: 0; top: 0; z-index: var(--z-cursor); pointer-events: none;
    width: 88px; height: 88px; margin: -44px 0 0 -44px;
    transform: translate3d(-200px,-200px,0);
    transition: scale var(--t-med) var(--ease-out);
    scale: 0;
  }
  .cursor.on { scale: 1; }
  .cur-icon { grid-area: 1 / 1; width: 88px; height: 88px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); transition: opacity var(--t-fast), scale var(--t-med) var(--ease-out); }
  .cursor .cur-reel { opacity: 0; scale: .6; }
  .cursor[data-mode="play"] .cur-cam { opacity: 0; scale: .6; }
  .cursor[data-mode="play"] .cur-reel { opacity: 1; scale: 1; }
  /* label sits inside the icon: in the reel's hub, or on the camera body (centre 33,39 of 88) */
  .cursor-label {
    grid-area: 1 / 1; position: relative; z-index: 1;
    font: 700 .6875rem/1 var(--font-body); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
    color: var(--text);
    transition: color var(--t-fast), translate var(--t-med) var(--ease-out);
  }
  .cursor:not([data-mode="play"]) .cursor-label { color: var(--accent); translate: -11px -5px; }
  html[lang^="zh"] .cursor-label { font-size: .75rem; letter-spacing: .08em; }
  [data-cursor] { cursor: none; }
  [data-cursor="drag"].dragging { cursor: grabbing; }
}

/* ---------- hero / 3D wall ---------- */
.hero { position: relative; height: 240vh; height: 240dvh; }
.hero-sticky { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.stage {
  position: absolute; inset: 0; z-index: var(--z-wall);
  perspective: 1100px; perspective-origin: 50% 50%;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.wall { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.tile {
  position: absolute; left: 0; top: 0;
  border-radius: var(--radius-sm); overflow: hidden; contain: paint;
  background: var(--surface);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 24px 48px rgba(60,45,20,.22);
}
.tile img {
  width: 100%; height: 100%; object-fit: cover; pointer-events: none;
  filter: saturate(.85);
  transition: filter var(--t-med), transform var(--t-slow) var(--ease-out);
}
.tile:hover img { filter: saturate(1.05); transform: scale(1.04); }
/* vertical videos in the grid: whole frame on top of a blurred copy (no bars, nothing cut) */
.card-media.is-vertical::before {
  content: ''; position: absolute; inset: -20px; background: var(--thumb) center / cover;
  filter: blur(18px) brightness(.85);
}
.card-media.is-vertical img { object-fit: contain; }
/* YouTube fallback stills carry black bars; `scale` composes with the hover transforms */
img.letterboxed { scale: 1.34; }
.tile .tile-cap {
  position: absolute; left: 12px; right: 12px; bottom: 10px;
  font: 600 .75rem/1.3 var(--font-body); letter-spacing: .04em;
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--t-fast), transform var(--t-med) var(--ease-out);
  color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.8);
}
.tile:hover .tile-cap { opacity: 1; transform: none; }

.hero-shade {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(ellipse 56% 48% at 50% 52%, rgba(247,244,238,.97), rgba(247,244,238,.8) 50%, rgba(247,244,238,0) 85%),
    linear-gradient(to bottom, rgba(247,244,238,.7), rgba(247,244,238,0) 20%, rgba(247,244,238,0) 75%, rgba(247,244,238,.95));
}
.hero-copy {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: grid; place-content: center; justify-items: center; text-align: center;
  padding: 0 var(--gutter);
  will-change: transform, opacity;
}
.kicker { margin: 0 0 18px; font-size: .8125rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hero-title {
  margin: 0; max-width: 12ch;
  font: 900 clamp(3rem, 10.5vw, 9.5rem)/.86 var(--font-display);
  font-stretch: 72%; text-transform: uppercase; letter-spacing: -.01em;
  text-wrap: balance;
}
.hero-title em { font-weight: 400; font-stretch: 125%; letter-spacing: -.04em; }
html[lang^="zh"] .hero-title { font-family: 'Noto Sans TC', sans-serif; font-weight: 900; line-height: 1.08; letter-spacing: .02em; max-width: 9em; font-size: clamp(2.6rem, 8.5vw, 7.5rem); }
html[lang^="zh"] .hero-title em { font-weight: 400; letter-spacing: 0; }
.hero-sub { margin: 22px 0 0; max-width: 34ch; font-size: clamp(1rem, 1.6vw, 1.25rem); color: var(--text); }

.hero-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px;
  padding: 0 var(--gutter) 22px;
}
.since { margin: 0; display: flex; align-items: center; gap: 8px; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.since svg { width: 14px; height: 14px; color: var(--accent); }
.scroll-cue { display: grid; justify-items: center; gap: 10px; text-decoration: none; }
.cue-dot { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); }
.cue-dot svg { animation: bob 1.8s var(--ease-in-out) infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }
.cue-text { font-size: .6875rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.spin { justify-self: end; display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(255,253,249,.8); border: 1px solid var(--line); }
@media (max-width: 640px) {
  .hero-foot { grid-template-columns: minmax(0, 1fr) auto; }
  .since { display: none; }
  .scroll-cue { justify-items: start; }
  .cue-text { white-space: normal; max-width: 22ch; }
}

/* ---------- sections ---------- */
.section { position: relative; z-index: var(--z-content); width: min(100% - 2 * var(--gutter), var(--max)); margin: 0 auto; padding: clamp(80px, 12vw, 160px) 0 0; }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 5vw, 56px); }
.h2 {
  margin: 0; font: 800 clamp(2.4rem, 6.5vw, 5.5rem)/.95 var(--font-display);
  font-stretch: 78%; text-transform: uppercase; letter-spacing: -.01em; text-wrap: balance;
}
.h2 em { font-weight: 400; font-stretch: 120%; }
.h3 { font: 800 clamp(1.6rem, 3.5vw, 2.6rem)/1 var(--font-display); font-stretch: 80%; text-transform: uppercase; margin: 0; }
html[lang^="zh"] .h2, html[lang^="zh"] .h3 { font-family: 'Noto Sans TC', sans-serif; font-weight: 900; line-height: 1.15; letter-spacing: .02em; }
html[lang^="zh"] .h2 em { font-weight: 400; }
.section-sub { margin: 0; max-width: 60ch; color: var(--muted); font-size: 1.0625rem; }

/* reveal on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- intro ---------- */
.intro { position: relative; z-index: var(--z-content); padding: clamp(60px, 10vw, 140px) 0 0; }
.manifesto {
  width: min(100% - 2 * var(--gutter), 1100px); margin: 0 auto;
  font: 700 clamp(1.75rem, 4.4vw, 3.6rem)/1.12 var(--font-display); font-stretch: 90%; letter-spacing: -.01em;
}
html[lang^="zh"] .manifesto { font-family: 'Noto Sans TC', sans-serif; font-weight: 700; line-height: 1.45; letter-spacing: .04em; }
.manifesto .w { opacity: .18; transition: opacity 300ms linear; }
.manifesto .w.lit { opacity: 1; }

.marquee { margin-top: clamp(64px, 9vw, 120px); border-block: 1px solid var(--line); padding: 22px 0; overflow: hidden; }
.marquee .label { width: min(100% - 2 * var(--gutter), var(--max)); margin: 0 auto 14px; }
.marquee-track { display: flex; width: max-content; animation: marquee 50s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee ul { display: flex; list-style: none; margin: 0; padding: 0; }
.marquee li {
  padding: 0 28px; white-space: nowrap;
  font: 700 clamp(1.25rem, 2.4vw, 2rem)/1.2 var(--font-display); font-stretch: 85%; text-transform: uppercase; color: var(--text);
}
.marquee li::after { content: '✳'; margin-left: 56px; color: var(--accent); font-size: .7em; vertical-align: middle; }
html[lang^="zh"] .marquee li { font-family: 'Noto Sans TC', sans-serif; text-transform: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- work ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  min-height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; font-weight: 500; font-size: .9375rem;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(16px, 2vw, 28px); grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.grid li { animation: cardIn var(--t-slow) var(--ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px); } }
.card { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.card-media { display: block; position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; contain: paint; background: var(--surface-2); box-shadow: 0 1px 0 var(--line); }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-out), filter var(--t-med); }
.card:hover .card-media img, .card:focus-visible .card-media img { transform: scale(1.05); }
.card:hover .card-media, .card:focus-visible .card-media { box-shadow: var(--shadow); }
.card-play {
  position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  transform: scale(.8); opacity: 0; transition: transform var(--t-med) var(--ease-out), opacity var(--t-fast);
}
.card:hover .card-play, .card:focus-visible .card-play { transform: none; opacity: 1; }
@media (hover: none) { .card-play { opacity: 1; transform: none; } }
.card-meta { display: flex; justify-content: space-between; gap: 16px; padding: 14px 2px 0; }
.card-title { margin: 0; font: 700 1.125rem/1.3 var(--font-body); }
.card-client { margin: 4px 0 0; color: var(--muted); font-size: .875rem; }
.card-cat { flex: none; font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.more-wrap { display: flex; justify-content: center; margin-top: 40px; }
.more-wrap[hidden] { display: none; }

/* ---------- services ---------- */
.svc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.svc { border-bottom: 1px solid var(--line); }
.svc-row {
  width: 100%; display: grid; grid-template-columns: 56px 1fr 44px; align-items: center; gap: 12px;
  min-height: 44px; padding: clamp(18px, 2.4vw, 28px) 0; border: 0; background: none; text-align: left; cursor: pointer;
}
.svc-no { font-size: .8125rem; color: var(--teal-ink); letter-spacing: .1em; }
.svc-name {
  font: 800 clamp(1.8rem, 5vw, 4.2rem)/1 var(--font-display); font-stretch: 78%; text-transform: uppercase;
  transition: color var(--t-fast), transform var(--t-med) var(--ease-out);
}
html[lang^="zh"] .svc-name { font-family: 'Noto Sans TC', sans-serif; font-weight: 900; line-height: 1.2; }
.svc-row:hover .svc-name { color: var(--teal-ink); transform: translateX(10px); }
.svc-plus { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); }
.svc-plus::before, .svc-plus::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; margin: -1px 0 0 -7px; background: currentColor; transition: transform var(--t-med) var(--ease-out); }
.svc-plus::after { transform: rotate(90deg); }
.svc-row[aria-expanded="true"] .svc-plus::after { transform: rotate(0); }
.svc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-med) var(--ease-out); }
.svc-body > * { overflow: hidden; }
.svc-row[aria-expanded="true"] + .svc-body { grid-template-rows: 1fr; }
.svc-body { grid-template-columns: 1fr; padding-left: 68px; }
.svc-body p { margin: 0; max-width: 60ch; font-size: 1.0625rem; color: var(--muted); min-height: 0; }
.svc-body .link { min-height: 0; }
.svc-row[aria-expanded="true"] + .svc-body { padding-bottom: 26px; }
.svc-row[aria-expanded="true"] + .svc-body p { margin-bottom: 10px; }
@media (max-width: 600px) { .svc-row { grid-template-columns: 36px 1fr 44px; } .svc-body { padding-left: 48px; } }
.link { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-ink); font-weight: 700; text-underline-offset: 4px; }
.post { margin: 28px 0 0; color: var(--muted); font-size: 1.0625rem; }
.post b { color: var(--text); }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.lead { margin: 0; font-size: clamp(1.15rem, 1.8vw, 1.45rem); line-height: 1.55; color: var(--text); }
.values { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.value { padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color var(--t-fast), transform var(--t-med) var(--ease-out); }
.value:hover { border-color: var(--teal); transform: translateX(-6px); }
.value h3 { margin: 0 0 6px; font: 700 1.125rem var(--font-body); }
.value p { margin: 0; color: var(--muted); }
.fests { margin-top: clamp(48px, 7vw, 88px); padding: 28px 0; border-block: 1px solid var(--line); }
.fests ul { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 0; }
.fests li { font: 600 clamp(1rem, 1.6vw, 1.25rem) var(--font-body); }
.fests li:not(:last-child)::after { content: '/'; margin: 0 16px; color: var(--accent); }
.fests small { color: var(--muted); font-weight: 400; }
.team-title { margin-top: clamp(64px, 9vw, 120px); margin-bottom: 28px; }
.team { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1024px) { .team { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .team { grid-template-columns: 1fr; } }
.member { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform var(--t-med) var(--ease-out), border-color var(--t-fast); }
.member:hover { transform: translateY(-6px) rotate(-.6deg); border-color: var(--text); box-shadow: var(--shadow); }
.mono {
  display: grid; place-items: center; aspect-ratio: 4 / 3; max-height: 220px; width: 100%; border-radius: var(--radius-sm); margin-bottom: 18px;
  background: var(--surface-2);
  font: 900 clamp(3.5rem, 7vw, 5.5rem)/1 var(--font-display); font-stretch: 70%; color: var(--teal-ink);
  transition: background var(--t-med);
}
.member:hover .mono { background: var(--accent); color: var(--on-accent); }
.member h4 { margin: 0; font-size: 1.125rem; }
.member h4 span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.member .role { margin: 4px 0 10px; color: var(--teal-ink); font-size: .875rem; font-weight: 500; }
.member p { margin: 0; color: var(--muted); font-size: .9375rem; }
.extended { margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; color: var(--text); }

/* ---------- studio & location ---------- */
/* studio gallery: tall clip on the left, four photos around it */
.studio-gallery {
  display: grid; gap: clamp(10px, 1.4vw, 18px); margin-bottom: clamp(40px, 6vw, 72px);
  grid-template-columns: .75fr 1.4fr 1fr; grid-auto-rows: clamp(180px, 20vw, 290px);
}
.sg { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--surface-2); }
.sg img, .sg video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-out); }
.sg:hover img { transform: scale(1.04); }
.sg figcaption {
  position: absolute; left: 12px; bottom: 12px; padding: 5px 11px; border-radius: 999px;
  background: rgba(20,20,20,.62); color: #fff; font-size: .8125rem; font-weight: 600;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none;
}
.sg-video { grid-column: 1; grid-row: 1 / span 2; }
.sg-set { grid-column: 2; grid-row: 1; }
.sg-interview { grid-column: 3; grid-row: 1; }
.sg-screening { grid-column: 2; grid-row: 2; }
.sg-onset { grid-column: 3; grid-row: 2; }
@media (max-width: 900px) {
  .studio-gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: clamp(150px, 30vw, 240px); }
  .sg-set { grid-column: 2; grid-row: 1; }
  .sg-interview { grid-column: 2; grid-row: 2; }
  .sg-screening { grid-column: 1; grid-row: 3; }
  .sg-onset { grid-column: 2; grid-row: 3; }
}
.studio-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
@media (max-width: 900px) { .studio-grid { grid-template-columns: 1fr; } }
.studio-copy { display: grid; gap: 26px; }
.studio-uses { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.studio-uses li { padding: 8px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .9375rem; }
.studio-kit h3 { margin: 0 0 12px; font: 700 1.125rem var(--font-body); }
.studio-kit ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.studio-kit li { display: flex; align-items: center; gap: 10px; color: var(--text); }
.studio-kit li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex: none; }
@media (max-width: 480px) { .studio-kit ul { grid-template-columns: 1fr; } }
.studio-card { border-radius: calc(var(--radius) + 6px); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.studio-map { display: block; width: 100%; height: auto; background: var(--surface-2); }
.map-label { font: 600 11px var(--font-body); fill: var(--muted); letter-spacing: .04em; }
.map-label-strong { fill: var(--text); font-weight: 800; font-size: 12px; }
.studio-address { padding: clamp(22px, 3vw, 32px); display: grid; gap: 10px; justify-items: start; }
.studio-address address { font-style: normal; font-size: 1.125rem; font-weight: 700; line-height: 1.45; }
.studio-mrt { margin: 0; color: var(--muted); }
.studio-phone { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 4px; font-weight: 700; color: var(--teal-ink); text-decoration: none; }
.studio-phone:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- workshop ---------- */
.ws-card { display: grid; grid-template-columns: 1fr 1.1fr; border-radius: calc(var(--radius) + 6px); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
@media (max-width: 900px) { .ws-card { grid-template-columns: 1fr; } }
.ws-media {
  min-height: 320px; position: relative;
  /* teal duotone of the PAN dance film still */
  background: url('https://i.vimeocdn.com/video/1820215685-ea05f89510070fa4e14c391b173ccfba0925493929ac998c6b5c9156bd414e51-d_1280x720') center / cover, var(--teal);
  background-blend-mode: luminosity;
}
.ws-copy { padding: clamp(28px, 5vw, 64px); display: grid; gap: 18px; align-content: center; }
.ws-list { display: grid; gap: clamp(16px, 2vw, 24px); }
.ws-copy .h3 { font-size: clamp(1.9rem, 4vw, 3.2rem); }
.ws-hosts { color: var(--muted) !important; font-size: .9375rem; }
.ws-hosts b { color: var(--text); }

/* upcoming event: a ticket stub with a torn perforated edge */
.ev-card {
  display: grid; grid-template-columns: minmax(150px, 220px) 1fr; overflow: hidden;
  border-radius: calc(var(--radius) + 6px); background: var(--surface); border: 1px solid var(--line);
}
.ev-stub {
  position: relative; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 28px 18px;
  background: var(--accent); color: var(--on-accent);
  /* punched holes down the tear line */
  -webkit-mask: radial-gradient(circle 5px at 100% 50%, transparent 98%, #000) right / 100% 18px repeat-y;
          mask: radial-gradient(circle 5px at 100% 50%, transparent 98%, #000) right / 100% 18px repeat-y;
}
.ev-stub::after { content: ''; position: absolute; top: 12px; bottom: 12px; right: 0; border-right: 2px dashed rgba(20,20,20,.3); }
.ev-stub-small { font: 700 .6875rem var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: #3a2f1c; }
.ev-stub-big { font: 800 clamp(2.6rem, 5vw, 3.6rem)/1 var(--font-display); font-stretch: 75%; letter-spacing: .02em; color: var(--text); rotate: -4deg; }
.ev-copy { padding: clamp(24px, 4vw, 44px); display: grid; gap: 14px; align-content: center; }
.ev-copy > p:not(.label) { margin: 0; max-width: 60ch; }
.ev-status { display: inline-flex; align-items: center; gap: 8px; color: var(--teal-ink); }
.ev-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(249,166,33,.25); }
.ev-cta { justify-self: start; }
@media (max-width: 640px) {
  .ev-card { grid-template-columns: 1fr; }
  .ev-stub {
    grid-auto-flow: column; align-items: baseline; gap: 14px; padding: 18px;
    -webkit-mask: radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) bottom / 18px 100% repeat-x;
            mask: radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) bottom / 18px 100% repeat-x;
  }
  .ev-stub::after { top: auto; left: 12px; right: 12px; bottom: 0; border-right: 0; border-bottom: 2px dashed rgba(20,20,20,.3); }
}
.ws-copy > p { margin: 0; color: var(--text); max-width: 56ch; }
.ws-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ws-tags li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .8125rem; }
.ws-date { color: var(--muted) !important; }
.ws-date b { color: var(--text); }
.ws-cta { justify-self: start; }

/* ---------- plan / quote builder ---------- */
.plan-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 960px) { .plan-grid { grid-template-columns: 1fr; } }
.planner { display: grid; gap: 14px; }
/* link to the budget guide page */
.estimate-cta {
  display: inline-flex; align-items: center; gap: 14px; justify-self: start; max-width: 100%;
  margin-top: 6px; padding: 12px 18px 12px 12px; border-radius: var(--radius);
  background: var(--teal-deep); color: #fff; text-decoration: none;
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med);
}
.estimate-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.estimate-cta b { color: var(--accent); }
.estimate-cta > svg { width: 20px; height: 20px; transition: transform var(--t-med) var(--ease-out); }
.estimate-cta:hover > svg { transform: translateX(4px); }
.estimate-cta-icon {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent); font: 800 .8125rem var(--font-display); font-stretch: 85%;
}
.opts-note { clear: both; margin: 12px 0 0; font-size: .9375rem; }
.opts-note a { color: var(--teal-ink); font-weight: 700; text-underline-offset: 3px; }
fieldset { margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
legend { float: left; width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 16px; padding: 0; font-weight: 700; font-size: 1.0625rem; }
legend small { font-weight: 400; color: var(--muted); }
.step { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: .8125rem; font-weight: 700; }
.opts { clear: both; display: flex; flex-wrap: wrap; gap: 8px; }
.opts label { position: relative; cursor: pointer; }
.opts input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opts span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); font-size: .9375rem;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.opts label:hover span { border-color: var(--text); }
.opts input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.opts input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.opts label:active span { transform: scale(.96); }
.fields { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; font-size: .875rem; color: var(--muted); }
.field-wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 400 1rem/1.5 var(--font-body);
  transition: border-color var(--t-fast);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--teal-ink); outline: none; box-shadow: 0 0 0 3px rgba(0,169,157,.22); }

.brief { position: sticky; top: 96px; }
.brief-inner { padding: 26px; border-radius: var(--radius); background: var(--teal-deep); color: #fff; }
.brief-inner .label { color: #cfe7e4; }
.brief-list { margin: 16px 0 0; display: grid; gap: 10px; min-height: 60px; }
.brief-list div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.18); animation: cardIn var(--t-med) var(--ease-out) both; }
.brief-list dt { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: #cfe7e4; padding-top: 3px; }
.brief-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.brief-empty { color: #cfe7e4; margin: 0; }
.brief-tip { margin: 16px 0 0; padding: 14px; border-radius: var(--radius-sm); background: rgba(255,255,255,.1); border-left: 3px solid var(--accent); font-size: .9375rem; }
.brief-tip:empty { display: none; }
.brief-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.brief-actions .btn-ghost { background: transparent; border-color: rgba(255,255,255,.45); color: #fff; }
.brief-actions .btn-ghost:hover { border-color: #fff; }
.brief :focus-visible { outline-color: var(--accent); }
.toast { margin: 12px 0 0; font-size: .875rem; color: #fff; min-height: 1.4em; }
@media (max-width: 960px) { .brief { position: static; } }

/* ---------- instagram peek: a strip of film ---------- */
.insta-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px 32px; }
.insta-head > div { display: grid; gap: 14px; }
.ig-strip {
  --frame-h: clamp(170px, 22vw, 260px);
  width: 100vw; margin-left: calc(50% - 50vw); overflow: hidden;
  background: #141414;
}
.ig-track {
  list-style: none; margin: 0; padding: 28px 0; display: flex; gap: 12px; width: max-content;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Crect x='6' y='3' width='12' height='10' rx='2.5' fill='%23f7f4ee'/%3E%3C/svg%3E") 0 6px / 24px 16px repeat-x, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Crect x='6' y='3' width='12' height='10' rx='2.5' fill='%23f7f4ee'/%3E%3C/svg%3E") 0 calc(100% - 6px) / 24px 16px repeat-x;
  animation: igRoll 90s linear infinite;
}
.ig-strip:hover .ig-track, .ig-strip:focus-within .ig-track { animation-play-state: paused; }
@keyframes igRoll { to { transform: translateX(-50%); } }
.ig-frame { display: block; height: var(--frame-h); border-radius: 4px; overflow: hidden; }
.ig-frame img { display: block; height: 100%; width: auto; filter: saturate(.92); transition: filter var(--t-med), transform var(--t-slow) var(--ease-out); }
.ig-frame:hover img, .ig-frame:focus-visible img { filter: saturate(1.08) brightness(1.05); transform: scale(1.03); }
.ig-frame:focus-visible { outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) {
  .ig-strip { overflow-x: auto; }
  .ig-track { animation: none; }
  .ig-track > li[aria-hidden] { display: none; }
}

/* ---------- contact ---------- */
.contact { position: relative; z-index: var(--z-content); width: min(100% - 2 * var(--gutter), var(--max)); margin: clamp(100px, 14vw, 200px) auto 0; padding-bottom: 40px; }
.contact-title { margin: 18px 0 36px; font: 900 clamp(2.8rem, 9vw, 8.5rem)/.9 var(--font-display); font-stretch: 72%; text-transform: uppercase; letter-spacing: -.01em; }
.contact-title em { font-weight: 400; font-stretch: 120%; }
.contact-title a { text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 6px no-repeat; transition: background-size var(--t-slow) var(--ease-out); }
.contact-title a:hover { background-size: 100% 6px; }
html[lang^="zh"] .contact-title { font-family: 'Noto Sans TC', sans-serif; line-height: 1.2; letter-spacing: .02em; }
.socials { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-top: 80px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.foot p { margin: 0; }
.foot-logo { width: 120px; height: auto; flex-basis: 100%; max-width: 120px; margin-bottom: 8px; }
.quote { font-style: italic; }

/* ---------- video dialog ---------- */
.player {
  width: min(100% - 32px, 1100px); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px); background: var(--surface); color: var(--text); overflow: auto;
}
.player::backdrop { background: rgba(20,20,20,.55); backdrop-filter: blur(6px); }
.player[open] { animation: dlgIn var(--t-med) var(--ease-out); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.player-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 18px 14px 22px; }
.player-title { margin: 6px 0 0; font: 700 clamp(1.1rem, 2.2vw, 1.5rem)/1.25 var(--font-body); }
.player-frame { aspect-ratio: 16 / 9; background: #000; }
.player-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-foot { padding: 16px 22px 20px; display: flex; justify-content: flex-end; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .grain { display: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .marquee ul + ul { display: none; }
  .js .reveal { opacity: 1; transform: none; }
  .manifesto .w { opacity: 1; }
  .hero { height: 100vh; height: 100dvh; }
}
