/* ULTEMA — one-pager and project pages.
   Palette and type steps from the Taste sheet (name-as-monument, warm black and gold, Unbounded / Onest);
   motion values follow Emil Kowalski's rules: transform and opacity only, strong ease-out, hover only on fine pointers. */

@font-face { font-family: Unbounded; src: url(../fonts/unbounded-latin.woff2) format('woff2'); font-weight: 200 900; font-display: swap;
  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: Unbounded; src: url(../fonts/unbounded-cyrillic.woff2) format('woff2'); font-weight: 200 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; src: url(../fonts/onest-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap;
  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: Onest; src: url(../fonts/onest-cyrillic.woff2) format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #0c0a08;
  --surface: #181512;
  --ink: #ffffff;
  --muted: #8f8a84;
  --accent: #c9a45a;
  --accent-ink: #0c0a08;
  --film: #000000;               /* the ground behind a film before and around its frames */
  --scrim: rgba(0, 0, 0, 0.72);  /* the one neutral scrim value under type on a film */

  --m: clamp(18px, 2.2vw, 32px);
  --gap: 8px;
  --bar-h: 72px;
  --section: clamp(120px, 14vw, 200px);

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.2rem + 3.6vw, 5rem);
  --step-display: clamp(3.25rem, 9vw, 8.5rem);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #3a342e var(--bg); }
body {
  background: var(--bg); color: var(--ink);
  font: 400 var(--step-body)/1.5 Onest, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #3a342e; }

/* Bilingual copy: both languages ship in the markup, the active one shows. */
html[data-lang="en"] [lang="ru"], html[data-lang="ru"] [lang="en"] { display: none !important; }

.display {
  font-family: Unbounded, Onest, sans-serif; font-weight: 800; text-transform: uppercase;
  letter-spacing: -0.03em; line-height: 1;
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Buttons and links: one rectangular shape, square corners, press feedback. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  background: var(--accent); color: var(--accent-ink); font-weight: 500; font-size: var(--step-small);
  text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.btn:active { transform: scale(0.97); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; background: rgba(12, 10, 8, 0.55); color: var(--ink);
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 16px; height: 16px; }
.link { text-decoration: none; transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #d8b673; }
  .icon-btn:hover { background: rgba(12, 10, 8, 0.8); }
  .link:hover { color: var(--accent); }
}

/* ---------- Bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--bar-h); padding: 0 var(--m);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  font-size: var(--step-small); font-weight: 500;
  transition: background-color 240ms ease;
}
.bar.is-solid { background: var(--bg); }
.bar__home { display: block; width: clamp(108px, 9vw, 136px); color: var(--ink); }
.bar__home svg { width: 100%; height: auto; }
.bar__nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 32px); }
.bar__nav a { text-decoration: none; }
.lang { display: flex; gap: 2px; }
/* The inactive language stays at 72% white, not Ash, so it holds 4.5:1 over bright reel frames. */
.lang button { min-width: 36px; min-height: 36px; color: rgba(255, 255, 255, 0.72); transition: color 200ms ease; }
.lang button[aria-pressed="true"] { color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .lang button:hover { color: var(--ink); } }
/* During the intro the logo lives in the reel; the bar's copy appears once the letters have opened. */
.bar__home { transition: opacity 400ms var(--ease-out); }
.intro-on:not(.intro-done) .bar__home { opacity: 0; }

/* ---------- Hero: film title on the bottom edge ---------- */
.hero { position: relative; height: 100svh; min-height: 520px; overflow: hidden; background: var(--film); }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* A second neutral scrim keeps the bar's white links legible over bright reel frames (accessibility). */
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 180px; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, var(--scrim), transparent); /* taste-skill-ignore: neutral scrim under the bar */
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 46%; pointer-events: none;
  background: linear-gradient(to top, var(--scrim), transparent); /* taste-skill-ignore: the neutral scrim under the hero type */
}
/* The copy sits above the intro layer (z 45), as The Mill keeps its statement on screen through the intro. */
.hero__copy {
  position: absolute; z-index: 46; left: var(--m); right: var(--m); bottom: clamp(28px, 4vw, 48px);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
}
/* After The Mill: a small two-line statement in the corner, the second line a quieter tone. */
.hero__title { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; }
.hero__title [lang] > span { display: block; }
.hero__title [lang] > span + span { color: rgba(255, 255, 255, 0.72); }
.hero__lede { margin-top: 12px; max-width: 34ch; font-size: var(--step-body); font-weight: 400; line-height: 1.45; text-wrap: pretty; }
.hero__lede b { font-weight: 500; }
.hero__actions { display: flex; align-items: center; gap: 16px; }
.hero__ctrl { display: flex; gap: 8px; }
.hero__now { transition: opacity 240ms ease; }
.hero__now.is-empty { opacity: 0; }
/* The film on screen right now, named and linked to its page. */
.hero__now { display: grid; text-align: right; font-size: var(--step-small); line-height: 1.35; text-decoration: none; }
.hero__now-k { color: rgba(255, 255, 255, 0.72); }
.hero__now b { font-weight: 500; font-size: var(--step-body); transition: opacity 180ms ease, color 200ms ease; }
.hero__now b.is-changing { opacity: 0; }
@media (hover: hover) and (pointer: fine) { .hero__now:hover b { color: var(--accent); } }

/* ---------- Intro: the reel seen through the ULTEMA letters, which then open to the full screen ---------- */
.intro { display: none; }
.intro-on .intro {
  --iw: min(62vw, 980px); --ih: calc(var(--iw) * 180 / 1796);
  display: block; position: fixed; inset: 0; z-index: 45; pointer-events: none; background: var(--bg);
  -webkit-mask: url(../img/ultema-logo.svg) center / var(--iw) auto no-repeat, linear-gradient(#000 0 0); /* taste-skill-ignore: a mask layer, never painted */
  -webkit-mask-composite: xor;
  mask: url(../img/ultema-logo.svg) center / var(--iw) auto no-repeat exclude, linear-gradient(#000 0 0); /* taste-skill-ignore: a mask layer, never painted */
  /* Zoom about a point inside the L's stem, so the opening letter swallows the whole screen. */
  transform-origin: calc(50% - var(--iw) / 2 + var(--iw) * 0.2394) calc(50% - var(--ih) / 2 + var(--ih) * 0.333);
  transition: transform 1100ms var(--ease-in-out), opacity 250ms ease 850ms;
}
.intro-on.is-zooming .intro { transform: scale(90); opacity: 0; }
.intro-done .intro { display: none; }
/* ---------- Work: giant title, uneven wall ---------- */
.work { padding: var(--section) var(--m) 0; scroll-margin-top: var(--bar-h); }
.work__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.work__title { font-size: var(--step-display); }
.filter { display: flex; gap: 6px; padding-bottom: 0.6em; font-size: var(--step-small); font-weight: 500; }
.filter button {
  min-height: 40px; padding: 0 14px; color: var(--muted); background: var(--surface);
  transition: color 200ms ease, background-color 200ms ease, transform 160ms var(--ease-out);
}
.filter button:active { transform: scale(0.97); }
.filter button[aria-pressed="true"] { color: var(--accent-ink); background: var(--ink); }
@media (hover: hover) and (pointer: fine) { .filter button:not([aria-pressed="true"]):hover { color: var(--ink); } }

.wall { display: flex; flex-wrap: wrap; gap: var(--gap); margin-top: 32px; }
.tile {
  --row-h: 260px; flex: var(--ar) 1 calc(var(--ar) * var(--row-h)); min-width: 0;
  position: relative; display: block; text-decoration: none; color: var(--ink);
  transition: opacity 240ms ease;
}
.wall.is-laid .tile { flex: none; }
.tile[hidden] { display: none; }
.tile__media { position: relative; aspect-ratio: var(--ar); overflow: hidden; background: var(--surface); transition: opacity 240ms ease; }
.wall.is-laid .tile__media { aspect-ratio: auto; height: var(--h); }
.tile__media img, .tile__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Hover: the poster pushes in slowly, the loop wipes across it from the left like a cut and settles from a slight
   zoom. Entering is slow and soft, leaving is quick (Emil: asymmetric timing; transform, clip-path and opacity only). */
.tile__media img { transition: transform 420ms var(--ease-out); }
.tile__media video {
  clip-path: inset(0 100% 0 0); transform: scale(1.08);
  transition: clip-path 260ms var(--ease-out), transform 420ms var(--ease-out);
}
.tile.is-playing .tile__media video {
  clip-path: inset(0 0 0 0); transform: scale(1);
  transition: clip-path 640ms var(--ease-out), transform 1100ms var(--ease-out);
}
/* The name sits on the preview itself (owner, 2026-10-26), over a neutral scrim so they read on any frame. */
.tile__cap {
  position: absolute; inset: auto 0 0; z-index: 1; display: grid; padding: 36px 12px 10px;
  grid-template-rows: auto 0fr; transition: grid-template-rows 360ms var(--ease-out);
  font-size: var(--step-small); line-height: 1.35; white-space: nowrap; pointer-events: none;
  background: linear-gradient(to top, var(--scrim), transparent); /* taste-skill-ignore: neutral scrim under the tile name */
}
.tile__cap > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; transition: transform 320ms var(--ease-out); }
.tile__cap > .tile__cta { min-height: 0; opacity: 0; font-weight: 400; color: rgba(255, 255, 255, 0.72); transform: translateY(6px); transition: opacity 200ms ease, transform 320ms var(--ease-out); }
.tile:active .tile__media { transform: scale(0.985); transition: transform 160ms var(--ease-out), opacity 240ms ease; }
@media (hover: hover) and (pointer: fine) {
  /* Dim the media, not the tile: the tile's entrance animation holds its own opacity. */
  .wall:has(.tile:hover) .tile:not(:hover) .tile__media { opacity: 0.55; }
  .tile:hover .tile__media img { transform: scale(1.06); transition: transform 1200ms var(--ease-out); }
  .tile:hover .tile__cap > span:first-child { transform: translateY(-2px); }
  .tile:hover .tile__cap { grid-template-rows: auto 1fr; }
  .tile:hover .tile__cap > .tile__cta { opacity: 1; transform: none; transition: opacity 320ms ease 80ms, transform 420ms var(--ease-out) 80ms; }
}
.tile:focus-visible { outline-offset: 4px; }

/* ---------- About: the name, the words and the lists on the left; the portrait holds the right ---------- */
.about { padding: var(--section) var(--m); scroll-margin-top: var(--bar-h); }
.about__grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; }
.about__text { grid-column: 1 / span 7; }
.about__title { font-size: var(--step-display); }
.about__title [lang] > span { display: block; }
.portrait { grid-column: 9 / span 4; align-self: center; justify-self: center; width: min(100%, 380px); text-align: center; }
.portrait img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; } /* owner asked for a round portrait */
/* Magnet (site.js, mouse only): up to 13px toward the pointer and 1.03x, settling with ease-out. */
.portrait img { translate: var(--tx, 0) var(--ty, 0); scale: var(--ts, 1); transition: translate 520ms var(--ease-out), scale 520ms var(--ease-out); }
.portrait figcaption { padding-top: 20px; }
.portrait figcaption b { display: block; font-size: var(--step-body); font-weight: 500; }
.portrait figcaption > span { font-size: var(--step-small); color: var(--muted); }

