/* harrysergeev.com — components and page layouts.
   Values come from tokens.css; avoid hard-coding colors or font sizes here. */

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

/* The page colour sits on <html> itself from the very first paint. iPhone Safari paints
   the strips behind its address bar from it (it ignores theme-color), so it must never
   change after load. Rule of thumb for the rest of the site: no fixed or sticky element
   that touches the top or bottom edge gets a background colour, and nothing fixed stays
   on the page invisibly, because Safari colours its bars from those too. */
html { -webkit-text-size-adjust: 100%; background-color: var(--color-bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  /* the page colour is on <html> (above): a background here would cover the fixed background photos and videos */
  color: var(--color-fg);
  font-family: var(--font);
  font-weight: var(--weight-regular);
  font-size: var(--type-body);
  line-height: var(--type-body-lh);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: var(--weight-regular); }
img, video { display: block; max-width: 100%; }
picture { display: contents; }   /* only wraps an <img> with a smaller AVIF copy; lays out as the <img> */

/* ---------- Text styles ---------- */

/* Copy-to-clipboard email button looks like plain text or a link */
.copy-email {
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
/* Links in text (.link, .accent) are white and underlined with a small icon: see fun.css */

/* Letter case for these (and every other text) is set in type.css */
.page-title {
  font-size: var(--type-title);
  line-height: var(--type-title-lh);
}
.label {
  font-weight: var(--weight-bold);
  font-size: var(--type-label);
  line-height: var(--type-label-lh);
}

/* ---------- Header ---------- */

/* The name and arrow stay at the top while the page scrolls. Once scrolled, a faint
   shadow fades in behind them, darkest at the name and fading out over a long way,
   so they stay readable over text and photos without a visible patch. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  padding: 20px var(--gutter) 0;
  height: var(--header-height);
  pointer-events: none;   /* only the name catches clicks, not the empty strip */
}
.site-header > .name, .site-header .menu { pointer-events: auto; }
.site-header::before {
  content: "";
  position: fixed;   /* fixed, so that when the menu scales it up it never makes the page wider */
  left: 0;
  top: 0;
  z-index: -1;
  width: min(100vw, 640px);
  height: 230px;
  /* a shadow corner: darkest in the very top-left corner, still dark behind the name,
     fading out over a long way to the right and down */
  background: radial-gradient(farthest-side at 0 0,
    color-mix(in srgb, var(--color-bg) 88%, transparent),
    color-mix(in srgb, var(--color-bg) 74%, transparent) 30%,
    color-mix(in srgb, var(--color-bg) 45%, transparent) 55%,
    color-mix(in srgb, var(--color-bg) 18%, transparent) 78%,
    transparent);
  opacity: 0;
  transform-origin: 0 0;
  transform: scale(var(--sh, 1));   /* the menu grows this shadow over the whole screen (below) */
  transition: opacity var(--page-in) var(--ease);   /* fades in and out like the lights button */
  pointer-events: none;
}
.scrolled .site-header::before { opacity: 1; }
.site-header .name {
  position: relative;
  font-size: var(--type-nav);
  /* Same proportions as the big name (line height, arrow, gap), so the two are one shape
     at two sizes and the menu and page changes can turn one into the other seamlessly */
  line-height: var(--type-display-lh);
  letter-spacing: var(--type-nav-tracking);
}
.site-header .name::after { content: ""; position: absolute; inset: -6px -4px; }   /* bigger tap area */

/* Name + arrow: one button. The whole thing dims on hover; nothing moves. */
.menu-toggle { display: inline-flex; align-items: center; gap: .25em; cursor: pointer; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .menu-toggle:hover { color: var(--color-muted); } }   /* a tap on a phone must not leave it grey */
.menu-toggle:focus:not(:focus-visible) { outline: none; }
.menu-arrow { display: inline-flex; width: .5em; height: .5em; flex: none; }
.menu-arrow svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;   /* same line weight at every size */
}
.is-close .menu-arrow svg { transform: rotate(180deg); }

