/* ==========================================================================
   Vlad Tymkiv — portfolio stylesheet
   One file for all seven pages. Sections:
   1 fonts · 2 tokens · 3 base · 4 type · 5 layout · 6 header & menu
   7 buttons · 8 hero & reel · 9 tiles & slots · 10 home sections
   11 service pages · 12 case studies · 13 about · 14 footer
   15 editor · 16 motion · 17 responsive
   ========================================================================== */

/* 1 · Fonts (self-hosted, SIL OFL) ---------------------------------------- */
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/hanken-grotesk-normal-latin.woff2") format("woff2");
  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;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/hanken-grotesk-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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: "Bodoni Moda";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("../assets/fonts/bodoni-moda-italic-latin.woff2") format("woff2");
  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;
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("../assets/fonts/bodoni-moda-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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;
}

/* 2 · Tokens -------------------------------------------------------------- */
:root {
  --bg: #08090b;
  --bg-2: #0e0f13;
  --panel: #121318;
  --panel-2: #17181e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f3f0;
  --muted: #9a9ca6;
  --dim: #83858f;
  --pink: #ee5aa9;
  --pink-soft: rgba(238, 90, 169, 0.14);
  --green: #7fe5a4;
  --radius: 20px;
  --radius-sm: 12px;
  --pill: 999px;
  --wrap: 1440px;
  --gutter: clamp(16px, 4vw, 56px);
  --gap: clamp(10px, 1.1vw, 16px);
  --header-h: 84px;
  --font-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Bodoni Moda", "Bodoni 72", Didot, "Didot LT STD", Georgia, serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 600ms;
  color-scheme: dark;
}

/* 3 · Base ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #2a2b33 var(--bg);
  scrollbar-width: thin;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  caret-color: var(--pink);
}

::selection { background: var(--pink); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2b33; border-radius: 10px; border: 2px solid var(--bg); }

a { color: inherit; text-decoration: none; }
a:not([class]) { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-color: var(--line-strong); }
a:not([class]):hover { text-decoration-color: var(--pink); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--pink); outline-offset: 4px; border-radius: 4px; }
.btn:focus-visible, .tile:focus-visible, .slot:focus-visible { border-radius: var(--pill); }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--pill);
  font-weight: 600; transition: top 150ms var(--ease-out);
}
.skip-link:focus { top: 16px; }

.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;
}

/* 4 · Type ---------------------------------------------------------------- */
.display {
  font-size: clamp(44px, 6.6vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-weight: 500;
  text-wrap: balance;
}
h2, .h2 {
  font-size: clamp(32px, 4.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h3, .h3 {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h4, .h4 {
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--muted);
  font-weight: 500;
}
h1 em, h2 em, h3 em, .display em, .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--pink);
  font-size: 1.04em;
  letter-spacing: -0.01em;
}
.eyebrow {
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.lead { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; color: var(--muted); max-width: 58ch; text-wrap: pretty; }
.lead strong { color: var(--text); font-weight: 500; }
.muted { color: var(--muted); }
.meta { font-size: 13px; line-height: 1.5; color: var(--muted); }
.prose p + p { margin-top: 1em; }
.prose { max-width: 68ch; text-wrap: pretty; }

/* 5 · Layout -------------------------------------------------------------- */
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(72px, 9vw, 136px); }
.section + .section { padding-top: 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-top: 22px; border-top: 1px solid var(--line); margin-bottom: clamp(28px, 3.5vw, 48px);
}
.section-head h2 { max-width: 16ch; }
.section-head .lead { max-width: 44ch; }
.section-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; text-align: right; }
.rail-controls { display: flex; gap: 8px; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text);
  transition: background 200ms var(--ease-out), border-color 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.icon-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.rule { border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12.5px; letter-spacing: 0.02em; line-height: 1; padding: 9px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--pill); color: var(--muted); white-space: nowrap;
}
.chip-strong { color: var(--text); border-color: rgba(255, 255, 255, 0.28); }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1;
  padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--pill); color: var(--text);
}
.arrow { width: 18px; height: 18px; flex: none; }

/* 6 · Header & menu ------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--header-h);
  display: flex; align-items: center;
  transition: transform 350ms var(--ease-out), background-color 250ms var(--ease-out), height 250ms var(--ease-out), border-color 250ms var(--ease-out);
  border-bottom: 1px solid transparent;
}
/* After the first screen the header becomes a compact bar; it hides on scroll-down and returns on scroll-up. */
.site-header.is-compact { height: 64px; background: rgba(8, 9, 11, 0.84); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: var(--line); }
.site-header.is-hidden { transform: translateY(-100%); }
body.menu-open .site-header { transform: none; background: transparent; border-bottom-color: transparent; }
main section[id], .case, .site-footer { scroll-margin-top: 72px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: -0.02em; font-size: 17px; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pink); display: inline-block; }
.nav { display: flex; align-items: center; gap: 30px; font-size: 14.5px; }
.nav > li { position: relative; }
.nav a, .nav button { padding: 10px 0; display: inline-flex; align-items: center; gap: 6px; color: #d7d7dc; transition: color 150ms; }
.nav a:hover, .nav button:hover, .nav a[aria-current="page"] { color: #fff; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.5em; text-decoration-color: var(--pink); text-decoration-thickness: 1.5px; }
.nav-dropdown-toggle svg { width: 14px; height: 14px; transition: transform 200ms var(--ease-out); }
.nav-dropdown.is-open .nav-dropdown-toggle svg { transform: rotate(180deg); }
.nav-menu {
  position: absolute; top: calc(100% + 6px); left: -18px; min-width: 300px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out), visibility 0s linear 150ms;
}
.nav-dropdown.is-open .nav-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav-menu a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 10px; width: 100%; color: var(--text); }
.nav-menu a:hover { background: var(--panel-2); }
.nav-menu small { color: var(--muted); font-size: 12.5px; display: block; margin-top: 2px; }
.nav-menu .arrow { width: 16px; height: 16px; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
  display: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong);
  align-items: center; justify-content: center; color: var(--text);
}
.menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle .icon-close { display: none; }
body.menu-open .menu-toggle .icon-menu { display: none; }
body.menu-open .menu-toggle .icon-close { display: block; }