.about__lead { margin-top: clamp(32px, 4vw, 56px); max-width: 38ch; font-size: var(--step-lead); line-height: 1.35; text-wrap: pretty; }

/* ---------- Contact: the email at the headline step, on the page's own ground ---------- */
.contact {
  position: relative; padding: clamp(72px, 7vw, 112px) var(--m) 0;
  display: grid; grid-template-rows: auto auto auto; scroll-margin-top: 0;
}
.contact__ask { max-width: 34ch; font-size: var(--step-lead); font-weight: 400; line-height: 1.3; text-wrap: balance; }
.contact__mail {
  display: block; width: fit-content; margin: clamp(32px, 4vw, 56px) 0 clamp(40px, 5vw, 72px);
  font-family: Unbounded, Onest, sans-serif; font-weight: 300; font-size: var(--step-head);
  letter-spacing: -0.04em; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: color 240ms ease;
}
@media (hover: hover) and (pointer: fine) { .contact__mail:hover { color: var(--accent); } }
/* Four contacts on the 12-column grid: a muted service name over the handle. */
.contact__list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 24px; }
.contact__list li { display: grid; gap: 8px; min-width: 0; }
.contact__list li > span { font-size: var(--step-small); color: var(--muted); }
.contact__list a { overflow-wrap: anywhere; }
.contact__note { margin-top: clamp(32px, 4vw, 48px); font-size: var(--step-small); color: var(--muted); }