/* The open menu is the home page itself: same big name, links, time, languages, legal.
   It opens like the shadow behind the name spreading over the whole screen: a soft
   black circle grows from the name, and the menu shows wherever the shadow reaches.
   Closing shrinks it back into the corner. (main.js grows the name at the same time.) */
.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;   /* gone completely when closed: Safari would keep colouring its bars from it */
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;   /* a swipe on the menu never scrolls the page underneath */
}
.menu-shown .menu { display: flex; }
.menu { scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }
/* One pixel taller than the screen, so the menu is always its own scroll box (see above) */
.menu > .home-main { flex: none; min-height: calc(100% + 1px); }
/* The black: the name's own corner shadow (above) grows out of the top-left corner over
   the whole screen, and shrinks back into it on closing. If the shadow isn't showing yet
   (page not scrolled), it grows from nothing at the corner. A copy of the same shape with
   a solid middle and a long soft edge sits on top of it, grows with it and fades in, so
   the shadow turns into solid black as it spreads. Both are drawn once and only scaled
   and faded, which phones do smoothly; their colours never change while they move.
   main.js sets --sh, the size. Neither is fixed or has a flat colour, so Safari's bars
   aren't affected, and nothing clips them, so they also reach behind the address bar. */
.site-header::after {
  content: "";
  position: fixed;
  left: 0;
  top: 0;
  z-index: 49;
  width: min(100vw, 640px);
  height: 230px;
  background: radial-gradient(farthest-side at 0 0, var(--color-bg) 15%,
    color-mix(in srgb, var(--color-bg) 88%, transparent) 30%,
    color-mix(in srgb, var(--color-bg) 62%, transparent) 50%,
    color-mix(in srgb, var(--color-bg) 32%, transparent) 70%,
    color-mix(in srgb, var(--color-bg) 10%, transparent) 88%,
    transparent);
  transform-origin: 0 0;
  transform: scale(var(--sh, 1));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
/* While the menu is shown, main.js moves the shadow (size and fade) on the same clock as
   the name and the menu words, so all three stay exactly together. These are the end states. */
.menu-shown .site-header::after { visibility: visible; }
.menu-open .site-header::after { opacity: 1; }
.sh-snap::before, .sh-snap::after { transition: none !important; }
/* The menu words are revealed by the shadow itself: each one shows only where the black
   has already reached (main.js cuts them to a circle that grows with it), and closing
   hides them the same way, so they disappear as the shadow shrinks past them. */
.menu-shown .site-header { z-index: 60; }   /* above the sound button and other fixed extras */
.menu-open .site-header::before { opacity: 1; }   /* the name's shadow stays until the menu's black covers it (no flicker) */
/* One name, never two: the menu's big name starts exactly on top of the small one and
   grows into place (main.js); the small one is hidden in that same moment. Closing runs
   in reverse, and the small one returns only when the big one has landed on it. */
.menu-open .site-header > .name, .menu-closing .site-header > .name { visibility: hidden; }

/* ---------- Main + footer ---------- */

main {
  flex: 1;
  padding: 44px var(--gutter) clamp(56px, 8vw, 96px);   /* the last line never touches the bottom of the screen */
}


/* ---------- Home view (home page and the open menu) ---------- */

/* Fits one screen: name at the top; the menu, then time, languages and legal links
   at the bottom. */
.home-page { display: flex; flex-direction: column; padding: 0; }
.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px var(--gutter) 16px;
  min-height: 100vh;
  min-height: 100svh;
}
/* Wider screens: the time in the top-right corner. Phones: see .home-foot .clock below. */
.home-top { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
@media (min-width: 641px) {
  .home-top { flex-direction: row; justify-content: space-between; gap: 24px; }
  .home-top .clock { padding-top: calc(var(--type-display) * .092); }   /* top of the letters lines up with the top of the name */
}
.home-name,
.home-nav a {
  font-size: var(--type-display);
  letter-spacing: var(--type-display-tracking);
}
.home-name { line-height: var(--type-display-lh); width: fit-content; transform-origin: 0 0; white-space: nowrap; }
/* The big name in the menu always stays on one line with its arrow. «Игорь Сергеев» is
   the longest: on narrow phones it gets just small enough to fit (about 7.95em wide). */
.home-name .menu-arrow { transform-origin: 0 0; }   /* main.js moves it from its top-left corner */
/* The home page's name keeps the arrow's space (invisible), so it has the same shape as
   the header name it turns into when a page opens */
.home-name:not(.menu-toggle) { display: inline-flex; align-items: center; gap: .25em; }
.home-name:not(.menu-toggle) .menu-arrow { visibility: hidden; }
.menu .home-name:lang(ru) { font-size: min(var(--type-display), calc((100vw - 2 * var(--gutter)) / 7.95)); }
.home-nav { display: flex; flex-direction: column; margin-top: auto; padding-top: 40px; }
.home-nav a { line-height: var(--type-display-nav-lh); width: fit-content; }
.home-nav a:hover { color: var(--color-muted); }

/* Under the menu: languages on the left, legal links on the right (all screens) */
.home-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-top: 32px;
  font-size: var(--type-small);
  line-height: 13px;
}
.home-foot .legal-links { display: flex; gap: 16px; font-size: var(--type-legal); color: var(--color-muted); }
.legal-links a:hover { color: var(--color-fg); }
.home-top .clock { font-size: var(--type-small); line-height: 13px; }
.clock { margin: 0; white-space: nowrap; }
/* Phones: the time sits at the bottom left, where the language switch was.
   Wider screens: in the top-right corner. */
