/* Reallex Films — design tokens (Direction B "Forest & Ivory").
   Palette normalised from the client's palette guide; see docs/BRAND-TOKENS.md for the corrections.
   Rule: Gold is never text on Ivory (contrast 2.1:1). Copper is for large text, UI states and details only. */

/* Metric-matched local fallbacks, shown only until the web fonts arrive (display=swap). Sized to Cormorant Garamond
   and Jost so text wraps the same before and after the swap: no layout shift. Where the local font is missing
   (e.g. Android), the stack continues as before. unicode-range = the latin + latin-ext subsets Google serves for both
   families, so characters the web fonts lack (e.g. → U+2192) still fall through to Futura / Georgia as before. */
@font-face { font-family: "Cormorant Garamond Fallback"; src: local("Georgia"); size-adjust: 89%; ascent-override: 103%; descent-override: 33%; line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost Fallback"; src: local("Arial"); font-weight: 300; size-adjust: 94.5%; ascent-override: 113%; descent-override: 40%; line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost Fallback"; src: local("Arial"); font-weight: 400; size-adjust: 96%; ascent-override: 111%; descent-override: 40%; line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost Fallback"; src: local("Arial"); font-weight: 500; size-adjust: 93%; ascent-override: 115%; descent-override: 41%; line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* ---- Brand palette (raw values — do not use directly in components) ---- */
  --rf-forest: #14342B;
  --rf-obsidian: #0B0B0A;
  --rf-ivory: #F1EDE5;
  --rf-gold: #C6A15B;
  --rf-copper: #A85E3B;
  --rf-deep-green: #0F2922;
  --rf-charcoal: #1A1A18;
  --rf-taupe: #8C857A;
  --rf-sage: #7A8F7A;
  --rf-beige: #D9D2C7;

  /* ---- Typography ---- */
  --font-display: "Cormorant Garamond", "Cormorant Garamond Fallback", "Cormorant", Georgia, "Times New Roman", serif;
  --font-sans: "Jost", "Jost Fallback", "Futura", "Avenir Next", "Helvetica Neue", Arial, sans-serif;

  /* fluid sizes: min @375px → max @1440px */
  --fs-display: clamp(2.75rem, 1.86rem + 3.8vw, 5.25rem);
  --fs-h1: clamp(2.25rem, 1.66rem + 2.5vw, 3.75rem);
  --fs-h2: clamp(1.875rem, 1.49rem + 1.6vw, 2.875rem);
  --fs-h3: clamp(1.375rem, 1.24rem + 0.55vw, 1.75rem);
  --fs-body: clamp(1rem, 0.96rem + 0.18vw, 1.125rem);
  --fs-small: 0.875rem;
  --fs-meta: 0.75rem;
  --fs-nav: 0.8125rem;
  --fs-button: 0.8125rem;

  --lh-display: 1.02;
  --lh-heading: 1.12;
  --lh-body: 1.65;
  --lh-tight: 1.35;

  --fw-display: 500;
  --fw-heading: 500;
  --fw-body: 300;
  --fw-body-strong: 400;
  --fw-ui: 400;
  --fw-button: 500;

  --tracking-display: -0.01em;
  --tracking-meta: 0.16em;
  --tracking-nav: 0.14em;
  --tracking-button: 0.12em;

  /* ---- Spacing scale (4px base) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* ---- Layout ---- */
  --content-max: 76rem;          /* 1216px — grids and text blocks */
  --content-wide: 90rem;         /* 1440px — full-bleed media cap */
  --measure: 38rem;              /* comfortable reading width */
  --gutter: 1.25rem;             /* mobile (<768) */
  --grid-gap: 1.25rem;
  --section-space: clamp(4rem, 2.6rem + 6vw, 8rem);
  --section-space-tight: clamp(3rem, 2.2rem + 3.4vw, 5rem);
  --header-h: 4.25rem;

  /* ---- Shape ---- */
  --radius-pill: 999px;          /* buttons only */
  --radius-media: 0;             /* images and video stay square */
  --hairline: 1px;

  /* ---- Motion (minimal; respects reduced motion in base.css) ---- */
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* ---- Aspect ratios ---- */
  --ar-film: 16 / 9;
  --ar-scope: 2.39 / 1;
  --ar-portrait-card: 4 / 5;
}