/* ---------- Footer: a quiet close with a small logo ---------- */
.foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  padding: clamp(56px, 6vw, 88px) var(--m) 32px; font-size: var(--step-small); color: var(--muted);
}
.foot__mark { display: block; width: clamp(120px, 11vw, 168px); color: var(--ink); transition: color 200ms ease; }
.foot__mark svg { width: 100%; height: auto; }
.foot__top { justify-self: end; }
@media (hover: hover) and (pointer: fine) { .foot__mark:hover { color: var(--accent); } }

/* ---------- Project pages ---------- */
.case-top { padding: calc(var(--bar-h) + clamp(32px, 6vw, 80px)) var(--m) 0; }
.case-top__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.case-top__title { font-size: var(--step-head); max-width: 18ch; }
.case-top__kind { margin-top: 14px; font-size: var(--step-lead); line-height: 1.3; max-width: 36ch; }
.case-top__meta { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-top: 24px; font-size: var(--step-small); color: var(--muted); }
.case-top__meta b { color: var(--ink); font-weight: 500; }
.film { margin: 40px var(--m) 0; background: var(--film); }
.film video { width: 100%; max-height: 86svh; margin: 0 auto; }
.film--v { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(32px, 5vw, 80px); background: none; align-items: start; }
.film--v video { height: 86svh; width: auto; max-width: 100%; aspect-ratio: 9 / 16; background: var(--film); margin: 0; }
.film__side { display: grid; align-content: start; }
.film__side .case-text__role { grid-column: auto; }
.case-text .case-text__role { padding-top: 0.45em; }
.film__side .stills { margin: 48px 0 0; }
.film__side p { font-size: var(--step-lead); line-height: 1.4; max-width: 34ch; }
.film__side .case-text__role { margin-top: 48px; max-width: 40ch; }
.film--s video { height: 86svh; width: auto; max-width: 100%; aspect-ratio: 1; margin: 0 auto; }
.films { display: flex; flex-wrap: wrap; gap: var(--gap); margin: 40px var(--m) 0; }
.films video { height: 80svh; width: auto; max-width: 100%; background: var(--film); }
.films video.is-wide { width: 100%; height: auto; }
.case-text { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; padding: 56px var(--m) 0; }
.case-text p { grid-column: 1 / span 8; font-size: var(--step-lead); line-height: 1.4; }
.case-text__role { font-size: var(--step-small); line-height: 1.5; color: var(--muted); }
.case-text .case-text__role { grid-column: 10 / span 3; }
/* Beside a vertical film the role block stays in the single text column at every width. */
.film__side .case-text__role { grid-column: auto; }
.case-text__role b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 6px; }
.case-text p, .film__side p { text-wrap: pretty; }
.stills { display: flex; gap: var(--gap); margin: var(--section) var(--m) 0; }
.stills img { flex: 1 1 0; min-width: 0; height: auto; object-fit: cover; }
.more { padding: var(--section) var(--m) 0; }
.more__title { font-size: var(--step-head); margin-bottom: 32px; }
.more__row { display: flex; gap: var(--gap); }
.more__row .tile { flex: var(--ar) 1 0; }