.home-foot .clock { font-size: var(--type-small); line-height: 13px; }
@media (max-width: 640px) { .home-main:has(.foot-clock) .home-top .clock { display: none; } }
/* Wider screens: the menu sits in the bottom row, its last line on the same baseline as
   the legal links in the bottom-right corner. */
@media (min-width: 641px) {
  .home-main { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; column-gap: 24px; }
  .home-top { grid-column: 1 / -1; }
  .home-nav { grid-column: 1; grid-row: 2; align-self: last baseline; margin-top: 0; }
  .home-foot { grid-column: 2; grid-row: 2; align-self: last baseline; margin-top: 0; }
  .home-foot .clock { display: none; }   /* the time is in the top-right corner here */
}
.clock b { font-weight: var(--weight-bold); margin-left: 4px; }

/* ---------- Bio ---------- */

.bio main { position: relative; }
.bio-text {
  position: relative;
  z-index: 1;
  max-width: var(--content-max);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.bio-text .page-title { margin-bottom: 16px; }
/* The portrait is a fixed background, like the videos on production pages: it never
   scrolls and never makes the page longer. It fades in slowly, and its left and bottom
   edges dissolve into the black so no cut edge shows. Only the text scrolls over it. */
.bio-photo {
  position: fixed;
  inset: 0 0 auto auto;
  height: 100vh;
  height: 100lvh;   /* behind the browser bars too, without jumping */
  z-index: -1;
  width: 58vw;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--bio-photo-opacity);
  animation: stage-in var(--bg-video-fade) var(--ease-out) both;
}
/* Desktop: the top of his head lines up with the first paragraph.
   The hood starts 32% down the photo, and the photo is 1.5 times as tall as it is wide. */
.bio-photo img {
  position: absolute;
  left: 0;
  width: 100%;
  max-width: none;
  height: auto;
  top: calc(var(--header-height) + 44px + var(--type-title) * 1.03 + 36px - 58vw * .48);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 38%), linear-gradient(to bottom, #000 70%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 38%), linear-gradient(to bottom, #000 70%, transparent);
  mask-composite: intersect;
  opacity: var(--fade, 1);   /* fades away while scrolling, like the play page photo (main.js) */
}

/* ---------- Audio player ----------
   Every control has a 44 px click area; the visible parts stay thin. */

