/* =====================================================================
   Портфолио — тёмная и светлая темы, фиолетовый акцент
   Палитра:
     Dark : чёрный #08070f · графит #14111f · неоновый фиолетовый #7a22d9 / #b86bff
     Light: белый #ffffff · лавандовый #ede7fa · насыщенный фиолетовый #9b6be6 / #6f34c4
===================================================================== */

:root {
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Consolas, 'Liberation Mono', monospace;
    --radius: 18px;
    --radius-sm: 12px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --container: 1180px;
    --header-h: 68px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: var(--custom-bg, #08070f);
    --surface: rgba(22, 19, 36, 0.72);
    --surface-solid: #14111f;
    --surface-hover: rgba(34, 28, 56, 0.85);
    --field: rgba(255, 255, 255, 0.035);
    --line: rgba(168, 120, 255, 0.16);
    --line-strong: rgba(184, 107, 255, 0.5);
    --text: #f4f0fc;
    --muted: #a39db9;
    --faint: #6e6786;
    --accent: #7a22d9;
    --accent-soft: #b86bff;
    --accent-text: #c58bff;
    --accent-bg: rgba(124, 58, 237, 0.16);
    --btn-grad: linear-gradient(135deg, #6a1fd0 0%, #8b2ff0 100%);
    --title-grad: linear-gradient(135deg, #8b3dff 0%, #c58bff 100%);
    --glow: rgba(139, 92, 246, 0.55);
    --spot: rgba(139, 92, 246, 0.16);
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
    --dot: rgba(168, 120, 255, 0.09);
    --orb: rgba(124, 58, 237, 0.34);
    --header-bg: rgba(8, 7, 15, 0.72);
    --danger: #fb7185;
}

[data-theme="light"] {
    color-scheme: light;
    --bg: var(--custom-bg, #f6f2ff);
    --surface: rgba(255, 255, 255, 0.78);
    --surface-solid: #ffffff;
    --surface-hover: rgba(255, 255, 255, 0.96);
    --field: #ffffff;
    --line: rgba(111, 52, 196, 0.15);
    --line-strong: rgba(111, 52, 196, 0.45);
    --text: #1c1430;
    --muted: #645c7e;
    --faint: #8f88a8;
    --accent: #6f34c4;
    --accent-soft: #9b6be6;
    --accent-text: #6f34c4;
    --accent-bg: rgba(124, 58, 237, 0.1);
    --btn-grad: linear-gradient(135deg, #6f34c4 0%, #9b6be6 100%);
    --title-grad: linear-gradient(135deg, #6f34c4 0%, #a97ef0 100%);
    --glow: rgba(111, 52, 196, 0.4);
    --spot: rgba(124, 58, 237, 0.11);
    --shadow: 0 24px 60px -28px rgba(80, 40, 150, 0.35);
    --dot: rgba(111, 52, 196, 0.1);
    --orb: rgba(155, 107, 230, 0.35);
    --header-bg: rgba(246, 242, 255, 0.78);
    --danger: #e11d48;
}


/* ---------- База ---------- */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }

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

.skip-link {
    position: fixed; top: -60px; left: 16px; z-index: 2000;
    padding: 10px 16px; border-radius: 10px;
    background: var(--accent); color: #fff; font-weight: 600;
    transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 12px; }


/* ---------- Фон ---------- */

.bg { 
    position: fixed; 
    inset: 0; 
    z-index: 0; 
    overflow: hidden; 
    pointer-events: none; 
}

.bg-image {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: 0.22;
}

.bg-grid {
    position: absolute; inset: 0;
    background-image: radial-gradient(var(--dot) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
            mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}

.bg-orb {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle, var(--orb), transparent 68%);
    filter: blur(20px);
    will-change: transform;
}
.bg-orb-1 { width: 620px; height: 620px; top: -220px; left: -160px; animation: drift-1 22s ease-in-out infinite alternate; }
.bg-orb-2 { width: 540px; height: 540px; top: 28%; right: -200px; animation: drift-2 26s ease-in-out infinite alternate; }
.bg-orb-3 { width: 480px; height: 480px; bottom: -220px; left: 24%; animation: drift-3 30s ease-in-out infinite alternate; opacity: 0.7; }

@keyframes drift-1 { to { transform: translate(120px, 80px) scale(1.15); } }
@keyframes drift-2 { to { transform: translate(-140px, 60px) scale(0.9); } }
@keyframes drift-3 { to { transform: translate(100px, -90px) scale(1.2); } }


/* ---------- Каркас ---------- */

.page-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto; 
    min-height: 100vh;
    min-height: 100dvh;
    animation: page-in 0.6s var(--ease) both;
}
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }

html.page-leave .page-shell {
    opacity: 0; transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.main, .header-inner, .footer-inner {
    width: min(100% - 40px, var(--container));
    margin-inline: auto;
}

.main {
    flex: 1 0 auto; 
    padding-block: 36px 72px;
}

.scroll-progress {
    position: fixed; top: 0; left: 0; z-index: 1500;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-soft));
    box-shadow: 0 0 12px var(--glow);
    transform: scaleX(0); transform-origin: 0 50%;
}


/* ---------- Шапка ---------- */

.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; min-width: 0; }
.brand-logo { width: 30px; height: 30px; object-fit: contain; border-radius: 8px; transition: transform 0.5s var(--ease); }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 9px;
    background: var(--btn-grad); color: #fff;
    box-shadow: 0 6px 18px -6px var(--glow);
    transition: transform 0.5s var(--ease);
}
.brand-mark svg { width: 16px; height: 16px; }
.brand:hover .brand-mark, .brand:hover .brand-logo { transform: rotate(-8deg) scale(1.1); }
.brand-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }

