/* chrisbernier.com public site.
   Type: one grotesque sans + its mono (A24 approach). Fonts live in exactly two
   variables; to switch to PP Neue Montreal, drop the two licensed .woff2 files in
   /fonts and change the two @font-face blocks below. */

@font-face {
  font-family: "Site Sans";
  src: url("/fonts/InterTight-Variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Site Mono";
  src: url("/fonts/GeistMono-Variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallbacks: keep line breaks stable while the web fonts load. */
@font-face {
  font-family: "Site Sans Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 94%;
  ascent-override: 102%;
  descent-override: 26%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Site Mono Fallback";
  src: local("Menlo"), local("Consolas"), local("Courier New");
  size-adjust: 100%;
  ascent-override: 98%;
  descent-override: 24%;
  line-gap-override: 0%;
}

:root {
  --font-sans: "Site Sans", "Site Sans Fallback", system-ui, sans-serif;
  --font-mono: "Site Mono", "Site Mono Fallback", ui-monospace, monospace;

  --bg: #0b0b0c;
  --fg: #f2f2f0;
  --fg-2: #a3a3a0;
  --rule: rgba(242, 242, 240, 0.16);
  --accent: #e0a868;
  --card-bg: #1a1a1c;

  --pad: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  --slide: 600ms;

  --fs-display: clamp(3rem, 8.4vw, 8.5rem);
  --fs-title-xl: clamp(2.25rem, 5.4vw, 5.5rem);
  --fs-title-l: clamp(1.75rem, 3.6vw, 3.5rem);
  --fs-row: clamp(1.5rem, 3.4vw, 3.25rem);
  --fs-body: 1.125rem;
  --fs-label: 0.6875rem;
}

:root[data-theme="light"] {
  --bg: #e9e7e2;
  --fg: #151514;
  --fg-2: #5c5b57;
  --rule: rgba(21, 21, 20, 0.18);
  --accent: #9a4f12;
  --card-bg: #d9d6cf;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 420;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { list-style: none; padding: 0; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--pad); top: -100px; z-index: 100;
  background: var(--fg); color: var(--bg); padding: 10px 14px; font-family: var(--font-mono);
  font-size: var(--fs-label); text-transform: uppercase; letter-spacing: 0.08em;
}
.skip:focus { top: 10px; }

.wrap { padding-inline: var(--pad); }

/* ---------- Type roles ---------- */
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 450;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.4;
}
.display {
  font-size: var(--fs-display);
  font-weight: 480;
  letter-spacing: -0.035em;
  line-height: 0.95;
}
.title-xl {
  font-size: var(--fs-title-xl);
  font-weight: 470;
  letter-spacing: -0.03em;
  line-height: 1;
}
.title-l {
  font-size: var(--fs-title-l);
  font-weight: 470;
  letter-spacing: -0.025em;
  line-height: 1.02;
}
.secondary, .spot { color: var(--fg-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 12px 18px; border: 1px solid var(--fg); border-radius: 999px;
  transition: background-color 200ms, color 200ms;
}
.btn::before {
  content: ""; width: 0; height: 0;
  border-left: 7px solid currentColor; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn-text { padding: 8px 2px; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; }
.btn-text:hover { text-decoration-color: currentColor; }
.link-arrow { text-decoration: none; display: inline-flex; gap: 8px; padding: 8px 0; }
.link-arrow::after { content: "\2192"; font-family: var(--font-sans); }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Header (A24 layout: nav left, name centered, contact right) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  min-height: 60px; padding: 10px var(--pad);
  background: var(--bg);
  border-bottom: 1px solid transparent;
}
.nav { display: flex; gap: clamp(14px, 2vw, 28px); align-items: center; }
.nav a { text-decoration: none; padding: 8px 0; }
.nav a:hover, .nav a[aria-current="true"] { text-decoration: underline; text-underline-offset: 4px; }
.nav-right { justify-content: flex-end; }
.brand {
  text-decoration: none; justify-self: center;
  font-size: clamp(1.25rem, 1.9vw, 1.625rem); font-weight: 520; letter-spacing: -0.02em; line-height: 1;
  padding: 6px 0;
}
.brand img { height: 34px; width: auto; }
.menu-toggle { display: none; padding: 8px 0; }
.mobile-menu {
  grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; padding: 16px 0 8px;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a { text-decoration: none; font-size: 2rem; font-weight: 470; letter-spacing: -0.02em; padding: 4px 0; }

@media (max-width: 760px) {
  .section-work .work-tools { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .work-tools .work-search { flex: none; width: 100%; }
  .site-header { grid-template-columns: 1fr auto; }
  .nav-left { display: none; }
  .brand { justify-self: start; grid-column: 1; grid-row: 1; }
  .nav-right { grid-column: 2; grid-row: 1; }
  .nav-right a { display: none; }
  .menu-toggle { display: block; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 9vw, 140px) 0; position: relative; }
.section-selected { padding-top: clamp(20px, 3vw, 40px); }
.section-head { margin-bottom: clamp(20px, 3vw, 40px); }
.intro { max-width: 46ch; margin-top: 20px; color: var(--fg-2); }
.below-carousel { margin-top: 8px; }

/* ---------- Carousel ---------- */
/* Space reserved before the content arrives, so nothing below shifts:
   stage (27% of width) + caption (roles, two title lines, button). */
.carousel { position: relative; outline: none; min-height: calc(27.2vw + 18px + var(--fs-title-xl) * 2 + 84px); }
@media (max-width: 699px) { .carousel { min-height: calc(44vw + 18px + 54px + var(--fs-title-xl) * 2 + 84px); } }
.carousel-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.27;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
@media (max-width: 699px) { .carousel-stage { aspect-ratio: 1 / 0.4388; } }

.c-card {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 100%;
  transition: transform var(--slide) var(--ease), opacity var(--slide) var(--ease);
  will-change: transform, opacity;
  background: var(--card-bg);
  overflow: hidden;
}
.c-card .media { position: absolute; inset: 0; overflow: hidden; }
.c-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.c-card .gray { filter: grayscale(1); }
.c-card .color { opacity: 0; transition: opacity var(--slide) var(--ease); }
.c-card.is-active .color { opacity: 1; }
.c-card.is-hidden { visibility: hidden; transition: transform var(--slide) var(--ease), opacity var(--slide) var(--ease), visibility 0s linear var(--slide); }
/* First layout and resizes: cards go straight to their places (see carousel.js). */
.carousel-stage.is-instant .c-card, .carousel-stage.is-instant .c-card .color { transition: none; }

/* Slow zoom on the active still (transform only). */
@keyframes slowzoom { from { transform: scale(1); } to { transform: scale(1.08); } }
.zoom-on .zoomable { animation: slowzoom 18s linear infinite alternate; }

.preview-host { position: absolute; inset: 0; pointer-events: none; }
.preview-frame {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  opacity: 0; transition: opacity 700ms var(--ease);
}
.preview-frame.is-playing { opacity: 1; }

/* ---------- Play cues (the cards and the reel frame are the play buttons) ---------- */
/* Pointer devices: no overlay, no "PLAY" pill. The only cues are the pointer cursor and
   a subtle brighten on hover (a faint white layer whose opacity rises: opacity only).
   Touch devices: a small play icon in the bottom-left corner of the active card, always. */
.c-card.is-active, .reel-frame, .is-playable { cursor: pointer; }
.c-card::after, .reel-frame::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: #fff; opacity: 0; transition: opacity 250ms var(--ease);
}
@media (hover: hover) {
  .c-card.is-active:hover::after, .reel-frame:hover::after { opacity: 0.07; }
}
.play-cue { display: none; }
@media (hover: none) {
  .c-card.is-active .play-cue, .reel-frame .play-cue {
    position: absolute; z-index: 2; left: 12px; bottom: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 999px;
    background: rgba(8, 8, 9, 0.62); color: #f2f2f0; pointer-events: none;
  }
  .play-icon {
    width: 11px; height: 13px; margin-left: 3px; background: currentColor;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
  }
}
.is-playable { transition: color 200ms; }
@media (hover: hover) { .is-playable:hover { color: var(--fg-2); } }

.carousel-caption {
  position: relative;
  margin-top: 18px;
  padding-left: var(--c-left, var(--pad));
  padding-right: var(--pad);
  display: grid;
  grid-template-columns: minmax(0, var(--c-width, 1fr)) 1fr;
  gap: 16px 32px;
  align-items: start;
}
.caption-text { transition: opacity 220ms var(--ease); min-height: calc(var(--fs-title-xl) * 2 + 104px); }
.caption-text.is-fading { opacity: 0; }
.caption-roles { color: var(--fg-2); margin-bottom: 10px; }
.caption-title { margin-bottom: 20px; }
/* Selected Work: DIR and DP right after the title in the same inline flow, so they sit on
   the baseline of the title's last line and wrap below it, left-aligned, when they do not
   fit, DIR and DP together (same treatment as the Work index rows). The gap is a space
   widened to about 18px:
   at a line break it hangs at the end of the title line, so wrapped credits start flush
   left. */
.caption-head { margin-bottom: 20px; }
.caption-head .caption-title { display: inline; margin-bottom: 0; }
.caption-credits { display: inline; color: var(--fg-2); }
.caption-credits[hidden] { display: none; }
.caption-gap { word-spacing: 11px; }
.caption-credit-list { display: inline-block; max-width: 100%; }
/* DIR and DP as one unit (js/data.js keepCreditsTogether): when even a full line cannot
   hold both, one per line, no dangling separator. */
.credits-unit.is-stacked .credit-part { display: block; }
.credits-unit.is-stacked .honor-sep { display: none; }
.caption-credits .credit-part { display: inline-block; max-width: 100%; }
.carousel-controls { display: flex; gap: 20px; align-items: center; justify-content: flex-end; padding-top: 2px; }
.carousel-count { color: var(--fg-2); font-variant-numeric: tabular-nums; }
.carousel-controls button { padding: 10px 0; }
.carousel-controls button:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 699px) {
  .carousel-caption { grid-template-columns: 1fr; }
  .carousel-controls { justify-content: flex-start; order: -1; }
}

/* ---------- Reel ---------- */
/* Same width and left edge as the Selected Work carousel's active card (carousel.js
   LAYOUT: 8.5% / 50% of the stage, 6% / 78% when the stage is under 700px). The
   section is a size container so the breakpoint follows its width, as the carousel's does.
   2.39:1 with cover, so letterbox bars in a 16:9 poster or video never show. */
.section-reel { container-type: inline-size; }
.reel { margin-left: 8.5%; width: 50%; max-width: var(--poster-w, none); }
@container (max-width: 699px) { .reel { margin-left: 6%; width: 78%; } }
.reel-frame {
  display: block; position: relative; width: 100%; aspect-ratio: 2.39 / 1; overflow: hidden;
  background: var(--card-bg); cursor: pointer;
}
.reel-frame img { width: 100%; height: 100%; object-fit: cover; }
/* The preview is 16:9: size it to the frame's width and center it, so the frame
   crops the video's own letterbox bars. No extra zoom: a 2.39:1 shot fills the frame
   exactly; Chris sets reel_preview_start past any wider shot. */
.reel-frame .preview-frame {
  inset: auto; left: 50%; top: 50%; width: 100%; height: auto; aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
}

/* ---------- Work index (A24 rows, role filters) ---------- */
.work-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: clamp(24px, 3.5vw, 48px); }
.work-filters { display: flex; flex-wrap: wrap; gap: 8px; }
/* Search: at the end of the filter row, styled like the filter buttons. */
.work-search { position: relative; flex: 0 1 220px; min-width: 160px; }
.work-search input {
  width: 100%; min-height: 44px; padding: 10px 40px 10px 16px;
  border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--fg);
  -webkit-appearance: none; appearance: none; transition: border-color 200ms;
}
.work-search input::placeholder { color: var(--fg-2); opacity: 1; }
.work-search input:hover { border-color: var(--fg-2); }
.work-search input:focus { border-color: var(--fg); }
.work-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.work-search-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 999px; color: var(--fg-2); font-size: 1.25rem; line-height: 1;
}
.work-search-clear:hover { color: var(--fg); }
.work-search-clear[hidden] { display: none; }
.work-empty { padding: clamp(28px, 4vw, 56px) 0; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.work-empty[hidden] { display: none; }
.work-empty p { color: var(--fg-2); }
/* Search matches in the rows. */
.rows mark { background: none; color: var(--fg); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.14em; }
.row-credits mark { text-underline-offset: 2px; }
.filter {
  min-height: 44px; padding: 10px 16px; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--fg-2); transition: color 200ms, border-color 200ms, background-color 200ms;
}
.filter .count { margin-left: 4px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.filter:hover { color: var(--fg); border-color: var(--fg-2); }
.filter[aria-pressed="true"] { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.work-index { margin-top: clamp(20px, 3vw, 40px); }
/* Reserve space until the list renders, so Contact does not start in view and jump. */
.work-index:empty { min-height: 100vh; }

/* Stacking for the hover still: other rows (1) < still (2) < hovered row (3).
   overflow: clip keeps the still inside the Work section. */
.work-list { position: relative; isolation: isolate; overflow: clip; border-top: 1px solid var(--rule); }
.rows li { position: relative; }
.row {
  position: relative; z-index: 1;
  display: grid; width: 100%; text-align: left;
  grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 26rem);
  gap: 8px 24px; align-items: baseline;
  padding: clamp(10px, 1.4vw, 18px) 0;
  border-bottom: 1px solid var(--rule);
}
.row.is-hot { z-index: 3; }
.row-year { color: var(--fg-2); font-variant-numeric: tabular-nums; }
.row-title { font-size: var(--fs-row); font-weight: 460; letter-spacing: -0.025em; line-height: 1.04; }
.row-title .client { color: var(--fg); }
.row-title .spot { color: var(--fg-2); transition: color 200ms; }
.row-roles { color: var(--fg-2); text-align: right; }
/* Title with DIR / DP beside it on the same line, baseline-aligned; they wrap below the
   title (left-aligned with it) when they do not fit. Styled exactly like the roles label. */
.row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; min-width: 0; }
.row-credits { color: var(--fg-2); }
/* Each credit stays in one piece where it fits, so lines break at the " · " first. */
.row-credits .credit-part { display: inline-block; max-width: 100%; }
.row-thumb { display: none; }
.work-index.no-years .row { grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); }
.work-index.no-years .row-year { display: none; }
.row:hover .spot, .row:focus-visible .spot, .row.is-hot .spot { color: var(--fg); }
.rows { transition: opacity 160ms var(--ease); }
.rows.is-fading { opacity: 0; }
.row.is-hot .row-title, .row.is-hot .row-roles, .row.is-hot .row-credits, .row.is-hot .row-honors { text-shadow: 0 0 2px var(--bg), 0 0 18px var(--bg), 0 0 36px var(--bg); }
.row.is-hot .row-roles { color: var(--fg); }