.player { margin-top: 64px; --player-hit: 44px; }
.player-row { display: flex; align-items: center; }
.player button {
  display: grid; place-items: center;
  width: var(--player-hit); height: var(--player-hit); padding: 0;
  border: 0; background: none; cursor: pointer; color: var(--color-fg);
  transition: color var(--fast) var(--ease);
}
.player button:hover { color: var(--color-muted); }
.player button svg { width: 18px; height: 18px; fill: currentColor; }
.player-play { margin-left: -13px; margin-right: 5px; }
.player .bar {               /* tall invisible hit area around a thin track */
  position: relative;
  flex: 1;
  height: var(--player-hit);
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.player .track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 5px;
  background: var(--color-muted);
  transition: height var(--fast) var(--ease);
}
.player .bar:hover .track, .player .bar.dragging .track, .player .bar:focus-visible .track { height: 6px; }
.player .track i {
  position: absolute; inset: 0 auto 0 0;
  width: 0; border-radius: inherit; background: var(--color-fg);
}
.player .track i::after {     /* knob at the play position, shown on hover and drag */
  content: "";
  position: absolute; right: -7px; top: 50%;
  width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%; background: var(--color-fg);
  transform: scale(0); transition: transform var(--fast) var(--ease);
}
.player .bar:hover .track i::after, .player .bar.dragging .track i::after, .player .bar:focus-visible .track i::after { transform: scale(1); }
.player-meta {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: nowrap;   /* time on the left, volume on the right, always one line */
  padding-left: 36px; gap: 8px 24px;
}
.player .time { font-size: var(--type-time); line-height: var(--type-time-lh); font-variant-numeric: tabular-nums; }
.player .time .total { color: var(--color-muted); font-size: var(--type-body); margin-left: 10px; }
.player-tools { display: flex; align-items: center; gap: 20px; }
.player .volume { display: flex; align-items: center; }
.player-mute[aria-pressed="true"] .waves { opacity: 0; }
.player-volume {           /* thin line slider, 80 px wide, 44 px tall to grab */
  -webkit-appearance: none; appearance: none;
  width: 80px; height: var(--player-hit); margin: 0;
  background: none; cursor: pointer;
  --v: 100%;
}
.player-volume::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(var(--color-fg), var(--color-fg)) 0 / var(--v) 100% no-repeat, var(--color-muted); }
.player-volume::-moz-range-track { height: 2px; background: var(--color-muted); }
.player-volume::-moz-range-progress { height: 2px; background: var(--color-fg); }
.player-volume::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; margin-top: -4px; border-radius: 50%; background: var(--color-fg); border: 0; }
.player-volume::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--color-fg); border: 0; }
.no-volume .player-volume { display: none; }   /* iPhones ignore page volume; the phone's buttons do it */
/* The demo's title, with the download link on the same line, on the right */
.demo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.demo-head .download {        /* same look as the other small actions: underlined, icon */
  flex: none;
  font-size: var(--type-label); line-height: var(--type-label-lh);
  padding: 12px 0;            /* 44 px tall click area */
}

/* ---------- Voice role cards ---------- */

.works {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-top: 34px;
}
.work img { width: 100%; height: 162px; object-fit: cover; background: var(--color-placeholder); }
.work h3 { font-size: var(--type-heading); line-height: var(--type-card-lh); }
.work p { color: var(--color-muted); }

/* ---------- Voice page ---------- */

.voice .works-title { margin-top: 64px; }   /* its own section, but close to the demo */
.voice .works-title + .label { margin-top: 24px; }
/* The demo title is as far from the player as "works" is from "official russian dubs".
   The player's 44 px click areas reach above the visible line, hence the smaller margin. */