.nav { position: relative; display: flex; align-items: center; gap: 4px; margin-left: auto; }

.nav-link {
    position: relative; z-index: 1;
    padding: 8px 14px; border-radius: 10px;
    font-size: 14px; font-weight: 500; color: var(--muted);
    transition: color 0.25s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active { color: var(--accent-text); }

.nav-indicator {
    position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-soft));
    box-shadow: 0 0 12px var(--glow);
    opacity: 0;
    transition: transform 0.45s var(--ease), width 0.45s var(--ease), opacity 0.3s ease;
}
.nav-indicator.ready { opacity: 1; }

.header-tools { display: flex; align-items: center; gap: 12px; }

/* переключатель темы */
.theme-toggle { padding: 0; border: 0; background: none; cursor: pointer; }
.theme-track {
    position: relative; display: block; width: 54px; height: 28px;
    border-radius: 99px;
    background: var(--accent-bg);
    border: 1px solid var(--line-strong);
    transition: background-color 0.4s ease, box-shadow 0.3s ease;
}
.theme-toggle:hover .theme-track { box-shadow: 0 0 0 4px var(--accent-bg), 0 0 16px -2px var(--glow); }
.theme-knob {
    position: absolute; top: 2px; left: 2px;
    display: grid; place-items: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--btn-grad); color: #fff;
    box-shadow: 0 2px 10px var(--glow);
    transition: transform 0.45s var(--ease);
}
[data-theme="dark"] .theme-knob { transform: translateX(26px); }
.theme-icon { position: absolute; width: 13px; height: 13px; transition: opacity 0.3s ease, transform 0.5s var(--ease); }
[data-theme="dark"] .theme-icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.4); }
[data-theme="light"] .theme-icon-moon { opacity: 0; transform: rotate(90deg) scale(0.4); }

/* переключатель языка */
.lang-btn {
    display: inline-grid; place-items: center;
    min-width: 42px; height: 30px; padding: 0 10px;
    border: 1px solid var(--line-strong); border-radius: 9px;
    background: var(--accent-bg);
    font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
    color: var(--accent-text);
    transition: background-color 0.3s ease, transform 0.3s var(--ease), box-shadow 0.3s ease;
    perspective: 200px;
}
.lang-btn:hover { background: var(--accent); color: #fff; box-shadow: 0 6px 18px -6px var(--glow); transform: translateY(-1px); }
.lang-btn:active { transform: scale(0.94); }
.lang-btn-label { display: block; }
.lang-btn:hover .lang-btn-label { animation: flip 0.55s var(--ease); }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); opacity: 0; } 51% { transform: rotateX(-90deg); } 100% { transform: rotateX(0); opacity: 1; } }

.menu-btn {
    display: none; width: 40px; height: 36px; padding: 0; position: relative;
    border: 1px solid var(--line-strong); border-radius: 10px; background: var(--accent-bg); cursor: pointer;
}
.menu-btn span {
    position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px;
    background: var(--accent-text);
    transition: transform 0.35s var(--ease), opacity 0.2s ease, top 0.35s var(--ease);
}
.menu-btn span:nth-child(1) { top: 11px; }
.menu-btn span:nth-child(2) { top: 17px; }
.menu-btn span:nth-child(3) { top: 23px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { top: 17px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { top: 17px; transform: rotate(-45deg); }


/* ---------- Общие элементы ---------- */

.badge {
    position: relative;
    z-index: 2; 
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 14px; border-radius: 99px;
    border: 1px solid var(--line); background: var(--accent-bg);
    font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.badge-dot::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent-soft); box-shadow: 0 0 10px var(--accent-soft);
    animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot { 50% { transform: scale(0.65); opacity: 0.6; } }

.dot { display: inline-block; width: 9px; height: 9px; margin-right: 10px; border-radius: 50%; background: var(--accent-soft); box-shadow: 0 0 10px var(--glow); }

.card {
    position: relative;
    isolation: isolate;              /* собственный stacking context — не нужен z-index на детях */
    padding: 24px; overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    transition: border-color 0.3s ease, transform 0.4s var(--ease), box-shadow 0.4s ease, background-color 0.3s ease;
}
.card::before {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--spot), transparent 62%);
    opacity: 0; transition: opacity 0.3s ease;
}
/* Контент лежит выше ::before без ручного z-index на каждом ребёнке */
.card > * { position: relative; }
.card > *:not(.more-btn) { z-index: 1; }
[data-spot]:hover::before { opacity: 1; }