@media (min-width: 768px) {
  :root { --gutter: 2rem; --grid-gap: 1.5rem; --header-h: 4.75rem; }
}
@media (min-width: 1024px) {
  :root { --gutter: 3rem; --grid-gap: 2rem; --header-h: 5.25rem; }
}

/* ---- Surfaces: semantic colour roles. Components read only these. ---- */
[data-surface="forest"], :root {
  --surface-bg: var(--rf-forest);
  --surface-text: var(--rf-ivory);
  --surface-text-muted: var(--rf-beige);
  --surface-meta: var(--rf-beige);
  --surface-accent: var(--rf-gold);          /* text-safe on this surface (5.6:1) */
  --surface-rule: rgba(241, 237, 229, 0.18);
  --surface-focus: var(--rf-gold);
  --logo-light: block; --logo-dark: none;
}
[data-surface="deep"] {
  --surface-bg: var(--rf-deep-green);
  --surface-text: var(--rf-ivory);
  --surface-text-muted: var(--rf-beige);
  --surface-meta: var(--rf-beige);
  --surface-accent: var(--rf-gold);
  --surface-rule: rgba(241, 237, 229, 0.16);
  --surface-focus: var(--rf-gold);
  --logo-light: block; --logo-dark: none;
}
[data-surface="obsidian"] {
  --surface-bg: var(--rf-obsidian);
  --surface-text: var(--rf-ivory);
  --surface-text-muted: var(--rf-beige);
  --surface-meta: var(--rf-taupe);           /* 5.4:1 on obsidian */
  --surface-accent: var(--rf-gold);          /* 8.1:1 */
  --surface-rule: rgba(241, 237, 229, 0.14);
  --surface-focus: var(--rf-gold);
  --logo-light: block; --logo-dark: none;
}
[data-surface="ivory"] {
  --surface-bg: var(--rf-ivory);
  --surface-text: var(--rf-obsidian);
  --surface-text-muted: #3A3833;             /* charcoal-tinted body on ivory */
  --surface-meta: #5E5850;                   /* darkened taupe for small text (≥4.5:1) */
  --surface-accent: var(--rf-forest);        /* gold is NOT text-safe on ivory */
  --surface-rule: rgba(11, 11, 10, 0.14);
  --surface-focus: var(--rf-forest);
  --logo-light: none; --logo-dark: block;
}

/* Base: reset, document defaults, typography roles. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--surface-bg);
  color: var(--surface-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; }
p { margin: 0 0 var(--space-4); max-width: var(--measure); }
ul, ol { margin: 0; padding: 0; }

/* Typography roles */
.t-display, .t-h1, .t-h2, .t-h3, h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-heading);
  line-height: var(--lh-heading);
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}
.t-display { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--tracking-display); font-weight: var(--fw-display); }
h1, .t-h1 { font-size: var(--fs-h1); }
h2, .t-h2 { font-size: var(--fs-h2); }
h3, .t-h3 { font-size: var(--fs-h3); line-height: var(--lh-tight); }
.t-body { font-size: var(--fs-body); }
.t-lead { font-size: calc(var(--fs-body) * 1.125); color: var(--surface-text-muted); }
.t-small { font-size: var(--fs-small); line-height: var(--lh-tight); }
.t-meta {
  font-family: var(--font-sans);
  font-size: var(--fs-meta);
  font-weight: var(--fw-ui);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  line-height: var(--lh-tight);
  color: var(--surface-meta);
}
.t-accent { color: var(--surface-accent); }