.voice .demo-head + .player { margin-top: 2px; }
.audiobooks { margin-top: 46px; }
.audiobooks .text { max-width: 827px; margin-top: 34px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Theater / playwriting: list + detail ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--col-gap);
  margin-top: 35px;
}
.nav-list { display: flex; flex-direction: column; gap: 14px; padding: 0; margin: 0; }
.nav-list > li { list-style: none; }
.nav-list a { font-size: var(--type-list); line-height: var(--type-list-lh); display: inline-block; }
.nav-list a:hover { color: var(--color-muted); }
.nav-list .current a { color: var(--color-fg); }
.nav-list .summary {
  border-top: 2px solid var(--color-fg);
  margin-top: 12px;
  padding: 14px 0 56px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail { display: flex; flex-direction: column; gap: 20px; margin-top: -4px; }
/* Read links (or the Download PDF button) in one row, spread across the column */
.nav-list .work-links { display: flex; justify-content: space-between; gap: 16px; }
.nav-list .work-links a {
  font-size: var(--type-body);
  line-height: var(--type-body-lh);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nav-list .work-links a:hover { color: var(--color-muted); }
/* Reading pages: the other languages sit on the right of the play's title row */
.nav-list .work-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.nav-list .work-aside { display: flex; gap: 16px; }
.nav-list .work-aside a {
  font-size: var(--type-body);
  line-height: var(--type-body-lh);
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Reading pages: the play text starts below the playwriting section */
.reading .split ~ .play-body { margin-top: 120px; }   /* "~", since a tiny script sits right after the block (components.mjs, split) */

/* Background video on production pages */
.bg-video {
  position: fixed;
  inset: 0 0 auto;
  /* The largest screen height, so the picture reaches behind the phone's address bar and
     doesn't jump when the bar shrinks or grows */
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  opacity: var(--bg-video-opacity);
  pointer-events: none;
  animation: stage-in var(--bg-video-fade) var(--ease-out) both;
}
/* Background media lights up slowly, like a stage: it only fades in from dark.
   When the next page shows the same picture, it stays lit instead (main.js adds .stage-lit). */
@keyframes stage-in { from { opacity: 0; } }   /* only a fade: nothing changes size */
.stage-lit .bg-video, .stage-lit .bio-photo { animation: none; }
/* Media fade-in: the slow light-up waits until the photo or video has actually arrived
   (the "loaded" class comes from a tiny script in <head>), so on a slow connection it
   doesn't pop in half-way through. Without JavaScript there is no .js and nothing waits. */
.js .bg-video:not(:has(> .loaded)), .js .bio-photo:not(:has(> .loaded)) { animation-play-state: paused; }
.js .work img { transition: opacity var(--page-in) var(--ease); }
.js .work img:not(.loaded) { opacity: 0; }
.bg-video video { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Play text (open-relationship-ru) ---------- */

.play-body { width: 100%; max-width: 696px; margin: 0 auto; display: flex; flex-direction: column; gap: 40px; }   /* centred at the desktop width until it meets the page padding */
/* Sizes and spacing grow smoothly with the screen, like the rest of the site (no jumps) */
.play-scene { display: flex; flex-direction: column; gap: var(--play-para-gap); }
.play-scene h2 { font-size: var(--type-play-small); line-height: 1; text-align: center; margin-bottom: var(--play-chapter-gap); }
.play-scene p { line-height: var(--type-play-lh); }
/* The title screen fills the whole screen: title in the middle, the note at the bottom.
   svh = the screen height with the phone browser's bars showing, so nothing hides behind them. */
.play-title { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: 1fr auto 1fr; text-align: center; }
.play-title-main { grid-row: 2; display: flex; flex-direction: column; gap: 20px; }
.play-title h1 { font-size: var(--type-title); line-height: var(--type-title-lh); }
.play-title h2 { font-size: var(--type-play-small); line-height: 1; }
.play-note { grid-row: 3; align-self: end; padding: 40px 0 var(--play-note-bottom); }


/* ---------- Contact ---------- */

/* Heading, then the links under it on the left, at the same distance as on the theater pages */
.contact-list { display: flex; flex-direction: column; gap: 8px; margin-top: 35px; }
.contact-list > * { font-size: var(--type-contact); line-height: var(--type-contact-lh); width: fit-content; }
.contact-list > *:hover { color: var(--color-muted); }

/* ---------- Legal ---------- */

.legal { max-width: var(--content-max); }
.legal h2 { font-size: var(--type-heading); line-height: var(--type-heading-lh); margin: 40px 0 12px; }
.legal h3 { font-weight: var(--weight-bold); margin: 24px 0 8px; }
.legal p { margin-bottom: 12px; }
.legal .page-title { margin-bottom: 20px; }

/* ---------- Languages ---------- */

/* EN DE RU switch: the current language is white, the others muted */
.lang-switch { display: flex; gap: 12px; }
.lang-switch a { color: var(--color-muted); transition: color var(--fast) var(--ease); }
.lang-switch a:hover, .lang-switch a[aria-current] { color: var(--color-fg); }

/* First visit: full-screen language choice on black, before the home page */
.lang-picker { display: none; }
.choose-lang body { overflow: hidden; }
.choose-lang .lang-picker {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  transition: background-color var(--menu-out) var(--ease-in-out);
}
/* After the choice the black lifts while the words shrink into the small switch (main.js) */
.lang-chosen .lang-picker { background-color: transparent; pointer-events: none; }
.lang-picker nav { display: flex; gap: clamp(32px, 9vw, 140px); animation: lang-picker-in var(--menu-in) var(--ease) both; }
.lang-picker a {
  transform-origin: 0 0;
  font-size: var(--type-display);
  line-height: var(--type-display-lh);
  letter-spacing: var(--type-display-tracking);
  transition: color var(--fast) var(--ease);
}
.lang-picker a:hover, .lang-picker a:focus-visible { color: var(--color-muted); }
@keyframes lang-picker-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lang-picker nav { animation: none; } }

/* Contact links show their short label (e-mail, telegram, instagram) at every width */
.contact-list .long { display: none; }

/* ---------- Desktop layout ---------- */

@media (min-width: 1200px) {

  /* theater / playwriting */
  .nav-list { gap: 8px; }
  .nav-list a { line-height: 42px; }
  .nav-list .summary { margin-top: 0; padding: 10px 0 140px; }

  /* bio */
  .bio-text { max-width: calc(50% - var(--col-gap) / 2); }

  /* voice */
  /* the demo keeps the left half */
  .voice .demo { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--col-gap); }
  .voice .demo > .demo-head, .voice .demo > .player { grid-column: 1; }
  .voice .demo-head + .player { margin-top: 8px; }
  .voice .works-title { margin-top: 88px; }
  .works { grid-template-columns: repeat(4, 1fr); gap: 68px 26px; }
  .audiobooks { margin-top: 48px; }
  .audiobooks .text { max-width: 691px; }


  /* play text */
  .play-scene p { text-align: justify; }
}

/* ---------- Responsive layout (font sizes change in tokens.css) ---------- */

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; row-gap: 40px; }
  /* About page on phones and tablets: a close crop of the face that bleeds off the right
     edge, with the title and text running over it. */
  .bio { --u: min(1vw, 5.2px); }   /* photo unit: 1% of a phone screen, capped on tablets */
  .bio-photo { width: calc(var(--u) * 100); height: calc(var(--u) * 112); bottom: auto; }
  /* Face center sits at about 63% across and 48% down the photo */
  .bio-photo img {
    width: calc(var(--u) * 150);
    left: calc(var(--u) * -28);
    top: calc(var(--u) * -56);
    -webkit-mask-image: none;
    mask-image: none;
  }
  .bio-photo {
    -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent), linear-gradient(to right, transparent, #000 50%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to bottom, #000 62%, transparent), linear-gradient(to right, transparent, #000 50%);
    mask-composite: intersect;
  }
  .bio-text { padding-top: calc(var(--u) * 62); }
}