.menu-overlay {
  position: fixed; inset: 0; z-index: 30; background: var(--bg);
  padding: calc(var(--header-h) + 16px) var(--gutter) 40px; overflow-y: auto;
  display: none; flex-direction: column; gap: 10px;
}
body.menu-open .menu-overlay { display: flex; }
body.menu-open { overflow: hidden; }
.menu-overlay a, .menu-overlay summary {
  display: flex; align-items: center; justify-content: space-between;
  font-size: clamp(26px, 7vw, 40px); letter-spacing: -0.03em; line-height: 1.15; padding: 14px 0;
  border-bottom: 1px solid var(--line); cursor: pointer; list-style: none;
}
.menu-overlay summary::-webkit-details-marker { display: none; }
.menu-overlay summary svg { width: 22px; height: 22px; transition: transform 200ms var(--ease-out); }
.menu-overlay details[open] summary svg { transform: rotate(180deg); }
.menu-overlay details ul { padding: 6px 0 10px 0; }
.menu-overlay details ul a { font-size: 19px; letter-spacing: -0.01em; padding: 12px 0 12px 18px; border-bottom: 0; color: var(--muted); }
.menu-overlay details ul a:hover { color: var(--text); }
.menu-overlay .menu-cta { margin-top: 24px; }
.menu-overlay .menu-cta .btn { width: 100%; }

/* 7 · Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: var(--pill);
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em; line-height: 1; white-space: nowrap;
  border: 1px solid transparent; color: var(--text);
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: #fff; border-color: #fff; }
.btn-ghost { border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--text); }
.btn-link { height: auto; padding: 0; border: 0; border-radius: 0; gap: 8px; color: var(--text); }
.btn-link:hover { color: var(--pink); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }

/* 8 · Hero & reel --------------------------------------------------------- */
.hero {
  position: relative; min-height: min(100svh, 980px); display: flex; align-items: flex-end;
  padding: calc(var(--header-h) + 40px) 0 clamp(40px, 6vh, 72px); overflow: hidden; isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -1; background: #0b0c10; }
.reel { position: absolute; inset: 0; }
.reel video, .reel .reel-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center;
  opacity: 0; transition: opacity var(--dur) var(--ease-out);
}
.reel video.is-on, .reel .reel-poster.is-on { opacity: 1; }
.reel[data-mode="static"] .reel-poster { opacity: 1; }
.hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 9, 11, 0.92) 0%, rgba(8, 9, 11, 0.78) 28%, rgba(8, 9, 11, 0.25) 58%, rgba(8, 9, 11, 0) 85%),
    linear-gradient(180deg, rgba(8, 9, 11, 0.55) 0%, rgba(8, 9, 11, 0) 22%, rgba(8, 9, 11, 0) 55%, rgba(8, 9, 11, 0.92) 100%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 8.4fr) minmax(0, 3.6fr); gap: 32px; align-items: end; }
.hero-eyebrow { margin-bottom: 22px; color: #c9c9d1; }
.hero h1 { max-width: 24ch; }
.hero .lead { margin-top: 26px; color: #c9c9d1; max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.reel-ui { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; justify-self: end; color: #d7d7dc; }
.reel-caption { display: flex; align-items: center; gap: 14px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.reel-live { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 4px var(--pink-soft); }
.reel-counter { color: var(--muted); }
.reel-progress { display: grid; grid-template-columns: repeat(4, 56px); gap: 6px; }
.reel-progress span { height: 2px; background: rgba(255, 255, 255, 0.22); border-radius: 2px; overflow: hidden; position: relative; }
.reel-progress span::after {
  content: ""; position: absolute; inset: 0; background: #fff; transform-origin: left; transform: scaleX(var(--p, 0));
}
.reel-progress span.is-done::after { transform: scaleX(1); }
.reel-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; }
.reel-toggle:hover { background: rgba(255, 255, 255, 0.08); }
.reel-toggle svg { width: 14px; height: 14px; }
.reel-toggle .icon-play { display: none; }
.reel-toggle[aria-pressed="true"] .icon-pause { display: none; }
.reel-toggle[aria-pressed="true"] .icon-play { display: block; }
.reel-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%; background: rgba(8, 9, 11, 0.6); border: 1px solid var(--line-strong);
  display: none; align-items: center; justify-content: center; color: #fff; backdrop-filter: blur(6px);
}
.reel-play svg { width: 26px; height: 26px; margin-left: 4px; }
.reel[data-mode="static"] .reel-play { display: inline-flex; }
.reel[data-mode="static"] ~ .hero-shade { background: linear-gradient(90deg, rgba(8, 9, 11, 0.9) 0%, rgba(8, 9, 11, 0.6) 40%, rgba(8, 9, 11, 0.2) 80%), linear-gradient(180deg, rgba(8, 9, 11, 0.4), rgba(8, 9, 11, 0) 30%, rgba(8, 9, 11, 0.9)); }

/* Sub-page hero */
.page-hero { padding: calc(var(--header-h) + clamp(56px, 9vw, 120px)) 0 clamp(40px, 5vw, 72px); }
.page-hero h1 { max-width: 18ch; }
.page-hero .lead { margin-top: 26px; max-width: 54ch; }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: end; }
.page-hero-aside { display: flex; flex-direction: column; gap: 14px; justify-self: end; max-width: 360px; }
.page-hero .eyebrow { margin-bottom: 22px; }

