/* ============================================================
   ГРАФФИТИ — сайт-портфолио
   ============================================================

   ПАЛИТРА: чтобы поменять цвета всего сайта — поменяй переменные
   в :root ниже. Три готовые палитры из референсов — закомментированы
   прямо под основной, раскомментируй нужную.
   ============================================================ */

:root {
  /* ── ПАЛИТРА «ШАЛФЕЙ + ТЕРРАКОТА» (актуальная: бежевый и зелёный поменяны
        местами — фон зелёный, поверхности секций бежевые) ── */
  --bg:        #8DA28C;   /* фон — шалфейный зелёный (палитра_3) */
  --surface:   #E5D2BD;   /* карточки, секции — бежевый (бывший фон) */
  --ink:       #241A12;   /* основной текст — тёмный шоколад */
  --accent:    #CD682C;   /* терракота — акцент */
  --accent-2:  #B5331B;   /* красный — hover */
  --muted:     #454D3B;   /* второстепенный текст — тёмная олива */
  --line:      rgba(36, 26, 18, .18);
  --dark:      #1A241C;   /* тёмные секции — глубокий лес */
  --dark-ink:  #E5D2BD;   /* текст на тёмном — бежевый */

  /* ── Готовые палитры из референсов. Чтобы переключиться — закомментируй
        блок выше и раскомментируй нужный целиком. Внутри блока нет вложенных
        комментариев (CSS их не поддерживает — иначе «закрытые» значения
        просачиваются в активные). ──

  ПАЛИТРА «ТЕРРАКОТА» (исходная: бежевый фон):
  --bg:        #E5D2BD;   // крем
  --surface:   #EFE0CB;
  --ink:       #241A12;
  --accent:    #CD682C;   // терракота
  --accent-2:  #B5331B;   // красный
  --muted:     #8A6A4F;
  --line:      rgba(36, 26, 18, .18);
  --dark:      #1C130C;
  --dark-ink:  #E5D2BD;

  ПАЛИТРА «ПРАГА» (палитра_2: copper / patina / gothic black):
  --bg:        #E8DFD3;
  --surface:   #F2ECE1;
  --ink:       #333333;
  --accent:    #A35846;   // copper
  --accent-2:  #5B9B8A;   // patina
  --muted:     #78726D;   // cobblestone
  --line:      rgba(51, 51, 51, .2);
  --dark:      #1E1B18;
  --dark-ink:  #EDE6DA;

  ПАЛИТРА «САД» (палитра_3: sage / monarch):
  --bg:        #EEE9C1;   // muted
  --surface:   #F5F0D4;
  --ink:       #3A230A;   // monarch
  --accent:    #8DA28C;   // sage
  --accent-2:  #A4530C;   // monarch orange
  --muted:     #7A6A45;
  --line:      rgba(58, 35, 10, .2);
  --dark:      #2A1B08;
  --dark-ink:  #EEE9C1;
  */

  /* ── Типографика и геометрия (не палитра, но тоже меняется в одном месте) ── */
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --radius: 18px;
  --pad-x: clamp(20px, 5vw, 72px);
  --header-h: 76px;
}

/* ============ БАЗА ============ */

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: var(--accent); color: #fff; }

.wrap {
  width: min(1280px, 100%);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

section { padding-block: clamp(72px, 10vw, 140px); }

/* Заголовки секций: маленький номер + крупный заголовок */
.sec-head { margin-bottom: clamp(40px, 6vw, 72px); }
.sec-head .kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px; font-weight: 600;
}
.sec-head .kicker::before {
  content: ""; width: 34px; height: 2px; background: var(--accent);
}
.sec-head h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 5.4vw, 62px);
  line-height: 1.08; font-weight: 700; letter-spacing: -.01em;
}

/* ============ ШАПКА / НАВИГАЦИЯ ============ */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  width: min(1280px, 100%); margin-inline: auto;
  padding-inline: var(--pad-x);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.logo {
  font-family: var(--font-display); font-weight: 700;
  font-size: 19px; letter-spacing: .04em; position: relative;
}
.logo em { font-style: normal; color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 34px); }
.nav-links a {
  font-size: 14.5px; font-weight: 600; letter-spacing: .02em;
  position: relative; padding-block: 6px; color: var(--ink); opacity: .82;
  transition: opacity .2s, color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: right; transition: transform .3s ease;
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.ext { color: var(--accent-2); opacity: 1; }

/* Бургер */
.burger {
  display: none; width: 44px; height: 44px; border: 1.5px solid var(--ink);
  background: none; cursor: pointer; border-radius: 50%; position: relative; z-index: 120;
}
.burger span {
  position: absolute; left: 50%; top: 50%; width: 18px; height: 2px;
  background: var(--ink); transform: translate(-50%, -50%); transition: .3s;
}
.burger span:nth-child(1) { transform: translate(-50%, -8px); }
.burger span:nth-child(2) { transform: translate(-50%, 8px); }
.burger.open span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.burger.open span:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg); }