/* 404: a short first screen on a looping film */
.lost { position: relative; min-height: 82svh; overflow: hidden; background: var(--film); display: grid; align-items: end; padding: calc(var(--bar-h) + 32px) var(--m) clamp(40px, 6vw, 72px); }
.lost__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lost::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--scrim), transparent); } /* taste-skill-ignore: neutral scrim under the 404 type */
.lost__copy { position: relative; z-index: 1; }

/* Sky Race breakdown */
.chapter { padding: var(--section) var(--m) 0; }
.chapter__title { font-size: var(--step-head); margin-bottom: 40px; }
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.board img { width: 100%; height: auto; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 64px; }
.two h3 { font-size: var(--step-lead); font-weight: 500; margin-bottom: 20px; }
.two ul { padding-left: 1.1em; display: grid; gap: 14px; }
.wide-loop { width: 100%; height: auto; background: var(--film); }
.car { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: center; margin-top: 64px; }
.car video { grid-column: 1 / span 7; width: 100%; height: auto; background: var(--film); }
.car div { grid-column: 9 / span 4; }
.car:nth-child(even) video { grid-column: 6 / span 7; grid-row: 1; }
.car:nth-child(even) div { grid-column: 1 / span 4; grid-row: 1; }
.car h3 { font-size: var(--step-lead); font-weight: 500; margin-bottom: 12px; }
.passes__big { width: 100%; height: auto; background: var(--film); }
.passes__steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap); margin-top: var(--gap); font-size: var(--step-small); font-weight: 500; text-align: left; }
.passes__steps button { display: grid; gap: 8px; color: var(--muted); transition: color 200ms ease, transform 160ms var(--ease-out); }
.passes__steps button img { width: 100%; height: auto; opacity: 0.55; transition: opacity 200ms ease; }
.passes__steps button:active { transform: scale(0.97); }
.passes__steps button[aria-pressed="true"] { color: var(--ink); }
.passes__steps button[aria-pressed="true"] img { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .passes__steps button:hover { color: var(--ink); } .passes__steps button:hover img { opacity: 0.85; } }
.scene { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: center; margin-top: 72px; }
.scene video { grid-column: 1 / span 7; width: 100%; height: auto; background: var(--film); }
.scene div { grid-column: 9 / span 4; }
.scene:nth-child(even) video { grid-column: 6 / span 7; grid-row: 1; }
.scene:nth-child(even) div { grid-column: 1 / span 4; grid-row: 1; }
.scene h3, .began h3, .fix h3 { font-size: var(--step-lead); font-weight: 500; margin-bottom: 12px; }
.began { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 64px; }
.fix { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 20px; margin-top: 72px; }
.fix video { grid-column: 1 / -1; width: 100%; height: auto; background: var(--film); }
.fix div { grid-column: span 6; }
.fix h4 { font-size: var(--step-body); font-weight: 500; margin-bottom: 6px; }
.fix p { color: var(--ink); }
.fix .fix__p { color: var(--muted); }
.still-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.still-grid img { width: 100%; height: auto; }
.still-grid img:last-child { grid-column: 1 / -1; }
.thanks { padding: var(--section) var(--m) 0; }
.thanks p { max-width: 40ch; margin-top: 32px; font-size: var(--step-lead); line-height: 1.4; }

