/* Portfolio · Vadym. The wall and its labels. The work carries colour and motion. */

/* Inter 4.001 (text optical size, 18pt statics), SIL OFL 1.1, self-hosted: /fonts/OFL.txt. Only the two weights the site uses. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
/* Inter Display (the 28pt optical size, same release): tighter cut for the big headline only (Vadym, 24.11.2026). */
@font-face {
  font-family: "Inter Display";
  src: url("/fonts/InterDisplay-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --wall: #e2e3df;
  --wall-deep: #d6d7d2;
  --ink: #161716;
  --ink-2: #50524d;
  --line: rgb(22 23 22 / 0.16);
  /* Edge of a work: a hairline that only shows where a light frame would melt into the wall. */
  --edge: rgb(22 23 22 / 0.1);
  --accent: #2234c4;
  --pending: #8f3d00;
  --sans: "Inter", "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  --gutter: clamp(1rem, 3.2vw, 3rem);
  --label: 0.9375rem;
  --small: 0.8125rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  color-scheme: light;
  scrollbar-color: var(--ink-2) var(--wall);
}

*, *::before, *::after { box-sizing: border-box; }

/* scrollbar-gutter: the page keeps its width when the player locks scrolling (classic scrollbars would otherwise jump it sideways). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1.5rem; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font: 400 var(--label) / 1.45 var(--sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  padding-inline: var(--gutter);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

::selection { background: var(--accent); color: var(--wall); }

img, video { display: block; max-width: 100%; }
video { background: var(--wall-deep); }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
p, dd { text-wrap: pretty; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--line); }
@media (hover: hover) and (pointer: fine) {
  a { transition: color 150ms ease, text-decoration-color 150ms ease; }
  a:hover { color: var(--accent); text-decoration-color: currentColor; }
}
/* Focus ring: only while the visitor moves with Tab (Vadym, 24.11.2026). main.js sets .kbd on Tab and clears it
   on any click or touch; browsers' own guess (:focus-visible) drew rings after mouse clicks in Safari and after
   a reload in Chrome. Without JS (.js missing) the browser's default rule stays, so the keyboard always works. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.js :focus-visible { outline: none; }
.js.kbd :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.muted { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.spec { font-variant-numeric: tabular-nums; color: var(--ink-2); }
/* A quiet line by the video, only in Safari on a Mac (main.js sets .is-mac-safari): Safari's own video bug (24.11.2026). */
.safari-note { display: none; }
.is-mac-safari .safari-note { display: block; margin-top: 0.5rem; max-width: 46ch; font-size: var(--small); line-height: 1.4; color: var(--ink-2); }
.is-mac-safari .player .safari-note { margin: 0.6rem auto 0; max-width: 40ch; text-align: center; color: rgb(255 255 255 / 0.66); }
.type { font-size: var(--small); letter-spacing: 0.02em; }
.todo { color: var(--pending); outline: 1px dashed currentColor; outline-offset: 1px; padding-inline: 0.15em; font-weight: 400; }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: var(--wall); padding: 0.5rem 0.75rem; z-index: 10; }
.skip:focus { left: var(--gutter); }

/* ---------- header / footer ---------- */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  padding-block: calc(1.25rem + env(safe-area-inset-top, 0px)) 1.25rem;
}
.site-name { font-weight: 500; text-decoration: none; }
.site-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.site-nav a { text-decoration: none; }
.site-nav .lang { color: var(--ink-2); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  padding-block: 2rem 2.5rem;
  margin-top: clamp(4rem, 10vw, 8rem);
  border-top: 1px solid var(--line);
  font-size: var(--small);
}

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease, border-color 150ms ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--ink); color: var(--wall); }
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { color: var(--wall); background: var(--accent); border-color: var(--accent); }
}
.btn.is-pending { border-style: dashed; border-color: var(--ink-2); color: var(--ink-2); font-weight: 400; }
.btn.is-pending:active { transform: none; }

/* ---------- intro: a short hello on the left, the photo on the right; the grid follows right under it ---------- */
/* One step of space (--space) for the whole first screen, on every width (Vadym, 23.11.2026): header (and,
   on phones, menu to name) → photo (phones) → hello → headline → layers → buttons → grid. The header keeps
   no padding of its own underneath on the home page, so each step is measured from one block to the next. */
