/* =========================================================================
   Портфолио Андрея Хлоповских — стили
   Порядок: токены → база → фон «космос» → шапка → hero → путь по разделам →
   панели разделов → проекты → документы → контакты → просмотрщик → курсор →
   анимации → адаптив
   Правило производительности: анимируем только transform и opacity.
   ========================================================================= */

:root {
  --accent: #5EEAA8;
  --ink: #04110C;          /* тёмный текст на зелёном */
  --bg: #050B0A;
  --text: #E8F3EE;
  --text-soft: #C6D8D0;
  --text-muted: #9DB3AA;
  --text-dim: #7F978D;
  --text-nav: #B2C7BE;
  --mint: #7FB8A6;
  --line: rgba(160, 220, 200, .14);
  --card: rgba(16, 29, 25, .85);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); }
::selection { background: var(--accent); color: var(--ink); }
a { color: var(--accent); }
a:hover { color: #A7F3D0; }
img { -webkit-user-drag: none; }

.page {
  position: relative;
  overflow: hidden;
  background-color: var(--bg);
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.content { position: relative; z-index: 1; }

.disp { font-family: 'Unbounded', 'Arial Black', system-ui, sans-serif; }
.mono { font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace; }
.accent { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- общие кнопки и чипы ---------- */
.btn { transition: transform .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .3s ease; }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* спокойная кнопка, при наведении загорается зелёным */
.btn-glow:hover {
  background: var(--accent) !important;
  color: var(--ink) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 14px 34px -12px var(--accent);
}

.btn-pill {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 16px;
}

/* круглая кнопка «закрыть» / «листать» */
.round-btn {
  all: unset; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(160, 220, 200, .2);
  display: grid; place-items: center; color: var(--text);
}
.round-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid rgba(160, 220, 200, .14);
  font-size: 13px; color: var(--text-soft);
  transition: border-color .25s, color .25s, transform .25s;
}
.chip:hover { transform: translateY(-2px); }
.chip--accent {
  padding: 8px 13px;
  border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  font-size: 14px; color: var(--accent);
}

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.tag { padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(160, 220, 200, .18); font-size: 12px; color: var(--text-soft); }
.tag--accent { padding: 4px 10px; border: 0; background: color-mix(in oklab, var(--accent) 15%, transparent); color: var(--accent); }
.tag--more { border: 0; background: color-mix(in oklab, var(--accent) 15%, transparent); color: var(--accent); }

/* карточки, приподнимающиеся при наведении */
.lift { transition: transform .4s var(--ease-out), border-color .4s, background-color .4s; }
.lift:hover { transform: translateY(-4px); }

/* обводка, которая «прорисовывается» при наведении снизу вверх по бокам.
   Отдельный слой ::after, анимируется одно свойство --trace. */
@property --trace { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.trace { transition: transform .4s var(--ease-out), background-color .4s; }
.trace::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from 180deg at 50% 100%, var(--accent) 0deg var(--trace), transparent var(--trace) calc(360deg - var(--trace)), var(--accent) calc(360deg - var(--trace)));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none; transform: translateZ(0);
  transition: --trace .9s cubic-bezier(.45, 0, .2, 1);
}
.trace:hover::after { --trace: 180deg; }
/* у каждой карточки своя фиксированная точка старта обводки */
.trace[data-tv="1"]::after, .tv-cycle > .trace:nth-child(6n+3)::after { background: conic-gradient(from 0deg at 50% 0%, var(--accent) 0deg var(--trace), transparent var(--trace) calc(360deg - var(--trace)), var(--accent) calc(360deg - var(--trace))); }
.trace[data-tv="2"]::after, .tv-cycle > .trace:nth-child(6n+2)::after { background: conic-gradient(from 270deg at 0% 50%, var(--accent) 0deg var(--trace), transparent var(--trace) calc(360deg - var(--trace)), var(--accent) calc(360deg - var(--trace))); }
.trace[data-tv="3"]::after, .tv-cycle > .trace:nth-child(6n+5)::after { background: conic-gradient(from 90deg at 100% 50%, var(--accent) 0deg var(--trace), transparent var(--trace) calc(360deg - var(--trace)), var(--accent) calc(360deg - var(--trace))); }
.trace[data-tv="4"]::after, .tv-cycle > .trace:nth-child(6n+4)::after { background: conic-gradient(from 0deg at 50% 0%, var(--accent) 0deg var(--trace), transparent var(--trace) calc(360deg - var(--trace)), var(--accent) calc(360deg - var(--trace))), conic-gradient(from 180deg at 50% 100%, var(--accent) 0deg var(--trace), transparent var(--trace) calc(360deg - var(--trace)), var(--accent) calc(360deg - var(--trace))); }
.trace[data-tv="5"]::after, .tv-cycle > .trace:nth-child(6n+6)::after { background: conic-gradient(from 270deg at 0% 50%, var(--accent) 0deg var(--trace), transparent var(--trace) calc(360deg - var(--trace)), var(--accent) calc(360deg - var(--trace))), conic-gradient(from 90deg at 100% 50%, var(--accent) 0deg var(--trace), transparent var(--trace) calc(360deg - var(--trace)), var(--accent) calc(360deg - var(--trace))); }
.trace[data-tv="4"]::after, .trace[data-tv="5"]::after, .tv-cycle > .trace:nth-child(6n+4)::after, .tv-cycle > .trace:nth-child(6n+6)::after { transition-duration: 1.3s; }

/* пульсирующее кольцо: только transform + opacity */
.pulse { position: relative; }
.pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
  will-change: transform, opacity; pointer-events: none;
}