/* ---------- Reveal on entry ----------
   Visible by default; where the browser has scroll timelines the part rises as it enters the screen.
   fill-mode forwards (not both) keeps everything below the fold in its finished state until it arrives. */
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@supports (animation-timeline: view()) {
  [data-reveal] {
    animation: rise var(--ease-out) forwards; animation-timeline: view();
    animation-range: entry calc(var(--k, 0) * 4%) entry calc(75% + var(--k, 0) * 4%);
  }
}

/* Text rises into place (site.js splits it): each word is a mask, and what sits in it rises from below.
   Headings go letter by letter, other text word by word so a paragraph is never slow to read. The mask reaches
   above the caps and below the baseline so Ё and descenders stay whole; ease-out, entrance only. */
/* The screen-reader copy is pinned to the block's own corner, not to wherever its sentence starts. */
.split { position: relative; }
.split .vh { left: 0; top: 0; }
.split .w { display: inline-block; clip-path: inset(-0.3em -0.1em -0.2em -0.1em); }
.split .c { display: inline-block; transform: translateY(125%); }
.split--letters .c { transition: transform 900ms var(--ease-out) calc(min(var(--i), 24) * 28ms), translate 220ms var(--ease-out), scale 220ms var(--ease-out); }
.split--words .c { transition: transform 700ms var(--ease-out) calc(min(var(--i), 40) * 12ms); }
.split.is-in .c { transform: none; }

