/* =====================================================================
   DENBFILM — styles (v17, reference-driven redesign)
   Darkroom black, bone-paper sections, blood-red call to action.
   The work itself is shown big and in the owner's own colour, with no
   decoration around it (the film-strip frames were removed, 2026-11-10).
   ===================================================================== */

/* ===== TOKENS ===== */
:root {
  --ink: #0d0a07;          /* darkroom black, page background */
  --ink-2: #17120d;        /* raised surface */
  --bone: #ece3d0;         /* main text on dark */
  --bone-dim: #b3a68e;     /* secondary text on dark, 8:1 */
  --line: rgba(236, 227, 208, .16);
  --line-strong: rgba(236, 227, 208, .32);
  --paper: #e6dcc6;        /* paper sections */
  --paper-ink: #1a130c;
  --paper-dim: #5e4f3b;    /* secondary text on paper, 5.8:1 */
  --paper-line: rgba(26, 19, 12, .18);
  --blood: #6b1009;        /* call-to-action field */
  --blood-hi: #8a160d;
  --edge: #e0912a;         /* film edge-print amber */
  --rec: #e5483a;
  --stamp: #a2301a;
  --frame: #221a13;

  --font-mega: "Oswald", "Arial Narrow", Impact, sans-serif;           /* giant type, nav, buttons */
  --font-title: "Cormorant Garamond", Georgia, "Times New Roman", serif; /* film titles, statements */
  --font-body: "Golos Text", "Segoe UI", Arial, sans-serif;           /* reading text */
  --font-type: "Courier New", Courier, "Liberation Mono", monospace;    /* the clapperboard slate */

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1320px;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 72px; --s7: 112px;
  --r-xs: 6px; --r-sm: 10px; --r-md: 16px; --r-lg: 24px; /* corner radii: a thing inside another steps down one size */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 88px;
  color-scheme: dark;
}
/* Light theme: the same tokens with new values, so everything built on them follows */
:root[data-theme="light"] {
  --ink: #f4efe4;
  --ink-2: #fffdf8;
  --bone: #1a130c;
  --bone-dim: #5e4f3b;     /* 6.9:1 on the light page */
  --line: rgba(26, 19, 12, .16);
  --line-strong: rgba(26, 19, 12, .32);
  color-scheme: light;
}
/* Always dark, in both themes: pictures (their box and captions over them), the red fields and the header lying on red */
.strip, .t-work, .t-contact, .cta, body[data-route="contact"] header.top {
  --ink: #0d0a07;
  --bone: #ece3d0;
  --bone-dim: #b3a68e;
  --line: rgba(236, 227, 208, .16);
  --line-strong: rgba(236, 227, 208, .32);
}
.strip { color: var(--bone); }
:root[data-theme="light"] :focus-visible { outline-color: var(--stamp); }
:root[data-theme="light"] .strip :focus-visible, :root[data-theme="light"] .t-work:focus-visible, :root[data-theme="light"] .t-contact:focus-visible { outline-color: var(--edge); }
:root[data-theme="light"] .pager i { color: var(--stamp); }
:root[data-theme="light"] .contact-form textarea::placeholder { color: var(--bone-dim); }
:root[data-theme="light"] .t-about { border-color: var(--paper-line); }
:root[data-theme="light"] .d-panel { box-shadow: 0 24px 40px -24px rgba(60, 40, 15, .45); }
/* colours fade while the theme changes (class set briefly by main.js); the switch knob keeps its own motion */

/* ===== BASE ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; background: var(--ink); color: var(--bone);
  font-family: var(--font-body); font-size: 17px; line-height: 1.6;
  overflow-x: hidden;
}
/* static film grain over everything */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='1 0 0 0 0  1 0 0 0 0  1 0 0 0 0  0 0 0 0 1'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>") 0 0 / 220px 220px;
}
img { max-width: 100%; }
[hidden]:not([hidden=until-found i]) { display: none !important; }
a { color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--edge); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
p { margin: 0 0 1em; }
/* Apple-style continuous corners where the browser supports them; plain round corners elsewhere */
.strip, .frame, .tile, .still, .cta, .board { corner-shape: squircle; }
.nav-left a, .mark, .lang button, .pager a { border-radius: var(--r-xs); }
/* first Tab stop: hidden until focused */
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100000; padding: 10px 16px; background: var(--bone); color: var(--ink); border-radius: var(--r-sm); font-weight: 600; text-decoration: none; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.container { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px)); }

/* red REC dot used in tile labels and "now showing" */
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--rec); } /* used once, on the reel's caption; no glow */

/* ===== INTRO ===== */
#intro-screen {
  position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center;
  background: var(--ink); pointer-events: none;
}
#intro-screen.skip { display: none; }
/* same type as the giant name on Home (h1), so the flight there is a pure move and scale */
.intro-name {
  font-family: var(--font-mega); font-weight: 700; text-transform: uppercase; white-space: nowrap;
  font-size: clamp(34px, 8vw, 110px); line-height: .95; letter-spacing: -.01em; color: var(--bone);
}
/* no will-change on purpose: a layer rasterised at the small size would land blurry and then snap sharp */