/* 9 · Tiles & slots ------------------------------------------------------- */
.tile, .slot {
  position: relative; overflow: hidden; border-radius: var(--radius); background: var(--panel);
  isolation: isolate;
}
.tile > img, .tile > video, .slot > img, .slot > video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 700ms var(--ease-out), opacity 400ms var(--ease-out);
}
.tile:hover > img, .tile:hover > video { transform: scale(1.025); }
.tile-caption {
  position: absolute; inset: auto 0 0 0; padding: 48px 18px 16px;
  background: linear-gradient(180deg, rgba(8, 9, 11, 0) 0%, rgba(8, 9, 11, 0.72) 100%);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; color: #fff;
}
.tile-caption > div { min-width: 0; }
.tile-title { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; overflow-wrap: anywhere; }
.tile-sub { font-size: 12.5px; color: #c9c9d1; margin-top: 2px; }
.tile-arrow {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff;
  transition: background 200ms var(--ease-out), transform 300ms var(--ease-out);
}
.tile-arrow svg { width: 15px; height: 15px; }
.tile:hover .tile-arrow { background: #fff; color: var(--bg); transform: translate(2px, -2px); }
.tile-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%; background: rgba(8, 9, 11, 0.55); border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; pointer-events: none;
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
}
.tile-play svg { width: 18px; height: 18px; margin-left: 3px; }
.tile.is-playing .tile-play { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
/* Keep playback controls out of the way during hover previews.
   The JS is-playing state still handles tap-to-play on touch devices. */
@media (hover: hover) and (pointer: fine) {
  .tile[data-hover-card]:hover > .tile-play {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.8);
  }
}
.tile[data-hover-card].is-playing > .tile-play {
  opacity: 0;
  visibility: hidden;
}

.tile-link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.tile-link:focus-visible { outline-offset: -3px; border-radius: var(--radius); }

/* Empty slot */
.slot.is-empty { background: var(--bg-2); }
.slot-empty {
  position: absolute; inset: 10px; border: 1px dashed var(--line-strong); border-radius: calc(var(--radius) - 8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 8px; padding: 18px; color: var(--muted);
}
.slot-empty svg { width: 26px; height: 26px; color: var(--dim); margin-bottom: 4px; }
.slot-empty strong { font-size: 14px; font-weight: 500; color: var(--text); letter-spacing: -0.005em; }
.slot-empty span { font-size: 12.5px; color: var(--dim); }
.slot[data-ratio="16/9"] { aspect-ratio: 16 / 9; }
.slot[data-ratio="4/3"] { aspect-ratio: 4 / 3; }
.slot[data-ratio="3/4"] { aspect-ratio: 3 / 4; }
.slot[data-ratio="1/1"] { aspect-ratio: 1 / 1; }
.slot[data-ratio="9/16"] { aspect-ratio: 9 / 16; }
.slot[data-ratio="21/9"] { aspect-ratio: 21 / 9; }

/* Unit grid for galleries: tiles span columns and rows of square units */
.unit-grid-wrap { container-type: inline-size; }
.unit-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: calc((100cqw - 11 * var(--gap)) / 12); grid-auto-flow: dense; gap: var(--gap);
}
.unit-grid > * { min-height: 0; }
.u-8x4 { grid-column: span 8; grid-row: span 4; }
.u-4x4 { grid-column: span 4; grid-row: span 4; }
.u-4x3 { grid-column: span 4; grid-row: span 3; }
.u-6x3 { grid-column: span 6; grid-row: span 3; }
.u-6x4 { grid-column: span 6; grid-row: span 4; }
.u-3x4 { grid-column: span 3; grid-row: span 4; }
.u-12x5 { grid-column: span 12; grid-row: span 5; }
.u-3x3 { grid-column: span 3; grid-row: span 3; }

/* Simple responsive galleries */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.gallery-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.gallery-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
/* Gallery defaults use :where() so a slot's own data-ratio rule always wins. */
.gallery :where(.slot), .gallery-2 :where(.slot), .gallery-4 :where(.slot) { aspect-ratio: 4 / 3; }
.gallery-wide :where(.slot) { aspect-ratio: 16 / 9; }
.gallery-portrait { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

/* 10 · Home sections ------------------------------------------------------ */
.statement { padding-block: clamp(64px, 8vw, 120px); }
.statement-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 40px; align-items: end; border-top: 1px solid var(--line); padding-top: 32px; }
.statement h2 { font-size: clamp(30px, 4vw, 58px); max-width: 20ch; }
.statement p { color: var(--muted); max-width: 40ch; text-wrap: pretty; }

.offers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px) var(--gap); }
.offer { display: flex; flex-direction: column; gap: 18px; }
.offer .slot, .offer .tile { aspect-ratio: 16 / 10; }
.offer-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: start; padding: 4px 4px 0; }
.offer-body h3 { max-width: 14ch; }
.offer-body p { color: var(--muted); grid-column: 1; max-width: 46ch; text-wrap: pretty; }
.offer-body .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.offers-secondary { margin-top: clamp(28px, 4vw, 56px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.offers-secondary.offers-single { grid-template-columns: minmax(0, 1fr); }
.offers-secondary.offers-single .offer-row { padding-right: 0; border-right: 0; }
.offer-row {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 20px; align-items: center;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.offer-row:nth-child(odd) { padding-right: clamp(16px, 3vw, 40px); border-right: 1px solid var(--line); }
.offer-row:nth-child(even) { padding-left: clamp(16px, 3vw, 40px); }
.offer-row .slot, .offer-row .tile { aspect-ratio: 4 / 3; border-radius: 14px; }
.offer-row .slot-empty { inset: 6px; border-radius: 9px; gap: 2px; padding: 6px; }
.offer-row .slot-empty strong { font-size: 11px; }
.offer-row .slot-empty span, .offer-row .slot-empty svg { display: none; }
.offer-row h3 { font-size: 20px; }
.offer-row p { color: var(--muted); font-size: 15px; margin-top: 4px; max-width: 36ch; }

.case-row:first-child { border-top: 1px solid var(--line); }
.case-row {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px clamp(24px, 3vw, 48px); align-items: center;
  padding: clamp(24px, 3vw, 40px) 0; border-bottom: 1px solid var(--line); position: relative;
}
.case-row .slot { aspect-ratio: 16 / 10; }
.case-row .case-body { display: flex; flex-direction: column; gap: 14px; padding-right: 8px; }
.case-row .case-body .meta { color: var(--muted); }
.case-row h3 { font-size: clamp(26px, 2.6vw, 38px); max-width: 16ch; }
.case-row p { color: var(--muted); max-width: 52ch; text-wrap: pretty; }
.case-row .btn-link { margin-top: 4px; }
.case-row-link { position: absolute; inset: 0; z-index: 1; }
.case-row:hover .btn-link { color: var(--pink); }
.case-row:hover .slot > img { transform: scale(1.025); }

.rail {
  display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding-bottom: 8px; scrollbar-width: none; cursor: grab;
  margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter);
}
.rail::-webkit-scrollbar { display: none; }
.rail { mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 56px), transparent 100%); -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 56px), transparent 100%); }
.rail.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.rail > * { scroll-snap-align: start; flex: none; }
.review-card {
  width: min(520px, 84vw); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 30px 26px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 320px;
}
.stars { display: flex; gap: 3px; color: var(--text); }
.stars svg { width: 15px; height: 15px; }
.stars-row { display: flex; align-items: center; gap: 12px; }
.stars-row .meta { color: var(--muted); }
.review-card blockquote { margin: 18px 0 0; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.45; letter-spacing: -0.012em; text-wrap: pretty; }
.review-card blockquote::before { content: "\201C"; font-family: var(--font-serif); color: var(--pink); font-size: 1.4em; line-height: 0; margin-right: 2px; vertical-align: -0.2em; }
.review-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.review-foot strong { display: block; font-size: 15px; font-weight: 500; }
.review-foot .meta { margin-top: 3px; }
.review-foot .btn-link { font-size: 14px; color: var(--muted); }
.review-foot .btn-link:hover { color: var(--pink); }
.reviews-note { margin-top: 18px; }

