/* ═══════════════════════════════════════════════════════════
   1704 — личное портфолио
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg: #0a0a0c;
  --bg-2: #101014;
  --card: #141419;
  --card-2: #1a1a21;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f3f3f6;
  --muted: #9b9ba8;
  --accent: #c8ff3d;
  --accent-ink: #0a0a0c;
  --accent-text: #c8ff3d;
  --accent-soft: rgba(200, 255, 61, .12);
  --live: #3ddc84;
  --dev: #ffb547;
  --radius: 22px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f3ee;
  --bg-2: #ecebe4;
  --card: #ffffff;
  --card-2: #f7f6f1;
  --line: rgba(10, 10, 12, .08);
  --line-2: rgba(10, 10, 12, .16);
  --text: #111114;
  --muted: #5e5e69;
  --accent: #c8ff3d;
  --accent-ink: #0a0a0c;
  --accent-text: #3d6b00;
  --accent-soft: rgba(120, 170, 0, .12);
  --shadow: 0 30px 70px -35px rgba(20, 20, 30, .25);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 1em; height: 1em; flex: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1200px, 100% - 48px); margin-inline: auto; }
.container--narrow { width: min(820px, 100% - 48px); }
.muted { color: var(--muted); }
.accent-text { color: var(--accent-text); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Шум поверх всего — «плёночная» фактура */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
  pointer-events: none; z-index: 0; opacity: 0; transition: opacity .5s;
  transform: translate3d(var(--x, -999px), var(--y, -999px), 0);
}
body.has-pointer .cursor-glow { opacity: 1; }
main, .footer { position: relative; z-index: 1; }

