:root {
  --bg: #fff;
  --fg: rgba(0, 0, 0, .9);
  --fg-1: rgba(0, 0, 0, .77);
  --fg-2: rgba(0, 0, 0, .63);
  --fg-3: rgba(0, 0, 0, .36);
  --fg-4: rgba(0, 0, 0, .14);
  --fg-5: rgba(0, 0, 0, .15);
  --edge: clamp(14px, 2.25vw, 29px);
  --glass: rgba(217, 217, 217, .7);
  --glass-hover: #c4c4c4;
  --glass-ink: rgba(0, 0, 0, .78);
  --link-box: rgba(217, 217, 217, .7);
  --fg-dots: rgba(0, 0, 0, .36);
  --panel-bg: #fff;
  --chip: rgba(0, 0, 0, .08);
  --chip-fg: rgba(0, 0, 0, .54);
  --pill: rgba(0, 0, 0, .06);
  --placeholder: #f1f1f1;
  --col: 600px;
  --wide: 800px;
  --sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.25, .1, .25, 1);
  color-scheme: light;
}
/* Тёмная тема — фон и текст как у ayurchenko.xyz (по просьбе владельца 14.10.2026): фон #0C0C0C вместо чистого чёрного,
   основной текст 63%, ссылки 77%, заголовки разделов 36%. Первый экран прозрачный и берёт этот фон (hero.css, hero-distort.js). */
:root[data-theme="dark"] {
  --bg: #0c0c0c;
  --fg: rgba(255, 255, 255, .9);
  --fg-1: rgba(255, 255, 255, .77);
  --fg-2: rgba(255, 255, 255, .63);
  --fg-3: rgba(255, 255, 255, .36);
  --fg-4: rgba(255, 255, 255, .16);
  --fg-5: rgba(255, 255, 255, .18);
  --glass: rgba(46, 46, 46, .7);
  --glass-hover: #3a3a3a;
  --glass-ink: rgba(255, 255, 255, .85);
  --link-box: rgba(46, 46, 46, .7);
  --fg-dots: rgba(255, 255, 255, .38);
  --panel-bg: #1a1a1a;
  --chip: rgba(255, 255, 255, .08);
  --chip-fg: rgba(255, 255, 255, .55);
  --pill: rgba(255, 255, 255, .08);
  --placeholder: #1a1a1a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.4 var(--sans);
  letter-spacing: -.02em;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
/* Космос: живое звёздное небо из starfield.js — фиксированный холст за всем содержимым.
   В тёмной теме звёзды светлые, в светлой — тёмные. */
.starfield { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
/* Небо проявляется мягко, а не «выпрыгивает» после первой отрисовки страницы */
.starfield.is-ready { opacity: 1; }
/* ── Курсор посетителя «HR» (figma.js): системный курсор скрыт, пока виден свой ── */
:root.figma-cursor, :root.figma-cursor * { cursor: none !important; }
.hr-cursor { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity .15s ease; }
.hr-cursor.is-on { opacity: 1; }
.hr-cursor svg { display: block; margin: -1px 0 0 -1px; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 35%)); }
.hr-cursor span {
  position: absolute; left: 14px; top: 18px; padding: 2px 7px; border-radius: 4px 10px 10px 10px;
  background: #f70; color: #fff; font: 600 11px/16px var(--sans); letter-spacing: 0; white-space: nowrap;
}