@media (max-width: 640px) {
  .works { grid-template-columns: 1fr; }
  .play-note { padding-bottom: calc(var(--play-note-bottom) + 44px); }   /* on phones the note sits above "turn lights on", which would cover a long line */
}

/* ---------- Page transitions ----------
   Pages change instantly, with one exception: leaving the home page or the open menu
   plays the menu animation in reverse. The big name shrinks into the header name and
   the whole view shrinks into the corner shadow (main.js marks it with .vt-contract and
   skips every other transition). Browsers without view transitions just load the page.
   Off for reduced motion. */

@view-transition { navigation: auto; }

.site-header .name, .home-name { view-transition-name: site-name; }
/* A name may be used once per page. With the menu open, the menu's big name takes it,
   and the page underneath stays part of the background picture. */
.menu .home-name { view-transition-name: none; }
.menu-open .site-header .name { view-transition-name: none; }
.menu-open .menu .home-name { view-transition-name: site-name; }
/* The arrow travels on its own, so the name's letters are one picture that simply shrinks */
.site-header > .name .menu-arrow { view-transition-name: site-arrow; }
.menu-open .site-header > .name .menu-arrow { view-transition-name: none; }
.menu-open .menu .home-name .menu-arrow { view-transition-name: site-arrow; }
.menu-open .bg-video, .menu-open .bio-photo,
.vt-contract .bg-video, .vt-contract .bio-photo { view-transition-name: none; }
.bg-video, .bio-photo { view-transition-name: stage; }