/* Heading draw-on (site.js adds .split--draw, then .is-drawing): the Work and About headings, after the logo.
   An SVG outline on each letter is traced 60ms apart, then the letter itself fills; nothing rises. */
.split.split--draw .c { transform: none; position: relative; }
.split--draw:not(.is-in) .c { -webkit-text-fill-color: transparent; }
.split--draw.is-drawing .c { animation: head-fill 1500ms var(--ease-in-out) calc(min(var(--i), 24) * 60ms) both; }
.c-base { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.c-draw { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
/* The variable font builds letters from overlapping pieces, so a bare stroke shows seams inside them. The outline is
   stroked at 3px under a fill of the page colour (paint-order), which hides the seams and leaves a 1.5px outer edge. */
.c-draw text {
  font: inherit; text-transform: none; fill: var(--bg); stroke: currentColor; stroke-width: 3px; stroke-linejoin: round;
  paint-order: stroke fill; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); opacity: 0;
}
.is-drawing .c-draw text { animation: head-trace 1500ms var(--ease-in-out) calc(min(var(--i), 24) * 60ms) both; }
@keyframes head-fill { 0%, 65% { -webkit-text-fill-color: transparent; } 100% { -webkit-text-fill-color: currentcolor; } }
@keyframes head-trace {
  0% { stroke-dashoffset: var(--len); opacity: 1; }
  65% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Lens (site.js, mouse only). Letters take the lift and growth through translate and scale, which stack on top of
   the rise's transform instead of replacing it. Reading text: the words step back to 30% and light up near the pointer. */
.lens-ui .c { display: inline-block; transition: translate 200ms var(--ease-out), scale 200ms var(--ease-out); }
.lens-ui .c, .work__title .c, .about__title .c, .contact__mail .c { translate: 0 var(--ly, 0); scale: var(--ls, 1); transform-origin: 50% 100%; }
.lw { transition: opacity 240ms ease; }
.is-lit .lw { opacity: var(--lo, 0.3); }

/* Load moment: the hero copy settles in once. */
.js .hero__copy > * { opacity: 0; transform: translateY(12px); transition: opacity 600ms var(--ease-out) 200ms, transform 600ms var(--ease-out) 200ms; }
.js .is-loaded .hero__copy > * { opacity: 1; transform: none; }
.js .is-loaded .hero__copy > .hero__actions { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  .tile__media img, .tile__media video, .tile.is-playing .tile__media video { transform: none !important; clip-path: none !important; transition: none !important; }
  [data-reveal] { animation-name: fade !important; }
  .split .c { transform: none; transition: none; }
  .split { opacity: 0; transition: opacity 300ms ease; }
  .split.is-in { opacity: 1; }
  .js .hero__copy > * { transform: none; transition: opacity 300ms ease; }
}

/* ---------- Logo draw-on (site.js adds .is-drawing) ----------
   Each letter's outline is traced (pathLength 1, so one dash is the whole letter), 60ms apart, then the letter fills. */
.logo.is-drawing path {
  stroke: currentColor; stroke-width: 12; stroke-dasharray: 1;
  animation: logo-draw 1500ms var(--ease-in-out) calc(var(--i) * 60ms) both;
}
@keyframes logo-draw {
  0% { stroke-dashoffset: 1; fill-opacity: 0; }
  65% { stroke-dashoffset: 0; fill-opacity: 0; }
  100% { stroke-dashoffset: 0; fill-opacity: 1; stroke-width: 0; }
}

/* ---------- Cursor (mouse only; site.js adds .has-cursor) ----------
   A dot exactly on the pointer and a ring that follows with weight. Over a link the ring opens,
   over a film it fills white and says Watch. Transform and opacity only. */
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor, .cursor-dot { position: fixed; left: 0; top: 0; z-index: 99; pointer-events: none; opacity: 0; transition: opacity 200ms ease; }
.cursor-on .cursor, .cursor-on .cursor-dot { opacity: 1; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--ink); }
.cursor { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
.cursor i {
  position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--ink);
  transition: transform 420ms var(--ease-out), background-color 240ms ease;
}
.cursor > span {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent-ink);
  font-size: 9px; font-weight: 500; letter-spacing: 0.02em; opacity: 0; transition: opacity 160ms ease;
}
.cursor.is-link i { transform: scale(1.6); }
.cursor.is-film i { transform: scale(2.1); background: var(--ink); }
.cursor.is-film > span { opacity: 1; transition: opacity 200ms ease 120ms; }
.cursor-on .cursor.is-film ~ .cursor-dot { opacity: 0; }
.cursor.is-down i { transform: scale(0.85); transition-duration: 160ms; }
.cursor.is-film.is-down i { transform: scale(1.9); }
@media (prefers-reduced-motion: reduce) { .cursor i { transition: background-color 200ms ease; } }

