/* ==========================================================================
   DENEB — index-v1 (гибрид)
   Архитектура: 3 файла (HTML/CSS/JS) + DESIGN.md
   v1: моя звезда (звёздное ядро вокруг {deneb}) + ambient blobs
   ========================================================================== */

/* --- Design tokens -------------------------------------------------------- */
:root {
  /* Палитра: terminal dark (не pure black — избежать OLED smear) */
  --bg:          #020617;
  --bg-2:        #050a18;
  --surface:     #0b1120;
  --surface-2:   #0f172a;
  --border:      #1e293b;
  --border-soft: #131c2e;
  --ink:         #f8fafc;
  --ink-dim:     #94a3b8;
  --ink-mute:    #475569;
  --accent:      #64dcdc;
  --accent-deep: #22b8b8;
  --accent-glow: rgba(100, 220, 220, 0.14);
  --indigo:      #6366f1;
  --indigo-glow: rgba(99, 102, 241, 0.18);
  --amber:       #f5b942;

  /* Типографика */
  --ff-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --ff-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ff-logo:    "Courier Prime", "JetBrains Mono", monospace;

  /* Моушн */
  --ease-skill: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur:        400ms;

  /* Сетка */
  --maxw:    1200px;
  --gutter:  clamp(1.25rem, 5vw, 3rem);
  --radius:  18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--ff-display);
  background:
    radial-gradient(900px 500px at 78% -8%, rgba(100,220,220,0.10), transparent 60%),
    radial-gradient(700px 700px at 8% 100%, rgba(99,102,241,0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

/* === ФОН-КАРТИНКА: ночное небо, цветкоррекция под нашу палитру === */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("./stars/milkyway.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* цветкор: чуть ярче + холодный циан-индиговый уклон + контраст */
  filter: brightness(0.5) saturate(0.6) hue-rotate(165deg) contrast(1.15);
  opacity: 0.55;
}
/* циан-overlay поверх фото — вытягивает в наш тон, не даёт проступить тёплым цветам */
.starfield::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 35%, rgba(100,220,220,0.06), transparent 70%),
    linear-gradient(to bottom, rgba(2,6,23,0.35) 0%, rgba(2,6,23,0.7) 100%);
}