/* Мобильное меню */
.mobile-menu {
  position: fixed; inset: 0; z-index: 110; background: var(--dark);
  color: var(--dark-ink); display: flex; flex-direction: column;
  justify-content: center; padding: var(--pad-x);
  clip-path: circle(0 at calc(100% - 42px) 38px);
  transition: clip-path .55s cubic-bezier(.7, 0, .2, 1);
  visibility: hidden;
}
.mobile-menu.open { clip-path: circle(150% at calc(100% - 42px) 38px); visibility: visible; }
.mobile-menu a {
  font-family: var(--font-display); font-size: clamp(26px, 7vw, 40px);
  padding-block: 10px; opacity: .9; border-bottom: 1px solid rgba(255,255,255,.08);
}
.mobile-menu a:hover { color: var(--accent); }

/* ============ HERO ============ */

.hero {
  min-height: 100vh;
  min-height: 100svh; display: flex; align-items: center;
  padding-top: var(--header-h); position: relative; overflow: hidden;
}

.hero .wrap { width: 100%; }

.hero-label {
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 13px; letter-spacing: .28em; text-transform: uppercase;
  font-weight: 700; color: var(--muted); margin-bottom: 28px;
}
.hero-label::before { content: ""; width: 40px; height: 2px; background: var(--accent); }

.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(52px, 13vw, 168px); line-height: .98; letter-spacing: -.02em;
  text-transform: uppercase;
}
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; }

/* Слово с «разрисовкой ручкой» */
.scribbled { position: relative; display: inline-block; color: var(--accent-2); }
.scribbled svg {
  position: absolute; left: -6%; bottom: -14%; width: 112%; height: auto;
  overflow: visible; pointer-events: none;
}
.scribbled path {
  fill: none; stroke: var(--accent); stroke-width: 5;
  stroke-linecap: round; opacity: .9;
}

.hero-sub {
  margin-top: 34px; max-width: 520px; font-size: clamp(16px, 2vw, 19px);
  color: var(--muted); font-weight: 500;
}

.hero-cta { margin-top: 44px; display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 30px; border-radius: 999px; font-weight: 700; font-size: 15px;
  border: 1.5px solid var(--ink); cursor: pointer; transition: .25s;
  background: transparent; color: var(--ink); letter-spacing: .02em;
}
.btn:hover { background: var(--ink); color: var(--bg); transform: translateY(-2px); }
.btn.solid { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.solid:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn .arr { transition: transform .25s; }
.btn:hover .arr { transform: translateX(4px); }

/* Индикатор скролла */
.scroll-hint {
  position: absolute; bottom: 34px; left: var(--pad-x);
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
}
.scroll-hint .wheel {
  width: 22px; height: 34px; border: 1.5px solid var(--muted); border-radius: 12px;
  position: relative;
}
.scroll-hint .wheel::after {
  content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 8px;
  background: var(--muted); border-radius: 2px; transform: translateX(-50%);
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 0%,100% { opacity: 1; top: 7px; } 50% { opacity: .2; top: 16px; } }

/* Декоративные «капли краски» в hero */
.blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; pointer-events: none; }
.blob.b1 { width: 220px; height: 220px; right: 8%; top: 18%; background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%); }
.blob.b2 { width: 140px; height: 140px; right: 26%; bottom: 22%; background: radial-gradient(circle at 30% 30%, var(--accent-2), transparent 70%); opacity: .35; }

/* ============ ОБО МНЕ ============ */

.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(36px, 5vw, 72px); align-items: center; }

.about-text p { font-size: clamp(16px, 1.8vw, 19px); color: var(--muted); margin-bottom: 20px; }
.about-text p strong { color: var(--ink); }