/* ── Кнопки ─────────────────────────────────────────────── */
.btn {
  --h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; letter-spacing: .01em; white-space: nowrap;
  transition: transform .35s var(--ease), background .25s, color .25s, border-color .25s, box-shadow .35s;
}
.btn svg { font-size: 18px; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn--sm { --h: 38px; padding: 0 16px; font-size: 14px; }
.btn--lg { --h: 56px; padding: 0 28px; font-size: 16px; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { box-shadow: 0 12px 40px -10px var(--accent); transform: translateY(-2px); }
.btn--ghost { border-color: var(--line-2); background: transparent; }
.btn--ghost:hover { border-color: var(--text); background: var(--text); color: var(--bg); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent;
  display: grid; place-items: center; font-size: 18px; transition: .25s;
}
.icon-btn:hover { border-color: var(--text); }
.link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 600; }
.link:hover svg { transform: translate(2px, -2px); }
.link svg { transition: transform .3s var(--ease); }

/* ── Шапка ──────────────────────────────────────────────── */
.header { position: fixed; inset: 0 0 auto; z-index: 50; transition: background .3s, border-color .3s, backdrop-filter .3s; border-bottom: 1px solid transparent; }
.header.is-scrolled { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-color: var(--line); }
.header__in { display: flex; align-items: center; gap: 24px; height: 76px; }
.logo { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; }
.logo__mark {
  font: 800 14px/1 var(--display); letter-spacing: .02em; padding: 9px 10px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); transition: transform .5s var(--ease);
}
.logo:hover .logo__mark { transform: rotate(-8deg) scale(1.06); }
.logo__name { font-size: 15px; }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav a:not(.btn) { padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--muted); transition: color .2s, background .2s; }
.nav a:not(.btn):hover { color: var(--text); background: var(--line); }
.nav__cta { margin-left: 8px; }
.header__actions { display: flex; gap: 8px; align-items: center; }
.lang { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.lang a { font: 600 11px/1 'JetBrains Mono', monospace; letter-spacing: .04em; padding: 7px 8px; border-radius: 999px; color: var(--muted); text-decoration: none; transition: color .2s, background .2s; }
.lang a:hover { color: var(--text); }
.lang a.is-active { background: var(--text); color: var(--bg); }
[data-theme="dark"] .i-sun, [data-theme="light"] .i-moon { display: none; }
.i-sun, .i-moon { display: grid; }
.burger { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.burger span { width: 16px; height: 1.5px; background: currentColor; transition: transform .3s var(--ease); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ── Анимации появления ─────────────────────────────────── */
.intro { opacity: 0; transform: translateY(24px); animation: rise .9s var(--ease) forwards; animation-delay: var(--d, 0ms); }
.line { display: block; overflow: hidden; padding-bottom: .06em; }
.line > span { display: inline-block; transform: translateY(110%); animation: lineUp 1.1s var(--ease) forwards; animation-delay: var(--d, 0ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes lineUp { to { transform: none; } }
.js .reveal { opacity: 0; }
.js .reveal.in { opacity: 1; animation: revealUp .9s var(--ease) var(--d, 0ms) backwards; }
@keyframes revealUp { from { opacity: 0; transform: translateY(40px); } }

/* ── Hero ───────────────────────────────────────────────── */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 130px 0 60px; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.blob--1 { width: 520px; height: 520px; background: var(--accent); opacity: .16; top: -140px; right: -80px; animation: drift 18s ease-in-out infinite alternate; }
.blob--2 { width: 420px; height: 420px; background: #6f5bff; opacity: .16; bottom: -160px; left: -120px; animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(-80px, 60px) scale(1.15); } }
.grid-lines {
  position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
}
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; border-radius: 999px; border: 1px solid var(--line-2); font: 500 13px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; background: color-mix(in srgb, var(--card) 60%, transparent); backdrop-filter: blur(8px); }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.hero__title { font: 800 clamp(40px, 6.2vw, 100px)/.95 var(--display); overflow-wrap: anywhere; letter-spacing: -.045em; margin: 26px 0 28px; }
.outline { color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.hero__role { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; font-size: 19px; font-weight: 600; margin: 0 0 18px; }
.hero__role mark { background: var(--accent); color: var(--accent-ink); padding: 4px 12px; border-radius: 8px; }
.hero__loc { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; font-size: 16px; }
.hero__tagline { max-width: 560px; font-size: 19px; color: var(--muted); margin: 0 0 36px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__visual { display: grid; place-items: center; }
.avatar { position: relative; width: min(360px, 28vw); aspect-ratio: 1; }
.avatar img, .avatar__ph {
  position: absolute; inset: 14%; width: 72%; height: 72%; object-fit: cover; border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  animation: morph 12s ease-in-out infinite; box-shadow: var(--shadow);
}
.avatar__ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #6f5bff); color: var(--accent-ink); font: 800 120px/1 var(--display); }
@keyframes morph {
  0%, 100% { border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; }
  50% { border-radius: 58% 42% 45% 55% / 55% 58% 42% 45%; }
}
.avatar__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 26s linear infinite; }
.avatar__ring text { font: 600 10.5px var(--mono); letter-spacing: .28em; fill: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 80px 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
.counters > div { background: var(--bg); padding: 24px 28px; transition: background .3s; }
.counters > div:hover { background: var(--card); }
.counters dt { font: 700 clamp(36px, 5vw, 56px)/1 var(--display); letter-spacing: -.03em; }
.counters dt::after { content: "+"; color: var(--accent-text); }
.counters dd { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

/* ── Бегущая строка ─────────────────────────────────────── */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 26px 0; background: var(--bg-2); position: relative; z-index: 1; }
.marquee__track { display: flex; gap: 32px; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span { font: 700 clamp(24px, 3vw, 38px)/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.marquee span:nth-of-type(even) { color: transparent; -webkit-text-stroke: 1px var(--muted); }
.marquee i { color: var(--accent-text); font-style: normal; font-size: 22px; align-self: center; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── Секции ─────────────────────────────────────────────── */
.section { padding: clamp(80px, 12vw, 150px) 0 0; }
.section:last-of-type { padding-bottom: clamp(80px, 12vw, 140px); }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 32px; margin-bottom: 48px; }
.kicker { width: 100%; font: 500 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kicker b { color: var(--accent-text); font-weight: 500; margin-right: 8px; }
.section__title { font: 700 clamp(36px, 6vw, 76px)/1 var(--display); letter-spacing: -.04em; margin: 0; flex: 1 1 auto; }
.section__more { margin-left: auto; }
.empty { padding: 48px; border: 1px dashed var(--line-2); border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty a { color: var(--accent-text); }
.h-sm { font: 700 28px/1.2 var(--display); letter-spacing: -.03em; margin: 0 0 28px; }

/* Общая карточка с подсветкой за курсором */
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  isolation: isolate; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 60%);
}
.card:hover::before { opacity: 1; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.meta__muted { color: var(--muted); font: 500 13px var(--mono); }
.badge { padding: 5px 10px; border-radius: 999px; background: var(--line); font: 500 12px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--muted); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status--live i { background: var(--live); animation: pulse 1.8s infinite; }
.status--dev i { background: var(--dev); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }

/* ── Проекты ────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); }
.filter { border: 0; background: transparent; padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); transition: .25s; }
.filter sup { font: 500 10px var(--mono); opacity: .7; }
.filter:hover { color: var(--text); }
.filter.is-active { background: var(--text); color: var(--bg); }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pcard { display: flex; flex-direction: column; transition: transform .5s var(--ease), border-color .3s, box-shadow .5s var(--ease), opacity .4s; }
.pcard:hover { transform: translateY(-6px); border-color: var(--line-2); box-shadow: var(--shadow); }
.pcard.is-hidden { display: none; }
/* Главные проекты — крупно, в 2 колонки; остальные — компактно, в 3 */
.pgrid--big { grid-template-columns: repeat(2, 1fr); gap: 24px; }
.pgrid--big + .pgrid--sm { margin-top: 24px; }
.pcard--big .pcard__media { aspect-ratio: 16 / 10; }
.pcard--big .pcard__body { padding: 26px 28px 30px; }
.pcard--big h3 { font-size: 26px; }
.pcard--sm .pcard__media { aspect-ratio: 16 / 9; }
.pcard--sm .pcard__body { padding: 16px 18px 20px; gap: 9px; }
.pcard--sm h3 { font-size: 18px; }
.pcard--sm p { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard__media { position: relative; aspect-ratio: 16 / 11; overflow: hidden; background: var(--card-2); border-bottom: 1px solid var(--line); }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.pcard:hover .pcard__media img { transform: scale(1.06); }
.pcard__ph { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%), var(--card-2); }
.pcard__ph span { font: 800 90px/1 var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--line-2); }
.pcard__arrow {
  position: absolute; top: 16px; right: 16px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 20px; transform: scale(0) rotate(-45deg); transition: transform .5s var(--ease);
}
.pcard:hover .pcard__arrow { transform: none; }
.pcard__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.pcard h3 { font: 700 22px/1.2 var(--display); letter-spacing: -.02em; margin: 2px 0 0; }
.pcard p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.pcard .chips { margin-top: auto; padding-top: 4px; }

/* ── Обо мне ────────────────────────────────────────────── */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 64px; align-items: start; }
.about__photo { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; border: 1px solid var(--line); position: sticky; top: 100px; }
.about__photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.2); transition: filter .6s, transform 1.2s var(--ease); }
.about__photo:hover img { filter: none; transform: scale(1.03); }
.about__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.prose { font-size: 18px; color: var(--muted); }
.prose--sm { font-size: 15.5px; }
.prose--lg { font-size: 19px; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose strong, .prose b, .prose h2, .prose h3 { color: var(--text); }
.prose h2 { font: 700 30px/1.2 var(--display); letter-spacing: -.03em; margin: 1.8em 0 .6em; }
.prose h3 { font: 700 21px/1.3 var(--display); margin: 1.6em 0 .5em; }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--accent-text); }
.prose img { border-radius: var(--radius-sm); margin: 1.5em 0; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--text); }
.prose code { font: 500 .88em var(--mono); background: var(--line); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--card-2); border: 1px solid var(--line); padding: 18px; border-radius: var(--radius-sm); overflow: auto; }
.prose pre code { background: none; padding: 0; }

/* ── Навыки ─────────────────────────────────────────────── */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.skill-group { padding: 26px 28px; }
.skill-group h3 { font: 700 18px/1 var(--display); margin: 0 0 20px; }
.skill-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.skill-group li { display: grid; gap: 7px; font-size: 15px; font-weight: 500; }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #6f5bff)); transition: width 1.4s var(--ease) .2s; }
.in .bar i { width: var(--lvl); }

/* ── Опыт ───────────────────────────────────────────────── */
.xp { list-style: none; margin: 0; padding: 0; position: relative; }
.xp::before { content: ""; position: absolute; left: 180px; top: 10px; bottom: 10px; width: 1px; background: var(--line-2); }
.xp__item { display: grid; grid-template-columns: 180px 1fr; gap: 40px; padding-bottom: 24px; position: relative; }
.xp__item::before { content: ""; position: absolute; left: 175px; top: 30px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.xp__when { font: 500 14px var(--mono); color: var(--muted); padding-top: 24px; padding-right: 24px; }
.xp__body { padding: 24px 28px; display: grid; gap: 14px; }
.xp__top { display: flex; gap: 16px; align-items: center; }
.xp__logo { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--card-2); }
.xp h3 { font: 700 20px/1.25 var(--display); margin: 0; }
.xp__company { color: var(--muted); font-size: 15px; margin-top: 4px; }
.xp__company a { color: var(--accent-text); }
.xp .prose p:last-child { margin-bottom: 0; }

/* ── Образование ────────────────────────────────────────── */
.edu { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.edu__item { display: flex; flex-direction: column; transition: transform .5s var(--ease), border-color .3s; }
.edu__item:hover { transform: translateY(-4px); border-color: var(--line-2); }
.edu__img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--card-2); border-bottom: 1px solid var(--line); cursor: zoom-in; }
.edu__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.edu__item:hover .edu__img img { transform: scale(1.05); }
.edu__body { padding: 22px 24px 26px; display: grid; gap: 10px; }
.edu h3 { font: 700 19px/1.3 var(--display); margin: 0; }
.edu p { margin: 0; font-size: 15px; }

/* ── История ────────────────────────────────────────────── */
.story { list-style: none; padding: 0; margin: 0; }
.story__item { display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding: 36px 0; border-top: 1px solid var(--line); }
.story__item:last-child { border-bottom: 1px solid var(--line); }
.story__year { font: 800 clamp(40px, 5vw, 64px)/1 var(--display); letter-spacing: -.04em; color: transparent; -webkit-text-stroke: 1.2px var(--muted); transition: color .4s, -webkit-text-stroke-color .4s; }
.story__item:hover .story__year { color: var(--accent-text); -webkit-text-stroke-color: transparent; }
.story h3 { font: 700 24px/1.25 var(--display); margin: 0 0 10px; letter-spacing: -.02em; }
.story p { margin: 0; color: var(--muted); max-width: 640px; }
.story img { margin-top: 18px; max-width: 360px; border-radius: var(--radius-sm); cursor: zoom-in; }

/* ── Блог ───────────────────────────────────────────────── */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.post-card { display: flex; flex-direction: column; transition: transform .5s var(--ease), border-color .3s; }
.post-card:hover { transform: translateY(-5px); border-color: var(--line-2); }
.post-card__img { aspect-ratio: 16 / 9; overflow: hidden; }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.post-card:hover .post-card__img img { transform: scale(1.05); }
.post-card__body { padding: 22px 24px 26px; display: grid; gap: 8px; }
.post-card h3 { font: 700 21px/1.25 var(--display); margin: 0; letter-spacing: -.02em; }
.post-card p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* ── Контакты ───────────────────────────────────────────── */
.section--contact .section__title { font-size: clamp(36px, 7vw, 92px); }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact__links { display: grid; }
.contact__row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 22px 4px; border-bottom: 1px solid var(--line); transition: padding .4s var(--ease), color .3s; }
.contact__row:first-child { border-top: 1px solid var(--line); }
.contact__row:hover { padding-left: 16px; }
.contact__icon { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); font-size: 20px; transition: .3s; }
.contact__row:hover .contact__icon { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.contact__row small { display: block; color: var(--muted); font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.contact__row b { font-size: 18px; font-weight: 600; word-break: break-all; }
.contact__arrow { font-size: 22px; color: var(--muted); transition: transform .4s var(--ease), color .3s; }
.contact__row:hover .contact__arrow { transform: rotate(45deg); color: var(--accent-text); }
.contact__form { padding: 30px; display: grid; gap: 18px; }
.contact__form label { display: grid; gap: 8px; }
.contact__form label span { font-size: 14px; font-weight: 600; color: var(--muted); }
.contact__form input, .contact__form textarea {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px; resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.contact__form input:focus, .contact__form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.contact__form .btn { justify-self: start; }
.form-status { margin: 0; font-size: 15px; min-height: 1.4em; }
.form-status.ok { color: var(--live); }
.form-status.err { color: #ff6b6b; }

/* ── Футер ──────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer__in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.footer p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.footer__login { color: var(--muted); font-size: 13px; text-decoration: none; opacity: .6; transition: opacity .2s, color .2s; }
.footer__login:hover { opacity: 1; color: var(--text, inherit); }
.socials { display: flex; gap: 8px; }
.socials a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 17px; transition: .25s; }
.socials a:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: translateY(-3px); }

/* ── Внутренние страницы ────────────────────────────────── */
.page-inner main { padding-top: 76px; }
.page-top { padding-top: 60px; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 15px; margin-bottom: 36px; transition: color .2s, gap .3s var(--ease); }
.back:hover { color: var(--text); gap: 12px; }
.page-title { font: 800 clamp(40px, 7vw, 88px)/1.02 var(--display); letter-spacing: -.045em; margin: 12px 0 20px; }
.page-lead { font-size: 20px; color: var(--muted); margin: 0 0 48px; max-width: 640px; }
.project { padding: 60px 0 120px; }
.project__head { max-width: 900px; }
.project__title { font: 800 clamp(44px, 8vw, 104px)/1 var(--display); letter-spacing: -.05em; margin: 18px 0 22px; }
.project__lead { font-size: clamp(18px, 2vw, 22px); color: var(--muted); margin: 0 0 32px; max-width: 720px; }
.project__links { display: flex; flex-wrap: wrap; gap: 10px; }
.project__cover { margin: 56px 0 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.project__cover img { width: 100%; }
.project__grid { display: grid; grid-template-columns: 1fr 300px; gap: 64px; margin-top: 72px; }
.project__aside { display: grid; gap: 22px; align-content: start; position: sticky; top: 100px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.project__aside small { display: block; color: var(--muted); font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.project__aside a b { color: var(--accent-text); }
.gallery-wrap, .more { margin-top: 96px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.shot { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); cursor: zoom-in; background: var(--card-2); }
.shot img { width: 100%; transition: transform .8s var(--ease); }
.shot:hover img { transform: scale(1.04); }
.gallery--phones { display: flex; gap: 28px; overflow-x: auto; padding: 10px 4px 30px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.phone {
  flex: 0 0 auto; width: 250px; aspect-ratio: 9 / 19.5; border-radius: 40px; padding: 10px; background: #050506;
  border: 1px solid var(--line-2); box-shadow: var(--shadow), inset 0 0 0 2px #2a2a30; scroll-snap-align: start; cursor: zoom-in;
  position: relative; transition: transform .5s var(--ease);
}
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; translate: -50% 0; width: 70px; height: 20px; border-radius: 20px; background: #050506; z-index: 1; }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 31px; }
.phone:hover { transform: translateY(-8px) rotate(-1deg); }
.pgrid--3 { grid-template-columns: repeat(3, 1fr); }
.nf { text-align: center; min-height: 70vh; display: grid; place-items: center; }
.nf__code { font: 800 clamp(120px, 25vw, 280px)/1 var(--display); letter-spacing: -.06em; margin: 0; color: transparent; -webkit-text-stroke: 2px var(--accent-text); }
.nf .page-lead { margin-inline: auto; }

/* ── Резюме ─────────────────────────────────────────────── */
.cv-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.cv-actions .back { margin: 0; }
.cv-actions > div { display: flex; gap: 8px; }
.cv { padding: clamp(28px, 5vw, 56px); }
.cv__head { display: flex; gap: 28px; align-items: center; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.cv__photo { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; }
.cv h1 { font: 800 clamp(30px, 5vw, 44px)/1.05 var(--display); letter-spacing: -.04em; margin: 0 0 6px; }
.cv__role { margin: 0 0 8px; font-weight: 700; color: var(--accent-text); }
.cv__contacts { margin: 0; color: var(--muted); font-size: 14.5px; }
.cv section { padding: 26px 0 6px; border-bottom: 1px solid var(--line); }
.cv section:last-child { border: 0; }
.cv h2 { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 16px; }
.cv__item { display: grid; grid-template-columns: 150px 1fr; gap: 20px; margin-bottom: 18px; }
.cv__when { font: 500 13px var(--mono); color: var(--muted); padding-top: 3px; }
.cv h3 { font-size: 17px; margin: 0 0 4px; }
.cv h3 small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 6px; }
.cv p { margin: 0 0 6px; font-size: 15px; }
.cv__skills p { margin-bottom: 8px; }

/* ── Лайтбокс ───────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(5, 5, 8, .92); backdrop-filter: blur(10px); animation: fade .3s; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 12px; box-shadow: 0 40px 120px rgba(0, 0, 0, .6); animation: zoomIn .4s var(--ease); }
.lightbox button { position: absolute; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #fff; width: 52px; height: 52px; border-radius: 50%; font-size: 24px; transition: .2s; }
.lightbox button:hover { background: #fff; color: #000; }
.lightbox__close { top: 20px; right: 20px; font-size: 18px !important; }
.lightbox__prev { left: 20px; }
.lightbox__next { right: 20px; }
.lightbox__count { position: absolute; bottom: 20px; color: #aaa; font: 500 13px var(--mono); }
@keyframes fade { from { opacity: 0; } }
@keyframes zoomIn { from { transform: scale(.92); opacity: 0; } }

/* ── Адаптив ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .pgrid, .pgrid--3 { grid-template-columns: repeat(2, 1fr); }
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__visual { order: -1; justify-items: start; }
  .avatar { width: 220px; }
  .about { grid-template-columns: 1fr; }
  .about__photo { position: static; max-width: 420px; }
  .project__grid { grid-template-columns: 1fr; gap: 40px; }
  .project__aside { position: static; }
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .burger { display: flex; }
  .header__actions { margin-left: auto; }
  .nav {
    position: fixed; inset: 76px 0 auto; flex-direction: column; align-items: stretch; gap: 4px; padding: 16px 24px 28px;
    background: var(--bg); border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform .5s var(--ease); z-index: -1;
  }
  .nav.is-open { transform: none; }
  .nav a:not(.btn) { padding: 14px 8px; font-size: 20px; color: var(--text); border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav__cta { margin: 12px 0 0; height: 52px; }
  .logo__name { display: none; }
  .xp::before, .xp__item::before { display: none; }
  .xp__item { grid-template-columns: 1fr; gap: 8px; }
  .xp__when { padding: 0; }
  .story__item { grid-template-columns: 1fr; gap: 12px; }
  .cv__item { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 640px) {
  .lang a { padding: 6px 6px; font-size: 10px; }
  body { font-size: 16px; }
  .container { width: calc(100% - 32px); }
  .pgrid, .pgrid--3 { grid-template-columns: 1fr; }
  .pgrid--big { grid-template-columns: 1fr; }
  .hero { padding-top: 110px; }
  .hero__title { font-size: clamp(32px, 10.5vw, 56px); }
  .avatar__ph { font-size: 72px; }
  .counters { margin-top: 56px; }
  .counters > div { padding: 18px 20px; }
  .gallery { grid-template-columns: 1fr; }
  .phone { width: 210px; }
  .cv__head { flex-direction: column; align-items: flex-start; }
  .lightbox__prev, .lightbox__next { bottom: 20px; top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal, .intro { opacity: 1; transform: none; }
  .line > span { transform: none; }
}

/* ── Печать резюме ──────────────────────────────────────── */
@media print {
  @page { margin: 14mm; }
  :root, [data-theme] { --bg: #fff; --card: #fff; --text: #111; --muted: #555; --line: #ddd; --accent-text: #2f5a00; }
  body { background: #fff; font-size: 12pt; }
  body::after, .header, .footer, .cursor-glow, .no-print, .lightbox { display: none !important; }
  .page-inner main { padding: 0; }
  .page-top { padding: 0; }
  .container--narrow { width: 100%; }
  .cv { border: 0; padding: 0; }
  .reveal, .intro { opacity: 1 !important; transform: none !important; animation: none !important; }
  .cv__item { break-inside: avoid; }
}