/* Точечная сетка (dotgrid.js) — основной фон; звёзды выше включаются адресом ?bg=stars */
.bg-layer { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
/* Под колонкой текста фон чистый: точки плавно уходят к центру и появляются к краям (читаемость, 14.10.2026) */
/* Переход идёт непрерывно от края экрана до колонки — без «плато» полных точек и резкого спада у колонки
   (так чистая зона читалась тёмной полосой с краем). Кривая (1 − p)^1.6: у края экрана точки полные, к тексту сходят на нет. */
.bg-layer {
  --l: calc(50% - var(--col) / 2 - 8px); /* левый край чистой зоны; правый симметричен: 100% − --l */
  --mask: linear-gradient(90deg,
    #000 0, rgba(0,0,0,.7) calc(var(--l) * .2), rgba(0,0,0,.44) calc(var(--l) * .4),
    rgba(0,0,0,.23) calc(var(--l) * .6), rgba(0,0,0,.08) calc(var(--l) * .8), transparent var(--l),
    transparent calc(100% - var(--l)),
    rgba(0,0,0,.08) calc(100% - var(--l) * .8), rgba(0,0,0,.23) calc(100% - var(--l) * .6),
    rgba(0,0,0,.44) calc(100% - var(--l) * .4), rgba(0,0,0,.7) calc(100% - var(--l) * .2), #000 100%);
  -webkit-mask-image: var(--mask);
  mask-image: var(--mask);
}
.bg-layer.is-ready { opacity: 1; }a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }

.wrap { width: min(var(--col), calc(100% - 32px)); margin: 0 auto; }
main.wrap { padding: 93px 0 80px; }

/* ── Dock ── */
.dock {
  position: fixed; inset: 24px 0 auto; z-index: 20; pointer-events: none;
  display: flex; justify-content: space-between;
  width: min(var(--col), calc(100% - 32px)); margin: 0 auto;
}
.dock > * { pointer-events: auto; }
.avatar {
  position: relative; width: 48px; height: 48px; border-radius: 16px;
  background: linear-gradient(135deg, #ff8a3d, #c2410c);
  display: grid; place-items: center; color: #fff; font: 500 15px var(--sans);
}
/* Скругление фото повторяет кнопку, в том числе при наведении (16 → 24px) */
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar::after {
  content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
  border-radius: 50%; background: #22c55e; border: 2px solid var(--bg);
}
/* Кнопки панели: при наведении фон темнеет, а углы скругляются до пилюли */
.pill-btn {
  height: 40px; min-width: 40px; padding: 0 12px; border-radius: 13px;
  background: var(--glass); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; color: var(--glass-ink);
  backdrop-filter: blur(30px) saturate(1.5);
  transition: border-radius .15s cubic-bezier(.45, 0, .55, 1), background-color .25s var(--ease), color .25s var(--ease);
}
.pill-btn svg { width: 18px; height: 18px; }
.avatar { transition: border-radius .15s cubic-bezier(.45, 0, .55, 1); }
@media (hover: hover) {
  .pill-btn:hover { background: var(--glass-hover); border-radius: 20px; }
  .avatar:hover { border-radius: 24px; }
}

/* ── Text ── */
.statement, .lede, .section-title, .row { font-size: 24px; line-height: 1.1; letter-spacing: -.02em; font-weight: 400; margin: 0; }
.statement { color: var(--fg-2); }
.statement .inline-link { color: var(--fg-1); }
.lede { color: var(--fg-2); margin-top: 26px; }
.section-title { color: var(--fg-3); margin-bottom: 24px; }
/* Ссылки в тексте: пунктирное подчёркивание. При наведении подчёркивание гаснет,
   вокруг слова раскрывается плашка, справа выезжает стрелка, соседние ссылки тускнеют.
   Раскрытие быстрое (150 мс), сворачивание медленное (500 мс). */
.inline-link {
  display: inline-flex; align-items: baseline; white-space: nowrap;
  padding-block: .125em; margin-block: -.125em; padding-inline: 0; border-radius: .41em;
  color: var(--fg-1);
  text-decoration: underline dotted 1px; text-decoration-color: var(--fg-dots); text-underline-offset: .22em;
  transition: background-color .5s, padding-inline .5s, color .3s, text-decoration-color .15s;
}
.inline-link .arr {
  display: inline-block; overflow: hidden; inline-size: 0; margin-inline-start: 0; opacity: 0;
  text-align: center; line-height: 1;
  transition: opacity .2s, inline-size .5s, margin-inline-start .5s;
}
.inline-link:focus-visible { outline: none; }
.inline-link:focus-visible, .inline-link:focus-visible .arr { transition-duration: .15s; }
.inline-link:focus-visible { background-color: var(--link-box); padding-inline: .25em; color: var(--fg); text-decoration-color: transparent; }
.inline-link:focus-visible .arr { inline-size: .74em; margin-inline-start: .12em; opacity: 1; }
@media (hover: hover) {
  .inline-link:hover, .inline-link:hover .arr { transition-duration: .15s; }
  .inline-link:hover { background-color: var(--link-box); padding-inline: .25em; color: var(--fg); text-decoration-color: transparent; }
  .inline-link:hover .arr { inline-size: .74em; margin-inline-start: .12em; opacity: 1; }
  :is(.statement, .lede, .panel p):has(.inline-link:hover) .inline-link:not(:hover) { color: var(--fg-2); }
  /* Имя в заголовке ещё и «моргает», намекая, что откроется панель */
  .statement [data-bio]:hover { animation: name-pulse .55s ease-out forwards; }
}
@keyframes name-pulse { 0% { opacity: .75; } 40% { opacity: .5; } 100% { opacity: 1; } }

.section { margin-top: 48px; padding-top: 40px; scroll-margin-top: 40px; }html { scroll-behavior: smooth; }

/* ── Index list ── */
.index { position: relative; display: flex; flex-direction: column; gap: 4px; }
.row {
  display: flex; align-items: baseline; min-height: 30px; padding: 2px 0;
  color: var(--fg-2); transition: opacity .3s var(--ease), color .2s;
}
.row .name { white-space: nowrap; margin-right: 25px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row .sub { display: none; } /* как на референсе: в «Опыте» только компания и годы; должность остаётся в разметке */
/* Точки-лидер: всегда видны, на базовой линии текста */
.row .leader {
  flex: 1 1 0; min-width: 1em; align-self: baseline; overflow: hidden; white-space: nowrap;
  font: 400 10.5px/2.29 var(--mono); letter-spacing: -.08em; color: var(--fg-5); user-select: none;
}
.row .leader::before { content: '........................................................................................................................................................................'; }
.row .chip {
  flex-shrink: 0; align-self: center; margin-left: 9px;
  font: 400 14px/20px var(--mono); text-transform: uppercase; letter-spacing: -.01em;
  color: var(--chip-fg); background: var(--chip); padding: 2.4px 10px 1.6px; border-radius: 999px; white-space: nowrap;
}
/* Наведение: остальные строки уходят в 40% */
.index:has(.row:hover) .row:not(:hover), .index:has(.row:focus-visible) .row:not(:focus-visible) { opacity: .4; }
.row:focus-visible { outline: none; }

/* ── Превью проекта (шоурил 4:3): прибито к правому нижнему углу, появляется при наведении на строку ──
   16.10.2026 по просьбе владельца вернули угол вместо превью, плывущего за курсором (было с 14.10.2026) */
.preview {
  /* Размер и отступ — как у превью на ayurchenko.xyz (380px, ~29px от края), но 4:3 и скругление больше (16 вместо 12) */
  position: fixed; right: 28px; bottom: 28px; z-index: 30;
  width: min(380px, 34vw); aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; pointer-events: none;
  background: var(--chip);
  opacity: 0; transform: scale(.6); transform-origin: right bottom;
  transition: opacity 240ms cubic-bezier(.333, .667, .667, 1), transform 240ms cubic-bezier(.333, .667, .667, 1);
}
.preview.is-on {
  opacity: 1; transform: none;
  transition-duration: 380ms; transition-timing-function: cubic-bezier(.333, 1, .667, 1);
}
.preview > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px), (hover: none) { .preview { display: none; } }
/* Без наведения (телефон, планшет) шоурил стоит прямо в списке: сверху ролик, под ним строка проекта */
/* Сетка, а не перенос флекса: строка под роликом остаётся одной линией (название с многоточием · точки · плашка) */
.row:has(.row-reel) { display: grid; grid-template-columns: minmax(0, max-content) minmax(1em, 1fr) auto; align-items: baseline; }
.row-reel { grid-column: 1 / -1; display: block; aspect-ratio: 4 / 3; margin: 6px 0 10px; border-radius: 16px; overflow: hidden; background: var(--chip); }
.row-reel > video { display: block; width: 100%; height: 100%; object-fit: cover; }
.row:has(.row-reel) + .row:has(.row-reel) { margin-top: 20px; }

/* Цветная заглушка вместо обложки */
.ph {
  display: grid; place-items: center; color: rgba(255, 255, 255, .9);
  font: 500 28px/1 var(--sans); letter-spacing: -.03em;
  background:
    radial-gradient(120% 90% at 20% 10%, hsl(var(--h) 90% 62%), transparent 60%),
    radial-gradient(90% 90% at 90% 100%, hsl(calc(var(--h) + 40) 80% 40%), transparent 70%),
    hsl(var(--h) 30% 14%);
}

/* ── Footer ── */
.site-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 96px 0 48px; color: var(--fg-2); font-size: 14px; }
.site-footer nav { display: flex; gap: 16px; align-items: baseline; }
.site-footer a { color: var(--fg-2); transition: color .2s var(--ease); }
@media (hover: hover) { .site-footer a:hover { color: var(--fg); } }
/* Кнопка звука в верхней панели: иконка-эквалайзер. Звук включён — полоски тихо «играют»,
   выключен — плавно оседают в ровные точки. */
.dock-right { display: flex; gap: 8px; }
.sound-toggle .eq rect { transform-box: fill-box; transform-origin: center; transform: scaleY(var(--h, .5)); transition: transform .45s cubic-bezier(.3, 1.3, .5, 1); }
.sound-toggle .eq rect:nth-child(1) { --h: .45; animation: eq-a 1.1s ease-in-out infinite alternate; }
.sound-toggle .eq rect:nth-child(2) { --h: .9; animation: eq-b .9s ease-in-out infinite alternate; }
.sound-toggle .eq rect:nth-child(3) { --h: .6; animation: eq-c 1.25s ease-in-out infinite alternate; }
.sound-toggle .eq rect:nth-child(4) { --h: .35; animation: eq-a 1s ease-in-out -.4s infinite alternate; }
@keyframes eq-a { from { transform: scaleY(.3); } to { transform: scaleY(.75); } }
@keyframes eq-b { from { transform: scaleY(.95); } to { transform: scaleY(.45); } }
@keyframes eq-c { from { transform: scaleY(.5); } to { transform: scaleY(1); } }
.sound-toggle[aria-pressed="false"] .eq rect { animation: none; transform: scaleY(.16); }
@media (prefers-reduced-motion: reduce) { .sound-toggle .eq rect { animation: none; } }

/* «Скачать резюме» под вступлением — та же ссылка со стрелкой, что и имя в заголовке */
.cta { margin-top: 32px; }
.cta .inline-link { color: var(--fg); }
/* Строки опыта открывают боковую панель */
.row--open { cursor: pointer; }

/* ── Bio panel ── */
.overlay { position: fixed; inset: 0; z-index: 40; visibility: hidden; }
.overlay.is-open { visibility: visible; }
.overlay__bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .25); opacity: 0; transition: opacity .35s var(--ease); }
.overlay.is-open .overlay__bg { opacity: 1; }
.panel {
  position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(480px, calc(100% - 24px));
  background: var(--bg); border-radius: 16px; overflow: auto; padding: 72px 32px 40px;
  transform: translateX(calc(100% + 24px)); transition: transform .5s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .2);
}
.overlay.is-open .panel { transform: none; }
.panel .pill-btn { position: absolute; top: 20px; right: 20px; }
.panel p { font-size: 18px; line-height: 1.45; color: var(--fg-2); margin: 0 0 16px; }
.panel p:first-of-type { color: var(--fg); }