.stats { display: flex; gap: clamp(24px, 4vw, 56px); margin-top: 36px; flex-wrap: wrap; }
.stat b { font-family: var(--font-display); font-size: clamp(28px, 4vw, 46px); display: block; color: var(--ink); }
.stat b i { font-style: normal; color: var(--accent-2); }
.stat span { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.about-photo { position: relative; }
.about-photo .frame {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5;
  border: 1px solid var(--line); box-shadow: 12px 12px 0 var(--accent-2);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo .tag {
  position: absolute; left: -14px; bottom: 28px; background: var(--ink); color: var(--bg);
  padding: 10px 20px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .1em;
}

/* ============ РАБОТЫ — список-строки (концепт «структура 1») ============ */

.works { background: var(--surface); }

.work-list { border-top: 1px solid var(--line); position: relative; }

.work-row {
  display: grid; grid-template-columns: 64px 1fr auto auto 40px;
  align-items: center; gap: clamp(12px, 2.5vw, 32px);
  padding: clamp(20px, 3vw, 34px) 8px;
  border-bottom: 1px solid var(--line); cursor: pointer; position: relative;
  transition: padding .3s ease, color .3s ease;
}

.work-row .num { font-family: var(--font-display); font-size: 14px; color: var(--muted); }
.work-row .title { font-family: var(--font-display); font-size: clamp(20px, 3.4vw, 40px); line-height: 1.1; transition: transform .3s ease, color .3s; }
.work-row .meta { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.work-row .year { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.work-row .go {
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line);
  display: grid; place-items: center; transition: .3s; font-size: 16px;
}

.work-row:hover { padding-left: 24px; }
.work-row:hover .title { color: var(--accent-2); transform: translateX(6px); }
.work-row:hover .go { background: var(--accent-2); border-color: var(--accent-2); color: #fff; transform: rotate(45deg); }

/* Плавающее превью при наведении (десктоп) */
.work-preview {
  position: fixed; z-index: 90; width: min(340px, 26vw); aspect-ratio: 4/3;
  border-radius: 14px; overflow: hidden; pointer-events: none;
  opacity: 0; transform: scale(.85) rotate(-4deg); transition: opacity .25s, transform .35s cubic-bezier(.2,.8,.3,1);
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.work-preview.show { opacity: 1; transform: scale(1) rotate(-2deg); }
.work-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ============ НАВЫКИ — чипы (элементы_2) ============ */

.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 72px); }

.skill-group h3 {
  font-size: 14px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 24px; font-weight: 700;
}

.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  padding: 12px 22px; border-radius: 999px; border: 1.5px solid var(--line);
  font-weight: 600; font-size: 15px; transition: .25s; background: transparent;
}
.chip:hover { border-color: var(--accent-2); color: var(--accent-2); transform: translateY(-3px) rotate(-1deg); }
.chip.hot { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.hot:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

/* ============ ГАЛЕРЕЯ — сетка (элементы_3) ============ */

.gallery { background: var(--dark); color: var(--dark-ink); }
.gallery .sec-head h2 { color: var(--dark-ink); }
.gallery .sec-head .kicker { color: color-mix(in srgb, var(--dark-ink) 55%, transparent); }

.gallery-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 1.6vw, 20px);
}
.g-item { position: relative; overflow: hidden; border-radius: 12px; aspect-ratio: 3/4; }
.g-item.wide { grid-column: span 2; aspect-ratio: auto; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.8,.3,1), filter .5s; }
.g-item:hover img { transform: scale(1.07); filter: saturate(1.15); }
.g-item .cap {
  position: absolute; inset: auto 0 0 0; padding: 40px 18px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  opacity: 0; transform: translateY(12px); transition: .4s;
}
.g-item:hover .cap { opacity: 1; transform: none; }

/* ============ КОНТАКТЫ ============ */

.contacts { text-align: center; }
.contacts .big-mail {
  display: inline-block; margin-top: 28px;
  font-family: var(--font-display); font-size: clamp(24px, 5.6vw, 68px);
  color: var(--ink); position: relative; transition: color .3s; letter-spacing: -.01em;
}
.contacts .big-mail:hover { color: var(--accent-2); }

.socials { display: flex; justify-content: center; gap: 14px; margin-top: 48px; flex-wrap: wrap; }
.socials a {
  padding: 13px 26px; border-radius: 999px; border: 1.5px solid var(--line);
  font-weight: 700; font-size: 14px; letter-spacing: .06em; transition: .25s;
}
.socials a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: translateY(-3px); }

/* ============ ФУТЕР ============ */