.work-peek {
  position: absolute; z-index: 2; top: 0; left: 36%; width: min(50%, 760px);
  aspect-ratio: 16 / 9; pointer-events: none;
}
.work-peek img {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 320ms var(--ease), transform 320ms var(--ease);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.work-peek img.no-move { transition: opacity 320ms var(--ease); }
.work-peek img.is-shown { opacity: 1; }

@media (max-width: 760px) {
  .row-credits { flex-basis: 100%; }
  .row, .work-index.no-years .row { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .work-index.no-years .row { grid-template-columns: minmax(0, 1fr); }
  .row-roles { grid-column: 2; text-align: left; }
  .work-index.no-years .row-roles { grid-column: 1; }
  .work-peek { left: 30%; width: 66%; }
}
/* Awarded marker (Work index) and the Awards section rows: title, honors underneath. */
.awarded-mark { color: var(--fg); margin-left: 10px; white-space: nowrap; }
.awards-index:empty { min-height: 50vh; }
.work-index.awards-index .row-award { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.row-award.row-static { cursor: default; }
.row-honors { color: var(--fg); line-height: 1.6; }
.honor-nom, .honor-sep { color: var(--fg-2); }
.row.is-hot .honor-nom { color: var(--fg-2); }

/* Touch screens: no hover, so each row shows a small thumbnail instead (no peek). */
@media (hover: none) {
  .row, .work-index.no-years .row { grid-template-columns: 96px minmax(0, 1fr); align-items: center; }
  .row-year { display: none; }
  .row-thumb { display: block; grid-row: span 2; width: 96px; aspect-ratio: 16 / 9; height: auto; object-fit: cover; background: var(--card-bg); }
  .row-title { font-size: clamp(1.25rem, 5.4vw, 2rem); }
  .row-credits { flex-basis: 100%; }
  .row-roles, .work-index.no-years .row-roles { grid-column: 2; text-align: left; }
  .work-peek { display: none; }
  .work-index.awards-index .row-award { grid-template-columns: 96px minmax(0, 1fr); gap: 8px 16px; }
  .row-award .row-honors { grid-column: 2; }
  span.row-thumb { visibility: hidden; }
  .work-filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); scrollbar-width: none; }
  .filter { flex: none; }
}

/* ---------- Contact / footer ---------- */
.section-contact .about { max-width: 34ch; margin-top: 28px; font-size: clamp(1.25rem, 2.2vw, 1.75rem); letter-spacing: -0.01em; line-height: 1.3; }
.section-contact .email { margin-top: 24px; }
.section-contact .email a {
  font-size: var(--fs-title-l); font-weight: 470; letter-spacing: -0.025em; line-height: 1.1;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.12em; word-break: break-word;
}
.site-footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(64px, 9vw, 140px); padding-block: 24px 32px; border-top: 1px solid var(--rule); color: var(--fg-2);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.noscript { padding-block: 40px; }

/* ---------- Player (simple pop-up) ---------- */
/* Always dark, whatever the site theme: it is a screening room over the page. */
html.player-open { overflow: hidden; }
.player {
  --arrow: 56px; --gap: clamp(12px, 2vw, 28px); --meta: 76px;
  /* Set per video by player.js: native width and aspect ratio (default 1920 x 1080). */
  --nw: 1920px; --ar: 1.7778;
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: #f2f2f0;
}
.player::backdrop { background: rgba(5, 5, 6, 0.95); }
.player[open] { display: block; }
.player-body {
  height: 100%; display: grid; grid-template-columns: var(--arrow) auto var(--arrow);
  justify-content: center; align-items: center; gap: var(--gap); padding: 64px var(--pad);
}
.player-frame {
  /* As large as fits, never wider than the native width (so never taller than the
     native height either, at the native aspect ratio). */
  position: relative; aspect-ratio: var(--ar); background: #000;
  width: min(calc(100vw - 2 * var(--pad) - 2 * var(--arrow) - 2 * var(--gap)), var(--nw), calc((100dvh - 128px - var(--meta)) * var(--ar)));
}
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-frame .player-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #a3a3a0; padding: 24px; text-align: center; }
.player-meta { min-height: var(--meta); padding-top: 14px; }
.player-title { font-size: clamp(1.0625rem, 1.5vw, 1.375rem); font-weight: 470; letter-spacing: -0.01em; line-height: 1.2; }
.player-roles { margin-top: 6px; color: #a3a3a0; }
.player.has-credits, .player.has-honors { --meta: 100px; }
.player.has-credits.has-honors { --meta: 124px; }
/* Title and credits share a line (baseline-aligned); credits that do not fit beside
   the title wrap below it as a whole, left-aligned. Credits look exactly like roles. */
.player-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.player-credits { color: #a3a3a0; }
.player-credits .honor-sep { color: #a3a3a0; }
.player-honors { margin-top: 6px; color: #f2f2f0; }
.player-honors .honor-nom, .player-honors .honor-sep { color: #a3a3a0; }

.player-close, .parrow {
  display: grid; place-items: center; width: var(--arrow); height: var(--arrow); border-radius: 50%;
  color: #f2f2f0; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(242, 242, 240, 0.35);
  font-size: 1.375rem; line-height: 1; transition: background-color 150ms, color 150ms, border-color 150ms;
}
.player-close:hover, .parrow:hover { background: #f2f2f0; color: #0b0b0c; border-color: #f2f2f0; }
.player-close:focus-visible, .parrow:focus-visible { outline: 2px solid #f2f2f0; outline-offset: 3px; }
.player-close { position: fixed; top: 12px; right: 12px; z-index: 2; width: 48px; height: 48px; font-size: 1.125rem; }
.parrow[hidden] { display: grid; visibility: hidden; }
.player.is-single .player-body { grid-template-columns: auto; }
.player.is-single .parrow { display: none; }
.player.is-single .player-frame { width: min(calc(100vw - 2 * var(--pad)), var(--nw), calc((100dvh - 128px - var(--meta)) * var(--ar))); }

/* Phones: video full width, arrows below it. */
@media (max-width: 760px) {
  .player { --arrow: 52px; }
  .player::backdrop { background: rgba(5, 5, 6, 0.97); }
  .player-body {
    grid-template-columns: 1fr 1fr; grid-template-areas: "stage stage" "prev next";
    align-content: center; gap: 16px 12px; padding: 72px 0 24px;
  }
  .player-stage { grid-area: stage; }
  .parrow-prev { grid-area: prev; justify-self: end; }
  .parrow-next { grid-area: next; justify-self: start; }
  .player-frame, .player.is-single .player-frame { width: min(100vw, var(--nw), calc((100dvh - 250px) * var(--ar))); }
  .player-stage { justify-self: center; }
  .player-meta { padding: 12px var(--pad) 0; min-height: 0; }
  .player.is-single .player-body { grid-template-columns: 1fr; grid-template-areas: "stage"; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .player-meta { display: none; }
  .player-body { padding-block: 12px; }
  .player-frame, .player.is-single .player-frame { width: min(calc(100vw - 2 * var(--pad) - 2 * var(--arrow) - 2 * var(--gap)), var(--nw), calc((100dvh - 24px) * var(--ar))); }
}

/* ---------- Landing screen (intro) ---------- */
/* Hidden unless theme.js set <html data-intro> before first paint. Always dark: it sits
   over the reel. Leaving fades it out (opacity only, 800 ms). */
.landing { display: none; }
html[data-intro] { overflow: hidden; }
html[data-intro] .landing {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 100; overflow: hidden;
  background: #0b0b0c; color: #f2f2f0; transition: opacity 800ms var(--ease);
}
html[data-intro="leaving"] .landing { opacity: 0; pointer-events: none; }
/* The reel is 16:9 with a 2.39:1 picture letterboxed inside: size the player so the
   picture itself covers the screen (cover), centered. */
.landing-video {
  position: absolute; left: 50%; top: 50%; pointer-events: none;
  width: max(100vw, calc(100dvh * 2.39)); aspect-ratio: 16 / 9; transform: translate(-50%, -50%);
}
.landing-video .preview-frame { transition-duration: 400ms; }
.landing-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(8, 8, 9, 0.38) 0%, rgba(8, 8, 9, 0.62) 100%); }
.landing-title {
  position: relative; display: grid; justify-items: center; gap: 10px; padding: 0 16px; text-align: center;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}
/* Subtle: at most 32px, never below 16px. A logo scales the same way. */
.landing-name { margin: 0; font-size: clamp(1rem, 2.125vw, 2rem); font-weight: 470; letter-spacing: -0.02em; line-height: 1; }
.landing-name img { display: block; max-width: min(17.5vw, 180px); max-height: 7.5vh; width: auto; height: auto; }
/* Styled exactly like the role labels, in the dark theme's secondary grey (the layer is
   always dark). */
.landing-roles { margin: 0; color: #a3a3a0; }
.landing-enter {
  position: absolute; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  padding: 12px 16px; background: none; border: 0; color: #f2f2f0; opacity: 0.9; white-space: nowrap; cursor: pointer;
}
.landing:focus { outline: none; }
.landing-enter:focus-visible { outline: 2px solid #f2f2f0; outline-offset: 2px; }
.when-touch { display: none; }
@media (hover: none) { .when-touch { display: inline; } .when-pointer { display: none; } }

/* ---------- Route layouts (data-route is set on <html> before first paint) ---------- */
main { display: flex; flex-direction: column; }
[data-route="director"] .section-selected,
[data-route="director"] .section-reel,
[data-route="director"] .section-awards { display: none; }
[data-route="awards"] .section-selected,
[data-route="awards"] .section-reel,
[data-route="awards"] .section-director,
[data-route="awards"] .section-work { display: none; }
[data-route="awards"] .section-awards { padding-top: clamp(28px, 4vw, 56px); }
[data-route="director"] .section-director { padding-top: clamp(28px, 4vw, 56px); }
[data-route="reel"] .section-reel { order: -1; padding-top: clamp(20px, 3vw, 40px); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .rows, .work-peek img { transition: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}

/* ---------- Background chips (js/chips.js) ---------- */
/* Fixed behind all content (the body's background is painted on the canvas below it):
   three layers of project chips. Each layer is blended toward the page colour by a filter
   on the whole layer: chip x (1 - s) + page x s, where s is the layer's darkness (dark
   theme) or fade (light theme) from chips_config (82% / 92% by default, which keeps all
   text at WCAG AA). brightness(x) invert(1) brightness(y) invert(1) gives
   chip x (x * y) + (1 - y); js/chips.js sets x and y per layer and theme. No chip pixel
   goes darker than the dark background (or lighter than the paper), transparent areas
   stay transparent, so the gaps are exactly the page background; the chips stay opaque
   and their feathered (blurred) edges blend cleanly over the layers behind. */
.chips {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  opacity: 0; transition: opacity 600ms var(--ease);
}
.chips.is-ready { opacity: 1; }
.chips-layer { position: absolute; left: 0; top: 0; width: 100%; will-change: transform; }
.chips-layer i {
  position: absolute; width: var(--chip-w); height: var(--chip-h);
  background: var(--chips-src) 0 0 / var(--chips-size) no-repeat;
}
.chips-layer { filter: brightness(var(--dk-x, 0.1866)) invert(1) brightness(var(--dk-y, 0.9646)) invert(1); }
html[data-theme="light"] .chips-layer { filter: brightness(var(--lt-x, 0.4805)) invert(1) brightness(var(--lt-y, 0.1665)) invert(1); }
/* Tuning panel only (js/chips-tune.js): live blur on top of the baked sprites. */
.chips.is-tuning .chips-layer { filter: brightness(var(--dk-x, 0.1866)) invert(1) brightness(var(--dk-y, 0.9646)) invert(1) blur(var(--live-blur, 0px)); }
html[data-theme="light"] .chips.is-tuning .chips-layer { filter: brightness(var(--lt-x, 0.4805)) invert(1) brightness(var(--lt-y, 0.1665)) invert(1) blur(var(--live-blur, 0px)); }
/* Parallax: each layer at its own fraction of the scroll speed, driven by the scroll
   itself (transform only). */
@supports (animation-timeline: scroll()) {
  .chips-layer.is-drifting { animation: chips-drift linear both; animation-timeline: scroll(root block); }
}
@keyframes chips-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, var(--chips-travel, 0), 0); } }
@media (prefers-reduced-motion: reduce) { .chips { transition: none; } .chips-layer.is-drifting { animation: none; } }

/* Chips tuning (js/tune-gate.js): why the panel did not open. */
.tune-notice {
  position: fixed; right: 12px; bottom: 12px; z-index: 1000; max-width: min(340px, calc(100vw - 24px)); margin: 0;
  padding: 10px 12px; border-radius: 8px; background: #0e0e0f; color: #f2f2f0; border: 1px solid rgb(242 242 240 / 0.25);
  font-family: var(--font-mono); font-size: 11px; line-height: 1.4;
}