/* Accessibility */
:focus-visible { outline: 2px solid var(--surface-focus); outline-offset: 3px; }
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--rf-ivory); color: var(--rf-obsidian);
  font-size: var(--fs-small); font-weight: var(--fw-button);
}
.skip-link:focus { top: var(--space-3); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Layout primitives: container, section, grid, stack, media. */

.container {
  width: 100%;
  max-width: calc(var(--content-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: calc(var(--content-wide) + var(--gutter) * 2); }
.container--bleed { max-width: none; padding-inline: 0; }

.section { padding-block: var(--section-space); background: var(--surface-bg); color: var(--surface-text); }
.section--tight { padding-block: var(--section-space-tight); }
.section__head { display: grid; gap: var(--space-3); margin-bottom: var(--space-7); max-width: 46rem; }
.section__head > * { margin: 0; }
.section__foot { margin-top: var(--space-7); }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack > * { margin: 0; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }

/* 12-column intent expressed as simple responsive grids */
.grid { display: grid; gap: var(--grid-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) {
  .grid--2, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.grid--projects { row-gap: calc(var(--grid-gap) * 1.75); }

/* Media wrapper: fixed aspect ratio, never upscaled, square corners */
.media {
  position: relative;
  aspect-ratio: var(--ar, var(--ar-film));
  overflow: hidden;
  border-radius: var(--radius-media);
  background: var(--rf-charcoal);
}
.media > img, .media > video, .media > picture > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.media--scope { --ar: var(--ar-scope); }
.media--portrait { --ar: var(--ar-portrait-card); }

/* Placeholder state (development shell only; the production build refuses to ship it) */
.media--pending {
  display: grid; place-items: center; text-align: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(241,237,229,0.035) 14px 15px),
    var(--rf-charcoal);
  color: var(--rf-beige);
  outline: 1px dashed rgba(241, 237, 229, 0.22); outline-offset: -1px;
}
.media--pending .media__label { padding: var(--space-4); font-size: var(--fs-meta); letter-spacing: var(--tracking-meta); text-transform: uppercase; line-height: 1.6; }

/* Shared components: header, navigation, buttons, logo, project card, footer, section variants. */

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo img { width: auto; }
.logo__light { display: var(--logo-light); }
.logo__dark { display: var(--logo-dark); }
.logo--full img { height: var(--logo-h, 3.5rem); }
.logo--mark img { height: var(--logo-h, 2rem); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 2.875rem; padding: 0 var(--space-5);
  border: var(--hairline) solid transparent; border-radius: var(--radius-pill);
  font-family: var(--font-sans); font-size: var(--fs-button); font-weight: var(--fw-button);
  letter-spacing: var(--tracking-button); text-transform: uppercase; text-decoration: none; line-height: 1;
  cursor: pointer; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn--primary { background: var(--rf-gold); color: var(--rf-obsidian); }
.btn--primary:hover { background: var(--rf-ivory); }
[data-surface="ivory"] .btn--primary { background: var(--rf-forest); color: var(--rf-ivory); }
[data-surface="ivory"] .btn--primary:hover { background: var(--rf-obsidian); }
.btn--secondary { background: transparent; color: var(--surface-text); border-color: var(--surface-rule); border-color: color-mix(in srgb, var(--surface-text) 45%, transparent); }
.btn--secondary:hover { border-color: var(--surface-text); }
.btn--small { min-height: 2.5rem; padding: 0 var(--space-4); }
.link-arrow {
  display: inline-flex; gap: var(--space-2); align-items: center;
  font-size: var(--fs-button); font-weight: var(--fw-button); letter-spacing: var(--tracking-button); text-transform: uppercase;
  text-decoration: none; color: var(--surface-text);
  border-bottom: var(--hairline) solid var(--surface-accent); padding-bottom: 0.2em;
}
.link-arrow:hover { color: var(--surface-accent); }
[data-surface="ivory"] .link-arrow:hover { color: var(--rf-copper); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface-bg); color: var(--surface-text);
  border-bottom: var(--hairline) solid var(--surface-rule);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: var(--header-h); }
/* Approved treatment B: RF monogram in the header at every size; the name is carried by the hero and footer. */
.site-header .logo--mark { --logo-h: 1.875rem; }
@media (min-width: 1024px) { .site-header .logo--mark { --logo-h: 2.25rem; } }

.site-nav__list { display: flex; align-items: center; gap: var(--space-6); list-style: none; }
.site-nav__link {
  font-size: var(--fs-nav); font-weight: var(--fw-ui); letter-spacing: var(--tracking-nav); text-transform: uppercase;
  text-decoration: none; color: var(--surface-text); padding-block: var(--space-2);
  border-bottom: var(--hairline) solid transparent;
}
.site-nav__link:hover, .site-nav__link[aria-current="page"] { border-bottom-color: var(--surface-accent); }
.nav-toggle { display: none; }

/* Mobile navigation (JS-enhanced; without JS the links stay visible and wrap) */
@media (max-width: 1023.98px) {
  .js .nav-toggle {
    display: inline-flex; align-items: center; gap: var(--space-3);
    min-height: 2.75rem; padding: 0 var(--space-2); background: none; border: 0; cursor: pointer;
    font-size: var(--fs-nav); letter-spacing: var(--tracking-nav); text-transform: uppercase;
  }
  .nav-toggle__bars { display: grid; gap: 5px; width: 22px; }
  .nav-toggle__bars span { display: block; height: 1px; background: currentColor; transition: transform var(--dur-base) var(--ease), opacity var(--dur-fast); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .js .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
    background: var(--rf-deep-green); color: var(--rf-ivory);
    padding: var(--space-7) var(--gutter); overflow-y: auto;
    display: none;   /* closed = removed from layout, focus order and hit-testing (no invisible overlay) */
  }
  .js .site-nav.is-open { display: block; animation: nav-in var(--dur-base) var(--ease); }
  .js .site-nav__list { flex-direction: column; align-items: flex-start; gap: var(--space-5); }
  .js .site-nav__link { font-family: var(--font-display); font-size: var(--fs-h2); letter-spacing: 0; text-transform: none; }
  .js .site-nav__cta { margin-top: var(--space-5); }
  html:not(.js) .site-header__inner { flex-wrap: wrap; padding-block: var(--space-3); }
  html:not(.js) .site-nav__list { flex-wrap: wrap; gap: var(--space-4); }
  body.nav-open { overflow: hidden; }
}
@keyframes nav-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Hero ---------- */
/* Approved fix: the footage is a backdrop filling the first screen; the text sits at its foot over a scrim,
   so identity, headline and CTAs are visible without scrolling at every width. */
.hero {
  position: relative; display: grid; overflow: hidden; background: var(--surface-bg);
  /* min() caps the first-screen height itself: a min-height larger than max-height would override it on tall screens. */
  min-height: min(calc(100vh - var(--header-h)), 60rem);
  min-height: min(calc(100svh - var(--header-h)), 60rem);
}
.hero__media { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
.hero__media img { object-position: var(--focus-x, 50%) 50%; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(11, 11, 10, 0.92) 0%, rgba(11, 11, 10, 0.55) 38%, rgba(11, 11, 10, 0) 70%);
}
.hero__content { position: relative; z-index: 1; align-self: end; padding-block: var(--space-7); display: grid; gap: var(--space-5); }
.hero__content > * { margin: 0; }
.hero__brand { font-size: var(--fs-meta); font-weight: var(--fw-button); letter-spacing: var(--tracking-meta); text-transform: uppercase; color: var(--rf-ivory); }
.hero .t-lead { color: var(--rf-ivory); }

/* ---------- Project card ---------- */
.project-card { position: relative; display: grid; gap: var(--space-3); align-content: start; }
.project-card__media { transition: opacity var(--dur-base) var(--ease); }
/* The "·" separator sits centred in the column gap, just left of each item. The first item on every line has its
   separator in the clipped area, so a wrapped line never starts with one (longer category names, 24 Oct 2026). */
.project-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-2) calc(var(--space-3) * 2); margin: 0; overflow: hidden; }
.project-card__meta span { position: relative; }
.project-card__meta span::before { content: "·"; position: absolute; right: 100%; width: calc(var(--space-3) * 2); text-align: center; color: var(--surface-accent); }
.project-card__title { margin: 0; font-size: var(--fs-h3); }
.project-card__title a { text-decoration: none; }
.project-card__title a::after { content: ""; position: absolute; inset: 0; }   /* whole card is the link target */
.project-card__client { margin: 0; color: var(--surface-text-muted); font-size: var(--fs-small); }
.project-card:hover .project-card__media { opacity: 0.88; }
.project-card:focus-within { outline: 2px solid var(--surface-focus); outline-offset: 6px; }
.project-card:focus-within a:focus-visible { outline: none; }

/* ---------- Discipline lanes ---------- */
.lane { display: grid; gap: var(--space-3); padding-top: var(--space-5); border-top: var(--hairline) solid var(--surface-rule); }
.lane > * { margin: 0; }

/* ---------- Trusted-by line ---------- */
.trusted { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); list-style: none; }
.trusted li { font-family: var(--font-display); font-size: var(--fs-h3); color: var(--surface-text); }

/* ---------- Dev-only notes in the shell build ---------- */
.dev-note {
  border: 1px dashed currentColor; padding: var(--space-4); font-size: var(--fs-small);
  color: var(--surface-meta); max-width: var(--measure);
}

/* ---------- Footer ---------- */
.site-footer { padding-block: var(--space-9) var(--space-6); background: var(--surface-bg); color: var(--surface-text); }
.site-footer__top { display: grid; gap: var(--space-7); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .site-footer__top { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); } }
.site-footer .logo--full { --logo-h: 5.5rem; }
.site-footer__col { display: grid; gap: var(--space-3); align-content: start; }
.site-footer__col h2 { margin: 0 0 var(--space-2); }
.site-footer__col a { text-decoration: none; color: var(--surface-text-muted); }
.site-footer__col a:hover { color: var(--surface-text); }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-8); padding-top: var(--space-5); border-top: var(--hairline) solid var(--surface-rule);
}