a.card:hover {
    transform: translateY(-5px);
    border-color: var(--line-strong);
    background: var(--surface-hover);
    box-shadow: 0 28px 60px -24px var(--glow);
}

.card-heading { display: flex; align-items: center; margin-bottom: 14px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.card-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card-text { margin-top: 6px; font-size: 14px; color: var(--muted); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { color: var(--muted); text-align: center; grid-column: 1 / -1; }

.icon-tile {
    display: grid; place-items: center;
    width: 46px; height: 46px; margin-bottom: 16px; border-radius: 13px;
    border: 1px solid var(--line-strong);
    background: linear-gradient(145deg, var(--accent-bg), transparent);
    color: var(--accent-text);
    font-size: 14px; font-weight: 700; letter-spacing: 0.02em;
    transition: transform 0.45s var(--ease), box-shadow 0.4s ease, background-color 0.3s ease;
}
.icon-tile svg { width: 22px; height: 22px; }
.icon-tile-lg { width: 68px; height: 68px; margin: 0; border-radius: 18px; }
.icon-tile-lg svg { width: 32px; height: 32px; }
.card:hover .icon-tile { transform: translateY(-2px) rotate(-6deg) scale(1.06); box-shadow: 0 10px 28px -8px var(--glow); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
    padding: 4px 12px; border-radius: 8px;
    border: 1px solid var(--line); background: var(--accent-bg);
    font-size: 12px; font-weight: 500; color: var(--muted);
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.3s var(--ease);
}
.chip:hover { color: var(--accent-text); border-color: var(--line-strong); transform: translateY(-2px); }

.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent-text); transition: gap 0.3s var(--ease); }
.text-link:hover { gap: 12px; }

.back-link {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
    font-size: 14px; font-weight: 500; color: var(--muted);
    transition: color 0.25s ease, gap 0.3s var(--ease);
}
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--accent-text); gap: 12px; }

.prose { font-size: 15px; color: var(--muted); }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 12px; }
.prose h3 { margin: 22px 0 8px; font-size: 17px; color: var(--text); }
.prose ul { margin-top: 10px; padding-left: 4px; }
.prose li { position: relative; padding-left: 22px; margin-top: 6px; }
.prose li::before { content: ''; position: absolute; left: 4px; top: 0.7em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-soft); }
.prose-legal { max-width: 820px; }
.legal-updated { margin-top: 24px !important; font-size: 13px; color: var(--faint); }


/* ---------- Кнопки ---------- */

.btn {
    position: relative; isolation: isolate; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 13px 24px; border-radius: 12px;
    border: 1px solid transparent;
    font-size: 15px; font-weight: 600; line-height: 1.2; cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.35s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.btn:active { transform: scale(0.97) !important; }
.btn-arrow { width: 18px; height: 18px; transition: transform 0.35s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(5px); }
.btn-block { width: 100%; }

.btn-primary {
    color: #fff; background: var(--btn-grad);
    box-shadow: 0 12px 32px -12px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary::after {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.38) 50%, transparent 70%);
    transform: translateX(-130%);
    transition: transform 0.8s var(--ease);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -12px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn-primary:hover::after { transform: translateX(130%); }

.btn-ghost { color: var(--text); background: var(--surface); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--accent-bg); color: var(--accent-text); transform: translateY(-3px); }
.btn-square { width: 50px; padding: 0; flex: 0 0 auto; }
.btn-square svg { width: 20px; height: 20px; }

.hero-actions .btn-primary { animation: glow-pulse 3.4s ease-in-out infinite; }
@keyframes glow-pulse { 50% { box-shadow: 0 14px 44px -8px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.25); } }

.ripple {
    position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
    background: rgba(255, 255, 255, 0.4); transform: scale(0);
    animation: ripple 0.65s ease-out forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }


/* ---------- Анимации появления ---------- */

[data-anim] { animation: rise 0.85s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms + 120ms); }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }

.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.75s var(--ease), transform 0.75s var(--ease), border-color 0.3s ease, box-shadow 0.4s ease; transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0s, 0s; }
.js .reveal.visible { opacity: 1; transform: none; }


/* ---------- Главная: hero ---------- */

.hero {
    display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    align-items: center; gap: 48px; padding-block: 24px 40px;
}

.hero-title {
    margin-top: 20px;
    font-size: clamp(42px, 6.4vw, 80px); font-weight: 800;
    line-height: 1.02; letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}