:root { --space: clamp(1.25rem, 2.2vw, 2rem); --grid-cols: 4; --grid-gap: 0.5rem; }
@media (max-width: 52rem) { :root { --grid-cols: 2; } }
.page-home .site-header { padding-bottom: 0; row-gap: var(--space); }
/* The right column is exactly one grid tile wide and sits over the grid's last column (same width, same
   gaps: --grid-cols, --grid-gap), so the photo is centred over the top-right work. */
/* Every width: the first screen holds only the header and this block, centred top to bottom in the room left
   above the timeline, so the space over it equals the space under it, never less than one step; the grid
   begins on the second screen. (--header-h: the header's height on the home page; on phones the name wraps
   under the menu, one step below it.) */
:root { --header-h: calc(1.25rem + 0.9375rem * 1.45 + env(safe-area-inset-top, 0px)); }
@media (max-width: 52rem) {
  :root { --header-h: calc(1.25rem + 2 * 0.9375rem * 1.45 + var(--space) + env(safe-area-inset-top, 0px)); }
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc((100% - (var(--grid-cols) - 1) * var(--grid-gap)) / var(--grid-cols));
  column-gap: 0;
  min-height: calc(100svh - var(--header-h) - var(--tl-h, 0px));
  align-content: center;
  padding-block: var(--space);
}
/* The photo frame is always exactly 4:5 and only ever scales as a whole (Vadym, 24.11.2026: never a frame
   that stretches or narrows while the window is resized). Its cell is a size container: the frame takes the
   room the cell offers (--photo-room, a height) and the cell's width, whichever is tighter, at 4:5.
   The cell itself adds no size of its own (the frame inside is positioned). */
