/* Общие стили портфолио: главная (index.html) и страницы кейсов.
   Шрифты подключены с Google Fonts только для прототипа; на проде - self-host с font-display: swap.
   Скругления: медиа и карточки 14px, кнопки - пилюли. */
  :root {
    --bg: #f3f3f1;
    --surface: #e9e9e6;
    --surface-2: #deded9;
    --ink: #141415;
    --muted: #66666a;
    --line: #d4d4cf;
    --accent: #df5427;
    --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--bg));
    --on-ink: #f3f3f1;
    --radius: 14px;
    --gutter: clamp(16px, 4vw, 48px);
    --font: "Onest", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --lamp: transparent; /* тёплый растр за героем: «лампа» горит только в тёмной теме */
    --lamp-on: 0;
    --lamp-icon: var(--muted);
    --halo: #e46a3d; --halo-o: .5; /* растр за героем: днём тёплое пятно, ночью свет лампы */
    --paper-img: url(assets/paper.png); /* ровное зерно бумаги на всей странице */
    --comic-ink: #141415; /* чернила пузырей и звукоподражаний — всегда тёмные, как в комиксе */
    --comic-paper: #fffdf7;
    --vinyl: #1c1c1f; --vinyl-2: #0f0f10; --vinyl-rim: rgb(255 255 255 / .12); --vinyl-sheen: .14; /* пластинки в «On repeat» */
    color-scheme: light;
  }
  /* Тема: по системе, пока посетитель не щёлкнул лампой (тогда data-theme на <html>) */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #111112;
      --surface: #1b1b1d;
      --surface-2: #242427;
      --ink: #ededea;
      --muted: #9b9ba0;
      --line: #2b2b2e;
      --accent: #ff7343;
      --on-ink: #111112;
      --lamp: #ffae6b;
      --lamp-on: 1;
      --lamp-icon: var(--accent);
      --halo: #ffae6b; --halo-o: .55;
      --paper-img: url(assets/paper-dark.png);
      --vinyl: #36363c; --vinyl-2: #232327; --vinyl-rim: rgb(255 255 255 / .3); --vinyl-sheen: .24;
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #111112;
    --surface: #1b1b1d;
    --surface-2: #242427;
    --ink: #ededea;
    --muted: #9b9ba0;
    --line: #2b2b2e;
    --accent: #ff7343;
    --on-ink: #111112;
    --lamp: #ffae6b;
    --lamp-on: 1;
    --lamp-icon: var(--accent);
    --halo: #ffae6b; --halo-o: .55;
    --paper-img: url(assets/paper-dark.png);
    --vinyl: #36363c; --vinyl-2: #232327; --vinyl-rim: rgb(255 255 255 / .3); --vinyl-sheen: .24;
    color-scheme: dark;
  }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

  * { box-sizing: border-box; margin: 0; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--bg) var(--paper-img) 0 0 / 256px 256px;
    color: var(--ink);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  a { color: inherit; text-decoration: none; }
  img, video { display: block; width: 100%; height: 100%; object-fit: cover; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

  .wrap { max-width: 1360px; margin-inline: auto; padding-inline: var(--gutter); }
  .grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
  .mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
  .muted { color: var(--muted); }

  /* ---------- Шапка ---------- */
  .top {
    position: sticky; top: 0; z-index: 10;
    /* то же зерно бумаги, что у страницы: полоса шапки не выглядит гладкой, фон идёт до самого верха */
    background: var(--paper-img) 0 0 / 256px 256px, color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .top .wrap { height: 64px; display: flex; align-items: center; gap: 24px; }
  .wordmark { font-weight: 600; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; }
  @media (max-width: 599px) { .mark-last { display: none; } } /* русская шапка на телефоне — только имя */
  .status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
  .status::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
  }
  /* статус — табло с перекидными буквами (site.js): факты сменяют друг друга, буквы перекидываются на двойках */
  .flap { display: inline-flex; gap: 1px; font: 500 12px/1 var(--mono); color: var(--ink); text-transform: uppercase; white-space: pre; }
  .flap-c { position: relative; width: calc(1ch + 3px); padding: 4px 0; text-align: center; background: var(--surface-2); border-radius: 2px; }
  .flap-c::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: color-mix(in srgb, var(--ink) 16%, transparent); }
  .nav { margin-left: auto; display: flex; align-items: center; gap: 28px; font-size: 15px; }
  .nav a:not(.btn) { color: var(--muted); white-space: nowrap; transition: color .2s; }
  .nav a:not(.btn):hover { color: var(--ink); }
  /* переключатель языка: две половинки пилюли, выбранная залита */
  .lang-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
  .lang-switch button {
    padding: 6px 8px; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer;
    font: 500 12px/1 var(--mono); letter-spacing: .04em; transition: background-color .2s, color .2s;
  }
  .lang-switch button:hover { color: var(--ink); }
  .lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
  .lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* русская версия, пока скрипт не подставил тексты: английский не мелькает (страховка снимает класс через 1,5 с) */
  .i18n-wait body { visibility: hidden; }

  .btn {
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
    height: 44px; padding: 0 20px; border-radius: 999px;
    font: 500 15px/1 var(--font);
    border: 1px solid var(--ink); cursor: pointer;
    transition: transform .2s var(--ease), background .2s, color .2s;
  }
  .btn:active { transform: scale(0.98); }
  .btn--solid { background: var(--ink); color: var(--on-ink); }
  .btn--solid:hover { background: var(--accent); border-color: var(--accent); color: #141415; }
  .btn--ghost { background: transparent; color: var(--ink); }
  .btn--ghost:hover { background: var(--ink); color: var(--on-ink); }
  .btn--sm { height: 36px; padding: 0 16px; font-size: 14px; }
  .btn i { font-size: 18px; }

  .lamp {
    width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line);
    display: inline-grid; place-items: center; background: none; color: var(--lamp-icon); cursor: pointer;
    transition: border-color .2s, transform .2s var(--ease);
  }
  .lamp:hover { border-color: var(--ink); }
  .lamp:active { transform: scale(0.94); }
  .lamp i { font-size: 18px; }

  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  /* шапка не шире окна (21.10). Окно 900–1099 px: в русской версии табло, меню и кнопка не помещались — короче зазоры,
     в имени только имя, как на телефоне. Телефон до 420 px: зазоры и поля кнопок меньше; до 359 px кнопка «Написать» —
     значок письма (подпись остаётся для экранного чтеца) */
  .top .btn--sm .ph { display: none; }
  @media (min-width: 900px) and (max-width: 1099px) {
    .top .wrap { gap: 16px; }
    .nav { gap: 18px; }
    .mark-last { display: none; }
  }
  @media (max-width: 420px) {
    .top .wrap { gap: 12px; }
    .nav { gap: 6px; }
    .top .btn--sm { padding: 0 12px; }
    .lang-switch button { padding: 6px; }
  }
  @media (max-width: 359px) {
    .top .btn--sm { width: 36px; padding: 0; justify-content: center; }
    .top .btn--sm .ph { display: inline; }
    .top .btn--sm span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  }

  /* ---------- Обложка: огромный титул, герой стоит перед ним, справа роль и анонсы кейсов ---------- */
  .cover {
    position: relative;
    height: clamp(700px, min(calc(100dvh - 64px), 74vw), 1000px);
    --cover-pad: clamp(16px, 3vw, 40px);
    padding-top: var(--cover-pad);
  }
  body { overflow-x: clip; }
  .masthead { position: relative; z-index: 0; margin: 0; line-height: 0; }
  /* на десктопе титул начинается правее абажура (тот кончается на 16–18% ширины): слева — чистое поле для лампы */
  @media (min-width: 900px) { .masthead { margin-left: 20%; margin-top: var(--mast-drop, 0px); } } /* --mast-drop: site.js опускает имя к роли */
  .mast-svg { display: block; width: 100%; height: auto; overflow: visible; }
  .mast-svg text { font: 800 100px "Onest", var(--font); }
  /* буквы: чернильный контур, внутри растр; голубой и пурпурный контуры со сдвигом — неточная печать */
  .mast-main {
    fill: url(#mast-dots); stroke: var(--ink); stroke-width: 2.5px; stroke-linejoin: round;
    paint-order: stroke; vector-effect: non-scaling-stroke;
  }
  .mast-dot { fill: var(--ink); }
  .mast-c, .mast-m { fill: none; stroke-width: 2.5px; vector-effect: non-scaling-stroke; }
  .mast-c { stroke: rgb(0 170 255 / .55); }
  .mast-m { stroke: rgb(255 40 140 / .5); }

  .cover-stage {
    position: absolute; z-index: 1; left: var(--gutter); top: 0; bottom: 0; margin: 0;
    width: calc((100% - 2 * var(--gutter)) * 0.42);
  }
  /* сцена живого героя: прозрачная, с тенью на полу и «лампой» в тёмной теме */
  .stage { position: absolute; inset: 0 0 34px 0; }
  .stage.over-hero { cursor: pointer; }
  .cover-copy {
    position: absolute; z-index: 2; right: var(--gutter); bottom: 48px; /* = линия пола */
    width: calc((100% - 2 * var(--gutter)) * 0.5);
  }
  .role { font-weight: 600; font-size: clamp(34px, min(4.4vw, 7vh), 64px); line-height: 1.04; letter-spacing: -0.035em; }
  .role span { display: block; color: var(--muted); }
  /* «Продуктовый дизайнер.» шире английской строки: чуть мельче, чтобы роль осталась в две строки и не наезжала на титул.
     На десктопе кегль — от ширины колонки (строка — 11,14 кегля): от процента экрана она местами переносилась в три */
  :root:lang(ru) .role { font-size: clamp(31px, min(4vw, 6.4vh), 58px); }
  @media (min-width: 900px) {
    .cover-copy { container-type: inline-size; }
    :root:lang(ru) .role { font-size: clamp(31px, min(8.8cqi, 6.4vh), 58px); }
  }
  /* анонсы кейсов, как строки на обложке журнала */
  .cover-lines { list-style: none; padding: 0; margin: clamp(24px, 4vh, 44px) 0 0; border-top: 1px solid var(--line); }
  .cover-lines a {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 16px;
    padding: 11px 0 12px; border-bottom: 1px solid var(--line);
  }
  .cover-lines .mono, .cl-title { grid-column: 1; }
  .cl-title {
    font-weight: 500; font-size: clamp(17px, 1.5vw, 21px); letter-spacing: -0.01em;
    text-decoration: underline 2px transparent; text-underline-offset: 5px; transition: text-decoration-color .2s;
  }
  .cover-lines i { grid-column: 2; grid-row: 1 / span 2; font-size: 20px; transition: transform .3s var(--ease); }
  .cover-lines a:hover .cl-title, .cover-lines a:focus-visible .cl-title { text-decoration-color: var(--accent); }
  .cover-lines a:hover i { transform: translate(2px, 2px); }
  .stage::before {
    content: ""; position: absolute; left: 18%; right: 4%; top: var(--halo-top, 4%); bottom: 6%;
    background: radial-gradient(circle, var(--halo) 1.5px, transparent 2px) 0 0 / 8px 8px;
    -webkit-mask-image: radial-gradient(closest-side, #000 15%, transparent);
    mask-image: radial-gradient(closest-side, #000 15%, transparent);
    opacity: var(--halo-o); transition: opacity .3s steps(2, end);
  }
  .stage::after {
    content: ""; position: absolute; left: 33%; width: 48%; bottom: 2px; height: 28px;
    background: radial-gradient(circle, var(--ink) 1.1px, transparent 1.5px) 0 0 / 5px 5px;
    -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent);
    mask-image: radial-gradient(closest-side, #000 30%, transparent);
    opacity: .4;
  }
  .neighbor-rig { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .5s var(--ease); pointer-events: none; }
  /* чернильная обводка героя + лёгкий сдвиг цветов, как при неточной печати комикса */
  .neighbor-rig.inked .neighbor-canvas {
    filter: drop-shadow(1.2px 0 0 var(--ink)) drop-shadow(-1.2px 0 0 var(--ink)) drop-shadow(0 1.2px 0 var(--ink))
      drop-shadow(0 -1.2px 0 var(--ink)) drop-shadow(4px 1px 0 rgb(0 170 255 / .4)) drop-shadow(-3px -1px 0 rgb(255 40 140 / .35));
  }

  /* лампа-торшер (hero/lamp.js): набросок → тушь → штриховка и растр */
  .scene-lamp { position: absolute; inset: 0; z-index: 0; }
  .lamp-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
  .lamp-body { transition: transform .36s steps(4, end); }
  .scene-lamp.inked .lamp-body, :root[data-theme="dark"] .lamp-body { transform: scale(1.05); }
  .lamp-pencil path { fill: none; stroke: color-mix(in srgb, var(--ink) 62%, transparent); stroke-width: 1.5; transform: translate(1.5px, -1px); }
  .lamp-ink path {
    fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 1; stroke-dashoffset: 1;
    transition: stroke-dashoffset .42s steps(5, end) calc(var(--i) * .1s);
  }
  .lamp-ink path:first-child { fill: color-mix(in srgb, var(--ink) 10%, transparent); }
  .scene-lamp.inked .lamp-ink path { stroke-dashoffset: 0; }
  .lamp-tone { opacity: 0; transition: opacity .25s steps(3, end); }
  .scene-lamp.inked .lamp-tone { opacity: 1; transition-delay: .45s; }
  .lamp-tone .dot { fill: var(--ink); opacity: .55; }
  .lamp-tone .hatch-line { stroke: var(--ink); stroke-width: 1.1; opacity: .45; }
  .lamp-cord { stroke: var(--ink); stroke-width: 1.6; }
  .lamp-bead { fill: var(--accent); stroke: var(--ink); stroke-width: 1.6; }
  .lamp-light { opacity: calc(var(--lamp-on) * 0.9); transition: opacity .2s steps(2, end); }
  .light-dot { fill: var(--lamp); }
  .lamp-bulb-glow { fill: var(--lamp); opacity: calc(var(--lamp-on) * 0.85); }
  .lamp-hit { position: absolute; z-index: 2; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 12px; }
  .lamp-hit--base { cursor: pointer; }
  .bead-hit {
    position: absolute; z-index: 3; width: var(--s, 40px); height: var(--s, 40px); margin: calc(var(--s, 40px) / -2) 0 0 calc(var(--s, 40px) / -2);
    border-radius: 50%; cursor: grab; touch-action: none;
  }
  .scene-lamp.pulling .bead-hit { cursor: grabbing; }
  /* ночью лампа горит и всегда «прорисована» */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .lamp-ink path { stroke-dashoffset: 0; }
    :root:not([data-theme="light"]) .lamp-tone { opacity: 1; }
    :root:not([data-theme="light"]) .lamp-body { transform: scale(1.05); }
  }
  :root[data-theme="dark"] .lamp-ink path { stroke-dashoffset: 0; }
  :root[data-theme="dark"] .lamp-tone { opacity: 1; }

  /* звукоподражание: вспышка-звезда и буквы, на двойках */
  .sfx {
    position: absolute; z-index: 4; width: 132px; height: 96px; pointer-events: none;
    display: grid; place-items: center; transform: translate(-50%, -50%) rotate(-9deg);
    animation: sfx 1s steps(1, end) forwards;
  }
  .sfx svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .sfx polygon { fill: var(--accent); stroke: var(--comic-ink); stroke-width: 3; stroke-linejoin: round; }
  .sfx span {
    position: relative; font: 400 21px/1 "Rubik Mono One", var(--font); color: var(--comic-paper);
    -webkit-text-stroke: 1.6px var(--comic-ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--comic-ink);
  }
  @keyframes sfx {
    0% { transform: translate(-50%, -50%) rotate(-9deg) scale(.45); }
    9% { transform: translate(-50%, -50%) rotate(-6deg) scale(1.18); }
    18%, 80% { transform: translate(-50%, -50%) rotate(-9deg) scale(1); opacity: 1; }
    88% { transform: translate(-50%, -50%) rotate(-12deg) scale(.9); opacity: .6; }
    96%, 100% { opacity: 0; }
  }
  .ready .neighbor-rig, .peek .neighbor-rig { opacity: 1; }
  /* статичный кадр куклы, пока она грузится: место и масштаб ставит index.html (placeStill) по формуле кадра сцены;
     растворяется вместе с проявлением куклы */
  .stage-still { position: absolute; z-index: 1; height: auto; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease); }
  .stage-still.placed { opacity: 1; }
  .ready .stage-still, .failed .stage-still { opacity: 0; }
  /* сидячий герой: холст шире сцены — стол и носки кед выходят вправо, к колонке текста; пол — под креслом и столом.
     Слева запас под локти: «руки за голову» выходят за основание торшера на 100 ед. листа (sitter.js сдвигает камеру) */
  .sitter-rig { left: -96px; right: -160px; }
  #stage::after { left: 22%; width: 84%; }
  /* стол и монитор в манере торшера: тушь, растр точками; ночью экран светится */
  .desk-svg { position: absolute; z-index: 0; overflow: visible; pointer-events: none; }
  .desk-ink > * { stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
  #desk-dots circle { fill: var(--ink); opacity: .5; }
  .desk-dots { fill: url(#desk-dots); }
  .desk-top { fill: color-mix(in srgb, var(--ink) 5%, var(--bg)); }
  .desk-light { fill: color-mix(in srgb, var(--ink) 13%, var(--bg)); }
  .desk-shade { fill: color-mix(in srgb, var(--ink) 22%, var(--bg)); }
  .desk-side { fill: color-mix(in srgb, var(--ink) 30%, var(--bg)); }
  .desk-back { fill: color-mix(in srgb, var(--ink) 45%, var(--bg)); }
  .desk-screen { fill: color-mix(in srgb, var(--accent) 10%, var(--bg)); stroke-width: 3; }
  .desk-ui { fill: none; stroke-width: 2; }
  .desk-ui-img { fill: color-mix(in srgb, var(--accent) 35%, var(--bg)); }
  :root[data-theme="dark"] .desk-screen {
    fill: color-mix(in srgb, var(--accent) 24%, var(--bg)); filter: drop-shadow(0 0 16px color-mix(in srgb, var(--accent) 50%, transparent));
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .desk-screen {
      fill: color-mix(in srgb, var(--accent) 24%, var(--bg)); filter: drop-shadow(0 0 16px color-mix(in srgb, var(--accent) 50%, transparent));
    }
  }
  .neighbor-canvas { width: 100%; height: 100%; display: block; }
  .stage-fallback { display: none; position: absolute; inset: 0 12% 0 0; }
  .failed .stage-fallback { display: block; }
  .failed .stage { cursor: default; }
  .failed .stage::after { display: none; }
  .stage-cap { position: absolute; left: 0; bottom: 8px; margin: 0; }
  /* лампа поверх титула: под линиями «вырез» цветом фона */
  .lamp-cap { display: none; font: 400 11px var(--mono); fill: var(--muted); letter-spacing: .02em; }
  .lamp-knock path, .lamp-cord-knock { fill: none; stroke: var(--bg); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }

  /* реплика героя */
  .bubble {
    position: absolute; z-index: 2; width: max-content; max-width: 230px;
    padding: 9px 15px 10px; border-radius: 22px;
    background: var(--comic-paper); color: var(--comic-ink); border: 2.5px solid var(--comic-ink);
    box-shadow: 3px 3px 0 var(--comic-ink);
    /* рукописный слой — Shantell Sans: латиница и кириллица нарисованы одной рукой (у Pangolin русские буквы уже и жёстче).
       Он шире Pangolin на ~13%, поэтому кегль пузыря на 1 px меньше и разрядка скромнее */
    font: 400 15px/1.3 "Shantell Sans", var(--font); text-transform: uppercase; letter-spacing: .01em;
    transform: translate(-8px, calc(-100% - 18px)); transform-origin: 14px 100%;
    opacity: 0; pointer-events: none; transition: opacity .1s steps(1, end);
  }
  /* хвостик: контур и заливка — два треугольника */
  .bubble::before, .bubble::after {
    content: ""; position: absolute; width: 0; height: 0; border-style: solid; border-color: transparent;
  }
  .bubble::before { left: 14px; bottom: -17px; border-width: 17px 14px 0 0; border-top-color: var(--comic-ink); }
  .bubble::after { left: 17px; bottom: -11px; border-width: 11px 9px 0 0; border-top-color: var(--comic-paper); }
  .bubble.on { opacity: 1; animation: pop .27s steps(1, end); }
  /* в тёмной теме чёрный контур и тень пузыря тонут в фоне — пузырь обводится, как герой: светлая тушь и сдвиг цветов */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .bubble {
      box-shadow: none;
      filter: drop-shadow(1.2px 0 0 var(--ink)) drop-shadow(-1.2px 0 0 var(--ink)) drop-shadow(0 1.2px 0 var(--ink))
        drop-shadow(0 -1.2px 0 var(--ink)) drop-shadow(4px 1px 0 rgb(0 170 255 / .4)) drop-shadow(-3px -1px 0 rgb(255 40 140 / .35));
    }
  }
  :root[data-theme="dark"] .bubble {
    box-shadow: none;
    filter: drop-shadow(1.2px 0 0 var(--ink)) drop-shadow(-1.2px 0 0 var(--ink)) drop-shadow(0 1.2px 0 var(--ink))
      drop-shadow(0 -1.2px 0 var(--ink)) drop-shadow(4px 1px 0 rgb(0 170 255 / .4)) drop-shadow(-3px -1px 0 rgb(255 40 140 / .35));
  }
  @keyframes pop {
    0% { transform: translate(-8px, calc(-100% - 18px)) scale(.55); }
    34% { transform: translate(-8px, calc(-100% - 18px)) scale(1.08); }
    67%, 100% { transform: translate(-8px, calc(-100% - 18px)) scale(1); }
  }
  /* пузырь влево: у героя, выглянувшего справа, — хвостик справа, сам пузырь растёт к странице */
  .bubble--left { transform: translate(calc(-100% + 8px), calc(-100% - 18px)); transform-origin: calc(100% - 14px) 100%; }
  .bubble--left::before { left: auto; right: 14px; border-width: 17px 0 0 14px; }
  .bubble--left::after { left: auto; right: 17px; border-width: 11px 0 0 9px; }
  .bubble--left.on { animation-name: pop-left; }
  @keyframes pop-left {
    0% { transform: translate(calc(-100% + 8px), calc(-100% - 18px)) scale(.55); }
    34% { transform: translate(calc(-100% + 8px), calc(-100% - 18px)) scale(1.08); }
    67%, 100% { transform: translate(calc(-100% + 8px), calc(-100% - 18px)) scale(1); }
  }

  /* угол, из которого герой выглядывает, когда первый экран уже прокручен */
  .peek {
    position: fixed; left: 0; bottom: 0; z-index: 20; width: min(420px, 100vw); height: 230px; /* герой стоит от края на длину машущей руки */
    pointer-events: none; transform: translateY(105%); transition: transform .55s var(--ease);
  }
  .peek.on { transform: none; }
  /* у кнопок контакта герой выглядывает справа (зеркально); если внизу справа играет плеер — над ним */
  .peek.right { left: auto; right: 0; }
  .player-on .peek.right { bottom: 112px; }
  @media (max-width: 899px) { .player-on .peek { bottom: 112px; } } /* плеер внизу во всю ширину */
  .hero-sub { margin-top: 24px; max-width: 46ch; font-size: 19px; color: var(--muted); }
  .hero-cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
  .avatar {
    aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden;
    background: #1a1530;
  }

  /* ---------- Секции ---------- */
  section { padding-block: clamp(64px, 9vw, 136px); }
  .section-head { margin-bottom: clamp(32px, 4.5vw, 60px); max-width: 60ch; }
  h2 { font-weight: 600; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1; letter-spacing: -0.03em; }
  .section-head p { margin-top: 12px; color: var(--muted); }

  /* ---------- Кейсы ---------- */
  .case { scroll-margin-top: 88px; }
  .cases { row-gap: clamp(56px, 7vw, 104px); }
  .case { display: block; color: inherit; }
  .case--wide { grid-column: 1 / -1; }
  .case--a { grid-column: 1 / span 7; }
  .case--b { grid-column: 9 / span 4; margin-top: clamp(0px, 10vw, 140px); }
  /* вторая пара — зеркально: малая слева, большая справа и ниже, чтобы порядок кейсов читался зигзагом */
  .case--c { grid-column: 1 / span 4; }
  .case--d { grid-column: 6 / span 7; margin-top: clamp(0px, 10vw, 140px); }
  .case-media { border-radius: var(--radius); overflow: hidden; position: relative; }
  .case-media > * { transition: transform .8s var(--ease); }
  .case:hover .case-media > * { transform: scale(1.015); }
  .case--wide .case-media { aspect-ratio: 16 / 9; }
  .case--a .case-media { aspect-ratio: 4 / 3; }
  .case--b .case-media, .case--c .case-media { aspect-ratio: 4 / 5; }
  .case--d .case-media { aspect-ratio: 4 / 3; }
  /* видео первого экрана главной банка — в своих пропорциях, чтобы шапка и баннер не срезались */
  .case .case-media--desktop { aspect-ratio: 1920 / 1128; }

  .case-info { margin-top: 20px; display: grid; gap: 6px; }
  .case-info .mono { text-wrap: balance; } /* длинная подпись в узкой карточке — двумя ровными строками, без года-сироты */
  .case--wide .case-info { grid-template-columns: 3fr 6fr 3fr; gap: 24px; align-items: baseline; }
  .case-title { font-weight: 500; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.2; letter-spacing: -0.02em; }
  .case-role { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; }
  .case--wide .case-role { justify-content: flex-end; }
  .case-role i { font-size: 18px; color: var(--ink); transition: transform .3s var(--ease); }
  .case:hover .case-role i { transform: translate(3px, -3px); }

  /* ---------- Beyond the day job ---------- */
  .side { row-gap: 48px; }
  .tile { display: flex; flex-direction: column; gap: 14px; }
  .tile-media { border-radius: var(--radius); overflow: hidden; background: var(--surface); }
  .t-film   { grid-column: 1 / span 7; }  .t-film .tile-media   { aspect-ratio: 16 / 9; }
  .t-day    { grid-column: 8 / span 5; }  .t-day .tile-media    { aspect-ratio: 5 / 4; }
  .t-verse  { grid-column: 1 / span 4; }  .t-verse .tile-media  { aspect-ratio: 3 / 2; }
  .t-sheet  { grid-column: 5 / span 5; }  .t-sheet .tile-media  { aspect-ratio: 1112 / 533; }
  .t-tools  { grid-column: 10 / span 3; } .t-tools .tile-media  { aspect-ratio: 1 / 1; }
  /* «Атлас продукта» — во всю ширину: интерфейс широкий, мелкая плитка превратила бы его в пятно.
     На телефоне кадр срезан до левого верха — шапка, меню и командная строка (см. мобильную версию) */
  .t-atlas  { grid-column: 1 / -1; }      .t-atlas .tile-media  { aspect-ratio: 12 / 5; }
  .t-atlas img { width: 100%; height: 100%; object-fit: cover; object-position: 0 0; }
  /* Вторая строка выравнивается по высоте листа персонажа: высота считается от ширины 5 колонок */
  .side { container-type: inline-size; }
  @media (min-width: 900px) {
    .t-verse .tile-media, .t-tools .tile-media {
      aspect-ratio: auto;
      height: calc((5 * (100cqw - 264px) / 12 + 96px) * 533 / 1112);
    }
  }
  .tools-box {
    height: 100%; background: var(--accent); color: #141415;
    display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 20px;
    font-family: var(--mono); font-size: clamp(15px, 1.4vw, 19px); font-weight: 500;
  }
  .tile h3 { font-weight: 500; font-size: 18px; letter-spacing: -0.01em; }
  .tile p { color: var(--muted); font-size: 15px; line-height: 1.45; max-width: 52ch; }

  /* ---------- Обо мне ---------- */
  .about { align-items: center; }
  .about-pic { grid-column: 1 / span 5; margin: 0; position: relative; }
  /* стоячий герой во весь рост — на бумаге, с растром за спиной и тенью на полу; без WebGL — портрет */
  .stage--about { position: relative; inset: auto; aspect-ratio: 3 / 4; }
  .about-fallback { display: none; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
  .failed .about-fallback { display: block; }
  .failed .stage--about { display: none; }
  .about-text { grid-column: 7 / span 6; }
  .about-text p.lead { margin-top: 20px; font-size: 20px; line-height: 1.5; max-width: 40ch; }
  .facts { margin-top: 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .facts dt { color: var(--muted); }
  .facts dd { margin-top: 4px; font-weight: 500; }
  .facts > div { cursor: default; } /* наведение — герой рядом показывает на факт и комментирует */
  /* где работал: годы слева, компания и чем занимался — справа, строкой под фактами */
  .jobs { margin-top: 28px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
  .jobs li { display: grid; grid-template-columns: 8em minmax(0, 1fr); column-gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line);
    cursor: default; } /* наведение — герой рядом говорит реплику про компанию (data-say), как на фактах */
  .jobs .mono { grid-row: span 2; padding-top: 3px; font-size: 12px; }
  .jobs b { font-weight: 500; }
  .jobs li > span:last-child { font-size: 15px; line-height: 1.45; }

  /* ---------- Отзывы ---------- */
  .quotes { border-top: 1px solid var(--line); padding-top: clamp(40px, 5vw, 64px); margin-top: clamp(72px, 9vw, 136px); }
  .quote { grid-column: span 6; }
  .quote blockquote { font-size: clamp(20px, 2vw, 26px); line-height: 1.4; letter-spacing: -0.015em; max-width: 30ch; }
  .quote figcaption { margin-top: 16px; color: var(--muted); font-size: 15px; }

  /* ---------- Рукописный слой: маркер, заметки на полях, наброски из скетчбука (главная и кейсы) ---------- */
  mark { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 38%, transparent) 58%); color: inherit; padding: 0 2px; }
  /* заметка на полях: рукописная, чуть повёрнута (rotate, чтобы не спорить с transform появления) */
  .margin-note { position: relative; max-width: 330px; font: 400 19px/1.4 "Shantell Sans", var(--font); }
  .margin-note--right { margin-left: auto; rotate: -2deg; }
  .margin-note--left { rotate: 1.5deg; }
  .note-arrow {
    position: absolute; width: 84px; height: 64px; overflow: visible; fill: none;
    stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  }
  .note-arrow--up-left { left: -94px; top: -52px; }
  .note-arrow--down-right { right: -74px; bottom: -54px; }
  .note-arrow--down-left { left: -90px; bottom: -54px; }
  .note-arrow path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .4s steps(5, end) .35s; }
  .margin-note.is-in .note-arrow path { stroke-dashoffset: 0; }
  /* набросок: карандаш виден сразу, тушь проходит по линиям, когда набросок появляется на экране */
  .sketch { margin: 0; }
  .sketch-svg { display: block; width: 100%; height: auto; overflow: visible; }
  .sk-pencil path { fill: none; stroke: color-mix(in srgb, var(--ink) 35%, transparent); stroke-width: 1.2; }
  .sk-ink path {
    fill: none; stroke: var(--ink); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .3s steps(4, end) calc(var(--i) * 18ms);
  }
  .sketch.is-in .sk-ink path { stroke-dashoffset: 0; }
  .sk-marker {
    fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; opacity: .42;
    stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .35s steps(4, end) 1.15s;
  }
  .sketch.is-in .sk-marker { stroke-dashoffset: 0; }
  .sk-label { font: 400 24px "Shantell Sans", var(--font); fill: var(--ink); }
  .sketch-cap { margin-top: 12px; font: 400 18px/1.35 "Shantell Sans", var(--font); color: var(--muted); }
  @media (prefers-reduced-motion: reduce) {
    .sk-ink path, .sk-marker, .note-arrow path { stroke-dashoffset: 0; transition: none; }
  }
  @media (max-width: 899px) {
    .margin-note { max-width: 300px; }
    .note-arrow--up-left { left: 0; top: -58px; }
    .note-arrow--down-right { right: 0; bottom: -60px; }
    .note-arrow--down-left { left: 0; bottom: -60px; }
  }

  /* паузы главной: заметка или набросок стоит посередине паузы между секциями, с полями секций сверху и снизу */
  .gap { position: relative; z-index: 1; }
  .cover + .gap { margin-top: clamp(40px, 5vw, 72px); }
  .gap .margin-note--right { margin-right: clamp(0px, 7vw, 120px); }
  .gap .sketch { max-width: 860px; }
  @media (max-width: 899px) {
    /* телефон: пауза занимает своё место, иначе стрелке заметки некуда деться, кроме заголовка */
    .gap { margin-block: 0 8px; }
    .cover + .gap { margin-top: 40px; }
    .gap .margin-note--right { margin-right: 0; max-width: 270px; }
    .gap .note-arrow--down-left { left: -78px; bottom: -40px; }
    .gap .note-arrow--up-left { left: -80px; top: -36px; }
  }

  /* ---------- Вне работы: хобби ---------- */
  .off-clock { margin-top: clamp(72px, 9vw, 136px); }
  .sub-h { font-weight: 600; font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -0.02em; margin-bottom: 24px; }
  /* между рядами — с запасом: наклейка заходит за верхний край карточки и не должна липнуть к подписи над ней */
  .hobbies { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 40px 16px; }
  .hobby { position: relative; margin: 0; display: flex; flex-direction: column; gap: 10px; color: inherit; }
  /* наклейка на карточке: бумажный кружок с рисунком тушью, заходит за край; тушь проходит по линиям, когда ряд появляется */
  .hobby-doodle {
    position: absolute; z-index: 1; top: -14px; left: -12px; width: 62px; height: 62px; padding: 9px;
    border-radius: 50%; background: var(--comic-paper); overflow: visible; rotate: -7deg;
    box-shadow: 0 0 0 1.5px var(--comic-ink), 0 8px 16px -10px rgb(20 20 21 / .55);
    fill: none; stroke: var(--comic-ink); stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round;
  }
  .hobby:nth-child(even) .hobby-doodle { rotate: 6deg; }
  /* у карточек с видео рисунок — у подписи, без бумажного кружка: в кадре он спорил бы с видео */
  .hobby-doodle--inline {
    position: static; width: 28px; height: 28px; padding: 0; margin: -4px 0;
    background: none; box-shadow: none; rotate: 0deg; stroke: var(--ink);
  }
  .hobby:nth-child(even) .hobby-doodle--inline { rotate: 0deg; }
  .hobby-doodle path {
    vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1;
    transition: stroke-dashoffset .3s steps(4, end) calc(var(--d, 0ms) + var(--i) * 45ms);
  }
  .hobbies.is-in .hobby-doodle path { stroke-dashoffset: 0; }
  .hobby:nth-child(2) { --d: 120ms; } .hobby:nth-child(3) { --d: 240ms; } .hobby:nth-child(4) { --d: 360ms; }
  .hobby:nth-child(5) { --d: 480ms; } .hobby:nth-child(6) { --d: 600ms; }
  @media (prefers-reduced-motion: reduce) { .hobby-doodle path { stroke-dashoffset: 0; transition: none; } }
  .hobby-media { aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
  .hobby figcaption, .hobby-cap { font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
  /* баня и музыка — карточки в комиксной манере: растр, крупная иконка, подпись */
  .hobby-banya, .hobby-music {
    display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; /* значок теперь — наклейка над карточкой */
    font-size: 15px; line-height: 1.45; /* как текст плиток: две-три строки читаются свободнее */
  }
  .hobby-banya { background: radial-gradient(circle, rgb(20 20 21 / .16) 1.2px, transparent 1.7px) 0 0 / 7px 7px, var(--accent); color: #141415; }
  .hobby-music { background: var(--ink); color: var(--on-ink); transition: transform .3s var(--ease); }
  a.hobby:hover .hobby-music { transform: translateY(-3px); }

  /* ---------- Альбомы: пластинки играют через виджет Spotify (site.js) ---------- */
  .albums { --art: 128px; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; }
  /* отступ до текста — с запасом под пластинку, выехавшую наполовину */
  .album-play { display: flex; align-items: center; gap: calc(var(--art) / 2); color: inherit; text-decoration: none; border-radius: 8px; }
  .album-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
  /* конверт с пластинкой: при наведении пластинка выезжает; выбранная выезжает дальше и крутится —
     33⅓ оборота в минуту и «на двойках», как герой */
  .album-art { position: relative; flex: none; width: var(--art); aspect-ratio: 1; }
  .album-disc { position: absolute; inset: 6px; translate: 10% 0; transition: translate .45s var(--ease); }
  .album-vinyl {
    position: absolute; inset: 0; border-radius: 50%;
    background: radial-gradient(circle, #0d0d0e 0 17%, transparent 17.5%), repeating-radial-gradient(circle, var(--vinyl) 0 1.4px, var(--vinyl-2) 1.4px 2.8px);
    box-shadow: 0 0 0 1px var(--vinyl-rim); /* в тёмной теме пластинка светлее фона и с ободком — иначе тонет */
  }
  /* «яблоко» с напечатанной полосой: по ней видно, что пластинка вращается */
  .album-vinyl::before {
    content: ""; position: absolute; inset: 35%; border-radius: 50%;
    background: conic-gradient(from 210deg, color-mix(in srgb, var(--label, var(--accent)) 50%, #fff) 0 48deg, var(--label, var(--accent)) 48deg);
  }
  .album-vinyl::after { content: ""; position: absolute; inset: 47.8%; border-radius: 50%; background: var(--bg); }
  /* блик от света неподвижен — крутится только сама пластинка */
  .album-disc::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
    background: conic-gradient(from 20deg, transparent 0 18deg, rgb(255 255 255 / var(--vinyl-sheen)) 36deg, transparent 54deg 198deg, rgb(255 255 255 / calc(var(--vinyl-sheen) * .7)) 216deg, transparent 234deg);
  }
  .album-sleeve { position: relative; display: block; width: 100%; height: 100%; border-radius: 8px; overflow: hidden; background: var(--surface); }
  .album-sleeve img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .album-play:hover .album-disc, .album-play:focus-visible .album-disc { translate: 38% 0; }
  .album.is-current .album-disc { translate: 50% 0; }
  .album.is-current .album-vinyl { animation: spin 1.8s steps(24) infinite paused; }
  .album.is-playing .album-vinyl { animation-play-state: running; }
  @keyframes spin { to { rotate: 1turn; } }
  /* значок «играть / пауза» на конверте: при наведении, у выбранной пластинки, а на сенсорных экранах — всегда */
  .album-badge {
    position: absolute; left: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 16px;
    opacity: 0; scale: .7; transition: opacity .2s, scale .25s var(--ease);
  }
  .album-play:hover .album-badge, .album-play:focus-visible .album-badge, .album.is-current .album-badge { opacity: 1; scale: 1; }
  @media (hover: none) { .album-badge { opacity: 1; scale: 1; } }
  .album-text { min-width: 0; display: grid; gap: 2px; }
  .album-title { font-weight: 500; font-size: 18px; }

  /* мини-плеер: справа внизу (на телефоне — во всю ширину), закрывается крестиком; спрятанный не ловит фокус */
  .player {
    position: fixed; right: 24px; bottom: 24px; z-index: 30; width: 360px;
    translate: 0 calc(100% + 48px); visibility: hidden; transition: translate .5s var(--ease), visibility 0s .5s;
  }
  .player.on { translate: none; visibility: visible; transition: translate .5s var(--ease); }
  .player iframe, .player-frame {
    display: block; width: 100%; height: 80px; border: 0; border-radius: 12px;
    box-shadow: 0 14px 34px -14px rgb(20 20 21 / .45);
  }
  .player-frame { display: grid; place-items: center; padding: 0 24px; background: var(--surface); color: var(--muted); text-align: center; }
  .player-frame a { color: var(--ink); }
  .player-close {
    position: absolute; top: -11px; left: -11px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
    display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 14px; cursor: pointer;
  }
  .player-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* подсказка на телефоне: звук в виджете Spotify включает только касание внутри него — кольцо вокруг его кнопки
     play (правый нижний угол виджета: центр в 22 px от правого края и 21 px от нижнего) и подпись над плеером.
     Касаниям не мешают — проходят в виджет */
  .player-ring, .player-tip { position: absolute; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease); }
  .player-ring { right: 2px; bottom: 1px; width: 40px; height: 40px; border: 3px solid var(--accent); border-radius: 50%; }
  .player-tip {
    right: 0; bottom: calc(100% + 10px); padding: 6px 10px; border-radius: 99px;
    background: var(--ink); color: var(--bg); font-size: 12px; white-space: nowrap;
  }
  .player.hint .player-ring, .player.hint .player-tip { opacity: 1; }
  .player.hint .player-ring { animation: player-ring 1.2s var(--ease) infinite; }
  @keyframes player-ring { 50% { scale: 1.18; } }
  @media (max-width: 899px) { .player { left: 12px; right: 12px; bottom: 12px; width: auto; } }
  @media (prefers-reduced-motion: reduce) {
    .album.is-current .album-vinyl { animation: none; }
    .album-disc, .album-badge, .player, .player.on { transition: none; }
    .player.hint .player-ring { animation: none; }
  }

  /* ---------- Контакт ---------- */
  .contact { background: var(--ink); color: var(--on-ink); border-radius: calc(var(--radius) * 2);
    padding: clamp(32px, 6vw, 80px); margin-bottom: 24px; }
  .contact h2 { font-size: clamp(34px, 5vw, 64px); max-width: 16ch; }
  .email {
    margin-top: 32px; display: inline-flex; align-items: center; gap: 12px;
    font: 500 clamp(20px, 2.4vw, 30px)/1.2 var(--font); letter-spacing: -0.02em;
    background: none; border: 0; color: inherit; cursor: pointer; padding: 0;
    border-bottom: 2px solid var(--accent); padding-bottom: 6px;
    text-align: left; /* адрес в две строки на телефоне — от левого края */
  }
  .email i { font-size: 0.9em; }
  @media (max-width: 599px) {
    .email { font-size: 18px; }
    .copied { display: block; margin: 8px 0 0; }
  }
  .copied { margin-left: 12px; font-size: 14px; color: var(--accent); opacity: 0; transition: opacity .2s; }
  .copied.on { opacity: 1; }
  .contact .row { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
  .contact .btn--solid { background: var(--on-ink); color: var(--ink); border-color: var(--on-ink); }
  .contact .btn--solid:hover { background: var(--accent); border-color: var(--accent); color: #141415; }
  .contact .btn--ghost { color: var(--on-ink); border-color: color-mix(in srgb, var(--on-ink) 40%, transparent); }
  .contact .btn--ghost:hover { background: var(--on-ink); color: var(--ink); }
  .socials { display: flex; flex-wrap: wrap; gap: 8px 24px; }
  .socials a { display: inline-flex; align-items: center; gap: 4px;
    color: color-mix(in srgb, var(--on-ink) 70%, transparent); transition: color .2s; }
  .socials a:hover { color: var(--on-ink); }

  footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
    padding-block: 24px 40px; color: var(--muted); font-size: 14px; }

  /* ---------- Движение ---------- */
  @media (prefers-reduced-motion: no-preference) {
    .cover-copy > * { opacity: 0; transform: translateY(16px);
      animation: rise .9s var(--ease) forwards; animation-delay: .5s; }
    .cover-copy > :nth-child(2) { animation-delay: .58s; }
    .cover-copy > :nth-child(3) { animation-delay: .66s; }
    .cover-copy > :nth-child(4) { animation-delay: .74s; }
    /* титул «проходит тушью»: контуры рисуются на двойках, потом проступают растр и сдвиг цветов */
    .mast-main { stroke-dasharray: 1400; stroke-dashoffset: 1400; fill-opacity: 0;
      animation: mast-ink .9s steps(9, end) .1s forwards, mast-tone .3s steps(3, end) .95s forwards; }
    .mast-c, .mast-m { opacity: 0; animation: mast-tone .2s steps(2, end) 1.15s forwards; }
    [data-reveal] { opacity: 0; transform: translateY(24px);
      transition: opacity .9s var(--ease), transform .9s var(--ease); }
    [data-reveal].is-in { opacity: 1; transform: none; }
  }
  @keyframes rise { to { opacity: 1; transform: none; } }
  @keyframes mast-ink { to { stroke-dashoffset: 0; } }
  @keyframes mast-tone { to { fill-opacity: 1; opacity: 1; } }
  @media (prefers-reduced-motion: reduce) {
    .lamp-ink path { stroke-dashoffset: 0; transition: none; }
    .lamp-tone { opacity: 1; transition: none; }
    .lamp-body { transition: none; }
    .bubble.on { animation: none; }
    .sfx { animation: sfx-still .9s steps(1, end) forwards; }
    @keyframes sfx-still { 0%, 90% { opacity: 1; } 100% { opacity: 0; } }
  }

  @media (max-width: 1100px) and (min-width: 900px) {
    .hobbies { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .albums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  /* ---------- Мобильная версия ---------- */
  @media (max-width: 899px) {
    .status, .nav a:not(.btn) { display: none; }
    .nav { gap: 10px; }
    .case--a, .case--b, .case--c, .case--d, .about-pic, .about-text, .quote,
    .t-film, .t-day, .t-verse, .t-sheet, .t-tools { grid-column: 1 / -1; }
    /* телефон: сначала имя и роль, затем герой, потом строка о себе и кнопки — сразу ясно, чья это страница */
    .cover { height: auto; --cover-pad: 16px; display: flex; flex-direction: column; }
    .cover-copy { display: contents; }
    .role { order: 1; margin-top: 14px; }
    .cover-stage { order: 2; position: relative; left: auto; width: auto; height: 400px; }
    .stage { inset: 0 0 12px 0; }
    .sitter-rig { right: 0; }
    #stage::after { left: 16%; width: 82%; } /* пол — в пределах сцены, иначе страница шире экрана */
    /* подпись бежит вдоль торшера; обычная остаётся для экранного чтеца */
    .lamp-cap { display: inline; }
    .stage-cap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .hero-sub { order: 3; margin-top: 2px; }
    .hero-cta { order: 4; margin-top: 20px; }
    .cover-lines { order: 5; }
    .stage-fallback { inset: 0 auto 0 0; width: 260px; }
    .case--b, .case--d { margin-top: 0; }
    .case--wide .case-info { grid-template-columns: 1fr; gap: 6px; }
    .case--wide .case-role { justify-content: flex-start; }
    .t-tools .tile-media { aspect-ratio: 2 / 1; }
    .t-atlas .tile-media { aspect-ratio: 4 / 3; }
    .facts { grid-template-columns: 1fr 1fr; }
    .hobbies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .albums { --art: 112px; grid-template-columns: 1fr; }
    .grid { gap: 20px; }
  }