.hero-title-line { display: block; }
.hero-title-accent {
    background: var(--title-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    background-size: 200% 100%;
    animation: title-sheen 6s ease-in-out infinite alternate;
}
@keyframes title-sheen { to { background-position: 100% 0; } }

.hero-role { margin-top: 22px; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.hero-lead { margin-top: 8px; max-width: 480px; color: var(--muted); }
.hero-actions { margin-top: 28px; }

.stack { margin-top: 36px; }
.stack-title { display: flex; align-items: center; margin-bottom: 14px; font-size: 15px; font-weight: 700; }
.stack-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.stack-chip {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 9px 16px 9px 10px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--surface);
    font-size: 13.5px; font-weight: 500;
    cursor: default;
    animation: rise 0.7s var(--ease) both; animation-delay: calc(var(--n, 0) * 70ms + 700ms);
    transition: transform 0.35s var(--ease), border-color 0.3s ease, box-shadow 0.3s ease;
}
.stack-chip:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 12px 28px -12px var(--glow); }
.stack-icon {
    display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 8px;
    background: var(--accent-bg); color: var(--accent-text);
    font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
    transition: transform 0.4s var(--ease);
}
.stack-chip:hover .stack-icon { transform: rotate(-10deg) scale(1.12); }

/* визуальная часть: фото + консоль */
.hero-visual { position: relative; width: 100%; max-width: 560px; margin-inline: auto; padding-bottom: 8px; }

.photo-frame {
    position: relative; z-index: 1; margin: 0 0 0 4%; width: 60%;
    transform: perspective(1100px) rotateY(calc(-9deg + var(--ry, 0deg))) rotateX(var(--rx, 0deg)) rotateZ(-1.5deg);
    transform-style: preserve-3d;
    transition: transform 0.5s var(--ease);
    animation: float 7s ease-in-out infinite;
}
@keyframes float { 50% { translate: 0 -10px; } }

.photo-glow {
    position: absolute; inset: -16px; z-index: -1; border-radius: 34px;
    background: radial-gradient(circle at 50% 40%, var(--glow), transparent 70%);
    filter: blur(26px); opacity: 0.7;
    animation: glow-breathe 5s ease-in-out infinite;
}
@keyframes glow-breathe { 50% { opacity: 0.4; transform: scale(0.96); } }

.photo-inner {
    position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 24px;
    border: 1px solid var(--line-strong);
    background: var(--surface-solid);
    box-shadow: 0 0 0 6px var(--accent-bg), 0 34px 70px -28px var(--glow);
}
.photo-inner img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 38% 28%; }
.photo-inner::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(160deg, rgba(124, 58, 237, 0.22), transparent 45%, rgba(10, 7, 20, 0.55));
    mix-blend-mode: soft-light;
}
.photo-shine {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.22) 50%, transparent 62%);
    transform: translateX(-130%);
    animation: shine 7s ease-in-out 1.6s infinite;
}
@keyframes shine { 0%, 62% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }

.console-stage { position: relative; z-index: 2; width: 80%; margin: -76px 0 0 auto; padding-top: 0; }