/* ---------- Project card: desktop hover (pointer devices only) ---------- */
@media (hover: hover) and (pointer: fine) {
  .project-card .media img, .project-card .media video { transition: transform 600ms var(--ease); }
  .project-card:hover .media img, .project-card:hover .media video { transform: scale(1.025); }
  .project-card:hover .project-card__title a { text-decoration: underline; text-decoration-color: var(--surface-accent); }
}
.project-card:hover .project-card__media { opacity: 1; }
.project-card[hidden], .work__empty[hidden] { display: none; }
.work__empty { display: grid; gap: var(--space-4); justify-items: start; padding-block: var(--space-6); }   /* fix 6 */

/* ---------- Work: filter bar ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--space-3); list-style: none; margin: 0 0 var(--space-7); }
.filter-chip {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 2.75rem; padding: 0 var(--space-4);
  border: var(--hairline) solid var(--surface-rule); border-radius: var(--radius-pill);
  font-size: var(--fs-button); font-weight: var(--fw-button); letter-spacing: var(--tracking-button); text-transform: uppercase;
  text-decoration: none; color: var(--surface-text);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.filter-chip:hover { border-color: var(--surface-text); }
.filter-chip[aria-current="page"] { background: var(--rf-ivory); border-color: var(--rf-ivory); color: var(--rf-obsidian); }
.filter-chip__count { font-weight: var(--fw-ui); opacity: 0.7; }

/* ---------- Project page ---------- */
.project__head { padding-bottom: 0; }
.project__crumbs { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); }
.project__crumbs a { text-decoration: none; color: var(--surface-meta); }
.project__crumbs a:hover { color: var(--surface-text); }
.project__head h1 { margin-bottom: var(--space-5); }
.project__note { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: baseline; padding: var(--space-3) var(--space-4); border-left: 2px solid var(--rf-copper); background: rgba(241, 237, 229, 0.06); max-width: var(--measure); }
.project__media { margin-top: var(--space-6); padding-bottom: var(--section-space-tight); }
.project__player-shell { position: relative; }
.project__player-note { margin-top: var(--space-3); }
.project__grid { align-items: start; }                       /* fix 1: facts align to the top, not centred */
.project__facts { margin: 0; display: grid; gap: var(--space-5); align-content: start; }
/* fix 2: with no credits block, facts become one inline row above the description (no empty half-column) */
.project__grid--sparse { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
.project__grid--sparse > * { max-width: 46rem; }   /* keep the container's left edge (aligned with the title) */
.project__grid--sparse .project__facts { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-7); }
.project__facts dd { margin: var(--space-1) 0 0; font-size: var(--fs-body); }
.project__credits ul { list-style: none; display: grid; gap: var(--space-2); }
.project__credits .t-meta { margin-right: var(--space-2); }
/* fix 5: previous / next pager */
.project__pager-inner { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .project__pager-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.project__pager-link { display: grid; gap: var(--space-2); align-content: start; text-decoration: none; padding-top: var(--space-4); border-top: var(--hairline) solid var(--surface-rule); }
@media (min-width: 768px) { .project__pager-link--next { text-align: right; } }
.project__pager-link .t-h3 { font-family: var(--font-display); font-size: var(--fs-h3); line-height: var(--lh-tight); }
.project__pager-link:hover .t-h3 { color: var(--surface-accent); }
.project__pager-all { margin-top: var(--space-6); }

/* ---------- Phase 3: page head, services, process, about, enquiry form (existing tokens only) ---------- */
.page-head { margin-bottom: var(--space-7); }

.services { display: grid; gap: 0; }
.service {
  display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr);
  padding-block: var(--space-7); border-top: var(--hairline) solid var(--surface-rule);
}
@media (min-width: 768px) { .service { grid-template-columns: 4rem minmax(0, 1fr); } }
.service__num { color: var(--surface-accent); margin: 0; padding-top: 0.6rem; }
.service__body { display: grid; gap: var(--space-4); max-width: 46rem; }
.service__body > * { margin: 0; }
.service__for { color: var(--surface-text-muted); }
.service__outputs { list-style: none; display: grid; gap: var(--space-2); }
.service__outputs li { padding-left: var(--space-5); position: relative; }
.service__outputs li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: var(--space-3); height: var(--hairline); background: var(--surface-accent); }
.services__aerial { margin: var(--space-5) 0 0; color: var(--surface-text-muted); border-top: var(--hairline) solid var(--surface-rule); padding-top: var(--space-5); }
.process { list-style: none; }