/* ===== HEADER: links left, wordmark centre, contact + language right ===== */
header.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px)) 18px max(var(--gutter), env(safe-area-inset-left, 0px));
  color: var(--bone);
}
.nav-left { display: flex; gap: 28px; }
.nav-left a, .nav-contact, .pill {
  font-family: var(--font-mega); font-weight: 500; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
}
.nav-left a, .nav-contact { padding-block: 9px; opacity: .82; transition: opacity .15s ease; }
.nav-left a:hover, .nav-left a[aria-current="page"], .nav-contact:hover, .nav-contact[aria-current="page"] { opacity: 1; }
.nav-left a[aria-current="page"], .nav-contact[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--edge); }
.nav-contact-m { display: none; }
.mark { display: inline-block; padding-block: 6px; text-decoration: none; justify-self: center; }
/* the stamp: an SVG impression (rough edge + patchy ink), tilted as if pressed by hand */
.mark .stamp { display: block; height: 38px; width: auto; aspect-ratio: 150 / 40; overflow: visible; transform: rotate(-1.5deg); }
.nav-right { justify-self: end; display: flex; align-items: center; gap: 14px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px;
  border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.pill:hover, .pill[aria-current="page"] { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.pill.solid { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.pill.solid:hover { background: var(--edge); border-color: var(--edge); }
.pill.big { min-height: 52px; font-size: 19px; }
.lang { display: flex; }
.lang button {
  min-width: 44px; min-height: 44px; padding: 4px 6px; border: 0; background: transparent; color: inherit; cursor: pointer; opacity: .6;
  font-family: var(--font-mega); font-weight: 500; font-size: 15px; letter-spacing: .06em;
}
.lang button:hover { opacity: 1; }
.lang button[aria-pressed="true"] { opacity: 1; box-shadow: inset 0 -2px 0 var(--edge); }

/* paper page: header switches to ink */
body[data-route="about"] header.top { color: var(--paper-ink); }

/* ===== PAGES ===== */
.page { display: block; }
.page.sub { padding-top: calc(var(--header-h) + var(--s6)); padding-bottom: var(--s6); }
#p-about { background: var(--paper); color: var(--paper-ink); }
#p-contact { padding-top: 0; }

h1, h2, h3 { margin: 0; font-weight: 700; }
h2 { font-family: var(--font-mega); text-transform: uppercase; font-size: clamp(64px, 13vw, 200px); line-height: .86; letter-spacing: -.005em; }
.page-head { margin-bottom: var(--s6); }
.page-intro { max-width: 44ch; margin: var(--s3) 0 0; font-size: clamp(19px, 1.8vw, 23px); line-height: 1.5; color: var(--bone-dim); }

/* ===== HOME: TITLE, THEN THE REEL AS ITS OWN FRAMED OBJECT ===== */
.hero { padding-top: calc(var(--header-h) + var(--s5)); padding-bottom: var(--s6); }
h1 {
  font-family: var(--font-mega); text-transform: uppercase; color: var(--bone);
  /* the owner's name on one line, column-wide: fitName() in main.js sets the exact size, this is the size before it runs */
  font-size: clamp(36px, 12vw, 180px); line-height: .95; letter-spacing: -.01em; margin-left: -.03em; white-space: nowrap;
}
:lang(ru) h1 { padding-bottom: .12em; } /* the tails of Д and У reach below the line */
.tagline {
  max-width: 30ch; margin: var(--s3) 0 0;
  font-family: var(--font-title); font-style: italic; font-weight: 500; font-size: clamp(24px, 2.8vw, 38px); line-height: 1.2;
}
.reel { margin-top: var(--s6); }
/* arrows to turn the films by hand: same look as the photo gallery's, over the frame's sides */
.reel .ph-prev { left: 14px; }
.reel .ph-next { right: 14px; }
#hero-frame { touch-action: pan-y; } /* sideways swipes turn the films, vertical ones still scroll */
/* the films take turns in the frame: they lie on top of each other and cross-fade */
.reel-slide { opacity: 0; transition: opacity .8s ease; }
.reel-slide.on { opacity: 1; }
/* one hairline per film under the frame; it fills as the film plays (--p, set by main.js); 44 px tall to tap */
.reel-dots { display: flex; gap: var(--s2); margin-top: 4px; }
.reel-dot { flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.reel-dot span { display: block; height: 2px; overflow: hidden; background: var(--line-strong); border-radius: 1px; }
.reel-dot i { display: block; height: 100%; background: var(--bone); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.reel-dot:hover span { background: color-mix(in srgb, var(--bone) 45%, transparent); }
#hero-frame { cursor: pointer; }
#hero-frame:focus-visible { outline: 3px solid var(--edge); outline-offset: -3px; }
/* caption over the film, no background: appears on hover or keyboard focus; on phones on the first tap (.on, set by main.js) */
.reel-over {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px var(--s3);
  padding: clamp(12px, 2.4vw, 32px); color: var(--bone); pointer-events: none; opacity: 0; transition: opacity .2s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 18px rgba(0, 0, 0, .85);
}
#hero-frame:focus-visible .reel-over, .reel-over.on { opacity: 1; }
@media (hover: hover) { #hero-frame:hover .reel-over { opacity: 1; } }
.now-showing { display: flex; align-items: flex-start; gap: 10px; font-size: 16px; line-height: 1.3; }
.now-showing .dot { margin-top: .35em; }
.now-showing .ns-label, .now-showing .yr { display: block; }
.now-showing b { display: block; font-family: var(--font-title); font-weight: 600; font-size: clamp(22px, 2.6vw, 36px); line-height: 1.1; }
.reel-over .watch { margin-top: 0; color: var(--bone); }

.statement {
  margin: 0; max-width: 24ch;
  font-family: var(--font-title); font-weight: 500; font-size: clamp(32px, 4.4vw, 62px); line-height: 1.08; letter-spacing: -.005em; font-variant-numeric: lining-nums;
  text-wrap: balance;
}

/* ===== PICTURE BOX (the reel, Work cards, the mini page) =====
   Just the picture, edge to edge, in its own colour: no frame, no shadow, no tint. (.strip keeps its old name because
   the scripts size and measure it.) */
.strip { position: relative; border-radius: var(--r-md); }
.frame { position: relative; width: 100%; overflow: hidden; display: grid; place-items: center; background: var(--frame); border-radius: var(--r-md); }
.frame img, .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.ar-239 { aspect-ratio: 2.39 / 1; }
.ar-169 { aspect-ratio: 16 / 9; }
.ar-45  { aspect-ratio: 4 / 5; }
.ar-11  { aspect-ratio: 1 / 1; }
.watch {
  display: inline-block; margin-top: var(--s3); padding-bottom: 3px; border-bottom: 1px solid currentColor;
  font-family: var(--font-mega); font-weight: 500; font-size: 18px; letter-spacing: .04em; text-transform: uppercase; color: var(--edge);
}
@keyframes arrive { from { outline: 2px solid var(--edge); outline-offset: 3px; } to { outline: 2px solid transparent; outline-offset: 16px; } }
.card.arrive .strip, .wcard.arrive .strip { animation: arrive 1.5s ease-out; }

/* ===== WORK PAGE: card grid (original layout, v17 styling) ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); grid-auto-flow: dense; gap: var(--s6) var(--s4); align-items: start; }
.grid > * { min-width: 0; }
.wcard { display: block; text-decoration: none; }
.wcard .strip { transition: transform .25s var(--ease); }
.wcard .meta { display: flex; justify-content: space-between; gap: 12px; margin-top: var(--s2); font-size: 16px; color: var(--bone-dim); font-variant-numeric: tabular-nums; }
.wcard h3 { margin: 6px 0 6px; font-family: var(--font-title); font-weight: 600; font-size: clamp(28px, 2.4vw, 34px); line-height: 1.05; transition: color .15s ease; }
.wcard p { margin: 0; max-width: 52ch; font-size: 16px; line-height: 1.5; color: var(--bone-dim); }
.wcard.feature h3 { font-size: clamp(38px, 4vw, 58px); }
.wcard.feature p { font-size: 18px; }
@media (min-width: 800px) { .wcard.feature { grid-column: span 2; } } /* below this the grid has only one column */
.wcard.wide { grid-column: 1 / -1; }
/* Work sections (Short films, Passion projects): a full-row block, heading over a hairline, its own grid */
.wsec-block { grid-column: 1 / -1; min-width: 0; scroll-margin-top: 24px; }
.wsec {
  margin: 0 0 var(--s5); padding-top: var(--s4); /* no hairline above: the owner wants the sections to flow on */
  font-family: var(--font-mega); font-weight: 700; text-transform: uppercase; font-size: clamp(36px, 5vw, 72px); line-height: .95; overflow-wrap: break-word;
}
.wsec:lang(ru) { line-height: 1.1; }
/* inside a section the films stand in one horizontal line, two equal columns (owner's request); a single film takes half,
   so every card in the sections has the same size. One column on narrow screens */
.wsec-block > .grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 800px) {
  .wsec-block > .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wsec-block .wcard.feature { grid-column: auto; }
}/* empty frame of a film still to come: a flat tone and one quiet line, bottom left, like a caption. No glow, no glass */
.soon {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: var(--s3);
  background: #1b1612; font-size: 16px; line-height: 1.3; color: #b3a68e;
}
/* teaser: a real photo from the shoot fills the frame; the line sits bottom right on a soft scrim so it reads, the photo keeps its colour */
/* unreleased film: poster-style "Coming soon" over the owner's still (or a dark frame); sizes follow the frame (cqi) */
.frame.is-soon { container-type: inline-size; background: #120e0b; }
.soon-over {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: clamp(14px, 5cqi, 32px); pointer-events: none;
  font-family: var(--font-mega); font-weight: 700; text-transform: uppercase; color: #ece3d0;
  font-size: clamp(40px, 15cqi, 120px); line-height: .85; letter-spacing: -.005em; overflow-wrap: break-word;
}
.soon-over:lang(ru) { line-height: .95; }
/* the owner asked for the teaser still darker; evenly, enough for the word to read, his light (candle, blinds) stays */
img.teaser, .still.teaser img { filter: brightness(.55); }
.wcard.placeholder .strip { opacity: .6; }
.wcard.placeholder h3 { font-style: italic; font-weight: 500; color: var(--bone-dim); }
@media (hover: hover) {
  .wcard:hover .strip { transform: translateY(-4px); }
  .wcard:hover h3 { color: var(--edge); }
  .wcard:hover .frame img, .wcard:hover .frame video { transform: scale(1.03); }
}

/* photo gallery card: full row, the film strip takes each photo's shape (sizes set in photoCard), no film tint (the colour is the owner's grade), soft crossfade */
.pcard { grid-column: 1 / -1; }
.wcard.pcard .strip { max-width: 100%; margin-inline: auto; transition: width .8s ease-in-out; }
.pcard .frame { background: #050403; cursor: pointer; touch-action: pan-y; user-select: none; transition: height .8s ease-in-out; }
.wcard.pcard .frame img.slide, .d-scroll .frame img.slide { filter: none; opacity: 0; transform: none; transition: opacity .8s ease-in-out; }
.wcard.pcard .frame img.slide.on, .d-scroll .frame img.slide.on { opacity: 1; }
.pcard .meta { justify-content: center; }
.pcard h3 { margin: 0 0 var(--s3); text-align: center; font-size: clamp(38px, 4vw, 58px); }
.ph-btn {
  position: absolute; top: var(--ph-y, 50%); z-index: 1; width: 44px; height: 44px; margin-top: -22px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%; background: color-mix(in srgb, var(--ink) 60%, transparent); color: var(--bone); cursor: pointer;
  font-size: 18px; line-height: 1; transition: background-color .2s ease, color .2s ease;
}
.ph-prev { left: 8px; }
.ph-next { right: 8px; }
@media (hover: hover) {
  .ph-btn:hover { background: var(--bone); color: var(--ink); }
  .wcard.pcard:hover .strip { transform: none; }
  .wcard.pcard:hover h3 { color: inherit; }
}

.pcard h3 a { display: inline-block; min-height: 44px; text-decoration: none; } /* looks like plain text; 44px tall to tap */

/* ===== PROJECT MINI PAGE (over Work) =====
   A dialog that grows out of the card: JS animates its real size, so everything here must tolerate any width while .morph is on. */
html.has-detail { overflow: hidden; }
.detail { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; }
.d-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 78%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.d-panel {
  position: relative; display: flex; flex-direction: column;
  width: min(1120px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow: hidden; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-lg); corner-shape: squircle;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9);
}
.d-panel.morph { position: fixed; max-height: none; }
.d-panel.morph .d-scroll { overflow: hidden; }
/* its height comes from its content, capped by the panel's max-height; a zero flex-basis here collapses the panel in Safari */
.d-scroll { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.d-scroll:focus-visible { outline-offset: -3px; }
.d-close { top: 12px; right: 12px; left: auto; z-index: 2; margin: 0; font-size: 24px; }
.d-scroll .strip { background: #050403; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.d-scroll .strip > .frame { border-radius: 0; }
.d-scroll .strip.d-gallery { display: flex; align-items: center; justify-content: center; padding-bottom: 40px; touch-action: pan-y; user-select: none; }
.d-count { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 15px; color: #b3a68e; font-variant-numeric: tabular-nums; }
.d-gallery .frame { flex: none; background: #050403; transition: width .8s ease-in-out, height .8s ease-in-out; }
.d-body { padding: var(--s4); }
.d-body h2 {
  font-family: var(--font-title); font-weight: 600; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05; letter-spacing: 0;
  text-transform: none; font-variant-numeric: lining-nums;
}
.d-desc { max-width: 62ch; margin: var(--s2) 0 var(--s4); color: var(--bone); }
.d-body dl { margin: 0; }
.d-body dl > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--s2); padding: 14px 0; border-top: 1px solid var(--line); }
.d-body dt { font-size: 16px; color: var(--bone-dim); }
.d-body dd { margin: 0; min-width: 0; font-variant-numeric: lining-nums; }
.d-body ul { margin: 0; padding: 0; list-style: none; }
.d-body li + li { margin-top: 6px; }
.d-links { display: flex; flex-wrap: wrap; gap: var(--s1); }
.d-links span { margin-left: 2px; }
/* wide screens: film left, facts right, so the links are on screen without scrolling */
@media (min-width: 900px) {
  .d-scroll { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .d-scroll .strip { display: flex; align-items: center; border-radius: var(--r-lg) 0 0 var(--r-lg); }
  /* a film (not a gallery): the frame is exactly its 16:9 picture, inset in the panel with its own rounded corners and
     level with the title, instead of floating in a tall black column with bars above and below */
  .d-scroll .strip:not(.d-gallery) { align-self: start; display: block; padding: var(--s4) 0 var(--s4) var(--s4); background: none; border-radius: 0; }
  .d-scroll .strip:not(.d-gallery) > .frame { border-radius: var(--r-md); corner-shape: squircle; }
  .d-body h2 { padding-right: 48px; font-size: clamp(32px, 3vw, 44px); }
  .d-body dl > div { grid-template-columns: 110px minmax(0, 1fr); }
}

/* ===== TILES (Home index + Contact) =====
   Each tile has its own character (contact sheet, Polaroid + quote, red field, Instagram). The arrow sits in the
   bottom line next to the title (.t-head), not in a round button in the corner. Titles wrap whole words,
   long strings (email) may break anywhere. Heights grow with content (no fixed rows, no overflow hidden). */
.home-tiles { padding-bottom: var(--s7); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: var(--s2); min-width: 0; min-height: 250px;
  padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-2); color: var(--bone);
  text-decoration: none; transition: border-color .2s ease, background-color .2s ease;
}
.t-kind { display: flex; align-items: center; gap: 10px; min-height: 28px; font-size: 16px; font-weight: 500; color: var(--bone-dim); }
/* bottom line: the title (or the short line) runs as text and the arrow follows its last word,
   so long words never have to break to make room for the arrow; if the line is full, the arrow moves down with the last word */
.t-head { display: block; margin-top: auto; min-width: 0; }
.t-head .t-title, .t-head .t-sub { display: inline; }
.t-arrow { display: inline-block; margin-left: .35em; font-size: clamp(24px, 2vw, 30px); line-height: 1; white-space: nowrap; transition: transform .25s var(--ease); }
.t-icon { width: 44px; height: 44px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.t-icon .fill { fill: currentColor; stroke: none; }
.t-title {
  font-family: var(--font-mega); font-weight: 700; text-transform: uppercase;
  font-size: clamp(34px, 3vw, 48px); line-height: .95; overflow-wrap: break-word;
}
.t-sub { font-size: 16px; line-height: 1.45; color: var(--bone-dim); overflow-wrap: anywhere; }
.t-mailaddr { font-variant-numeric: lining-nums; }
.t-quote { flex: 1; min-width: 0; font-family: var(--font-title); font-weight: 500; font-size: clamp(24px, 2.1vw, 32px); line-height: 1.2; }

/* Work: a dark tile holding a contact sheet of stills */
.t-work { grid-column: span 2; grid-row: span 2; background: #0d0a07; border-color: rgba(236, 227, 208, .16); }
.t-work .t-title { font-size: clamp(56px, 6.4vw, 104px); }
/* first still large (2x2), then five frames around it; every cell 16:9 */
.stills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.still {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--frame); border-radius: var(--r-sm);
}
.still:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
/* fewer films: four = the large frame beside a column of three; three = beside a column of two; two = side by side */
.stills[data-n="4"] .still:first-child { grid-row: span 3; }
/* five = the large frame with two beside it, then two wider ones in the row below */
.stills[data-n="5"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stills[data-n="5"] .still { grid-column: span 2; }
.stills[data-n="5"] .still:first-child { grid-column: span 4; grid-row: span 2; }
.stills[data-n="5"] .still:nth-child(n+4) { grid-column: span 3; }
.stills[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stills[data-n="2"] .still:first-child { grid-column: auto; grid-row: auto; aspect-ratio: 16 / 9; }
.still img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.still.empty { background: #1b1612; }
.still.photo img { filter: none; } /* the owner's own grade, no film tint */
@media (hover: hover) { .t-work:hover .still img { transform: scale(1.04); } }

/* About: bone paper with the owner's own words and a small Polaroid of the portrait beside them */
.t-about { grid-column: span 2; background: var(--paper); color: var(--paper-ink); border-color: transparent; }
.t-about .t-kind, .t-about .t-sub { color: var(--paper-dim); }
.t-about-body { display: flex; align-items: flex-end; gap: var(--s3); margin-top: auto; }
.mini-pol {
  flex: none; width: clamp(96px, 9vw, 132px); padding: 6px 6px 22px; rotate: 3deg;
  background: #fbfaf5; border: 1px solid rgba(26, 19, 12, .1); border-radius: 3px;
  box-shadow: 0 12px 18px -12px rgba(60, 40, 15, .5); transition: rotate .3s var(--ease);
}
.mini-pol img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 40%; border-radius: 1px; }

/* Contact: the blood-red field */
.t-contact { background: var(--blood); border-color: transparent; }
.t-contact .t-kind, .t-contact .t-sub { color: color-mix(in srgb, var(--bone) 84%, transparent); }
.t-contact .dot { background: var(--bone); box-shadow: none; }

/* hover: the tile stays put; what is inside reacts (arrow moves, stills lean in, the Polaroid straightens, red deepens) */
@media (hover: hover) {
  .tile:hover { border-color: var(--line-strong); }
  .tile:hover .t-arrow { transform: translateX(6px); }
  .tile[target]:hover .t-arrow { transform: translate(4px, -4px); }
  .t-about:hover .mini-pol { rotate: 0deg; }
  .t-contact:hover { background: var(--blood-hi); }
  .t-contact:hover, .t-about:hover { border-color: transparent; }
  .t-work:hover { border-color: #000; }
}

/* ===== CALL TO ACTION (blood red) ===== */
.cta { background: var(--blood); color: var(--bone); padding-block: var(--s7); position: relative; overflow: hidden; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.cta .sec-label { color: color-mix(in srgb, var(--bone) 78%, transparent); }
.cta .dot { background: var(--bone); box-shadow: none; }
.cta-big {
  display: block; margin: 0; text-decoration: none; color: var(--bone);
  font-family: var(--font-mega); font-weight: 700; text-transform: uppercase;
  font-size: clamp(52px, 9vw, 150px); line-height: .84; letter-spacing: -.01em; /* smaller since the clean-up, so the email is on the first screen */
  transition: color .2s ease;
}
.cta-head { padding-top: calc(var(--header-h) + var(--s6)); }
.cta-head .cta-big { color: var(--bone); }
/* tight display leading is cut for Latin: the breve on Russian Й would hit the line above */
.cta-big:lang(ru), .t-title:lang(ru) { line-height: 1.2; }
.cta-big:lang(ru), .cta-big:lang(fr) { font-size: clamp(44px, 9vw, 150px); } /* their longest word must fit a 320 px phone */
.cta-sub { margin-top: var(--s4); }

/* ===== ABOUT (paper page) ===== */
/* wide screens: heading and text on the left, the Polaroid on the right from the heading's top down */
.about {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "head photo" "text photo"; column-gap: var(--s6); align-items: start;
}
.about > * { min-width: 0; }
.about > .page-head { grid-area: head; }
.about > .about-text { grid-area: text; }
.about > .print { grid-area: photo; }
@media (min-width: 861px) { #p-about .page-head h2 { font-size: clamp(64px, 9vw, 150px); } } /* fits the left column in every language */
.body-l { max-width: 52ch; margin-top: var(--s4); font-size: 19px; line-height: 1.65; color: var(--paper-dim); }
#p-about h2 { color: var(--paper-ink); }
/* facts under the text: label left, value right, hairlines between, like the rows in the project mini page */
.facts { max-width: 52ch; margin: var(--s5) 0 0; padding: 0; border-top: 1px solid var(--paper-line); }
.facts > div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: var(--s3); padding: 14px 0; border-bottom: 1px solid var(--paper-line); }
.facts dt { font-size: 16px; color: var(--paper-dim); }
.facts dd { margin: 0; font-size: 17px; line-height: 1.45; color: var(--paper-ink); }
@media (max-width: 420px) { .facts > div { grid-template-columns: 1fr; gap: 2px; } }
#p-about .pager { border-top-color: var(--paper-line); }
#p-about .pager small { color: var(--paper-dim); }
#p-about .pager i { color: var(--stamp); }
#p-about .page-head h2 { opacity: .92; }

/* portrait: a Polaroid 600 level with the statement. White frame in the real proportions (88 × 107 mm: 4.5 mm sides,
   6 mm top, a deep bottom margin), square picture with a soft vignette and warm fade laid over it (the file itself is untouched).
   "What I do" is written in the bottom margin by hand: role, formats, Instagram */
/* Its width follows the screen height too (the Polaroid is about 1.21 × its width tall and starts ~155px down the page),
   so on a laptop the whole of it, notes included, is on screen without scrolling.
   The tilt uses the separate `rotate` property: the reveal animation sets `transform` and would otherwise
   straighten the photo while it plays and snap it back at the end. */
.print {
  justify-self: end; container-type: inline-size;
  width: min(100%, 580px, max(260px, calc((100vh - 185px) / 1.22)));
  width: min(100%, 580px, max(260px, calc((100svh - 185px) / 1.22)));
  margin: 0; padding: 38px 28px 0; rotate: -1.6deg;
  /* matte print paper: a faint fixed tooth over the white, no colour cast */
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.3  0 0 0 0 0.25  0 0 0 0.09 0'/></filter><rect width='100%' height='100%' filter='url(%23p)'/></svg>") 0 0 / 160px 160px,
    linear-gradient(170deg, #fdfcf8 0%, #f6f3ea 100%);
  border: 1px solid rgba(26, 19, 12, .1); border-radius: var(--r-xs);
  box-shadow: inset 0 1px 0 #fff, 0 26px 40px -22px rgba(60, 40, 15, .55), 0 2px 6px -2px rgba(60, 40, 15, .3);
}
.pol-photo { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #2a2622; border-radius: 2px; }
.pol-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.pol-photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); } /* only the print's edge: the photo keeps its own colour */
.print figcaption {
  min-height: 140px; min-height: max(96px, 24cqw); padding: 18px 6px 24px; display: grid; align-content: center;
  font-family: var(--font-title); font-style: italic; font-weight: 500; line-height: 1.25; color: #2b2620; text-align: center;
  font-size: clamp(20px, 1.9vw, 26px); font-size: clamp(17px, 4.4cqw, 26px); /* scales with the Polaroid */
}
.pol-notes { margin: 0; }
.pol-notes dd { margin: 0; text-wrap: balance; }
.pol-notes a { display: inline-block; padding-block: 10px; margin-block: -10px; color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; } /* 44px tall to tap */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ===== CONTACT ===== */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); /* email first (left / on top), the form after it */ gap: var(--s5); padding-top: var(--s6); align-items: start; }
.contact-form { display: flex; flex-direction: column; gap: var(--s3); }
.contact-form h3 { font-family: var(--font-title); font-weight: 600; font-size: clamp(34px, 3.4vw, 48px); line-height: 1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 16px; font-weight: 500; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; background: transparent; color: var(--bone);
  font-family: var(--font-body); font-size: 18px; line-height: 1.45; transition: border-color .15s ease;
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: color-mix(in srgb, var(--bone-dim) 75%, transparent); }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-bottom-color: var(--edge); box-shadow: 0 1px 0 var(--edge); }
.contact-form .pill { align-self: flex-start; }
.form-note { margin: 0; font-size: 16px; color: var(--bone-dim); }
.form-note b { color: var(--bone); font-weight: 600; user-select: all; overflow-wrap: anywhere; }
/* email large and Instagram under it, no icon cards (clean-up, 2026-11-11) */
.contact-direct { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); min-width: 0; padding-top: 6px; }
.hc-label { margin: 0; font-size: 16px; color: var(--bone-dim); }
/* Instagram as a profile line: round avatar (his portrait), the handle large, "Instagram" small under it, an arrow;
   a hairline under the whole line turns amber on hover and the arrow moves */
.ig-link {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s3);
  width: 100%; max-width: 460px; padding: 14px 0 18px; color: var(--bone); text-decoration: none;
  border-bottom: 1px solid var(--line-strong); transition: border-color .2s ease;
}
.ig-ava { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 0 0 1px var(--line-strong); }
.ig-ava img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 28%; transform: scale(1.35); display: block; } /* the face fills the circle */
.ig-text { display: flex; flex-direction: column; min-width: 0; }
.ig-handle { font-family: var(--font-title); font-weight: 600; font-size: clamp(30px, 3vw, 40px); line-height: 1.05; overflow-wrap: anywhere; }
.ig-where { margin-top: 4px; font-size: 16px; color: var(--bone-dim); }
.ig-go { font-size: 26px; line-height: 1; transition: transform .25s var(--ease), color .2s ease; }
.ig-link:hover { border-color: var(--edge); }
.ig-link:hover .ig-go { transform: translate(4px, -4px); color: var(--edge); }
.ig-link:focus-visible { outline-offset: 6px; }
/* honeypot for spam bots: off screen, never seen or tabbed to by people */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note.ok { color: var(--bone); }
.form-note.err { color: #f0a59c; }
/* ===== PAGER & FOOTER ===== */
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: var(--s7); padding-top: var(--s2); border-top: 1px solid var(--line); }
.pager a { display: flex; align-items: center; gap: 14px; min-height: 56px; min-width: 0; text-decoration: none; }
.pager .next { margin-left: auto; text-align: right; }
.pager small { display: block; font-size: 16px; color: var(--bone-dim); }
.pager b { display: block; font-family: var(--font-mega); font-weight: 600; font-size: 30px; line-height: 1.1; text-transform: uppercase; }
.pager i { font-style: normal; font-size: 24px; color: var(--edge); transition: transform .2s ease; }
@media (hover: hover) {
  .pager .next:hover i { transform: translateX(5px); }
  .pager .prev:hover i { transform: translateX(-5px); }
}
footer.container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: var(--s3) var(--s4); font-size: 16px; color: var(--bone-dim); border-top: 1px solid var(--line); }
body[data-route="about"] footer.container { background: var(--paper); color: var(--paper-dim); max-width: none; border-top-color: var(--paper-line); }

/* ===== CLAPPERBOARD TRANSITION ===== */
.clap {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; overflow: hidden;
  background: color-mix(in srgb, #050403 92%, transparent); visibility: hidden; pointer-events: none; opacity: 0;
  --sl-ink: #eadfc8; --sl-bg: #050403;
}
.clap.on { visibility: visible; pointer-events: auto; }
.flash { position: absolute; inset: 0; background: #fff4de; opacity: 0; pointer-events: none; }
.slate-wrap { position: relative; width: min(92vw, 720px); max-width: 100%; }
.slate { --bar: clamp(30px, 6vw, 46px); --st: clamp(18px, 4vw, 30px); position: relative; } /* flat, like a real board: no drop shadow */
.arm, .bar { height: var(--bar); border: 2px solid var(--sl-ink); border-radius: var(--r-xs); }
.bar { border-radius: var(--r-xs) var(--r-xs) 0 0; }
.arm { position: absolute; top: 0; left: 0; right: 0; transform-origin: 0 100%; transform: rotate(-24deg); background: repeating-linear-gradient(-55deg, var(--sl-ink) 0 var(--st), var(--sl-bg) var(--st) calc(var(--st) * 2)); }
.arm::after { content: ""; position: absolute; left: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--edge); transform: translate(-45%, 45%); }
.bar { margin-top: var(--bar); background: repeating-linear-gradient(55deg, var(--sl-ink) 0 var(--st), var(--sl-bg) var(--st) calc(var(--st) * 2)); }
.board { background: var(--sl-bg); border: 2px solid var(--sl-ink); border-top: 0; border-radius: 0 0 var(--r-md) var(--r-md); color: var(--sl-ink); }
.sl-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sl-row.first { border-bottom: 2px solid var(--sl-ink); }
.sl-row.last { border-top: 2px solid var(--sl-ink); }
.sl-cell { min-width: 0; padding: 8px 12px 10px; }
.sl-cell + .sl-cell { border-left: 2px solid var(--sl-ink); }
.sl-cell small { display: block; font-family: var(--font-type); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.sl-cell span { display: block; font-family: var(--font-mega); font-weight: 600; font-size: clamp(15px, 3.8vw, 26px); line-height: 1.25; text-transform: uppercase; overflow-wrap: anywhere; }
.sl-title { padding: 18px 14px 22px; text-align: center; }
.sl-title span { display: block; font-family: var(--font-mega); font-weight: 700; text-transform: uppercase; font-size: clamp(44px, 13vw, 110px); line-height: .95; overflow-wrap: anywhere; }
.clap.tail .sl-title span { transform: rotate(180deg); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-work { grid-row: auto; }
}
@media (max-width: 860px) {
  #p-about .about, .contact-layout, .about { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .about { grid-template-rows: none; grid-template-areas: "head" "photo" "text"; row-gap: var(--s5); }
  .about > .page-head { margin-bottom: 0; }
  .print { justify-self: center; width: calc(100% - 8px); max-width: 560px; padding: 24px 18px 0; }
  .print figcaption { min-height: 92px; font-size: 20px; } /* one column: the portrait comes first, under the heading */
}
@media (max-width: 760px) {
  :root { --header-h: 132px; }
  header.top {
    grid-template-columns: 1fr auto; grid-template-areas: "mark right" "nav nav"; row-gap: 6px; padding-bottom: 6px;
  }
  .mark { grid-area: mark; justify-self: start; }
  .mark .stamp { height: 33px; }
  .nav-right { grid-area: right; }
  .nav-right .nav-contact { display: none; }
  .nav-left { grid-area: nav; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line-strong); }
  body[data-route="about"] .nav-left { border-top-color: var(--paper-line); }
  .nav-left a { padding-block: 12px; text-align: center; }
  .nav-contact-m { display: block; }
  body { font-size: 16.5px; }
  .cta { padding-block: var(--s6); }
  .cta-head { padding-top: calc(var(--header-h) + var(--s4)); }
  .hero { padding-bottom: var(--s5); }
  .reel { margin-top: var(--s5); }
  .home-tiles { padding-bottom: var(--s6); }
  .tiles { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .t-work, .t-about { grid-column: auto; }
  .tile { min-height: 200px; padding: var(--s3); }
  .t-work .t-title { font-size: clamp(52px, 16vw, 80px); }
  .t-title { font-size: clamp(34px, 10vw, 46px); }
  .t-list .l-title { font-size: 21px; }
  .d-panel { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .d-body { padding: var(--s3); }
  .d-body dl > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .pager b { font-size: 24px; }
  .contact-form .pill { align-self: stretch; }
  footer.container { flex-direction: column; }
}
/* narrowest phones: wordmark, three languages and the switch must share one row */
@media (max-width: 359px) {
  header.top { column-gap: 8px; }
  .nav-right { gap: 6px; }
  .mark .stamp { height: 26px; } /* wordmark, three languages and the switch must share one row on a 320 px phone */
  .lang button { min-width: 40px; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .frame img, .frame video, .pager i, .tile, .t-arrow, .reel-over, .wcard.pcard .strip, .pcard .frame, .wcard.pcard .frame img.slide, .d-gallery .frame, .d-scroll .frame img.slide, .ph-btn { transition: none; }
  .wcard:hover .frame img, .wcard:hover .frame video, .tile:hover, .tile:hover .t-arrow { transform: none; }
  .mini-pol, .t-about:hover .mini-pol { transition: none; }
  .wcard .strip { transition: none; }
  .wcard:hover .strip { transform: none; }
}