.hero-photo-cell { position: relative; container-type: size; }
.hero-photo {
  --photo-room: 100cqh;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: 4 / 5;
  width: min(100cqw, var(--photo-room) * 4 / 5);
  height: auto;
  background: var(--wall-deep);
  outline: 1px solid var(--edge);
  outline-offset: -1px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
/* One column (phones, tablets upright): the name always on its own line under the menu, one step below it
   (so the header's height is known); the photo first, between the header and the hello, in the flow. Type,
   photo and step grow with the screen's width and height, as on wide screens, so a tall tablet isn't left half empty. */
@media (max-width: 52rem) {
  :root { --space: clamp(1.25rem, min(4.5vw, 2.6vh), 2.25rem); }
  .page-home .site-header { flex-direction: column; align-items: flex-start; }
  /* Every gap is exactly one step (menu, name, photo, text, buttons, fold) and the photo takes all the room
     that's left: its cell grows to fill the first screen and the photo fills the cell's height at 4:5
     (narrower if the column is narrower), so nothing floats and the name sits evenly between menu and photo. */
  /* The cell never grows taller than a 4:5 frame of the full column width (100cqw of .hero), so the frame
     always fills it; any room left over centres the whole block, keeping every gap one step. */
  .hero { display: flex; flex-direction: column; gap: var(--space); justify-content: center; container-type: inline-size; }
  /* Here the frame takes the cell's full height and its width from 4:5 (a flexed cell's height doesn't reach
     container units in Chrome, a percentage does); the cap above keeps that width within the column. */
  .hero-photo-cell { order: -1; flex: 1 1 auto; min-height: 8.5rem; max-height: calc(100cqw * 5 / 4); container-type: normal; }
  .hero-photo { top: 0; left: 0; transform: none; height: 100%; width: auto; }
  .hero .hero-hello { font-size: clamp(1.125rem, min(4.6vw, 2.6vh), 1.75rem); }
  /* Sized for Inter (24.11): the German line stays on three lines and the block fits the first screen from 360x640. */
  .hero .hero-headline { font-size: clamp(1.75rem, min(7.9vw, 4.7vh), 4rem); }
  /* Inter is wider than Helvetica: smaller type and an em gap keep three layers a row down to 360px (DE). */
  .hero .hero-layers ul { font-size: clamp(0.875rem, min(4vw, 2.3vh), 1.375rem); column-gap: 0.9em; }
}
/* Spacing by closeness, all from the one step S (--space): the hello leads into the headline (S/2, one thought),
   the layers and the buttons are groups of their own (S). */
.hero-text { display: grid; gap: var(--space); justify-items: start; }
.hero-hello + .hero-headline { margin-top: calc(var(--space) / -2); }
/* Large and medium screens (photo beside the text): balance after Anton Nevin's first screen (Vadym's reference,
   23.11.2026): the block takes about half the height under the header. Type and step grow with the screen's
   width and height alike. */
@media (min-width: 52.0625rem) {
  .hero { --space: clamp(1.5rem, min(2.4vw, 4vh), 2.75rem); }
  .hero .hero-hello { font-size: clamp(1.375rem, min(1.8vw, 3.2vh), 2rem); }
  .hero .hero-headline { font-size: clamp(3rem, min(4.6vw, 8vh), 5.25rem); }
  .hero .hero-layers ul { font-size: clamp(1.125rem, min(1.3vw, 2.3vh), 1.5rem); }
  /* The photo reaches one step above the hello and one below the buttons, as a portrait framing the text,
     and is never wider than the tile under it: then the whole frame is smaller (still 4:5), centred on the text. */
  .hero-photo { --photo-room: calc(100cqh + 2 * var(--space)); }
}
.hero-hello { font-size: clamp(1.25rem, 1.75vw, 1.5rem); line-height: 1.3; letter-spacing: -0.01em; color: var(--ink-2); }
.hero-headline {
  position: relative;
  width: fit-content;
  font-family: "Inter Display", var(--sans);
  font-size: clamp(2rem, 3.6vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 22ch;
}

/* The headline as a selected text layer in After Effects: bounding box, handles at corners and mid-sides,
   anchor point in the middle. Only on hover with a mouse; nothing moves on its own. */
.sel { position: absolute; inset: -0.3rem -0.45rem; border: 1px solid var(--accent); opacity: 0; pointer-events: none; }
.sel-h { position: absolute; width: 7px; height: 7px; background: var(--wall); border: 1px solid var(--accent); transform: translate(-50%, -50%); }
.sel-tl { left: 0; top: 0; } .sel-t { left: 50%; top: 0; } .sel-tr { left: 100%; top: 0; }
.sel-r { left: 100%; top: 50%; } .sel-br { left: 100%; top: 100%; } .sel-b { left: 50%; top: 100%; }
.sel-bl { left: 0; top: 100%; } .sel-l { left: 0; top: 50%; }
/* Anchor point: a small circle with a cross through it. */
.sel-anchor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(var(--accent), var(--accent)) center / 100% 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 1px 100% no-repeat;
}
.sel-anchor::after { content: ""; position: absolute; inset: 3.5px; border: 1px solid var(--accent); border-radius: 50%; }
@media (hover: hover) and (pointer: fine) {
  .hero-headline:hover .sel { opacity: 1; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .sel { transition: opacity 120ms ease; }
}

/* What he animates, as a row of layers: each name with its After Effects label colour (AE's first six defaults). */
.hero {
  --ae-1: #b53838; --ae-2: #e4d84c; --ae-3: #a9cbc7;
  --ae-4: #e5bcc9; --ae-5: #a9a9ca; --ae-6: #e7c19e;
}
.hero-layers ul { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 1.125rem; }
/* Below wide screens: the six layers in two rows of three. */
/* The line is measured in its own em, so it holds three layers but not four, whatever the font size:
   they break three and three with their natural spacing, not stacked in columns.
   Inter (24.11): widest row of three is 21.5em (DE), narrowest four is 22.4em (EN, 800px), so 22em. Re-measure if the layer names change. */
@media (max-width: 75rem) { .hero-layers ul { max-width: 22em; } }
.hero-layers a { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.layer-label { width: 0.7em; height: 0.7em; background: var(--label); outline: 1px solid var(--edge); outline-offset: -1px; }


.label-head { font-size: var(--small); font-weight: 500; margin-top: 1rem; }

/* ---------- sections ---------- */
/* --pad: air above a section. A jump to it (nav, #work) skips that air and lands on the title, ~3rem from the top. */
.section { --pad: clamp(5rem, 12vw, 10rem); padding-top: var(--pad); scroll-margin-top: calc(3rem - 1.5rem - var(--pad)); }
.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

/* ---------- portfolio: one dense grid of equal 4:5 tiles ---------- */
/* Sixteen cells: the showreel and fifteen clips, all one size. Four columns make four full rows (large tiles,
   23.11.2026); medium screens four as well; phones two (eight rows). Adding a work: recount. */
.grid { display: grid; grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr)); gap: var(--grid-gap); }
/* The grid follows the first screen closely, so its top row already shows there; no heading (it has one for screen readers). */
/* The first screen's own bottom space is the gap; the grid starts right at the fold. */
.portfolio { --pad: 0px; }
.piece { position: relative; min-width: 0; scroll-margin-top: 1.5rem; }
.piece-link { display: block; height: 100%; text-decoration: none; color: inherit; }
/* Every tile is 9:16, so vertical works (and the reel) show whole and landscape ones are cropped to the middle. */
.piece-media {
  position: relative;
  aspect-ratio: 9 / 16;
  height: 100%;
  background: var(--wall-deep);
  overflow: hidden;
  outline: 1px solid var(--edge);
  outline-offset: -1px;
}
.piece-media img, .piece-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.piece-media video { opacity: 0; transition: opacity 240ms ease; background: transparent; }
.piece.is-playing .piece-media video { opacity: 1; }
/* Landscape works: whole, centred across the tile; behind them the same frame stretched to the tile and blurred,
   so the band above takes the colour of the top edge and the band below that of the bottom edge. */
.is-wide .piece-media > :not(.tile-bg) { object-fit: contain; }
.piece-media .tile-bg { object-fit: fill; filter: blur(28px) saturate(1.1); transform: scale(1.25); }

/* Title on the tile: shown over the bottom of the preview on hover or focus (with a mouse); the player has the rest. */
.tile-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 0.1rem;
  padding: 2.5rem 0.75rem 0.7rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.62));
  color: #fff;
  font-size: var(--small);
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
}
.tile-title { font-size: var(--label); font-weight: 500; }
.tile-sub, .tile-type { color: rgb(255 255 255 / 0.78); }
.piece-link:hover .tile-label, html:not(.js) .piece-link:focus-visible .tile-label, .kbd .piece-link:focus-visible .tile-label { opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .tile-label { transition: opacity 160ms ease; } }
/* Touch screens have no hover: the title stays on, the subtitle and type wait for the player. */
@media (hover: none) {
  .tile-label { opacity: 1; padding-top: 1.75rem; }
  .tile-sub, .tile-type { display: none; }
}