.about { max-width: 46rem; }
.about__text p { max-width: none; }
.about__credits { max-width: 46rem; }
.frame { margin: 0; display: grid; gap: var(--space-3); }
.frame__link { display: block; }
@media (hover: hover) and (pointer: fine) { .frame__link img { transition: transform 600ms var(--ease); } .frame__link:hover img { transform: scale(1.025); } }

/* Enquiry form — square fields (pill radius stays reserved for buttons) */
.book { align-items: start; gap: var(--space-8); }
.book__intro .page-head { margin-bottom: 0; }
.enquiry { display: grid; gap: var(--space-5); }
.enquiry > p { margin: 0; }
.field { display: grid; gap: var(--space-2); }
.field__label { font-size: var(--fs-small); font-weight: var(--fw-button); letter-spacing: 0.02em; }
.field__req { color: var(--rf-copper); }
.field__opt { font-weight: var(--fw-body); color: var(--surface-meta); }
.field__hint { margin: 0; font-size: var(--fs-small); color: var(--surface-meta); }
.field__input {
  width: 100%; min-height: 3rem; padding: var(--space-3) var(--space-4);
  font: inherit; font-size: max(16px, var(--fs-body)); /* ≥16px prevents iOS zoom on focus */
  color: var(--surface-text); background: transparent;
  border: var(--hairline) solid color-mix(in srgb, var(--surface-text) 40%, transparent); border-radius: 0;
}
textarea.field__input { resize: vertical; min-height: 6rem; }
select.field__input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: var(--space-7); }
.field__input:hover { border-color: var(--surface-text); }
.field__input:focus-visible { outline: 2px solid var(--surface-focus); outline-offset: 0; border-color: var(--surface-focus); }
.field.is-invalid .field__input { border-color: var(--rf-copper); border-width: 2px; }
.field__error { margin: 0; font-size: var(--fs-small); font-weight: var(--fw-button); padding-left: var(--space-3); border-left: 2px solid var(--rf-copper); }
.enquiry__summary { padding: var(--space-4) var(--space-5); border-left: 3px solid var(--rf-copper); background: rgba(11, 11, 10, 0.04); }
.enquiry__summary p, .enquiry__summary ul { margin: 0; }
.enquiry__summary ul { margin-top: var(--space-2); padding-left: var(--space-5); }
.enquiry__summary a { color: var(--surface-text); }
.enquiry__done { display: grid; gap: var(--space-4); padding: var(--space-6); border-left: 3px solid var(--rf-forest); background: rgba(11, 11, 10, 0.04); }
.enquiry__done > * { margin: 0; }
.enquiry__done[hidden], .enquiry[hidden] { display: none; }