/* =========================================================================
   ФОН «КОСМОС» (фиксированный слой, полностью изолирован от страницы)
   ========================================================================= */
.space {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; contain: strict;
  background: radial-gradient(120% 70% at 50% -10%, #0B1F1A 0%, var(--bg) 65%);
}
.nebula { position: absolute; border-radius: 50%; animation: nebula 40s ease-in-out infinite alternate; will-change: transform; }
.nebula--1 { top: -18%; left: -14%; width: 70vw; height: 70vw; max-width: 1100px; max-height: 1100px; background: radial-gradient(closest-side, rgba(16,185,129,.20), rgba(16,185,129,.06) 55%, transparent); animation-duration: 34s; }
.nebula--2 { top: 28%; right: -22%; width: 62vw; height: 62vw; max-width: 1000px; max-height: 1000px; background: radial-gradient(closest-side, rgba(20,170,165,.15), rgba(20,170,165,.04) 55%, transparent); animation-duration: 42s; animation-delay: -12s; }
.nebula--3 { bottom: -24%; left: 18%; width: 58vw; height: 58vw; max-width: 950px; max-height: 950px; background: radial-gradient(closest-side, rgba(80,90,200,.12), rgba(80,90,200,.03) 55%, transparent); animation-duration: 50s; animation-delay: -20s; }

/* звёзды: три слоя-тайла, картинка звёзд строится в main.js */
.stars { position: absolute; left: 0; right: 0; top: 0; background-repeat: repeat; animation: starsUp 200s linear infinite; will-change: transform; }
.stars--a { height: calc(100% + 500px); background-size: 500px 500px; --tile: -500px; animation-duration: 200s; }
.stars--b { height: calc(100% + 700px); background-size: 700px 700px; --tile: -700px; animation-duration: 140s; }
.stars--c { height: calc(100% + 900px); background-size: 900px 900px; --tile: -900px; animation-duration: 90s; }

.twinkles, .planets { position: absolute; inset: 0; }
.tw { position: absolute; border-radius: 50%; background: radial-gradient(circle, #F2FFF9 0 28%, rgba(160,255,215,.45) 52%, transparent 72%); animation: twinkle 4s ease-in-out infinite; will-change: transform, opacity; }

.float-slow { position: absolute; animation: floatSlow var(--fd, 20s) ease-in-out infinite; will-change: transform; }
.planet--big { --fd: 28s; left: -150px; bottom: -170px; width: 440px; height: 440px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(127,184,166,.30), rgba(127,184,166,.07) 55%, transparent 72%); }
.planet--ringed { --fd: 19s; right: 8%; top: 18%; width: 110px; height: 110px; }
.planet--ringed .planet__body { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 30% 28%, #A7F3D0, #2F8A70 50%, #0A2A22 100%); opacity: .5; box-shadow: inset -16px -12px 30px rgba(0,0,0,.55); }
.planet--ringed .planet__ring { position: absolute; left: -44px; right: -44px; top: 50%; height: 30px; margin-top: -15px; border-radius: 50%; border: 1.5px solid rgba(167,243,208,.28); transform: rotate(-18deg); }
.planet--dot1 { --fd: 15s; left: 12%; top: 34%; width: 38px; height: 38px; border-radius: 50%; background: rgba(127,184,166,.16); }
.planet--dot2 { --fd: 22s; right: 22%; top: 62%; width: 22px; height: 22px; border-radius: 50%; background: rgba(127,184,166,.22); }
.planet--dot3 { --fd: 12s; left: 46%; top: 8%; width: 14px; height: 14px; border-radius: 50%; background: rgba(167,243,208,.25); }

.shoot { position: absolute; width: 150px; height: 1.5px; border-radius: 2px; background: linear-gradient(90deg, #FFFFFF, rgba(200,255,232,.7) 25%, rgba(200,255,232,0)); opacity: 0; animation: shoot 14s linear infinite; will-change: transform, opacity; }
.shoot--1 { top: 10%; left: 74%; animation-duration: 11s; animation-delay: 2s; }
.shoot--2 { top: 36%; left: 94%; animation-duration: 17s; animation-delay: 7s; }
.shoot--3 { top: 4%; left: 44%; animation-duration: 23s; animation-delay: 13s; }

/* на сенсорных и слабых устройствах фон спокойнее */
@media (pointer: coarse) {
  .nebula, .float-slow { animation: none !important; }
  .twinkles .tw:nth-child(n+9) { display: none; }
}
.lite .nebula, .lite .float-slow { animation: none !important; }
.lite .stars--c, .lite .twinkles { display: none; }

/* =========================================================================
   ШАПКА
   ========================================================================= */
.site-header { position: sticky; top: 0; z-index: 60; background: rgba(5,11,10,.84); border-bottom: 1px solid rgba(160,220,200,.08); }
.nav { max-width: 1240px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 17px; }
.logo:hover { color: var(--text); }
.logo__mark { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: var(--ink); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.nav__links { display: flex; gap: 30px; font-size: 15px; }
.navlink { color: var(--text-nav); text-decoration: none; transition: color .2s; }
.navlink:hover { color: var(--text); }
.nav__cta { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--accent); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav__cta:hover { color: var(--ink); box-shadow: 0 14px 34px -12px var(--accent); }

/* =========================================================================
   HERO
   ========================================================================= */
.hero { position: relative; max-width: 1240px; margin: 0 auto; padding: 88px 24px 80px; display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.hero__text { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }

.status { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 9px 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; font-size: 13px; color: var(--text-nav); background: rgba(255,255,255,.02); }
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.hero__titles { display: flex; flex-direction: column; gap: 12px; }
.hero__title { margin: 0; font-size: 34px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--text); }
.hero__title .ln > span { text-wrap: balance; }

.hero__type-wrap { display: flex; flex-direction: column; gap: 14px; }
.type-line { display: flex; align-items: center; flex-wrap: wrap; min-height: 34px; font-size: 19px; color: var(--text); }
.type-line__kw { color: var(--mint); }
.type-line__value { display: inline-flex; align-items: center; color: var(--accent); }
.type-line__text { white-space: pre; }
.caret { display: inline-block; width: 10px; height: 22px; margin: 0 2px; background: var(--accent); animation: blink 1s steps(1) infinite; }

.hero__lead { margin: 0; max-width: 560px; font-size: 19px; line-height: 1.6; color: var(--text-soft); text-wrap: pretty; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* правая часть: фото и орбиты */
.hero__visual { position: relative; flex: 1 1 400px; min-width: 0; min-height: 540px; display: grid; place-items: center; }
.hero-ring { position: absolute; aspect-ratio: 1; border-radius: 50%; }
.hero-ring--mid { width: min(460px, 100%); border: 1px dashed rgba(255,255,255,.18); }
.hero-ring--inner { width: min(340px, 78%); border: 1px solid rgba(160,220,200,.10); }
.hero-ring--outer { width: min(580px, 120%); border: 1px dashed rgba(160,220,200,.07); }
.sat { position: absolute; border-radius: 50%; }
.sat--1 { top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; background: var(--accent); box-shadow: 0 0 24px var(--accent); }
.sat--2 { bottom: 14%; left: 4%; width: 7px; height: 7px; background: var(--mint); }
.sat--3 { top: 50%; right: -9px; width: 18px; height: 18px; margin-top: -9px; background: radial-gradient(circle at 30% 30%, #CFFBE8, #5EAE95 60%, #1E4D40); box-shadow: 0 0 18px rgba(127,184,166,.6); }
.sat--4 { bottom: 12%; right: 10%; width: 9px; height: 9px; background: var(--text-nav); box-shadow: 0 0 12px rgba(178,199,190,.6); }
.sat--5 { top: 9%; left: 16%; width: 5px; height: 5px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.photo-card { position: relative; width: 290px; height: 410px; border-radius: 38px; padding: 10px; background: #0E1A16; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 50px 90px -30px rgba(0,0,0,.85), 0 0 0 7px rgba(255,255,255,.025); }
.photo-card__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; border-radius: 29px; }
.photo-card__badge { position: absolute; left: 22px; right: 22px; bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 18px; background: rgba(5,13,11,.88); border: 1px solid rgba(160,220,200,.14); }
.photo-card__who { display: flex; flex-direction: column; gap: 2px; }
.photo-card__name { font-weight: 600; font-size: 15px; }
.photo-card__meta { font-size: 12px; color: var(--text-muted); }
.photo-card__icon { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--ink); display: grid; place-items: center; }

/* плавающие «кусочки кода» вокруг фото */
.code-tag { position: absolute; padding: 10px 14px; border-radius: 14px; background: #0E1B17; border: 1px solid rgba(255,255,255,.12); font-size: 13px; box-shadow: 0 20px 40px -20px rgba(0,0,0,.8); }
.code-tag--fn { top: 46px; left: 0; }
.code-tag--kotlin { top: 150px; right: -6px; border: 0; background: var(--accent); color: var(--ink); font-weight: 500; box-shadow: 0 20px 40px -18px color-mix(in oklab, var(--accent) 60%, transparent); }
.code-tag--room { bottom: 70px; left: 10px; }
.code-tag--paging { top: 300px; right: -28px; }
.code-tag--flow { bottom: 36px; right: 20px; color: var(--text-muted); }
.code-tag__muted { color: var(--text-muted); }

/* бегущая строка со стеком */
.marquee-band { position: relative; overflow: hidden; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.07); border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.015); }
.marquee { display: flex; width: max-content; font-size: 15px; color: var(--text-muted); white-space: nowrap; animation: marquee 38s linear infinite; will-change: transform; }
.marquee__item { display: inline-flex; align-items: center; gap: 30px; padding-right: 30px; }
.marquee__dot { width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); }

/* =========================================================================
   ПУТЬ ПО РАЗДЕЛАМ (волнистая линия, точки, карточки)
   ========================================================================= */
.journey { position: relative; max-width: 1240px; margin: 0 auto; padding: 24px 24px 60px; }

.jr { scroll-margin-top: 84px; }
.jr--right { --from: 56px; }
.jr--left { --from: -56px; }
.jr-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr); min-height: 210px; view-timeline-name: --row; }

.jr-cap { display: grid; grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr); view-timeline-name: --cap; }
.jr-capcell { grid-column: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 48px; }
.jr-cap__label { font-size: 12px; color: var(--text-dim); letter-spacing: .12em; }
.jr-startdot { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); }
/* место под отрезок от стартовой точки; саму линию рисует общая кривая .jr-path */
.jr-startline { width: 8px; height: 64px; }

.jr-track { grid-column: 2; grid-row: 1; position: relative; align-self: stretch; min-height: 210px; }
/* дорожка: одна SVG поверх всего пути (под карточками и панелями), рисует main.js */
.jr-path { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.jr-path-glow { fill: none; stroke: var(--accent); stroke-opacity: .22; stroke-width: 8; stroke-linecap: butt; stroke-linejoin: round; }
.jr-path-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.jr-dot { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #06100D; border: 3px solid var(--accent); box-shadow: 0 0 0 6px #06100D, 0 0 22px color-mix(in oklab, var(--accent) 60%, transparent); transition: background-color .35s ease; }
.jr--right .jr-dot { left: 81.43%; }
.jr--left .jr-dot { left: 18.57%; }

.jr-card { grid-row: 1; align-self: center; width: 100%; max-width: 500px; margin: 22px 0; border-radius: 26px; background: rgba(10,21,18,.9); border: 1px solid var(--line); transition: border-color .35s, background-color .35s, transform .45s var(--ease-out); }
.jr-card:hover { transform: translateY(-3px); }
.jr--right .jr-card { grid-column: 3; justify-self: start; }
.jr--left .jr-card { grid-column: 1; justify-self: end; }

.jr-head { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; align-items: flex-start; gap: 16px; padding: 24px 26px; }
.jr-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 26px; }
.jr-head__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.jr-head__kicker { font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.jr-head__title { font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--text); }
.jr-head__sub { font-size: 15px; line-height: 1.5; color: var(--text-muted); }
.jr-head__meta { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.jr-head__meta--wide { gap: 16px; }

.jr-plus { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(160,220,200,.22); display: grid; place-items: center; color: var(--text); transform: rotate(0deg); transition: transform .5s var(--ease-out), background-color .3s, color .3s, border-color .3s; }
.jr-card:hover .jr-plus { background: var(--accent); color: var(--ink); border-color: var(--accent); }

/* раскрывающаяся часть: высота меняется сразу (без пересчёта страницы
   каждый кадр), а сама панель плавно проявляется и выезжает на GPU */
.jr-collapse { display: grid; grid-template-rows: 0fr; visibility: hidden; }
.jr-collapse__inner { overflow: hidden; min-height: 0; }
.jr-body { position: relative; padding: 40px 0; }
.jr-panel { position: relative; z-index: 1; padding: 40px; border-radius: 34px; background: rgba(8,18,15,.95); border: 1px solid var(--line); opacity: 0; transform: translateY(-28px) scale(.96); transition: opacity .5s ease .12s, transform .8s var(--ease-out); }
.jr-panel--clip { overflow: hidden; }

/* состояние «раздел открыт» */
.jr.is-open .jr-dot { background: var(--accent); }
.jr.is-open .jr-card { background: rgba(14,34,28,.96); border-color: color-mix(in oklab, var(--accent) 55%, transparent); }
.jr.is-open .jr-plus { transform: rotate(45deg); }
.jr.is-open .jr-collapse { grid-template-rows: 1fr; visibility: visible; }
.jr.is-open .jr-panel { opacity: 1; transform: none; }

/* место, куда скрипт вставляет карточку проекта / документа: сама обёртка
   не создаёт блока, карточка встаёт в раскладку как прямой потомок */
.slot { display: contents; }

/* внутренности панелей */
.panel-stack { display: flex; flex-direction: column; gap: 28px; }
.panel-stack--loose { gap: 40px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-head--wrap { flex-wrap: wrap; }
.panel-head__label { font-size: 13px; color: var(--accent); letter-spacing: .08em; }
.panel-head__side { display: flex; align-items: center; gap: 16px; }
.panel-head__hint { font-size: 13px; color: var(--text-muted); }

/* ---------- 01 обо мне ---------- */
.avatar-q { flex: 0 0 auto; display: block; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: #DDEFE7; border: 2px solid color-mix(in oklab, var(--accent) 55%, transparent); }
.avatar-q svg { display: block; width: 100%; height: 100%; }
.avatar-q text { fill: var(--accent); font-family: 'Unbounded', 'Arial Black', sans-serif; }

.about-intro { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.about-intro__title { flex: 1 1 480px; min-width: 0; margin: 0; font-size: 38px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.about-intro__text { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 16px; font-size: 17px; line-height: 1.7; color: var(--text-soft); }
.about-intro__text p { margin: 0; text-wrap: pretty; }

.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.about-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 26px; border-radius: 22px; background: var(--card); border: 1px solid rgba(160,220,200,.1); }
.about-card__kicker { font-size: 13px; color: var(--accent); }
.about-card__title { margin: 0; font-size: 19px; font-weight: 700; }
.about-card__text { margin: 0; font-size: 16px; line-height: 1.6; color: var(--text-muted); }
.about-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.icon-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(160,220,200,.16); font-size: 13px; color: var(--text-soft); }

/* ---------- 02 опыт ---------- */
.job { display: flex; flex-wrap: wrap; gap: 32px; padding: 32px; border-radius: 26px; background: rgba(13,26,22,.9); border: 1px solid rgba(160,220,200,.1); }
.job__when { flex: 0 1 220px; display: flex; flex-direction: column; gap: 10px; }
.job__dates { font-size: 14px; color: var(--accent); }
.job__place { font-size: 13px; color: var(--text-dim); }
.job__main { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.job__head { display: flex; flex-direction: column; gap: 8px; }
.job__company { margin: 0; font-size: 26px; font-weight: 700; }
.job__role { font-size: 17px; color: var(--text-soft); }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; }
.metric { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 18px; background: color-mix(in oklab, var(--accent) 9%, #0A1512); border: 1px solid color-mix(in oklab, var(--accent) 25%, transparent); }
.metric__value { font-size: 30px; font-weight: 800; color: var(--accent); }
.metric__label { font-size: 14px; line-height: 1.5; color: var(--text-soft); }

.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.points--narrow { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.point { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 18px; background: var(--card); border: 1px solid rgba(160,220,200,.08); }
.point__label { font-size: 12px; color: var(--accent); }
.point__text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text-soft); }

/* ---------- 03 проекты: иконки приложений на орбитах ---------- */
.mini-orbit { position: relative; width: 54px; height: 54px; flex: 0 0 auto; border-radius: 50%; border: 1px dashed rgba(160,220,200,.32); }
.mini-orbit span { position: absolute; border-radius: 50%; }
.mini-orbit__core { left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: color-mix(in oklab, var(--accent) 35%, #0D1A16); border: 1px solid var(--accent); }
.mini-orbit__p1 { left: -5px; top: 20px; width: 11px; height: 11px; background: #7FD8FF; }
.mini-orbit__p2 { right: 3px; top: -3px; width: 9px; height: 9px; background: #FFB86B; }
.mini-orbit__p3 { right: 5px; bottom: -3px; width: 11px; height: 11px; background: var(--accent); }

.projects-body { position: relative; display: flex; flex-direction: column; gap: 8px; }
.orbit-wrap { display: grid; place-items: center; padding: 34px 0 18px; }
.orbit { --r1: 175px; --r2: 305px; --ico: 84px; position: relative; width: 740px; height: 740px; max-width: 100%; }
.orbit-path { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; border: 1px dashed rgba(160,220,200,.16); pointer-events: none; }
.orbit-path--inner { width: calc(var(--r1) * 2); height: calc(var(--r1) * 2); }
.orbit-path--outer { width: calc(var(--r2) * 2); height: calc(var(--r2) * 2); }
.orbit-core { position: absolute; left: 50%; top: 50%; width: 200px; height: 200px; margin: -100px 0 0 -100px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 18px; text-align: center; background: radial-gradient(circle at 40% 35%, color-mix(in oklab, var(--accent) 22%, #0D1A16), #0A1512 72%); border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent); color: var(--accent); }
.orbit-core__text { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--accent); text-wrap: balance; }

.orbit-ring { position: absolute; inset: 0; pointer-events: none; }
.ring-a { animation: spin 48s linear infinite; }
.ring-b { animation: spin 72s linear infinite reverse; }
.orbit-slot { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.ring-a .orbit-slot { transform: rotate(var(--a)) translateX(var(--r1)) rotate(calc(var(--a) * -1)); }
.ring-b .orbit-slot { transform: rotate(var(--a)) translateX(var(--r2)) rotate(calc(var(--a) * -1)); }
.up-a { animation: spin 48s linear infinite reverse; }
.up-b { animation: spin 72s linear infinite; }

/* орбиты стоят, пока раздел закрыт; крутятся, пока открыт.
   Орбита, на иконке которой курсор, замирает — по иконке легко попасть.
   Классы is-running / is-held / is-focused ставит main.js. */
.orbit-ring, .orbit-up { animation-play-state: paused; }
.orbit.is-running .orbit-ring, .orbit.is-running .orbit-up { animation-play-state: running; }
.orbit.is-running .orbit-ring.is-held, .orbit.is-running .orbit-ring.is-held .orbit-up,
.orbit.is-focused .orbit-ring, .orbit.is-focused .orbit-up { animation-play-state: paused; }

.orbit-btn { all: unset; box-sizing: border-box; position: absolute; left: 0; top: 0; width: 132px; transform: translate(-50%, calc(var(--ico) / -2)); display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; pointer-events: auto; }
.orbit-icon { position: relative; width: var(--ico); height: var(--ico); border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(160,220,200,.25); box-shadow: 0 14px 30px -14px rgba(0,0,0,.9); transition: transform .35s var(--ease-out), border-color .3s; }
.orbit-img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.orbit-num { font-size: 18px; font-weight: 800; color: #FFFFFF; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.orbit-badge { position: absolute; right: -2px; top: -2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--ink); transform: scale(0); transition: transform .3s var(--ease-out); }
.orbit-name { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; line-height: 1.3; color: var(--text-nav); text-align: center; padding: 3px 9px; border-radius: 999px; background: rgba(5,11,10,.78); transition: color .3s; }
.orbit-btn:hover .orbit-icon, .orbit-btn:focus-visible .orbit-icon { transform: scale(1.12); border-color: var(--accent); }
.orbit-btn:hover .orbit-badge, .orbit-btn:focus-visible .orbit-badge { transform: scale(1); }
.orbit-btn:hover .orbit-name, .orbit-btn:focus-visible .orbit-name, .orbit-btn.sel .orbit-name { color: var(--accent); }
.orbit-btn.sel .orbit-icon { border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in oklab, var(--accent) 20%, transparent), 0 14px 30px -14px rgba(0,0,0,.9); }

/* приложение в разработке: полупрозрачная планета с «?» */
.orbit-btn.wip .orbit-icon { border: 2px dashed color-mix(in oklab, var(--accent) 55%, transparent); box-shadow: inset 0 0 22px color-mix(in oklab, var(--accent) 16%, transparent); }
.orbit-btn.wip .orbit-num { font-family: 'Unbounded', sans-serif; font-size: 34px; font-weight: 700; color: var(--accent); opacity: .85; text-shadow: none; }
.orbit-btn.wip:hover .orbit-icon, .orbit-btn.wip.sel .orbit-icon, .orbit-btn.wip:focus-visible .orbit-icon { border-style: dashed; border-color: var(--accent); }
.orbit-btn.wip .orbit-name { font-style: italic; }

/* карточка выбранного проекта */
.project { display: flex; flex-direction: column; gap: 24px; padding: 26px; border-radius: 24px; background: rgba(16,29,25,.88); border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent); }
.project__head { display: flex; align-items: center; gap: 16px; }
.project__icon { flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; border: 2px solid color-mix(in oklab, var(--accent) 55%, transparent); color: #FFFFFF; font-size: 16px; font-weight: 800; text-shadow: 0 1px 6px rgba(0,0,0,.6); overflow: hidden; }
.project__icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.project__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.project__kicker { font-size: 12px; color: var(--accent); }
.project__title { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.project__close { flex: 0 0 auto; }
.project__wip { margin: 0; max-width: 760px; font-size: 16px; line-height: 1.65; color: var(--text-soft); }
.project__done { display: flex; flex-direction: column; gap: 24px; }
.project__cols { display: flex; flex-wrap: wrap; gap: 40px; }
.project__info { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.project__block { display: flex; flex-direction: column; gap: 6px; }
.project__block--list { gap: 10px; }
.project__label { font-size: 12px; color: var(--accent); }
.project__about { margin: 0; max-width: 760px; font-size: 16px; line-height: 1.65; color: var(--text-soft); }
.project__links { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.project__repo { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(160,220,200,.2); color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.fact { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border-radius: 14px; background: rgba(5,11,10,.45); border: 1px solid rgba(160,220,200,.12); }
.fact__k { font-size: 11px; letter-spacing: .08em; color: var(--accent); }
.fact__v { font-size: 15px; line-height: 1.4; color: var(--text); }

.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 10px 28px; margin: 0; padding: 0; list-style: none; }
.feat { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.5; color: var(--text-soft); }
.feat::before { content: ''; flex: 0 0 auto; width: 7px; height: 7px; margin-top: 8px; border-radius: 50%; background: var(--accent); }

/* заглушки экранов, пока нет скриншотов */
.shot-placeholders { flex: 1 1 400px; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 0 24px; }
.shot { aspect-ratio: 9 / 19; display: grid; place-items: center; color: var(--text-muted); font-size: 11px; animation: shotIn .8s var(--ease-out) both; animation-delay: var(--d, 0s); }
.hatch { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.055) 0 10px, transparent 10px 20px); }

/* лента скриншотов */
.shots { display: flex; flex-direction: column; gap: 12px; }
.shots__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.shots__count { font-size: 12px; color: var(--accent); }
.shots__hint { font-size: 12px; color: var(--text-dim); }
.shots-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(140px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; scrollbar-width: thin; scrollbar-color: color-mix(in oklab, var(--accent) 45%, transparent) transparent; }
.shot-fig { margin: 0; scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.shot-btn { all: unset; position: relative; display: block; cursor: zoom-in; border-radius: 20px; }
.shot-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shot-img { display: block; width: 100%; height: auto; aspect-ratio: 420 / 910; border-radius: 20px; border: 1px solid rgba(160,220,200,.16); box-shadow: 0 24px 50px -28px rgba(0,0,0,.9); background: #0D1A16; object-fit: cover; transition: transform .35s var(--ease-out), border-color .3s; }
.shot-fig:hover .shot-img { transform: translateY(-4px); border-color: color-mix(in oklab, var(--accent) 55%, transparent); }
.shot-zoom { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(5,11,10,.78); color: var(--accent); opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s; }
.shot-fig:hover .shot-zoom, .shot-btn:focus-visible .shot-zoom { opacity: 1; transform: none; }
.shot-fig figcaption { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; line-height: 1.4; color: var(--text-muted); }

/* ---------- 04 стек ---------- */
.stack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.stack-card { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 22px; background: var(--card); border: 1px solid rgba(160,220,200,.1); }
.stack-card__head { display: flex; align-items: center; gap: 14px; }
.stack-card__icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in oklab, var(--accent) 12%, transparent); border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent); color: var(--accent); }
.stack-card__titles { display: flex; flex-direction: column; gap: 3px; }
.stack-card__title { margin: 0; font-size: 19px; font-weight: 700; color: var(--text); }
.stack-card__sub { font-size: 14px; color: var(--text-muted); }

/* ---------- 05 образование ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); gap: 14px; }
.edu-card { position: relative; display: flex; gap: 20px; align-items: flex-start; padding: 26px; border-radius: 22px; background: var(--card); border: 1px solid rgba(160,220,200,.1); }
.year { flex: 0 0 auto; font-size: 15px; font-weight: 700; padding: 8px 12px; border-radius: 12px; }
.year--fill { color: var(--ink); background: var(--accent); }
.year--outline { color: var(--text); border: 1px solid rgba(255,255,255,.2); }
.edu-card__body { display: flex; flex-direction: column; gap: 8px; }
.edu-card__body--grow { flex: 1; min-width: 0; }
.edu-card__title { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.3; }
.edu-card__sub { font-size: 16px; color: var(--text-muted); }

.doc-thumbs { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.doc-thumb { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.doc-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }
.doc-thumb img { display: block; height: 89px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(160,220,200,.22); transition: transform .35s var(--ease-out), border-color .3s; }
.doc-thumb:hover img { transform: translateY(-3px); }
.doc-thumb__cert { width: 150px; object-position: left top; }
.doc-thumb__ref { width: 63px; object-position: top; background: #FFFFFF; }
.doc-thumb__cap { font-size: 12px; color: var(--text-muted); }

.doc-viewer { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.doc-viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.doc-viewer__tabs, .doc-viewer__tools { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-viewer__tools { align-items: center; }
.doc-tab { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(160,220,200,.22); background: transparent; color: var(--text); font-size: 15px; font-weight: 500; }
.doc-tab[aria-pressed="true"] { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.doc-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.doc-viewer__page { min-width: 54px; text-align: center; font-size: 13px; color: var(--text-muted); }
.doc-viewer__full { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(160,220,200,.2); color: var(--text); font-size: 14px; }
.doc-viewer__full.btn-glow:hover { box-shadow: none; }   /* загорается без мягкой тени, как в макете */
.doc-viewer__full:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.doc-viewer__img { display: block; width: 100%; max-width: 100%; margin: 0 auto; border-radius: 12px; background: #FFFFFF; }
.doc-viewer__img--page { max-width: 720px; }

/* появление карточки проекта и документа */
.doc-view { animation: fadeUp .5s var(--ease-out) both; }

/* ---------- 06 контакты ---------- */
.contact { padding-bottom: 40px; }
.jr-tail { display: flex; flex-direction: column; align-items: center; width: 22px; margin: 0 auto; }
.jr-tail__line { width: 8px; height: 80px; }   /* место под последний отрезок дорожки */
.jr-tail__dot { position: relative; z-index: 2; width: 22px; height: 22px; margin-bottom: -11px; border-radius: 50%; background: var(--accent); }
/* у раскрывающихся панелей тени нет: её обрезал край раскрывающегося блока,
   и под панелью получалась тёмная «ступенька» поверх зелёной дорожки.
   Контакты ничем не обрезаны, поэтому мягкая тень снизу остаётся только здесь. */
.contact-panel { overflow: hidden; opacity: 1; transform: none; box-shadow: 0 50px 120px -50px rgba(0,0,0,.95); }
.contact-panel__glow { position: absolute; right: -220px; bottom: -280px; width: 680px; height: 680px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in oklab, var(--accent) 20%, transparent), transparent); pointer-events: none; }
.contact-panel__inner { position: relative; display: flex; flex-direction: column; gap: 32px; }
.contact__intro { display: flex; flex-direction: column; gap: 18px; }
.contact__title { margin: 0; font-size: 54px; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; max-width: 880px; text-wrap: balance; }
.contact__text { margin: 0; max-width: 620px; font-size: 18px; line-height: 1.6; color: var(--text-soft); }
.contact__links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 12px; }

.contact-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-radius: 20px; background: rgba(17,31,26,.88); border: 1px solid rgba(160,220,200,.12); color: var(--text); text-decoration: none; transition: transform .4s var(--ease-out), background-color .3s, border-color .3s, box-shadow .3s, color .3s; }
.contact-link:hover { background: var(--accent) !important; color: var(--ink) !important; border-color: var(--accent) !important; box-shadow: 0 14px 34px -12px var(--accent); }
.contact-link:hover * { color: var(--ink) !important; }
.contact-link__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.contact-link__label { font-size: 12px; color: var(--text-muted); }
.contact-link__value { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.contact-link__value--big { font-size: 22px; font-weight: 700; }
.arrow-link .arr { transition: transform .3s var(--ease-out); }
.arrow-link:hover .arr { transform: translate(4px, -4px); }

.footer { max-width: 1240px; margin: 0 auto; padding: 28px 24px 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid rgba(255,255,255,.07); }
.footer__copy { font-size: 13px; color: var(--text-dim); }
.footer__top { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; }

/* =========================================================================
   ПОЛНОЭКРАННЫЙ ПРОСМОТР СКРИНШОТОВ И ДОКУМЕНТОВ
   ========================================================================= */
.lb { position: fixed; inset: 0; z-index: 9000; outline: none; animation: fadeIn .25s ease both; }
.lb-bg { position: absolute; inset: 0; background: rgba(3,7,6,.95); }
.lb-viewport { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.lb-viewport:active { cursor: grabbing; }
.lb-track { display: flex; height: 100%; will-change: transform; transition: transform .45s var(--ease-out); }
.lb-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 76px 96px 70px; }
.lb-img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 26px; border: 1px solid rgba(160,220,200,.16); box-shadow: 0 40px 90px -30px rgba(0,0,0,.95); }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.lb-caption { font-size: 13px; color: var(--text-soft); }
.lb-close { width: 48px; height: 48px; border-color: rgba(160,220,200,.25); background: rgba(5,11,10,.6); }
.lb-nav { all: unset; position: absolute; top: 50%; margin-top: -28px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text); background: rgba(5,11,10,.6); border: 1px solid rgba(160,220,200,.25); }
.lb-nav:hover { background-color: var(--accent); color: var(--ink); border-color: var(--accent); }
.lb-nav:active { transform: scale(.94); }
.lb-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.lb-dot { all: unset; cursor: pointer; display: grid; place-items: center; width: 16px; height: 40px; }
.lb-dot span { display: block; width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.3); transition: width .4s var(--ease-out), background-color .4s; }
.lb-dot[aria-current="true"] { width: 30px; }
.lb-dot[aria-current="true"] span { width: 24px; background: var(--accent); }

/* =========================================================================
   КУРСОР-КОМЕТА (только для мыши)
   ========================================================================= */
.cur-layer { position: fixed; inset: 0; z-index: 9999; pointer-events: none; overflow: hidden; contain: strict; display: none; transition: opacity .3s; }
.cur-on .cur-layer { display: block; }
@media (hover: hover) and (pointer: fine) {
  .cur-on, .cur-on * { cursor: none !important; }
}
.cur-head { position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px 2px color-mix(in oklab, var(--accent) 70%, transparent); will-change: transform; }
.cur-head::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
.cur-ring { position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 1.5px solid color-mix(in oklab, var(--accent) 60%, transparent); opacity: 0; transition: opacity .25s; will-change: transform; }
.cur-tail { position: absolute; left: 0; top: 0; border-radius: 50%; background: var(--accent); will-change: transform; }

/* «взрыв» частиц по клику: два одинаковых набора keyframes, переключение
   класса перезапускает анимацию без принудительного пересчёта раскладки */
.burst { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.burst-ring { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--accent); opacity: 0; }
.bp { position: absolute; left: calc(var(--sz) / -2); top: calc(var(--sz) / -2); width: var(--sz); height: var(--sz); border-radius: 50%; background: var(--accent); opacity: 0; }
.burst.go-a .burst-ring { animation: burstRingA .6s var(--ease-out) forwards; }
.burst.go-b .burst-ring { animation: burstRingB .6s var(--ease-out) forwards; }
.burst.go-a .bp { animation: burstPA .75s cubic-bezier(.15, .8, .25, 1) forwards; }
.burst.go-b .bp { animation: burstPB .75s cubic-bezier(.15, .8, .25, 1) forwards; }

/* =========================================================================
   АНИМАЦИИ
   ========================================================================= */
@keyframes rise { from { opacity: 0; transform: translateY(105%); } to { opacity: 1; transform: none; } }
.ln { display: block; overflow: hidden; padding-bottom: .08em; }
.ln > span { display: inline-block; animation: rise 1.1s var(--ease-out) both; animation-delay: var(--d, 0s); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.fu { animation: fadeUp .9s var(--ease-out) both; animation-delay: var(--d, 0s); }

@keyframes spin { to { transform: rotate(360deg); } }
.spin, .spin-rev, .spin-slow, .bob { will-change: transform; }
.spin { animation: spin 28s linear infinite; }
.spin-rev { animation: spin 18s linear infinite reverse; }
.spin-slow { animation: spin 70s linear infinite; }

@keyframes bob { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -12px, 0); } }
.bob { animation: bob 5.5s ease-in-out infinite; animation-delay: var(--d, 0s); }

@keyframes marquee { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@keyframes ping { from { transform: scale(1); opacity: .55; } to { transform: scale(2.6); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shotIn { from { opacity: 0; transform: translateY(40px) rotate(var(--r, 0deg)); } to { opacity: 1; transform: translateY(var(--y, 0px)) rotate(var(--r, 0deg)); } }

@keyframes nebula { 0% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(4vw, -3vh, 0); } 100% { transform: translate3d(-3vw, 2vh, 0); } }
@keyframes starsUp { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, var(--tile, -600px), 0); } }
@keyframes twinkle { 0%, 100% { opacity: .12; transform: scale(.55); } 50% { opacity: 1; transform: scale(1); } }
@keyframes shoot { 0% { transform: translate(0, 0) rotate(-32deg); opacity: 0; } 1.5% { opacity: 1; } 8% { transform: translate(-560px, 350px) rotate(-32deg); opacity: 0; } 100% { transform: translate(-560px, 350px) rotate(-32deg); opacity: 0; } }
@keyframes floatSlow { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(18px, -28px) rotate(5deg); } }

@keyframes burstRingA { from { transform: scale(1); opacity: .9; } to { transform: scale(6); opacity: 0; } }
@keyframes burstRingB { from { transform: scale(1); opacity: .9; } to { transform: scale(6); opacity: 0; } }
@keyframes burstPA { 0% { transform: rotate(var(--a)) translateX(0) scale(1); opacity: 1; } 100% { transform: rotate(var(--a)) translateX(var(--dist)) scale(.2); opacity: 0; } }
@keyframes burstPB { 0% { transform: rotate(var(--a)) translateX(0) scale(1); opacity: 1; } 100% { transform: rotate(var(--a)) translateX(var(--dist)) scale(.2); opacity: 0; } }

/* карточки на пути выезжают из стороны при прокрутке (без JS) */
@keyframes trIn { from { opacity: 0; translate: var(--from, 0) 0; } to { opacity: 1; translate: 0 0; } }
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@supports (animation-timeline: view()) {
  .jr-card { animation: trIn linear both; animation-timeline: --row; animation-range: entry 15% contain 15%; }
  .jr-startdot { animation: popIn linear both; animation-timeline: --cap; animation-range: entry 30% entry 90%; }
}

/* блок не виден на экране — его бесконечные анимации на паузе (вид не меняется) */
.is-offscreen .spin, .is-offscreen .spin-rev, .is-offscreen .spin-slow, .is-offscreen .bob,
.is-offscreen.marquee, .is-offscreen .pulse::after { animation-play-state: paused; }

/* =========================================================================
   АДАПТИВ
   ========================================================================= */
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .hero__title { font-size: 22px; }
  .type-line { font-size: 15px; }
  .contact__title { font-size: 32px; }

  .jr-row, .jr-cap { grid-template-columns: 56px minmax(0, 1fr); }
  .jr-track, .jr-capcell { grid-column: 1 !important; }
  .jr-card, .jr--right .jr-card, .jr--left .jr-card { grid-column: 2; justify-self: stretch; max-width: none; }
  .jr-tail { margin: 0 0 0 17px; }
  .jr-panel { padding: 22px; border-radius: 26px; }

  .lb-slide { padding: 70px 14px 60px; }
  .lb-nav { display: none; }

  .orbit { --r1: 78px; --r2: 130px; --ico: 52px; width: 300px; height: 300px; }
  .orbit-core { width: 104px; height: 104px; margin: -52px 0 0 -52px; padding: 0 10px; }
  .orbit-core__text { font-size: 10px; }
  .orbit-btn { width: 88px; gap: 5px; }
  .orbit-num { font-size: 13px; }
  .orbit-btn.wip .orbit-num { font-size: 22px; }
  .orbit-name { font-size: 10px; padding: 2px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