/* The layer filter (the row in the first screen): the other sections' tiles step back. */
.grid.is-filtered .piece:not(.is-match) { opacity: 0.18; }
@media (prefers-reduced-motion: no-preference) { .piece { transition: opacity 220ms ease; } }
.hero-layers a.is-on { color: var(--accent); }


/* ---------- about ---------- */
/* Short (Vadym, 24.11.2026): who he is, how he works, one line of facts with the CV. No skill lists: the works
   show what he does and the CV lists the tools. */
.about-body { display: grid; gap: var(--space); }
/* Six blocks in an even grid, text and air only (Vadym 24.11.2026): 3 × 2, medium screens 2 × 3, phones one
   column. The lead words carry each block. */
.about-blocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(2rem, 4vw, 4.5rem); row-gap: clamp(2.5rem, 5vw, 4.5rem); }
.about-block { display: grid; align-content: start; gap: 0.7rem; }
/* The block names in the site's warm red-orange (Vadym 24.11.2026): the one touch of colour in About. */
.about-label { font-size: var(--small); color: var(--pending); }
.about-block h3 { font-size: clamp(1.25rem, 1.8vw, 1.625rem); font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
.about-block p:last-child { font-size: clamp(0.95rem, 1.1vw, 1.0625rem); line-height: 1.5; color: var(--ink-2); max-width: 52ch; }
@media (max-width: 75rem) { .about-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 52rem) { .about-blocks { grid-template-columns: 1fr; } }

/* ---------- contact ---------- */
.contact-email { font-size: clamp(1.75rem, 5.5vw, 4.5rem); letter-spacing: -0.03em; line-height: 1.05; font-weight: 500; overflow-wrap: anywhere; }
.contact-email a { text-decoration-thickness: 2px; }
/* Copy button beside the big email (or under it, at the same left edge, when the line is too narrow). */
/* Shown from the first paint where the clipboard works (.can-copy is set in <head>): no shift under the email
   when the script arrives (Chrome flashed the lines below it on a reload, 24.11.2026). */
.can-copy .contact-email { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 0.6em; }
.copy-email { display: none; }
.can-copy .copy-email {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  font: 400 var(--label) / 1 var(--sans);
  letter-spacing: 0;
  color: var(--ink);
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), color 150ms ease, border-color 150ms ease;
}
.copy-email:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .copy-email:hover { border-color: var(--ink); } }
.copy-email.is-done, .copy-email.is-done:hover { color: var(--accent); border-color: var(--accent); }
.contact-list { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin-top: 2rem; }
.link.is-pending { color: var(--ink-2); }