/* Phase 3 QA: Enquire current-page state (gold ring, existing tokens) and the character counter */
.site-nav__cta .btn[aria-current="page"] { box-shadow: 0 0 0 2px var(--surface-bg), 0 0 0 3px var(--rf-gold); }
.field__count { margin: 0; justify-self: end; font-size: var(--fs-meta); color: var(--surface-meta); font-variant-numeric: tabular-nums; }
.field__count.is-near { color: var(--surface-text); font-weight: var(--fw-button); }
.service__also { color: var(--surface-text-muted); }

/* Preview loop (hero / tiles): the poster <img> paints first and holds the box; the video fades in over it only
   once it is actually playing, so there is no flash of black and no layout shift. */
.media--loop > video { opacity: 0; transition: opacity var(--dur-base) var(--ease); }
.media--loop.is-playing > video { opacity: 1; }
.hero__media video { object-position: var(--focus-x, 50%) 50%; }
/* Pause/play control (WCAG 2.2.2). Quiet by design: no ring, an obsidian disc and a slim ivory icon that
   come up to full strength on hover and keyboard focus (gold focus ring from base.css). It sits on the layout
   grid: the content container's right edge, on the hero buttons' line (bottom = the hero's --space-7 padding).
   44 × 44 px hit area. Icon contrast on its disc, measured over the brightest footage: ≥ 4.4:1 on phones. */