/* === КООРДИНАТНАЯ СЕТКА (научная, как на фотопластинках неба) === */
.coordgrid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right,  rgba(100, 220, 220, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(100, 220, 220, 0.18) 1px, transparent 1px);
  background-size: 80px 80px;
  /* сдвиг сетки по вертикали на -15% клетки, чтобы линии не выстраивались под навбаром */
  background-position: 0 -12px;
  /* маска: сетка видна сильнее по краям, к центру затухает (имитация виньетки пластинки) */
  mask-image: radial-gradient(ellipse 95% 95% at 50% 50%, transparent 25%, #000 75%);
  -webkit-mask-image: radial-gradient(ellipse 95% 95% at 50% 50%, transparent 25%, #000 75%);
}
/* метки-координаты по краям (RA/Dec каталога) */
.coordgrid::before {
  content: "20ʰ 41ᵐ 25.9ˢ  ·  α Cyg  ·  +45° 16′ 49″";
  position: absolute;
  top: 84px;
  left: 1.5rem;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: rgba(100, 220, 220, 0.45);
  white-space: nowrap;
}
.coordgrid::after {
  content: "PLATE α-CYG-001  ·  exp. 4200s  ·  mag limit +6.5";
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: rgba(100, 220, 220, 0.4);
  white-space: nowrap;
}

/* === МИГАЮЩИЕ ЗВЁЗДЫ (CSS, 9 штук, случайные позиции/тайминги) === */
.twinkle {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.twinkle i {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 4px var(--ink), 0 0 8px var(--accent);
  opacity: 0;
  animation: twinkle 4s ease-in-out infinite;
}
.twinkle i:nth-child(1)  { top: 14%; left: 22%; animation-delay: 0.0s;  animation-duration: 3.2s; }
.twinkle i:nth-child(2)  { top: 28%; left: 71%; animation-delay: 0.8s;  animation-duration: 4.5s; width:3px; height:3px; }
.twinkle i:nth-child(3)  { top: 42%; left: 12%; animation-delay: 1.6s;  animation-duration: 3.8s; }
.twinkle i:nth-child(4)  { top: 19%; left: 88%; animation-delay: 0.4s;  animation-duration: 5.0s; }
.twinkle i:nth-child(5)  { top: 61%; left: 34%; animation-delay: 2.2s;  animation-duration: 3.5s; width:3px; height:3px; }
.twinkle i:nth-child(6)  { top: 73%; left: 78%; animation-delay: 1.2s;  animation-duration: 4.2s; }
.twinkle i:nth-child(7)  { top: 38%; left: 53%; animation-delay: 0.6s;  animation-duration: 5.5s; }
.twinkle i:nth-child(8)  { top: 52%; left: 19%; animation-delay: 2.8s;  animation-duration: 3.0s; }
.twinkle i:nth-child(9)  { top: 84%; left: 47%; animation-delay: 1.8s;  animation-duration: 4.8s; width:3px; height:3px; }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50%      { opacity: 0.95; transform: scale(1.2); }
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* (blobs удалены в v3 — фон через body::before: сетка + россыпь) */

/* --- Layout primitives --- */
.container {
  width: 100%; max-width: var(--maxw);
  margin: 0 auto; padding: 0 var(--gutter);
  position: relative; z-index: 1;
}
section, .section { position: relative; z-index: 1; }
.section { padding: clamp(5rem, 12vh, 9rem) 0; }

.eyebrow {
  font-family: var(--ff-mono); font-size: 0.78rem;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin: 0 0 1.5rem;
}
.eyebrow::before {
  content: ""; width: 28px; height: 1px;
  background: var(--accent); display: inline-block;
}
.eyebrow[data-typed] { visibility: hidden; }
.eyebrow[data-typed].is-ready { visibility: visible; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
.h-section {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 600; max-width: 18ch;
}
.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  color: var(--ink-dim); max-width: 52ch;
  margin: 1.5rem 0 0; font-weight: 300;
}

/* --- NAV (frosted glass, плотный фон — перекрывает координатную сетку) --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--dur) var(--ease-skill), border-color var(--dur) var(--ease-skill);
}
.nav.scrolled {
  background: rgba(2, 6, 23, 0.96);
  border-bottom-color: var(--border);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--ff-mono); font-weight: 700;
  font-size: 0.95rem; letter-spacing: 0.22em; color: var(--ink);
}
.brand small {
  color: var(--ink-mute); font-weight: 400;
  font-size: 0.72rem; letter-spacing: 0.08em;
}
.brand__dot {
  width: 8px; height: 8px; background: var(--accent);
  border-radius: 50%; box-shadow: 0 0 14px var(--accent);
  animation: pulse 2.4s var(--ease-skill) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.75); }
}
.nav__links {
  display: flex; align-items: center; gap: 2rem;
  font-family: var(--ff-mono); font-size: 0.85rem;
}
.nav__links > a:not(.btn) {
  color: var(--ink-dim);
  transition: color 0.2s var(--ease-skill);
  letter-spacing: 0.04em;
}
.nav__links > a:not(.btn):hover { color: var(--accent); }

/* --- BUTTONS (scale-press) --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--ff-mono); font-size: 0.86rem;
  font-weight: 500; letter-spacing: 0.06em;
  padding: 0.85rem 1.5rem; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer;
  transition: all 0.25s var(--ease-skill);
  white-space: nowrap;
}
.btn--sm { padding: 0.6rem 1.1rem; font-size: 0.8rem; }
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--accent); color: var(--bg);
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn--primary:hover {
  box-shadow: 0 0 32px var(--accent-glow), 0 0 0 1px var(--accent);
  transform: translateY(-2px);
}
.btn--primary:active { transform: scale(0.97); }
.btn--ghost {
  border-color: var(--border); color: var(--ink); background: transparent;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn__arrow { transition: transform 0.25s var(--ease-skill); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* --- HERO --- */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
  padding: 120px 0 80px;
}
.hero__inner {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}

.hero__meta {
  font-family: var(--ff-mono); font-size: 0.78rem;
  color: var(--ink-mute); letter-spacing: 0.18em;
  margin-bottom: 2rem;
  display: flex; align-items: center; gap: 0.7rem;
}
.hero__meta b { color: var(--accent); font-weight: 500; }

/* === ЗВЕЗДА ИЗ zai+skill (1-в-1): большая пульсирующая deneb-star === */
.deneb-star {
  position: relative;
  width: 6.5rem; height: 6.5rem;
  margin-bottom: 2rem;
  display: grid;
  place-items: center;
  animation: starPulse 8s ease-in-out infinite;
}
.deneb-star::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, var(--ink) 0 8%, var(--accent) 30%, transparent 68%);
  filter: blur(.4rem);
  opacity: .55;
}
.deneb-star::after {
  content: "";
  width: .9rem; height: .9rem;
  background: var(--ink);
  border-radius: 50%;
  box-shadow:
    0 0 .9rem var(--ink),
    0 0 2.4rem var(--accent),
    0 0 4rem var(--accent);
}
@keyframes starPulse {
  0%, 100% { transform: scale(1); opacity: .92; }
  50%      { transform: scale(1.06); opacity: 1; }
}