/* ---------- work player: a full-screen wall panel, the work at true proportion, its label beside it ---------- */
.work-player {
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: calc(4.5rem + env(safe-area-inset-top, 0px)) clamp(1rem, 4vw, 3.5rem) calc(clamp(1rem, 4vw, 3rem) + env(safe-area-inset-bottom, 0px));
  border: 0;
  background: var(--wall);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 1;
  transition: opacity 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.work-player:not([open]) { opacity: 0; transition-duration: 140ms; }
@starting-style { .work-player[open] { opacity: 0; } }
.work-player::backdrop { background: var(--wall); }
/* The page behind does not scroll while the player is open. */
html:has(.work-player[open]) { overflow: hidden; }
/* Opening straight into a work (link or reload): the page stays blank wall until the player is up, and it appears without a fade. */
.opening-work body * { visibility: hidden; }
.opening-work .work-player, .opening-work .work-player * { visibility: visible; transition: none; }
.wp-stage {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(15rem, 22rem);
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 3rem);
  /* One rule for every format (Vadym, 24.11.2026): the video and its label as a pair, centred on the screen
     both ways, the label's foot on the video's foot. Upright works fill the height anyway; landscape ones
     no longer sink to the bottom. (If a label is taller than its video, the label is what gets centred.) */
  align-items: end;
  align-content: center;
  min-height: 100%;
}
.wp-media { display: grid; place-items: center; min-width: 0; }
/* The video's size comes from its proportions (--ar, set by the build) and the room, not from the file:
   Safari draws a video at 300x150 until the file's size is read, so on a reload the player jumped (24.11.2026).
   As large as the stage's height allows (--wp-h), never wider than the column. */