.site-footer {
  border-top: 1px solid var(--line); padding-block: 30px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 13.5px; color: var(--muted); flex-wrap: wrap;
}

/* ============ АНИМАЦИИ ПОЯВЛЕНИЯ (управляется из main.js) ============
   Класс .js-anim вешается на <body> сразу при парсинге main.js.
   Пока он есть — элементы скрыты; anime.js (или страховка) их показывает.
   Если JS не сработал вовсе — класс не вешается, всё видно сразу. */

.js-anim [data-reveal] { opacity: 0; transform: translateY(34px); }
.js-anim [data-reveal].in { opacity: 1; transform: none; transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.3,1); }
.js-anim [data-reveal].in.d1 { transition-delay: .1s; }
.js-anim [data-reveal].in.d2 { transition-delay: .2s; }
.js-anim [data-reveal].in.d3 { transition-delay: .3s; }

/* Строки hero: прячем до старта anime.js (overflow:hidden уже в .line) */
.js-anim [data-hero-line] { opacity: 0; transform: translateY(110%); }

/* Штрих «маркера»: без anime.js показываем готовый, не пустой */
.scribbled path { stroke-dasharray: 400; }
.js-anim .scribbled path { stroke-dashoffset: 400; }
body:not(.js-anim) .scribbled path { stroke-dasharray: none; }

/* ============ СТРАНИЦА «ПРОЕКТЫ»: фильтры и секции (projects.js) ============ */

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px;
}
.filter-chip { cursor: pointer; }
.filter-chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter-chip.active:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

.filter-count {
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: clamp(32px, 5vw, 56px); min-height: 1.4em;
}

.project-section { margin-bottom: clamp(56px, 8vw, 104px); }
.project-section:last-child { margin-bottom: 0; }

.projects-fallback {
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: clamp(28px, 5vw, 48px); text-align: center;
}
.projects-fallback p + p { margin-top: 12px; }
.projects-fallback code, .hero-sub code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85em;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  padding: 2px 7px; border-radius: 6px;
}

/* ============ СТРАНИЦА «АЛЬБОМ» (album.js) ============ */