.hero__title {
  font-family: var(--ff-logo);
  font-weight: 400;
  font-size: clamp(3rem, 13vw, 10rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 1.2rem;
  position: relative; z-index: 1;
}
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0; width: 100%;
  clip-path: inset(0 0 0 0); opacity: 0.95;
  /* лёгкий постоянный RGB-сдвиг (хром. аберрация) на спокойном состоянии */
  text-shadow: 0 0 0 transparent;
}
.glitch::before {
  color: #ff00c1;
  animation: glitch-x 4.5s infinite steps(1);
  mix-blend-mode: screen;
}
.glitch::after {
  color: var(--accent);
  animation: glitch-y 3.6s infinite steps(1);
  mix-blend-mode: screen;
}
/* X-фантом (пурпурный): одна плотная группа вспышек в конце цикла.
   Спокойное состояние (0–90%) — едва заметный RGB-сдвиг (аберрация вдвое слабее). */
@keyframes glitch-x {
  0%, 90%, 100% { transform: translate(-0.5px, 0); clip-path: inset(0 0 0 0); }
  /* группа вспышек 92–98%, сдвиги уменьшены вдвое (до ~3px) */
  92% { transform: translate(-3px, 1px);  clip-path: inset(15% 0 60% 0); }
  94% { transform: translate(3px, -1px);  clip-path: inset(55% 0 15% 0); }
  96% { transform: translate(-3px, 0);    clip-path: inset(35% 0 45% 0); }
  98% { transform: translate(2px, -1px);  clip-path: inset(10% 0 70% 0); }
}
/* Y-фантом (циан): рассинхрон по фазе, вспышки чуть раньше, мягче */
@keyframes glitch-y {
  0%, 90%, 100% { transform: translate(0.5px, 0); clip-path: inset(0 0 0 0); }
  91% { transform: translate(2px, -1px);  clip-path: inset(70% 0 5% 0); }
  93% { transform: translate(-2px, 1px);  clip-path: inset(25% 0 55% 0); }
  95% { transform: translate(3px, 0);     clip-path: inset(50% 0 30% 0); }
  97% { transform: translate(-2px, 1px);  clip-path: inset(40% 0 35% 0); }
}

.hero__tagline {
  font-family: var(--ff-mono);
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  color: var(--ink-dim); letter-spacing: 0.06em;
  margin: 0 0 0.6rem;
  min-height: 1.4em; white-space: nowrap;
}
.hero__tagline .old-school { color: var(--amber); }
.caret {
  display: inline-block; width: 0.55ch; height: 1.05em;
  background: var(--accent); margin-left: 0.12em;
  vertical-align: text-bottom; transform: translateY(2px);
  animation: caret-blink 0.85s step-end infinite;
}
.caret.is-typing { animation: none; opacity: 1; }
@keyframes caret-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero__sub {
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  color: var(--ink-dim); max-width: 48ch;
  margin: 1.4rem auto 2.6rem; font-weight: 300;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: center; }