.wp-media { --wp-h: calc(100svh - 8rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
.wp-media video {
  width: calc(var(--wp-h) * var(--ar));
  height: auto;
  aspect-ratio: var(--ar);
  max-width: 100%;
  max-height: var(--wp-h);
  background: #000;
}
/* Safari, on a reload that scrolls back or opens a work: nothing is painted until that is done (build.mjs). */
.safari-hold body { visibility: hidden; }
/* A section heading that took the focus after a header link (main.js): it's a reading position, not a control. */
.jump-target:focus { outline: none; }
/* Safari: until the poster is drawn the box shows its background; the wall instead of black (no black flash). */
.is-safari .wp-media video { background: transparent; }
.wp-label { display: grid; gap: 0.3rem; align-content: end; font-size: var(--small); }
.wp-label .work-title { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -0.03em; line-height: 1.05; }
.work-sub { font-size: 1.0625rem; }
.wp-label .type { margin-top: 0.35rem; }
.wp-label .desc { margin-top: 0.9rem; max-width: 46ch; color: var(--ink-2); }
.source { font-size: var(--small); color: var(--ink-2); margin-top: 0.5rem; }
.wp-more { margin-top: 0.9rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.wp-more-title { font-size: inherit; font-weight: 500; }
.wp-more p { margin-top: 0.4rem; max-width: 46ch; }
.wp-bar {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  right: clamp(1rem, 4vw, 3.5rem);
  display: flex;
  gap: 0.5rem;
  z-index: 1;
}
.wp-bar form { display: contents; }
/* Where you are: section and position, quiet, left of the buttons. */
.wp-where {
  align-self: center;
  margin-right: 0.75rem;
  font-size: var(--small);
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.wp-where-count { font-variant-numeric: tabular-nums; }
/* Bare arrows, one fixed size: nothing in the bar shifts while you step through. */
.wp-arrow { width: 2.75rem; padding: 0; }
.wp-btn {
  font: inherit;
  font-weight: 500;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  background: var(--wall-deep);
  color: var(--ink);
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out);
}
.wp-btn:active { transform: scale(0.97); }
.wp-close { background: var(--ink); color: var(--wall); }

/* ---------- text pages ---------- */
.text-page { max-width: 44rem; padding-top: clamp(2rem, 6vw, 5rem); display: grid; gap: 0.75rem; }
.text-page .section-title { margin-bottom: 1rem; }
.text-page .label-head { margin-top: 1.25rem; }

/* ---------- showreel player ---------- */
.player {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100svh;
  overflow: visible;
  opacity: 1;
  transform: none;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out), overlay 220ms allow-discrete, display 220ms allow-discrete;
}
.player::backdrop { background: rgb(14 15 14 / 0.92); transition: opacity 220ms ease, overlay 220ms allow-discrete, display 220ms allow-discrete; }
.player:not([open]) { opacity: 0; transform: scale(0.98); transition-duration: 150ms; }
.player:not([open])::backdrop { opacity: 0; }
@starting-style {
  .player[open] { opacity: 0; transform: scale(0.98); }
  .player[open]::backdrop { opacity: 0; }
}
.player video { height: min(90svh, 1920px); width: auto; aspect-ratio: 9 / 16; max-width: calc(100vw - 2rem); background: #000; }
.player form { position: fixed; top: calc(1rem + env(safe-area-inset-top, 0px)); right: 1rem; }
.player-close {
  font: inherit;
  font-weight: 500;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  background: var(--wall);
  color: var(--ink);
  border: 0;
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.player-close:active { transform: scale(0.97); }

/* ---------- small screens ---------- */
@media (max-width: 52rem) {
  .wp-stage { grid-template-columns: minmax(0, 1fr); align-items: start; align-content: start; min-height: 0; }
  /* Video on top, full column width up to 70% of the screen's height, starting at the same left edge as the label. */
  .wp-media { justify-items: start; }
  .wp-media { --wp-h: 70svh; }
  .wp-bar { left: 1rem; right: 1rem; justify-content: flex-end; }
  /* Phone: the section name alone, at the left. */
  .wp-where { margin-right: auto; }
  .wp-where-count { display: none; }
  .wall { --row: 11rem; }
}

@media (prefers-reduced-motion: reduce) {
  .btn:active, .player-close:active { transform: none; }
  .player, .player:not([open]) { transform: none; }
  @starting-style { .player[open] { transform: none; } }
}


/* ---------- timeline: scroll is the playhead, sections are markers ---------- */
:root { --tl-h: 2.75rem; }
/* has-timeline is set in <head> (JS on), so the bar and the room for it are there from the first paint; main.js fills in the marks. */
.has-timeline .timeline[hidden] { display: grid; }
.has-timeline body { padding-bottom: calc(var(--tl-h) + env(safe-area-inset-bottom, 0px)); }
.has-timeline { scroll-padding-bottom: var(--tl-h); }
.timeline {
  position: fixed;
  inset: auto 0 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  height: calc(var(--tl-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 var(--gutter) env(safe-area-inset-bottom, 0px);
  background: var(--wall);
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  user-select: none;
  -webkit-user-select: none;
}
.tl-tc { align-self: center; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.tl-end { color: var(--ink-2); }
.tl-now { display: none; }
.tl-track {
  position: relative;
  cursor: col-resize;
  touch-action: none;
  /* Ruler: a fine tick every 8px, a longer one every 40px. */
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px) 0 100% / 8px 0.3rem repeat-x,
    linear-gradient(to right, rgb(22 23 22 / 0.34) 1px, transparent 1px) 0 100% / 40px 0.55rem repeat-x;
}
.tl-marks { position: absolute; inset: 0; }
.tl-mark {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  align-items: flex-start;
  min-width: 0;
  padding-top: 0.45rem;
  border-left: 1px solid var(--ink-2);
  white-space: nowrap;
  transition: background-color 200ms ease;
}
.tl-mark a { min-width: 0; overflow: hidden; text-overflow: ellipsis; padding-inline: 0.35rem; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.timeline.is-instant .tl-mark, .timeline.is-instant .tl-mark a { transition: none; }
.tl-mark.is-current { border-left-color: var(--ink); background: rgb(22 23 22 / 0.045); }
.tl-mark.is-current a { color: var(--ink); font-weight: 500; }
.tl-mark[hidden] { display: none; }
.tl-mark.is-tick a { visibility: hidden; }
.tl-mark.is-flip a { position: absolute; right: 100%; overflow: visible; }
.tl-head {
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  margin-left: -0.5px;
  background: var(--accent);
  pointer-events: none;
}
/* The playhead's handle, as on an editing timeline. */
.tl-head::before {
  content: "";
  position: absolute;
  top: 0;
  left: -0.3rem;
  width: 0.6rem;
  height: 0.45rem;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%);
}
@media (hover: hover) and (pointer: fine) {
  .tl-mark a { transition: color 150ms ease; }
  .tl-mark a:hover { color: var(--accent); }
}
@media (max-width: 52rem) {
  :root { --tl-h: 2.25rem; }
  .tl-mark a { display: none; }
  .tl-end { display: none; }
  .tl-tc:first-child { display: flex; align-items: baseline; min-width: 0; white-space: nowrap; }
  .tl-now { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; margin-left: 0.6rem; font-weight: 500; }
  .timeline { grid-template-columns: minmax(0, auto) minmax(4.5rem, 1fr) auto; }
}

/* ---------- CV: an A4 sheet on its own page (/cv/, /de/cv/) ---------- */
.cv-sheet {
  --cv-ink: var(--ink);
  display: grid;
  align-content: start;
  /* Gap 13 (was 18): room for the keywords and the Showreel link on one page. Margins 52 on every side
     (Vadym 26.11.2026: even margins; the bottom ends up ~57 px of white, the same to the eye). */
  gap: 13px;
  width: 794px;
  height: 1123px;
  padding: 52px;
  background: #f4f4f1;
  color: var(--cv-ink);
  font: 400 12.5px/1.5 var(--sans);
  text-align: left;
}
.cv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding-bottom: 22px; border-bottom: 1px solid var(--ink); margin-bottom: 4px; }
.cv-id { display: grid; gap: 2px; }
/* Same photo as the first screen, exactly 4:5. */
.cv-photo { width: 112px; height: 140px; object-fit: cover; }
/* Links (email, site, works) look like the text with a thin line under them, so they read as clickable in the PDF too. */
.cv-sheet a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--line); text-underline-offset: 0.2em; }
@media (hover: hover) and (pointer: fine) { .cv-sheet a:hover { color: var(--accent); text-decoration-color: currentColor; } }
.cv-note { display: block; font-weight: 400; color: var(--ink-2); }
.cv-sheet strong { font-weight: 500; }
.cv-name { font-size: 15px; font-weight: 500; }
.cv-role { font-size: 40px; line-height: 1; letter-spacing: -0.035em; font-weight: 500; margin-block: 4px 10px; }
.cv-contact, .cv-muted, .cv-when { color: var(--ink-2); }
.cv-sep { color: var(--ink-2); }
.cv-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 24px; }
.cv-row h3 { font-size: 12.5px; font-weight: 500; }
.cv-list { display: grid; gap: 8px; }
.cv-list.cv-tight { gap: 2px; }
.cv-entry { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; }
.cv-when { font-variant-numeric: tabular-nums; }
.cv-entry strong { font-weight: 500; }


/* The CV page: a bar (PDF, other language) over the sheet, centred on the wall; zoomed to fit on narrow screens. */
.page-cv { padding: 0 1rem 2rem; }
.cv-bar { display: flex; justify-content: center; align-items: center; gap: 1.5rem; padding-block: 1rem; }
.cv-bar .is-pending { background: var(--wall-deep); }
.cv-stage { display: grid; justify-content: center; }
.cv-stage .cv-sheet { outline: 1px solid var(--line); zoom: var(--cv-k, 1); }
/* Printing (and the PDF later): just the sheet, one A4 page, no margins. */
@page { size: A4; margin: 0; }
@media print {
  .page-cv { padding: 0; background: #f4f4f1; }
  .cv-bar { display: none; }
  .cv-stage .cv-sheet { outline: none; zoom: 1; }
  .cv-sheet a { text-decoration-color: var(--line); }
}