::view-transition-group(*) { animation-duration: var(--page-in); animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation: fade-out var(--page-out) var(--ease) both; }
/* The new page arrives by rising a little, just after the old one is gone */
::view-transition-new(root) { animation: rise-in var(--page-in) var(--ease-out) calc(var(--page-out) * .6) both; }
/* Background media cross-fades slowly and never moves */
::view-transition-group(stage) { animation: none; }
::view-transition-old(stage) { animation: fade-out var(--page-in) var(--ease) both; }
::view-transition-new(stage) { animation: none; }
/* Big-to-small name: keep the sharp old picture until late, then swap */
::view-transition-old(site-name) { animation: name-out var(--page-in) var(--ease) both; }
::view-transition-new(site-name) { animation: name-in var(--page-in) var(--ease) both; }

/* From the home page or the open menu: the old view shrinks into the corner on top of
   the new page, which is already in place underneath */
.vt-contract::view-transition-group(*) { animation-duration: var(--menu-out); animation-timing-function: var(--ease-in-out); }
/* One name, never two: the big name shrinks into the header's place as one picture, and
   the small one replaces it only at the very end, where they match exactly. The arrow
   travels with it and turns from up to down on the way, like when the menu closes. */
.vt-contract::view-transition-image-pair(site-name) { isolation: auto; }
.vt-contract::view-transition-old(site-name) { animation: none; mix-blend-mode: normal; }
.vt-contract::view-transition-new(site-name) { animation: show-at-end var(--menu-out) linear both; mix-blend-mode: normal; }
.vt-contract::view-transition-image-pair(site-arrow) { isolation: auto; }
.vt-contract::view-transition-old(site-arrow) { animation: arrow-turn var(--menu-out) var(--ease-in-out) both; mix-blend-mode: normal; }
.vt-contract::view-transition-new(site-arrow) { animation: show-at-end var(--menu-out) linear both; mix-blend-mode: normal; }
/* From the home page there is no arrow yet: it fades in as the name lands */
.vt-contract::view-transition-new(site-arrow):only-child { animation: rise-fade calc(var(--menu-out) * .4) var(--ease) calc(var(--menu-out) * .6) both; }
@keyframes arrow-turn { to { transform: rotate(-180deg); } }   /* same direction as when the menu closes */
@keyframes show-at-end { 0%, 99% { opacity: 0; } 100% { opacity: 1; } }
@keyframes rise-fade { from { opacity: 0; } }
.vt-contract::view-transition-new(root) { animation: none; }
.vt-contract::view-transition-old(root) {
  z-index: 1;
  animation: contract var(--menu-out) var(--ease-in-out) both;
  -webkit-mask-image: radial-gradient(circle at 100px 40px, #000 calc(var(--reveal) - 35vmax), transparent var(--reveal));
  mask-image: radial-gradient(circle at 100px 40px, #000 calc(var(--reveal) - 35vmax), transparent var(--reveal));
}
@property --reveal { syntax: "<length>"; inherits: false; initial-value: 0px; }
@keyframes contract { from { --reveal: 180vmax; } to { --reveal: 0px; } }

@keyframes fade-out { to { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } }
/* the two pictures of the name overlap at full strength, so it never dims halfway */
@keyframes name-out { 0%, 55% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes name-in { 0%, 30% { opacity: 0; } 55%, 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .bg-video, .bio-photo { animation: none; }
}