.hero__scroll {
  position: absolute; bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  font-family: var(--ff-mono); font-size: 0.72rem;
  letter-spacing: 0.25em; color: var(--ink-mute);
  text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.hero__scroll::after {
  content: ""; width: 1px; height: 36px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-line 2s var(--ease-skill) infinite;
}
@keyframes scroll-line {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* --- GLASS CARDS --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem; margin-top: 3.5rem;
}
.card {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.9rem 2.1rem;
  position: relative; overflow: hidden;
  transition: border-color 0.3s var(--ease-skill),
              transform 0.3s var(--ease-skill),
              background 0.3s var(--ease-skill),
              box-shadow 0.3s var(--ease-skill);
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.3s var(--ease-skill);
}
.card:hover {
  border-color: var(--accent-deep);
  transform: translateY(-4px);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 12px 40px -8px rgba(0,0,0,0.5), 0 0 0 1px var(--accent-glow);
}
.card:hover::before { opacity: 1; }
.card__num {
  font-family: var(--ff-mono); font-size: 0.78rem;
  color: var(--accent); letter-spacing: 0.16em;
  margin-bottom: 1.3rem; display: block;
}
.card__title { font-size: 1.4rem; font-weight: 600; margin-bottom: 0.7rem; letter-spacing: -0.01em; }
.card__desc { color: var(--ink-dim); font-size: 0.96rem; font-weight: 300; margin: 0 0 1.4rem; }
.card__list { list-style: none; padding: 0; margin: 0; font-family: var(--ff-mono); font-size: 0.82rem; color: var(--ink-mute); }
.card__list li { padding: 0.3rem 0; border-top: 1px dashed var(--border-soft); display: flex; justify-content: space-between; }
.card__list li:first-child { border-top: none; }
.card__list li b { color: var(--ink-dim); font-weight: 500; }

/* --- APPROACH --- */
.approach__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  margin-top: 3.5rem;
}
.approach__text p { color: var(--ink-dim); font-size: 1.08rem; font-weight: 300; margin: 0 0 1.3rem; max-width: 52ch; }
.approach__text p strong { color: var(--ink); font-weight: 500; }
.stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.stat {
  background: rgba(11, 17, 32, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2rem 1.6rem;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  gap: 1.4rem; /* зазор цифра ↔ подпись — чтобы блок «дышал» */
  min-height: 8rem; /* единая высота ячейки → содержимое центрируется по вертикали */
}
.stat__val {
  font-family: var(--ff-display); font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700; color: var(--accent); line-height: 1; letter-spacing: -0.03em;
  /* компенсируем шрифтовой «хвост» под базовой линией, чтобы визуальный центр
     цифры совпал с центром подписи */
  margin: 0;
}
.stat__val sup { font-size: 0.4em; color: var(--ink-mute); font-weight: 400; vertical-align: 0.5em; margin-left: 0.2em; }
.stat__label { font-family: var(--ff-mono); font-size: 0.78rem; color: var(--ink-mute); letter-spacing: 0.1em; text-transform: uppercase; }

/* --- STACK --- */
.stack__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem; margin-top: 3.5rem;
}
.tech {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 1.2rem 1.3rem; font-family: var(--ff-mono);
  transition: all 0.25s var(--ease-skill);
  background: rgba(11, 17, 32, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tech:hover {
  border-color: var(--accent); color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -6px rgba(0,0,0,0.4);
}
.tech__name { font-size: 0.98rem; font-weight: 500; color: var(--ink); }
.tech:hover .tech__name { color: var(--accent); }
.tech__cat { font-size: 0.72rem; color: var(--ink-mute); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 0.4rem; }

/* --- CONTACT --- */
.contact {
  background:
    radial-gradient(ellipse 60% 50% at 50% 100%, var(--accent-glow), transparent 70%),
    var(--bg);
  border-top: 1px solid var(--border);
}
.contact__inner { text-align: center; max-width: 640px; margin: 0 auto; }
.contact__title { font-size: clamp(2.2rem, 5.5vw, 3.8rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.contact__title .accent { color: var(--accent); }
.contact__sub { color: var(--ink-dim); font-size: 1.1rem; font-weight: 300; margin: 1.4rem auto 2.4rem; max-width: 44ch; }
.contact__cta { display: inline-flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.contact__channels { margin-top: 3rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; font-family: var(--ff-mono); font-size: 0.86rem; color: var(--ink-mute); }
.contact__channels a { color: var(--ink-dim); transition: color 0.2s var(--ease-skill); letter-spacing: 0.04em; }
.contact__channels a:hover { color: var(--accent); }

/* --- REVEAL (stagger по скиллу: back.out) --- */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity var(--dur) var(--ease-back), transform var(--dur) var(--ease-back);
}
.reveal.in { opacity: 1; transform: none; }
.stagger > * {
  opacity: 0; transform: translateY(16px) scale(0.92);
  transition: opacity 0.45s var(--ease-back), transform 0.45s var(--ease-back);
}
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(1) { transition-delay: 0.00s; }
.stagger.in > *:nth-child(2) { transition-delay: 0.06s; }
.stagger.in > *:nth-child(3) { transition-delay: 0.12s; }
.stagger.in > *:nth-child(4) { transition-delay: 0.18s; }
.stagger.in > *:nth-child(5) { transition-delay: 0.24s; }
.stagger.in > *:nth-child(6) { transition-delay: 0.30s; }
.stagger.in > *:nth-child(7) { transition-delay: 0.36s; }
.stagger.in > *:nth-child(8) { transition-delay: 0.42s; }
.stagger.in > *:nth-child(9) { transition-delay: 0.48s; }
.stagger.in > *:nth-child(n+10) { transition-delay: 0.54s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .stagger > * { opacity: 1 !important; transform: none !important; }
  .eyebrow[data-typed] { visibility: visible; }
}

@media (max-width: 860px) {
  .nav__links > a:not(.btn) { display: none; }
  .approach__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  /* на мобиле цифра и подпись — по центру карточки, как единый блок */
  .stat { align-items: center; text-align: center; }
}

/* footer удалён — был пустым */


/* ==========================================================================
   PORTFOLIO — каталог-реестр избранных работ + модалки кейсов (<dialog>)
   Стилистика продолжает звёздную метафору: работы = объекты каталога.
   ========================================================================== */

/* Шапка-описатель каталога: колонтитул звёздного атласа */
.cat__head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 1rem;
  margin-top: 3.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.cat__head b { color: var(--accent); font-weight: 500; }
.cat__head span { color: var(--ink-mute); }

/* Реестр — таблица-каталог объектов */
.catalog {
  margin-top: 0;
  border-top: 1px solid var(--border-soft);
}
.cat__row {
  display: grid;
  grid-template-columns:
    minmax(64px, 0.4fr)   /* id      */
    minmax(220px, 1.8fr)  /* объект  */
    minmax(130px, 1fr)    /* тип     */
    minmax(100px, 0.8fr)  /* контекст*/
    minmax(80px, 0.6fr);  /* статус  */
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 0.5rem;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--ff-mono);
  color: var(--ink-dim);
  position: relative;
  transition: background 0.25s var(--ease-skill),
              color 0.25s var(--ease-skill);
  text-decoration: none;
  cursor: pointer;
}
/* верхняя световая линия при ховере — как у .card::before */
.cat__row::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.25s var(--ease-skill);
}
.cat__row:hover {
  background: rgba(100, 220, 220, 0.05);
  color: var(--ink);
}
.cat__row:hover::before { opacity: 1; }

/* Колонки */
.cat__id {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
}
.cat__obj {
  display: flex; flex-direction: column; gap: 0.3rem;
}
.cat__name {
  font-family: var(--ff-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
  transition: color 0.25s var(--ease-skill);
}
.cat__row:hover .cat__name { color: var(--accent); }
.cat__sub {
  font-size: 0.78rem;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  font-weight: 300;
}
.cat__type {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cat__scope {
  font-size: 0.78rem;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
}
.cat__status {
  font-size: 0.78rem;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
}
.cat__status b { color: var(--accent); font-weight: 500; }
.cat__status--mobile b { color: var(--amber); }
.cat__status--review b { color: var(--indigo); }

/* (стрелка-переход .cat__go убрана — наезжала на столбец статуса) */

/* Колонтитул внизу каталога */
.cat__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.cat__foot a { color: var(--ink-dim); transition: color 0.2s var(--ease-skill); }
.cat__foot a:hover { color: var(--accent); }

/* Адаптив каталога: на мобиле — читаемая карточка вместо разброса по grid.
   DOM-порядок сохраняем (id, obj, type, scope, status); раскладку собираем
   через flex-wrap, чтобы id и статус встали в одну верхнюю строку. */
@media (max-width: 720px) {
  .cat__row {
    display: flex; flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.6rem; row-gap: 0.3rem;
    padding: 1.2rem 0.5rem;
  }
  /* верхняя строка: id + статус (status прижимается вправо) */
  .cat__id { order: 1; }
  .cat__status { order: 2; margin-left: auto; }
  /* основное тело карточки: название + подпись */
  .cat__obj { order: 3; flex-basis: 100%; }
  .cat__name { font-size: 1.15rem; }
  /* нижняя мета-строка: тип и scope идут подряд */
  .cat__type { order: 4; }
  .cat__scope { order: 5; }
  .cat__type::after { content: " · "; color: var(--ink-mute); }
}

/* --- МОДАЛКА КЕЙСА: нативный <dialog> (закреплённый вариант) --- */
.case {
  width: min(680px, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7),
              0 0 0 1px var(--accent-glow);
  padding: 0;
  color: var(--ink);
  font-family: var(--ff-display);
}
.case__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 1.8rem 1.2rem;
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
}
.case__id {
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}
.case__title {
  font-family: var(--ff-display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 0.4rem;
}
.case__meta {
  font-family: var(--ff-mono);
  font-size: 0.76rem;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
}
.case__meta b { color: var(--ink-dim); font-weight: 500; }
.case__close {
  flex: none;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink-dim);
  font-size: 1.1rem; line-height: 1;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s var(--ease-skill),
              color 0.2s var(--ease-skill),
              background 0.2s var(--ease-skill);
}
.case__close:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(100,220,220,0.06);
}
.case__body { padding: 1.4rem 1.8rem 1.8rem; }
.case__block { margin-bottom: 1.4rem; }
.case__block:last-child { margin-bottom: 0; }
.case__label {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}
.case__text {
  color: var(--ink-dim);
  font-size: 0.98rem;
  font-weight: 300;
  line-height: 1.6;
  max-width: 56ch;
}
.case__text strong { color: var(--ink); font-weight: 400; }
.case__list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--ink-dim);
  font-size: 0.98rem;
  font-weight: 300;
  line-height: 1.6;
}
.case__list li + li { margin-top: 0.35rem; }
.case__list strong { color: var(--ink); font-weight: 400; }
.case__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.case__tag {
  font-family: var(--ff-mono);
  font-size: 0.76rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink-dim);
  background: rgba(11,17,32,0.5);
  letter-spacing: 0.04em;
}
.case__shot {
  margin: 1.6rem 0 0;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(11,17,32,0.4);
}
.case__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* скриншот кейса кликабелен: открывает сайт в новой вкладке */
.case__shot-link {
  display: block;
  width: 100%;
  height: 100%;
}
.case__shot-link img {
  transition: opacity 0.25s ease;
}
.case__shot-link:hover img,
.case__shot-link:focus-visible img {
  opacity: 0.8;
}
.case__caption {
  margin: 0.65rem 0 0;
  color: var(--ink-mute);
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
}
.case__foot {
  padding: 1rem 1.8rem 1.6rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* <dialog>-специфика: прозрачный фон контейнера (::backdrop даёт затемнение) */
dialog.case {
  background: transparent;
  border: none; padding: 0;
  margin: auto;
}
dialog.case::backdrop {
  background: rgba(2,6,23,0.78);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  animation: bd-in 0.25s var(--ease-skill);
}
dialog.case[open] { animation: case-in 0.3s var(--ease-back); }
@keyframes case-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes bd-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  dialog.case[open],
  dialog.case::backdrop { animation: none; }
}