.about-preview { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.portrait { border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); padding: 10px; }
.portrait .slot { border-radius: calc(var(--radius) - 8px); aspect-ratio: 3 / 4; }
.portrait .slot > img { object-position: 50% 18%; }
.about-preview-body { display: flex; flex-direction: column; gap: 22px; }
.about-preview-body .prose { color: var(--muted); }

/* 11 · Service pages ------------------------------------------------------ */
.step:first-child { border-top: 1px solid var(--line); }
.step {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 24px 40px;
  padding: clamp(40px, 5vw, 72px) 0; border-bottom: 1px solid var(--line);
}
.step-label { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pink); font-weight: 500; padding-top: 10px; }
.step h2 { font-size: clamp(28px, 3.6vw, 52px); max-width: 16ch; }
.step p { color: var(--muted); max-width: 62ch; margin-top: 20px; text-wrap: pretty; font-size: clamp(16px, 1.25vw, 18px); }
.tech-note, .step .tech-note { font-size: 10.4px; line-height: 1.6; color: var(--muted); max-width: 120ch; margin-top: 18px; }
.tech-note strong { color: var(--text); font-weight: 600; }
.feature-strip { margin-top: 28px; }

.result-kicker {
  font-size: clamp(22px, 3vw, 40px); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; line-height: 1;
  color: var(--text); margin-bottom: 22px;
}
.result h2 { max-width: 22ch; }
.result .lead { margin-top: 26px; max-width: 62ch; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: clamp(32px, 4vw, 56px); }
.stat-card {
  display: flex; flex-direction: column; gap: 10px; padding: 28px 26px 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
  transition: border-color 200ms var(--ease-out), transform 300ms var(--ease-out);
}
.stat-card:hover { border-color: rgba(255, 255, 255, 0.28); transform: translateY(-2px); }
.stat-number { font-size: clamp(52px, 5.4vw, 76px); line-height: 0.95; letter-spacing: -0.04em; color: var(--green); font-weight: 500; font-variant-numeric: tabular-nums; }
.stat-number small { font-size: 0.45em; letter-spacing: -0.02em; margin-left: 2px; }
.stat-source { font-size: 15px; font-weight: 500; margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.stat-source svg { width: 14px; height: 14px; color: var(--muted); }
.stat-measure { font-size: 14px; color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.stat-year { font-size: 12.5px; color: var(--dim); margin-top: auto; padding-top: 6px; }
.stats-caveat { margin-top: 18px; max-width: 90ch; }

.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.how-step { padding: 28px 26px 30px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 14px; }
.how-step .serif { font-size: 34px; line-height: 1; color: var(--pink); }
.how-step h3 { font-size: 22px; }
.how-step p { color: var(--muted); font-size: 15.5px; text-wrap: pretty; }

.crosslinks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.crosslinks.crosslinks-single { grid-template-columns: minmax(0, 1fr); }
.crosslink {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 28px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: border-color 200ms var(--ease-out);
}
.crosslink:hover { border-color: rgba(255, 255, 255, 0.28); }
.crosslink h3 { font-size: 21px; }
.crosslink p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.crosslink .tile-arrow { background: transparent; border-color: var(--line-strong); }
.crosslink:hover .tile-arrow { background: #fff; color: var(--bg); }

.list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.list-card { padding: 26px 26px 28px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; }
.list-card h3 { font-size: 21px; }
.list-card p { color: var(--muted); font-size: 15.5px; text-wrap: pretty; }
.includes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; border-top: 1px solid var(--line); }
.includes li { padding: 18px 0; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: baseline; }
.includes li .serif { color: var(--pink); font-size: 22px; line-height: 1; flex: none; width: 28px; }
.includes-plain li { padding: 22px 0; }
.includes-plain strong { font-size: 19px; letter-spacing: -0.015em; }
.faq h3 { font-size: 19px; letter-spacing: -0.015em; font-weight: 500; line-height: 1.3; }
.faq p { color: var(--muted); margin-top: 6px; font-size: 15.5px; line-height: 1.55; text-wrap: pretty; max-width: 60ch; }
.includes li strong { font-weight: 500; }
.includes li span { color: var(--muted); }

.teasers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.teasers { border-top: 1px solid var(--line); gap: 0; }
.teaser { padding: 30px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.teaser:nth-child(odd) { padding-right: clamp(16px, 3vw, 40px); border-right: 1px solid var(--line); }
.teaser:nth-child(even) { padding-left: clamp(16px, 3vw, 40px); }
.teaser h3 { font-size: 26px; }
.teaser p { color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.teaser .btn-link { margin-top: auto; }

.quote-block { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: center; padding: clamp(32px, 4vw, 56px) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quote-block blockquote { margin: 0; font-size: clamp(22px, 2.4vw, 34px); line-height: 1.3; letter-spacing: -0.02em; text-wrap: pretty; }
.quote-block blockquote::before { content: "\201C"; font-family: var(--font-serif); color: var(--pink); font-size: 1.3em; line-height: 0; margin-right: 2px; vertical-align: -0.2em; }
.quote-block .quote-meta { display: flex; flex-direction: column; gap: 10px; justify-self: end; max-width: 320px; }

/* 12 · Case studies ------------------------------------------------------- */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.toc a { font-size: 13.5px; padding: 11px 15px; border: 1px solid var(--line-strong); border-radius: var(--pill); display: inline-flex; align-items: center; gap: 8px; transition: border-color 150ms, color 150ms; }
.toc a:hover { border-color: var(--text); }
.toc a svg { width: 13px; height: 13px; color: var(--muted); }
.case { padding-top: clamp(56px, 7vw, 100px); scroll-margin-top: 24px; }
.case + .case { border-top: 1px solid var(--line); margin-top: clamp(56px, 7vw, 100px); }
.case-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 40px; align-items: end; margin-bottom: clamp(24px, 3vw, 40px); }
.case-head .meta { margin-top: 14px; }
.case-head .meta .serif { font-size: 20px; color: var(--pink); }
.case-head h2 { max-width: 16ch; }
.case-head .chips { margin-top: 24px; }
.case-head .lead { justify-self: end; max-width: 44ch; }
.case-hero.slot { aspect-ratio: 16 / 9; }
.case-hero.slot.is-empty { aspect-ratio: 2.2 / 1; }
.case-blocks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.case-block { padding: 24px 22px 26px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; min-height: 220px; }
.case-block h3 { color: var(--pink); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.case-block p { color: var(--muted); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.case-block strong { color: var(--text); font-weight: 500; }
.spec { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(16px, 3vw, 40px); margin: var(--gap) 0 0; border-top: 1px solid var(--line); }
.spec > div { padding: 16px 0 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.spec dt { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.spec dd { margin: 6px 0 0; font-size: 15.5px; line-height: 1.45; text-wrap: pretty; }
.case-gallery { margin-top: var(--gap); }
.case-note { margin-top: 16px; max-width: 90ch; }
.review-full {
  margin-top: clamp(28px, 3vw, 44px); padding: clamp(28px, 4vw, 56px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 32px 56px;
}
.review-full .review-text { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; letter-spacing: -0.008em; text-wrap: pretty; }
.review-full .review-text p + p { margin-top: 1em; }
.review-full .review-text p:first-child::before { content: "\201C"; font-family: var(--font-serif); color: var(--pink); font-size: 1.5em; line-height: 0; margin-right: 2px; vertical-align: -0.25em; }
.review-side { display: flex; flex-direction: column; gap: 14px; align-self: start; }
.review-side strong { font-size: 17px; font-weight: 500; display: block; }
.review-side .meta { max-width: 32ch; }
.review-full .stars svg { width: 16px; height: 16px; }
.next-up { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: start; }
.next-up .gallery-2 { grid-column: 2; }

/* 13 · About -------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 96px); align-items: start; }
.about-sticky { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 18px; }
.about-name h2 { font-size: clamp(28px, 3vw, 40px); }
.about-name p { color: var(--muted); margin-top: 6px; }
.about-body { display: flex; flex-direction: column; gap: clamp(32px, 4vw, 56px); }
.about-body h3 { font-size: clamp(26px, 3vw, 44px); max-width: 16ch; }
.about-body .prose { color: var(--muted); font-size: clamp(16px, 1.25vw, 18px); max-width: 62ch; }
.about-body .prose strong { color: var(--text); font-weight: 500; }
.timeline { border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.timeline .serif { font-size: 26px; color: var(--pink); line-height: 1.1; }
.timeline strong { display: block; font-weight: 500; margin-bottom: 4px; }
.timeline p { color: var(--muted); font-size: 15.5px; max-width: 56ch; text-wrap: pretty; }
.about-quote { font-size: clamp(22px, 2.4vw, 34px); line-height: 1.3; letter-spacing: -0.02em; max-width: 24ch; text-wrap: pretty; border-left: 1px solid var(--pink); padding-left: 24px; }

/* 14 · Footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: clamp(72px, 9vw, 136px) 0 32px; margin-top: clamp(48px, 6vw, 96px); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: end; }
.footer-grid h2 { max-width: 16ch; }
.footer-grid .lead { margin-top: 24px; max-width: 42ch; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; align-items: center;
  margin-top: clamp(48px, 6vw, 96px); padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-nav a:hover { color: var(--text); }
.footer-tools { display: flex; gap: 6px 10px; flex-wrap: wrap; }
.footer-tools span + span::before { content: "·"; margin-right: 10px; color: var(--dim); }

/* 15 · Editor ------------------------------------------------------------- */
.editor-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; height: 46px; padding: 0 18px; border-radius: var(--pill);
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
}
.editor-fab svg { width: 16px; height: 16px; }
.editor-panel {
  position: fixed; right: 20px; bottom: 78px; z-index: 60; width: min(340px, calc(100vw - 40px));
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 18px; padding: 20px;
  display: none; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.8);
}
.editor-panel.is-open { display: flex; }
.editor-panel h3 { font-size: 17px; }
.editor-panel p { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.editor-panel .btn { width: 100%; }
.editor-status { font-size: 13px; color: var(--muted); min-height: 1.5em; }
.editor-status.is-error { color: #ff8aa6; }
.editor-status.is-ok { color: var(--green); }
.is-editing .slot, .is-editing .tile[data-media] { outline: 1px dashed var(--pink); outline-offset: 3px; }
.is-editing .is-overridden { outline-style: solid; }
.editor-panel code { font: inherit; font-weight: 600; color: var(--text); }
.editor-panel .meta { font-size: 12.5px; }
.slot-tools {
  position: absolute; top: 10px; right: 10px; z-index: 5; display: none; gap: 6px;
}
.is-editing .slot-tools { display: flex; }
.slot-tools button {
  height: 32px; padding: 0 12px; border-radius: var(--pill); background: rgba(8, 9, 11, 0.82); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2); font-size: 12.5px; font-weight: 500; backdrop-filter: blur(6px);
}
.slot-tools button:hover { background: #fff; color: var(--bg); }
.is-editing .tile-link, .is-editing .case-row-link { pointer-events: none; }

/* 16 · Motion ------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); }
.reveal.in-view { opacity: 1; transform: none; }
.reveal-fade { transform: none; transition-duration: 900ms; }
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
#cursor-dot {
  position: fixed; left: 0; top: 0; width: 15px; height: 15px; border-radius: 50%; background: #fff; z-index: 1000;
  pointer-events: none; transform: translate(-50%, -50%); mix-blend-mode: difference; opacity: 0;
  transition: opacity 200ms, width 200ms var(--ease-out), height 200ms var(--ease-out);
}
#cursor-dot.is-hover { width: 34px; height: 34px; }
#cursor-trail { position: fixed; inset: 0; z-index: 999; pointer-events: none; }
body.has-cursor, body.has-cursor a, body.has-cursor button, body.has-cursor .rail { cursor: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tile > img, .tile > video, .tile:hover > img, .tile:hover > video { transition: none; transform: none; }
  .reel video, .reel .reel-poster { transition: none; }
  #cursor-dot, #cursor-trail { display: none; }
  .nav-menu { transition: none; }
  .site-header { transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* 17 · Responsive --------------------------------------------------------- */
@media (max-width: 1200px) {
  .unit-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: calc((100cqw - 5 * var(--gap)) / 6); }
  .u-8x4 { grid-column: span 6; grid-row: span 3; }
  .u-4x4 { grid-column: span 3; grid-row: span 3; }
  .u-4x3 { grid-column: span 3; grid-row: span 3; }
  .u-6x3 { grid-column: span 3; grid-row: span 3; }
  .u-6x4 { grid-column: span 6; grid-row: span 4; }
  .u-3x4 { grid-column: span 3; grid-row: span 4; }
  .u-12x5 { grid-column: span 6; grid-row: span 3; }
  .u-3x3 { grid-column: span 3; grid-row: span 3; }
  .case-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --header-h: 72px; }
  body { font-size: 16px; }
  .nav, .header-actions .nav-cta { display: none; }
  .menu-toggle { display: inline-flex; }
  .hero { align-items: flex-end; min-height: min(100svh, 860px); }
  .hero-grid, .page-hero-grid, .statement-grid, .about-preview, .about-grid, .footer-grid, .case-head, .review-full, .quote-block, .next-up { grid-template-columns: minmax(0, 1fr); }
  .reel-ui { justify-self: start; align-items: flex-start; }
  .page-hero-aside, .case-head .lead, .quote-block .quote-meta { justify-self: start; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-head-side { align-items: flex-start; text-align: left; }
  .offers, .offers-secondary, .crosslinks, .list-grid, .teasers, .how, .includes { grid-template-columns: minmax(0, 1fr); }
  .teaser:nth-child(odd) { padding-right: 0; border-right: 0; }
  .teaser:nth-child(even) { padding-left: 0; }
  .offer-row:nth-child(odd) { padding-right: 0; border-right: 0; }
  .offer-row:nth-child(even) { padding-left: 0; }
  .case-row { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .case-row .case-index { display: none; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-portrait { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery.gallery-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-flow: row; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .about-sticky { position: static; }
  .next-up .gallery-2 { grid-column: 1; }
  .step { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .footer-actions { justify-content: flex-start; }
  .case-hero.slot { aspect-ratio: 16 / 9; }
}

@media (max-width: 640px) {
  :root { --gap: 10px; }
  .display { font-size: clamp(40px, 12vw, 60px); }
  h2, .h2 { font-size: clamp(30px, 9vw, 44px); }
  .hero-actions .btn, .footer-actions .btn { width: 100%; }
  /* Phone: the clip is a framed block above the copy, so the media stays bright and the text sits on the ground. */
  .hero { display: block; min-height: 0; padding: calc(var(--header-h) + 8px) 0 clamp(32px, 6vh, 56px); }
  .hero-media { position: relative; inset: auto; z-index: 0; margin: 0 var(--gutter); aspect-ratio: 4 / 5; max-height: 62svh; border-radius: var(--radius); overflow: hidden; }
  .hero-shade, .reel[data-mode="static"] ~ .hero-shade { background: linear-gradient(180deg, rgba(8, 9, 11, 0) 72%, rgba(8, 9, 11, 0.45) 100%); }
  .hero-grid { padding-top: 26px; }
  .hero-eyebrow { margin-bottom: 16px; }
  .hero .lead { margin-top: 18px; }
  .hero-actions { margin-top: 26px; }
  .hero h1 { max-width: none; }
  .unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .unit-grid > * { grid-column: span 1; grid-row: auto; aspect-ratio: 1 / 1; }
  .unit-grid > .u-8x4, .unit-grid > .u-12x5, .unit-grid > .u-6x3, .unit-grid > .u-6x4 { grid-column: span 2; aspect-ratio: 16 / 10; }
  .tech-note, .step .tech-note { font-size: 12px; }
  .gallery, .gallery-2, .gallery-4, .case-blocks, .spec { grid-template-columns: minmax(0, 1fr); }
  .gallery.gallery-portrait, .gallery.gallery-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: span 1; }
  .review-card { width: min(440px, 86vw); padding: 24px 22px 22px; min-height: 0; }
  .reel-progress { grid-template-columns: repeat(4, 40px); }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .offer-body { grid-template-columns: minmax(0, 1fr); }
  .offer-body .btn { grid-column: 1; grid-row: auto; justify-self: start; }
  .offer-row { grid-template-columns: 84px minmax(0, 1fr); }
  .offer-row .btn { grid-column: 2; justify-self: start; }
  .case-block { min-height: 0; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .stat-number { font-size: 56px; }
}

@media (max-width: 380px) {
  .display { font-size: clamp(36px, 11.5vw, 44px); }
  .reel-caption { font-size: 11px; letter-spacing: 0.1em; }
}

/* Game creatives: formats tile and the paired scene gallery */
.formats-tile { background: var(--bg-2); border: 1px solid var(--line); }
.formats { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 18px 16px 16px; }
.formats h3 { font-size: 19px; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
.formats p { font-size: 12.5px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.ratios { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 8px; margin: 0; padding: 0; list-style: none; }
.ratios li { display: grid; grid-template-rows: 36px auto; justify-items: center; align-items: center; row-gap: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ratio-box { display: grid; place-items: center; height: 36px; }
.ratio { display: block; border: 1.5px solid var(--text); border-radius: 3px; }
.ratio-16x9 { aspect-ratio: 16 / 9; height: 20px; }
.ratio-9x16 { aspect-ratio: 9 / 16; height: 34px; }
.ratio-1x1 { aspect-ratio: 1 / 1; height: 26px; }
.ratio-4x5 { aspect-ratio: 4 / 5; height: 30px; }
.ratio.is-shown { border-color: var(--pink); }
.ratios li:has(.is-shown) { color: var(--text); }
.gallery-pairs { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(2, auto); grid-auto-flow: column; }

/* 18 · Lightbox ---------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: clamp(12px, 3vw, 40px); opacity: 0; transition: opacity 320ms var(--ease-out); }
.lightbox.is-open { opacity: 1; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(8, 9, 11, 0.96); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); transition: backdrop-filter 480ms var(--ease-out), -webkit-backdrop-filter 480ms var(--ease-out); }
.lightbox.is-open .lightbox-backdrop { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.lightbox-figure { position: relative; margin: 0; width: 100%; max-width: min(1600px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lightbox-stage { display: grid; place-items: center; max-width: 100%; }
.lightbox-stage img, .lightbox-stage video { max-width: min(100%, 92vw); max-height: min(80vh, 80svh); width: auto; height: auto; border-radius: var(--radius-sm); background: #000; box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.9); }
.lightbox-stage img { background: transparent; }
.lightbox-caption { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; justify-content: center; color: var(--text); font-size: 14px; text-align: center; opacity: 0; transform: translateY(10px); transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out); }
/* The media lands first; caption and controls follow a beat later. Hover colours never wait. */
.lightbox.is-open .lightbox-caption { opacity: 1; transform: none; transition: opacity 320ms var(--ease-out) 200ms, transform 480ms var(--ease-out) 200ms; }
.lightbox.is-open .lightbox-close, .lightbox.is-open .lightbox-nav { opacity: 1; transition: opacity 280ms var(--ease-out) 220ms, background 200ms var(--ease-out), color 200ms var(--ease-out); }
.lightbox-title { font-weight: 500; }
.lightbox-close, .lightbox-nav {
  position: absolute; z-index: 2; width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: rgba(8, 9, 11, 0.6); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 160ms var(--ease-out), background 200ms var(--ease-out), color 200ms var(--ease-out);
}
.lightbox-close { top: clamp(12px, 2vw, 24px); right: clamp(12px, 2vw, 24px); }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: clamp(8px, 2vw, 24px); }
.lightbox-next { right: clamp(8px, 2vw, 24px); }
.lightbox-close:hover, .lightbox-nav:hover { background: #fff; color: var(--bg); }
.lightbox-close svg, .lightbox-nav svg { width: 20px; height: 20px; }
body.lightbox-open { overflow: hidden; }
.tile-zoom { position: absolute; inset: 0; z-index: 2; background: transparent; border: 0; border-radius: inherit; cursor: zoom-in; padding: 0; }
.tile-zoom:focus-visible { outline: 2px solid var(--pink); outline-offset: -3px; }
.tile-caption { z-index: 3; pointer-events: none; }
.tile-caption a, .tile-caption .tile-arrow { pointer-events: auto; }
.is-editing .tile-zoom { display: none; }
.reel-buttons { display: flex; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .lightbox, .lightbox-backdrop, .lightbox-caption, .lightbox-close, .lightbox-nav, .lightbox.is-open .lightbox-caption, .lightbox.is-open .lightbox-close, .lightbox.is-open .lightbox-nav { transition: none; } }
@media (max-width: 640px) {
  .lightbox-nav { top: auto; bottom: 16px; transform: none; width: 44px; height: 44px; }
  .lightbox-prev { left: 16px; }
  .lightbox-next { right: 16px; }
  .lightbox-stage img, .lightbox-stage video { max-height: 70svh; }
  .lightbox-figure { padding-bottom: 64px; }
}

@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
  .editor-fab, .editor-panel, .slot-tools, #cursor-dot, #cursor-trail, .menu-toggle { display: none !important; }
}

/* v5: ensure visual cursor stays above navigation popovers. */
#cursor-dot { z-index: 2147483647 !important; mix-blend-mode: normal; }
#cursor-trail { z-index: 2147483646 !important; }

.editor-collections { display:grid; gap: 8px; margin:18px 0; }
.editor-collections h4 {font-size:16px;}
.editor-collections p {color:var(--muted);font-size:12px;line-height:1.5;}
.editor-collection-btn {width:100%;justify-content:center;font-size:12px;}
.media-collection-section[hidden] {display:none!important;}
.media-collection-section .unit-grid {min-height:0;}
[data-collection="creatives"] > [data-collection-id] {aspect-ratio:9 / 16;}

/* V6: editable titles for shared-library cards */
.collection-rename { display:none; position:absolute; z-index:100; top:12px; right:12px; border:1px solid rgba(255,255,255,.45); background:#151519; color:#fff; padding:8px 11px; border-radius:8px; font:600 12px/1.2 Arial,sans-serif; cursor:pointer; }
.is-editing .collection-rename { display:block; }
.is-editing [data-collection-id] { position:relative; outline:1px dashed #ee5aa9; outline-offset:2px; }

/* Separate organic portfolio contact address */
.footer-email-link {
  display: block;
  flex: 0 0 100%;
  text-align: right;
  font-size: 14px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
.footer-email-link:hover { color: var(--text); }
@media (max-width: 840px) { .footer-email-link { text-align: left; } }

/* Case Studies navigation cards: the full tile, including its caption, is clickable. */
.case-card .tile-caption .tile-arrow { pointer-events: none; }
.case-card .tile-link { cursor: pointer; }
.case-card:focus-within { outline: 2px solid var(--pink); outline-offset: 3px; }