/* Панорама-обложка: во весь экран, текст поверх */
.album-hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; overflow: hidden;
  padding-top: var(--header-h); background: var(--dark);
}
.album-cover {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.album-hero-veil {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.18) 45%, rgba(0,0,0,.62) 100%);
}
.album-hero-text { position: relative; z-index: 2; color: #fff; }
.album-hero-text .hero-label { color: rgba(255,255,255,.75); }
.album-hero-text .hero-label::before { background: var(--accent); }
.album-hero-text h1 {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(34px, 7vw, 88px); line-height: 1.02; letter-spacing: -.015em;
  max-width: 16ch; text-shadow: 0 2px 30px rgba(0,0,0,.45);
}
.album-hero-text .hero-sub { color: rgba(255,255,255,.85); }
.album-hero .btn { border-color: rgba(255,255,255,.7); color: #fff; }
.album-hero .btn:hover { background: #fff; border-color: #fff; color: var(--ink); }
.album-hero .btn.solid { background: var(--accent-2); border-color: var(--accent-2); }
.album-hero .btn.solid:hover { background: #fff; border-color: #fff; color: var(--ink); }
.album-hero .scroll-hint { color: rgba(255,255,255,.7); }
.album-hero .scroll-hint .wheel { border-color: rgba(255,255,255,.7); }
.album-hero .scroll-hint .wheel::after { background: rgba(255,255,255,.8); }

/* Сетка альбома: те же g-item, но с подписью всегда видимой на тач-устройствах */
.album-grid .g-item { cursor: zoom-in; }
@media (hover: none) {
  .album-grid .g-item .cap { opacity: 1; transform: none; }
}

/* Экран выбора альбома */
.picker-cap { opacity: 1; transform: none; padding: 56px 20px 18px; }
.picker-cap small { display: block; margin-top: 6px; font-size: 12px; letter-spacing: .08em; opacity: .75; text-transform: none; }

/* Секция скачивания */
.download-wrap { max-width: 860px; }
.download-hint { color: color-mix(in srgb, var(--dark-ink) 75%, transparent); font-size: 16px; max-width: 480px; }
.download-cta { margin-top: 36px; }
.btn.big { padding: 20px 44px; font-size: 17px; }

/* Форматы после ввода кода */
.download-formats { margin-top: 48px; }
.formats-title {
  font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
  color: color-mix(in srgb, var(--dark-ink) 60%, transparent); margin-bottom: 20px; font-weight: 700;
}
.format-cards { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2.5vw, 24px); }
.format-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  text-align: left; padding: clamp(20px, 3vw, 30px); border-radius: var(--radius);
  background: color-mix(in srgb, var(--dark-ink) 8%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--dark-ink) 28%, transparent);
  color: var(--dark-ink); cursor: pointer; transition: .25s;
}
.format-card:hover { border-color: var(--accent); background: color-mix(in srgb, var(--dark-ink) 14%, transparent); transform: translateY(-3px); }
.format-card .fc-name { font-family: var(--font-display); font-size: clamp(17px, 2.4vw, 22px); font-weight: 700; }
.format-card .fc-desc { font-size: 13.5px; color: color-mix(in srgb, var(--dark-ink) 68%, transparent); }
.format-card .fc-arr { margin-top: auto; font-size: 20px; color: var(--accent); transition: transform .25s; }
.format-card:hover .fc-arr { transform: translateY(4px); }

.download-status {
  margin-top: 28px; min-height: 1.5em; font-size: 14.5px;
  color: color-mix(in srgb, var(--dark-ink) 80%, transparent);
}

/* Модалка ввода кода */
.code-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.code-modal[hidden] { display: none; }
.code-backdrop { position: absolute; inset: 0; background: rgba(10,8,6,.55); backdrop-filter: blur(4px); opacity: 0; transition: opacity .25s; }
.code-modal.open .code-backdrop { opacity: 1; }
.code-card {
  position: relative; width: min(460px, 100%);
  background: var(--surface); color: var(--ink); border-radius: var(--radius);
  padding: clamp(28px, 5vw, 44px); box-shadow: 0 30px 80px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(24px) scale(.96); transition: .3s cubic-bezier(.2,.8,.3,1);
}
.code-modal.open .code-card { opacity: 1; transform: none; }
.code-card h3 { font-family: var(--font-display); font-size: clamp(24px, 4vw, 32px); margin-bottom: 10px; }
.code-card .kicker { color: var(--muted); margin-bottom: 12px; }
.code-sub { color: var(--muted); font-size: 14.5px; margin-bottom: 24px; }
.code-input {
  width: 100%; padding: 16px 20px; border-radius: 999px;
  border: 1.5px solid var(--line); background: color-mix(in srgb, var(--bg) 40%, transparent);
  font: inherit; font-size: 17px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s;
}
.code-input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 18%, transparent); }
.code-input.shake { animation: shake .45s; border-color: var(--accent-2); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
.code-error { color: var(--accent-2); font-size: 13.5px; margin-top: 12px; }
.code-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.code-close {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
  border-radius: 50%; border: 1.5px solid var(--line); background: none;
  font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink); transition: .2s;
}
.code-close:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Лайтбокс */
.lightbox {
  position: fixed; inset: 0; z-index: 190; display: grid; place-items: center;
  background: rgba(8,6,4,.9); padding: clamp(16px, 4vw, 48px);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: 8px; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.lightbox .lb-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.7); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.lightbox .lb-close { position: absolute; top: 18px; right: 20px; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.4); background: none; color: #fff; font-size: 22px; cursor: pointer; transition: .2s; }
.lightbox .lb-close:hover { background: #fff; color: #000; border-color: #fff; }

/* ============ АДАПТИВ ============ */

@media (max-width: 980px) {
  .nav-links { display: none; }
  .burger { display: block; }

  .about-grid, .skills-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 480px; }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .g-item.wide { grid-column: span 2; aspect-ratio: 16/9; }

  .work-row { grid-template-columns: 40px 1fr auto; }
  .work-row .meta { display: none; }

  .format-cards { grid-template-columns: 1fr; }
  .album-hero-text h1 { font-size: clamp(30px, 9vw, 56px); }

  .hero h1 { font-size: clamp(48px, 15vw, 96px); }
}

@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .g-item, .g-item.wide { aspect-ratio: 4/3; grid-column: span 1; }
  .work-row { grid-template-columns: 32px 1fr 32px; }
  .work-row .year { display: none; }
  .scroll-hint { display: none; }
}

/* Уважение к prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
html { scroll-behavior: auto; }
*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
[data-reveal], [data-hero-line] { opacity: 1 !important; transform: none !important; }
.scribbled path { stroke-dashoffset: 0 !important; }
}