.media__loop-toggle {
  position: absolute; z-index: 2;
  right: max(var(--gutter), calc((100% - var(--content-max)) / 2)); bottom: var(--space-7);
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 0; border-radius: var(--radius-pill);
  background: rgba(11, 11, 10, 0.6); color: var(--rf-ivory); opacity: 0.9;
  transition: opacity var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.media__loop-toggle:hover, .media__loop-toggle:focus-visible { opacity: 1; background: rgba(11, 11, 10, 0.75); }
/* `display: grid` above would override the hidden attribute: a hidden control must not render or take focus. */
.media__loop-toggle[hidden] { display: none; }
/* Pause icon (two slim bars); aria-pressed="true" (paused) shows a play triangle. */
.media__loop-toggle > span { width: 0.625rem; height: 0.75rem; border-inline: 0.1875rem solid currentColor; }
.media__loop-toggle[aria-pressed="true"] > span {
  width: 0; height: 0; border-inline: 0; border-block: 0.375rem solid transparent; border-left: 0.625rem solid currentColor; margin-left: 0.2rem;
}
/* Below 768 px the hero CTAs span the full width at the foot: the control moves to the top-right, on the gutter. */
@media (max-width: 47.99rem) {
  .hero .media__loop-toggle { top: var(--space-4); right: var(--gutter); bottom: auto; }
}

/* Project film (Mux Player): fills the existing 16:9 media box; letterboxes rather than crops. */
.project__player > mux-player { position: absolute; inset: 0; width: 100%; height: 100%; --media-object-fit: contain; }

/* Vertical films (9:16; 24 Oct 2026). Never stretched or cropped to landscape. In a 16:9 card or frame the whole
   vertical frame sits centred over a blurred, darkened backdrop of itself (decorative). On the project page the player
   itself is 9:16, centred, and sized so the whole film fits on screen below the header. */
.media--vertical > img:not(.media__backdrop), .media--vertical > picture > img { object-fit: contain; }
.media--vertical > .media__backdrop { inset: -8%; width: 116%; height: 116%; filter: blur(18px) brightness(0.45) saturate(0.9); }
.project__player--vertical {
  --ar: 9 / 16;
  width: min(100%, 27rem, calc((100vh - var(--header-h) - 2 * var(--space-5)) * 9 / 16));
  width: min(100%, 27rem, calc((100svh - var(--header-h) - 2 * var(--space-5)) * 9 / 16));
  margin-inline: auto;
}

/* Tile loops (only present when a card has one): the quieter local pause control: smaller, tight to the
   tile's corner, slightly receded until the card is hovered or the control has keyboard focus. It sits above the
   card's full-card link layer. 28 px target (WCAG 2.2 minimum 24 px). */
.project-card .media__loop-toggle {
  right: var(--space-2); bottom: var(--space-2); width: 1.75rem; height: 1.75rem;
  background: rgba(11, 11, 10, 0.55); opacity: 0.8;
}
.project-card:hover .media__loop-toggle, .project-card .media__loop-toggle:focus-visible { opacity: 1; background: rgba(11, 11, 10, 0.75); }
.project-card .media__loop-toggle > span { width: 0.5rem; height: 0.625rem; border-inline-width: 0.15rem; }
.project-card .media__loop-toggle[aria-pressed="true"] > span { border-block-width: 0.3rem; border-left-width: 0.5rem; }