/* ── Reveal ── */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ── Case page ── */
.case-head { padding-top: 0; }
.case-title { font-size: 24px; line-height: 1.3; font-weight: 500; margin: 0; }
.case-title span { display: block; font-weight: 400; color: var(--fg-2); }
.case-summary { font-size: 18px; line-height: 1.5; color: var(--fg-2); margin: 40px 0 0; }
.meta { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 40px 0 0; font-size: 15px; }
.meta dt { color: var(--fg-3); }
.meta dd { margin: 0; color: var(--fg); }
.case-body h2 { font-size: 24px; font-weight: 500; margin: 96px 0 16px; }
.case-body p { font-size: 18px; line-height: 1.5; color: var(--fg-2); margin: 0 0 16px; }
/* Изображения кейса — строго по колонке текста, не шире (владелец 14.10.2026; раньше выходили на ширину --wide) */
.figure {
  width: 100%; margin: 24px 0 0;
  aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--placeholder);
  display: grid; place-items: center; color: var(--fg-3); font: 400 12px var(--mono); text-transform: uppercase;
}
.figure > img, .figure > video, .figure > .ph { width: 100%; height: 100%; object-fit: cover; }
.figure > .ph { font: 500 40px/1 var(--sans); text-transform: none; }
.case-body > .figure:first-child { margin-top: 64px; aspect-ratio: 4 / 3; } /* шоурил кейса, 4:3 */
.figure--img { background: var(--placeholder); }
.figure--img + .figure--img { margin-top: 12px; }
.case-body .cap { font-size: 15px; color: var(--fg-3); margin: 40px 0 0; }
.case-body .cap + .figure { margin-top: 12px; }
.case-body ul, .case-body ol { font-size: 18px; line-height: 1.5; color: var(--fg-2); margin: 0 0 16px; padding-left: 1.3em; }
.case-body li + li { margin-top: 6px; }
.case-body li::marker { color: var(--fg-3); }
.note {
  font-size: 17px; line-height: 1.5; color: var(--fg-1); background: var(--chip);
  border-radius: 12px; padding: 16px 20px; margin: 24px 0;
}
.note + .note { margin-top: -12px; }
.figure + p, .figure + h2 + p { margin-top: 24px; }
.case-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 24px; }
.case-tags .chip { font: 400 13px/20px var(--mono); text-transform: uppercase; color: var(--chip-fg); background: var(--chip); padding: 2px 10px 1px; border-radius: 999px; }
.next-case { display: block; margin-top: 120px; }
.next-case small { display: block; color: var(--fg-3); font-size: 15px; margin-bottom: 4px; }
.next-case strong { font-size: 24px; font-weight: 400; }
.next-case:hover strong { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

@media (max-width: 640px) {
  main.wrap { padding-top: 96px; }
  .statement, .lede, .section-title, .row { font-size: 20px; }
  .row .name { margin-right: 12px; }
  .row .chip { font-size: 11px; line-height: 16px; padding: 2px 8px 1px; }
  .row .sub { display: none; }
  .section { margin-top: 72px; }
  .meta { grid-template-columns: 96px 1fr; }
  .figure { border-radius: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
  .reveal { opacity: 1; transform: none; }
}