/* консоль */
.console {
    position: relative; overflow: hidden;
    border: 1px solid rgba(184, 107, 255, 0.35); border-radius: 16px;
    background: linear-gradient(160deg, #0f0c1c, #0a0813);
    color: #e9e3f8;
    box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(124, 58, 237, 0.12), 0 0 44px -14px var(--glow);
    animation: console-glow 4.5s ease-in-out infinite;
}
@keyframes console-glow { 50% { border-color: rgba(184, 107, 255, 0.6); box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(124, 58, 237, 0.2), 0 0 56px -10px var(--glow); } }

.console-bar { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid rgba(168, 120, 255, 0.14); background: rgba(255, 255, 255, 0.02); }
.console-dots { display: inline-flex; gap: 6px; }
.console-dots i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.console-dots i:nth-child(2) { background: #febc2e; }
.console-dots i:nth-child(3) { background: #28c840; }
.console-title { font-family: var(--mono); font-size: 11.5px; color: #8f87a8; }
.console-status { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: #7f7897; }
.console-status i { width: 6px; height: 6px; border-radius: 50%; background: #28c840; box-shadow: 0 0 8px #28c840; animation: pulse-dot 1.8s ease-in-out infinite; }

.console-code {
    margin: 0; padding: 14px 16px 16px; min-height: 164px;
    font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
    white-space: pre; overflow: hidden; counter-reset: ln;
    text-align: left; direction: ltr;
}
.console-code .line { display: block; min-height: 1.7em; counter-increment: ln; }
.console-code .line::before {
    content: counter(ln); display: inline-block; width: 2ch; margin-right: 16px;
    text-align: right; color: #4c4666; user-select: none;
}
.tk-kw { color: #c084fc; }
.tk-str { color: #a7f3a8; }
.tk-prop { color: #7dd3fc; }
.tk-fn { color: #f0abfc; }
.tk-num { color: #fbbf24; }
.tk-pun { color: #968fb0; }
.tk-com { color: #6a6388; font-style: italic; }
.caret { display: inline-block; width: 7px; height: 1.15em; margin-left: 1px; vertical-align: -0.2em; background: #c084fc; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }


/* ---------- Главная: блоки ниже ---------- */

.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }

.cta {
    display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    margin-top: 24px; padding: 30px 34px; overflow: hidden;
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: linear-gradient(120deg, var(--accent-bg), var(--surface) 70%);
    position: relative;
}
.cta-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.cta-text { margin-top: 4px; color: var(--muted); }


/* ---------- Заголовки страниц ---------- */

.page-head { margin-bottom: 30px; }
.page-title { margin-top: 14px; font-size: clamp(34px, 5vw, 54px); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; }
.page-lead { margin-top: 12px; max-width: 560px; font-size: 17px; color: var(--muted); }
.section-heading { margin: 48px 0 20px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }


/* ---------- Фильтры ---------- */

.filters { position: relative; display: flex; flex-wrap: wrap; gap: 6px; width: fit-content; max-width: 100%; margin-bottom: 26px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.filter-chip {
    position: relative; z-index: 1; padding: 8px 18px; border: 0; border-radius: 10px; background: none;
    font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer;
    transition: color 0.3s ease, transform 0.25s var(--ease);
}
.filter-chip:hover { color: var(--text); }
.filter-chip:active { transform: scale(0.94); }
.filter-chip.active { color: #fff; }
.filter-indicator {
    position: absolute; z-index: 0; top: 0; left: 0; width: 0; height: 0; border-radius: 10px;
    background: var(--btn-grad); box-shadow: 0 8px 22px -8px var(--glow);
    transition: transform 0.5s var(--ease), width 0.5s var(--ease), height 0.3s ease;
}

.filter-empty { margin-top: 20px; }


/* ---------- Карточки проектов ---------- */

.project-card { display: flex; flex-direction: column; padding: 10px; }
.project-card.pop { animation: pop-in 0.55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(0.96); } }

.project-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: var(--surface-solid); }
.project-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease), filter 0.5s ease; }
.project-card:hover .project-cover img { transform: scale(1.07); }

.cover-fallback {
    display: grid; place-items: center; width: 100%; height: 100%;
    background:
        linear-gradient(var(--dot) 1px, transparent 1px) 0 0 / 22px 22px,
        linear-gradient(90deg, var(--dot) 1px, transparent 1px) 0 0 / 22px 22px,
        radial-gradient(circle at 70% 20%, var(--glow), transparent 60%),
        linear-gradient(135deg, var(--accent-bg), transparent);
    transition: transform 0.9s var(--ease);
}
.cover-fallback span { font-size: 64px; font-weight: 800; text-transform: uppercase; background: var(--title-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.project-card:hover .cover-fallback { transform: scale(1.07); }

.cover-count {
    position: absolute; left: 10px; bottom: 10px; padding: 3px 10px; border-radius: 99px;
    background: rgba(8, 7, 15, 0.65); border: 1px solid rgba(255, 255, 255, 0.12); color: #fff;
    font-size: 11.5px; font-weight: 600; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

.project-body { padding: 16px 10px 8px; }
.project-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.project-head-text { min-width: 0; }

.arrow-btn {
    display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--line-strong); color: var(--accent-text);
    transition: transform 0.4s var(--ease), background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.arrow-btn svg { width: 16px; height: 16px; }
.project-card:hover .arrow-btn { background: var(--btn-grad); color: #fff; border-color: transparent; transform: rotate(-45deg) scale(1.08); box-shadow: 0 8px 20px -6px var(--glow); }


/* ---------- Страница проекта / услуги ---------- */

.project-tabs { display: flex; gap: 8px; margin-bottom: 22px; padding-bottom: 6px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.project-tab {
    flex: 0 0 auto; padding: 7px 16px; border-radius: 99px;
    border: 1px solid var(--line); background: var(--surface);
    font-size: 13px; font-weight: 600; color: var(--muted);
    transition: transform 0.3s var(--ease), color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}
.project-tab:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-2px); }
.project-tab.active { color: #fff; background: var(--btn-grad); border-color: transparent; box-shadow: 0 8px 22px -8px var(--glow); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin-top: 30px; }
.detail-main { display: grid; gap: 24px; min-width: 0; }
.detail-side { position: sticky; top: calc(var(--header-h) + 20px); }
.detail-title-row { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.detail-title { margin-top: 10px; font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.detail-title-row .detail-title { margin-top: 0; }

.side-card .chips { margin-top: 4px; }
.side-actions { display: flex; gap: 10px; margin-top: 22px; }
.side-card .card-heading { margin-bottom: 12px; }

.check-list { display: grid; gap: 10px; }
.check-list li { display: flex; align-items: flex-start; gap: 12px; color: var(--muted); font-size: 15px; }
.check-list svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; padding: 3px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-text); }
.reveal .check-list li, .check-list li { transition: transform 0.3s var(--ease), color 0.25s ease; }
.check-list li:hover { transform: translateX(5px); color: var(--text); }


/* ---------- Услуги ---------- */

.service-card { display: flex; flex-direction: column; min-height: 200px; padding: 24px 24px 66px; }
.service-card .card-title { font-size: 18px; }

.more-btn {
    position: absolute !important; right: 18px; bottom: 16px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; border-radius: 99px;
    background: var(--btn-grad); color: #fff;
    font-size: 13px; font-weight: 600;
    box-shadow: 0 10px 26px -8px var(--glow);
    opacity: 0; transform: translateY(14px) scale(0.92);
    transition: opacity 0.35s ease, transform 0.45s var(--ease);
    pointer-events: none;
}
.more-btn svg { width: 15px; height: 15px; transition: transform 0.35s var(--ease); }
.service-card:hover .more-btn, .service-card:focus-visible .more-btn, .service-card:focus-within .more-btn { opacity: 1; transform: none; }
.service-card:hover .more-btn svg { transform: translateX(3px); }
@media (hover: none) { .more-btn { opacity: 1; transform: none; pointer-events: auto; } }

.service-hero { display: flex; align-items: center; gap: 26px; padding: 30px; }
.service-hero .detail-title { margin-top: 12px; }
.service-hero .page-lead { margin-top: 8px; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.fact { display: flex; flex-direction: column; gap: 4px; padding: 22px; }
.fact-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 10px; border-radius: 12px; background: var(--accent-bg); color: var(--accent-text); }
.fact-icon svg { width: 20px; height: 20px; }
.fact-label { font-size: 12.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.fact-value { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }


/* ---------- Контакты ---------- */

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding-top: 12px; }
.contact-info .page-lead { margin-bottom: 30px; }

.contact-list { display: grid; gap: 12px; }
.contact-link {
    display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--surface);
    animation: rise 0.7s var(--ease) both; animation-delay: calc(var(--n, 0) * 80ms + 500ms);
    transition: transform 0.35s var(--ease), border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}
.contact-link:hover { transform: translateX(8px); border-color: var(--line-strong); background: var(--surface-hover); box-shadow: 0 14px 30px -16px var(--glow); }
.contact-icon { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-bg); color: var(--accent-text); transition: transform 0.4s var(--ease); }
.contact-icon svg { width: 19px; height: 19px; }
.contact-link:hover .contact-icon { transform: rotate(-8deg) scale(1.08); }
.contact-text { display: flex; flex-direction: column; min-width: 0; }
.contact-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.contact-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.contact-arrow { margin-left: auto; color: var(--accent-text); transition: transform 0.35s var(--ease); }
.contact-link:hover .contact-arrow { transform: translateX(4px); }
.contact-list-compact { margin-top: 18px; gap: 8px; }
.contact-list-compact .contact-link { animation: none; padding: 9px 12px 9px 9px; }
.contact-list-compact .contact-icon { width: 34px; height: 34px; }

.form-card { padding: 28px; }
.field { display: block; margin-bottom: 14px; }
.field input, .field textarea {
    width: 100%; padding: 14px 16px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--field); color: var(--text);
    font-size: 15px; outline: none;
    transition: border-color 0.25s ease, box-shadow 0.3s ease, background-color 0.3s ease, transform 0.3s var(--ease);
}
.field textarea { min-height: 170px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:hover, .field textarea:hover { border-color: var(--line-strong); }
.field input:focus, .field textarea:focus { border-color: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-bg), 0 0 24px -6px var(--glow); transform: translateY(-1px); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.field-error { display: block; margin-top: 6px; font-size: 12.5px; color: var(--danger); }
.form-alert { margin-bottom: 14px; padding: 10px 14px; border-radius: 10px; font-size: 14px; color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); animation: shake 0.45s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.toasts { position: fixed; top: calc(var(--header-h) + 14px); left: 50%; z-index: 600; display: grid; gap: 10px; transform: translateX(-50%); width: min(92vw, 420px); }
.toast {
    display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-radius: 14px;
    border: 1px solid var(--line-strong); background: var(--surface-solid); box-shadow: var(--shadow), 0 0 40px -12px var(--glow);
    font-size: 14.5px; font-weight: 500;
    animation: toast-in 0.6s var(--ease) both;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.toast svg { flex: 0 0 auto; width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--btn-grad); color: #fff; }
.toast.is-leaving { opacity: 0; transform: translateY(-12px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-20px) scale(0.95); } }


/* ---------- Подвал ---------- */

.site-footer {
    margin-top: auto;
    flex-shrink: 0;
    border-top: 1px solid var(--line);
    background: var(--header-bg);
}
.footer-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px; padding-block: 24px; }
.footer-brand { justify-self: start; font-size: 14px; font-weight: 600; color: var(--muted); transition: color 0.25s ease; }
.footer-brand:hover { color: var(--accent-text); }
.socials { display: flex; gap: 10px; }
.social-link {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
    border: 1px solid var(--line); color: var(--muted); background: var(--surface);
    transition: transform 0.35s var(--ease), color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.3s ease;
}
.social-link svg { width: 18px; height: 18px; }
.social-link:hover { color: #fff; background: var(--btn-grad); border-color: transparent; transform: translateY(-4px) rotate(-6deg); box-shadow: 0 10px 24px -8px var(--glow); }
.footer-meta { justify-self: end; display: flex; align-items: center; justify-content: flex-end; gap: 4px 18px; flex-wrap: wrap; text-align: right; font-size: 12.5px; color: var(--faint); }
.footer-copy { color: var(--faint); }
.footer-policy { color: var(--accent-text); font-weight: 500; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: opacity 0.25s ease, text-decoration-color 0.25s ease; }
.footer-policy:hover, .footer-policy:focus-visible { opacity: 0.85; text-decoration-color: currentColor; }



/* ---------- Просмотрщик фото проекта ---------- */

.viewer { margin-top: 4px; }

.viewer-stage {
    position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: min(66vh, 600px); overflow: hidden;
    border: 1px solid var(--line-strong); border-radius: 22px; background: var(--surface-solid);
    box-shadow: 0 0 0 6px var(--accent-bg), 0 40px 80px -36px var(--glow);
}
.viewer-open { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.viewer-open:focus-visible, .viewer-thumb:focus-visible, .gallery-nav:focus-visible, .lightbox-close:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; }

.viewer-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: opacity 0.18s ease, transform 0.7s var(--ease); }
.viewer-img.is-changing { opacity: 0; }
.viewer-stage:hover .viewer-img { transform: scale(1.025); }

.viewer-counter, .viewer-zoom {
    position: absolute; top: 14px; display: inline-flex; align-items: center; justify-content: center; min-height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 99px; color: #fff;
    background: rgba(8, 7, 15, 0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); pointer-events: none;
}
.viewer-counter { left: 14px; padding: 4px 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.viewer-zoom { right: 14px; width: 32px; }
.viewer-zoom svg { width: 16px; height: 16px; }

.viewer-caption, .lightbox-caption { min-height: 1.6em; margin: 14px 0 0; color: var(--muted); font-size: 14px; text-align: center; }

.gallery-nav {
    position: absolute; top: 50%; z-index: 2; display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 50%; color: #fff;
    background: rgba(8, 7, 15, 0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    cursor: pointer; transform: translateY(-50%);
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.35s var(--ease);
}
.gallery-nav svg { width: 22px; height: 22px; }
.gallery-nav:hover { background: var(--accent); border-color: transparent; transform: translateY(-50%) scale(1.1); }
.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }

.viewer-thumbs { display: flex; gap: 10px; margin-top: 14px; padding-bottom: 6px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.viewer-thumb {
    flex: 0 0 auto; width: 112px; aspect-ratio: 16 / 10; padding: 0; overflow: hidden;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface-solid);
    opacity: 0.55; cursor: pointer;
    transition: opacity 0.3s ease, border-color 0.3s ease, transform 0.35s var(--ease), box-shadow 0.3s ease;
}
.viewer-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.viewer-thumb:hover { opacity: 0.9; transform: translateY(-3px); }
.viewer-thumb.active { opacity: 1; border-color: var(--accent-soft); box-shadow: 0 8px 22px -8px var(--glow); }

.lightbox {
    position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column;
    background: rgba(6, 4, 12, 0.95); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    opacity: 0; transition: opacity 0.25s ease; color: #fff;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
html.lightbox-open { overflow: hidden; }
.lightbox-top { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; padding: 14px 18px; }
.lightbox-counter { color: #b9b2d0; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; pointer-events: none; }
.lightbox-close {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 50%; color: #fff; background: rgba(255, 255, 255, 0.06); cursor: pointer;
    transition: background-color 0.3s ease, transform 0.4s var(--ease);
}
.lightbox-close:hover { background: var(--accent); transform: rotate(90deg); }
.lightbox-close svg { width: 20px; height: 20px; }
.lightbox-main { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 80px; }
.lightbox-img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); transition: opacity 0.18s ease; }
.lightbox-img.is-changing { opacity: 0; }
.lightbox .gallery-prev { left: 18px; }
.lightbox .gallery-next { right: 18px; }
.lightbox-caption { flex: 0 0 auto; margin: 0; padding: 14px 20px 20px; color: #b9b2d0; }


/* ---------- Анимация смены темы ---------- */

html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
    transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease, fill 0.45s ease !important;
}


/* ---------- Адаптив ---------- */

@media (max-width: 1020px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 900px) {
    .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .hero-visual { max-width: 500px; }
    .about-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
    .contact-grid { gap: 36px; }
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .detail-side { position: static; }
}

@media (max-width: 760px) {
    .menu-btn { display: block; }
    .header-inner { gap: 10px; }
    .brand-name { max-width: 46vw; }
    .header-tools { gap: 8px; margin-left: auto; }

    .nav {
        position: absolute; top: calc(100% + 8px); left: 12px; right: 12px; margin: 0;
        flex-direction: column; align-items: stretch; gap: 2px; padding: 8px;
        border: 1px solid var(--line-strong); border-radius: 16px;
        background: var(--surface-solid); box-shadow: var(--shadow);
        opacity: 0; transform: translateY(-10px) scale(0.98); transform-origin: top right; pointer-events: none;
        transition: opacity 0.3s ease, transform 0.4s var(--ease);
    }
    .nav.open { opacity: 1; transform: none; pointer-events: auto; }
    .nav-link { padding: 12px 14px; }
    .nav-link.active { background: var(--accent-bg); }
    .nav-indicator { display: none; }

    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .facts { grid-template-columns: minmax(0, 1fr); }
    .service-hero { flex-direction: column; align-items: flex-start; }
    .footer-inner { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .footer-brand, .footer-meta { justify-self: center; }
    .footer-meta { justify-content: center; text-align: center; }
    .main { padding-block: 24px 56px; }
    .lightbox-main { padding: 0 12px; }
    .lightbox .gallery-nav { width: 40px; height: 40px; }
    .console-code { font-size: 11.5px; }
    .cta { padding: 24px; }
    .viewer-stage { border-radius: 16px; }
}

@media (max-width: 440px) {
    .photo-frame { width: 66%; }
    .console-stage { width: 90%; margin-top: -56px; }
    .gallery-nav { width: 38px; height: 38px; }
}


/* ---------- Без анимаций (системная настройка) ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
    .js .reveal { opacity: 1; transform: none; }
    .photo-frame { animation: none; }
}


/* Статус проекта в карточке портфолио */
.project-status {
    align-self: flex-start;
    margin: 12px 10px 0;
    font-size: 11.5px;
    padding: 4px 11px;
}


/* Animated vector stars fill the unused desktop margins */
.bg-stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    opacity: .9;
    z-index: 0;
    /* Сдвиг через inset-модификатор, не через transform (не ломает stacking) */
    top: 150px;
}
.bg-stars .star {
    fill: rgba(174, 119, 255, .10);
    stroke: rgba(190, 145, 255, .72);
    stroke-width: 1.5;
    stroke-linejoin: round;
    transform-box: fill-box;
    transform-origin: center;
    animation: star-twinkle 4.8s ease-in-out infinite;
}
.bg-stars .star-large { stroke-width: 2; animation-duration: 6.2s; }
.bg-stars .star-small { stroke-width: 1.1; animation-duration: 3.7s; }
.bg-stars .star-drift-a { animation: stars-float-a 24s ease-in-out infinite alternate; }
.bg-stars .star-drift-b { animation: stars-float-b 29s ease-in-out infinite alternate; }
.bg-stars .star-drift-b .star { animation-delay: -2.1s; }
.bg-stars .star-dots { fill: rgba(197, 158, 255, .7); animation: star-dots 5.5s ease-in-out infinite alternate; }
@keyframes star-twinkle {
    0%, 100% { opacity: .35; transform: scale(.82) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.12) rotate(12deg); }
}
@keyframes stars-float-a { to { transform: translate3d(8px, -14px, 0); } }
@keyframes stars-float-b { to { transform: translate3d(-10px, 12px, 0); } }
@keyframes star-dots { to { opacity: .28; } }
@media (max-width: 700px) {
    .bg-stars { opacity: .48; top: 100px; }
    .bg-stars .star-drift-a, .bg-stars .star-drift-b { transform: scale(.8); }
}
@media (prefers-reduced-motion: reduce) {
    .bg-stars *, .bg-stars { animation: none !important; }
}


/* =====================================================================
   COOKIE-УВЕДОМЛЕНИЕ · КНОПКА КОМАНДЫ · ПОМЕТКА «СТРАНИЦА СКРЫТА»
===================================================================== */

.cookie-banner {
    position: fixed; z-index: 700;
    left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    width: min(94vw, 820px); padding: 18px 20px;
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: var(--surface-solid);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55), 0 0 0 4px var(--accent-bg);
    animation: cookie-in 0.6s var(--ease) both;
}
.cookie-banner.is-leaving { opacity: 0; transform: translate(-50%, 16px); transition: opacity 0.3s ease, transform 0.3s var(--ease); }
@keyframes cookie-in { from { opacity: 0; transform: translate(-50%, 24px); } }
.cookie-body { min-width: 0; }
.cookie-title { font-size: 15px; font-weight: 700; color: var(--text); }
.cookie-text { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.cookie-link { margin-left: 4px; color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.cookie-link:hover { opacity: 0.8; }
.cookie-actions { display: flex; flex: 0 0 auto; gap: 10px; }
.cookie-btn { padding: 10px 18px; font-size: 14px; white-space: nowrap; }

.page-actions { margin-top: 22px; }
.team-icon { width: 20px; height: 20px; color: var(--accent-text); }

.preview-notice {
    padding: 10px 20px; text-align: center;
    font-size: 13px; font-weight: 600; color: var(--accent-text);
    background: var(--accent-bg); border-bottom: 1px solid var(--line-strong);
}

@media (max-width: 640px) {
    .cookie-banner { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
    .cookie-actions { flex-direction: column; }
    .cookie-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .cookie-banner { animation: none; }
}