/* ---------- Phone and tablet ---------- */
@media (max-width: 820px) {
  :root { --bar-h: 60px; --step-display: 14vw; }
  .about { padding-top: 150px; }
  .about__grid { display: block; }
  .portrait { width: 72%; margin: 48px auto 0; }
  .bar__nav a.bar__wide { display: none; }
  .hero__lede { max-width: 30ch; font-size: var(--step-body); }
  .hero__copy { flex-direction: column; align-items: stretch; gap: 20px; }
  .hero__actions { justify-content: space-between; }
  .hero__now { text-align: left; }
  .intro-on .intro { --iw: 92vw; }
  .contact__mail { white-space: normal; }
  .contact__list { grid-template-columns: 1fr; gap: 24px; }
  .foot { grid-template-columns: 1fr auto; row-gap: 40px; }
  .foot__mark { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .case-text p, .case-text__role { grid-column: 1 / -1; }
  .case-text .case-text__role { grid-column: 1 / -1; margin-top: 48px; padding-top: 0; }
  .film--v { grid-template-columns: 1fr; row-gap: 48px; }
  .film--v video, .film--s video { height: auto; width: 100%; }
  .films video { height: auto; width: 100%; }
  .more__row { flex-wrap: wrap; }
  .more__row .tile { flex: 1 1 40%; }
  .stills { flex-direction: column; }
  .board { grid-template-columns: 1fr 1fr; }
  .two, .began { grid-template-columns: 1fr; }
  .car video, .car div, .car:nth-child(even) video, .car:nth-child(even) div,
  .scene video, .scene div, .scene:nth-child(even) video, .scene:nth-child(even) div { grid-column: 1 / -1; grid-row: auto; }
  .car div, .scene div { margin-top: 20px; }
  .fix div { grid-column: 1 / -1; }
  .passes__steps { grid-template-columns: repeat(3, 1fr); }
}
