/* ==========================================================================
   Портфолио Даниила Мустафина — визуальный язык DREAMAGE
   Токены: bg #030303 · accent #c67df9 · glass blur(18px) saturate(1.1)
   Radii: 36 / 24 / 16 · reveal: y28 → 0, 0.7s, stagger 80ms
   ========================================================================== */

:root {
    --bg: #030303;
    --surface: #0a0a0a;
    --accent: #c67df9;
    --accent-2: #9333ea;
    --blue: #3b82f6;
    --emerald: #10b981;
    --border: rgba(255, 255, 255, 0.06);
    --ink: #ffffff;
    --muted: rgba(255, 255, 255, 0.55);
    --faint: rgba(255, 255, 255, 0.35);
    --glass: rgba(255, 255, 255, 0.03);
    --radius: 36px;
    --radius-premium: 24px;
    --radius-btn: 16px;
    --header-h: 80px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
    overflow-y: scroll;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    background-color: var(--bg);
    color: var(--ink);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: rgba(198, 125, 249, 0.35); color: #fff; }

/* Скроллбар — фирменный фиолетовый */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--accent));
    border-radius: 999px;
    border: 2px solid transparent;
    border-right-width: 4px;
    background-clip: padding-box;
    min-height: 70px;
    transition: border-right-width 0.2s ease, filter 0.2s ease;
}
::-webkit-scrollbar-thumb:hover { border-right-width: 2px; filter: brightness(1.15); }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(198, 125, 249, 0.45) transparent; }

.container {
    width: min(1600px, calc(100% - 48px));
    margin-inline: auto;
}

/* ========================== Фоновые сферы ============================== */
.orbs { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.32;
    will-change: transform;
}
.orb--purple {
    width: 520px; height: 520px;
    background: var(--accent);
    top: -140px; left: -120px;
    animation: orb-drift 26s ease-in-out infinite alternate;
}
.orb--blue {
    width: 460px; height: 460px;
    background: var(--blue);
    top: 38vh; right: -160px;
    opacity: 0.22;
    animation: orb-drift 32s ease-in-out infinite alternate-reverse;
}
.orb--emerald {
    width: 420px; height: 420px;
    background: var(--emerald);
    bottom: -160px; left: 30vw;
    opacity: 0.16;
    animation: orb-drift 38s ease-in-out infinite alternate;
}
@keyframes orb-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(80px, 60px, 0) scale(1.15); }
}

/* ========================== Стекло и карточки ========================== */
.glass-panel {
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    backdrop-filter: blur(18px) saturate(1.1);
    border-radius: var(--radius-premium);
    position: relative;
}

/* Следящий за курсором spotlight (как на DREAMAGE) */
.spotlight::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle 220px at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(198, 125, 249, 0.16),
        rgba(198, 125, 249, 0.05) 40%,
        transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.spotlight:hover::before { opacity: 1; }

/* ========================== Шапка ====================================== */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: rgba(3, 3, 3, 0.55);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    backdrop-filter: blur(18px) saturate(1.1);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease, height 0.3s ease;
}
.site-header.is-scrolled { background: rgba(3, 3, 3, 0.8); }

.header-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    width: min(1600px, calc(100% - 48px));
}

.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.logo-text {
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 15px;
}
.logo-text em {
    font-style: italic;
    font-weight: 400;
    text-transform: lowercase;
    color: var(--muted);
    letter-spacing: 0;
    margin-left: 6px;
}

.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    border-radius: 10px;
    transition: background 0.2s ease;
}
.nav-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 10%;
    width: 80%;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    border-radius: 2px;
    transition: opacity 0.2s ease, width 0.25s ease, left 0.25s ease;
}
.nav-item:hover::after { opacity: 1; left: 0; width: 100%; }
.nav-item.is-active::after { opacity: 1; left: 20%; width: 60%; }

.header-cta {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 20px;
    border-radius: var(--radius-btn);
    font-size: 13.5px;
    font-weight: 700;
    background: linear-gradient(90deg, #a855f7, #6366f1);
    transition: filter 0.25s ease, transform 0.25s ease;
}
.header-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }

.burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.burger span { width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: 0.25s; }

/* ========================== Кнопки ===================================== */
.btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    padding: 0 30px;
    border-radius: var(--radius-btn);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: filter 0.25s ease, transform 0.25s var(--ease-soft), background 0.25s ease, box-shadow 0.25s ease;
}
.btn--enchanted {
    background: linear-gradient(90deg, #c67df9, #6366f1);
    color: #fff;
    box-shadow: 0 0 24px -6px rgba(168, 85, 247, 0.55);
}
.btn--enchanted:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 0 34px -6px rgba(168, 85, 247, 0.7); }
.btn--frost {
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    backdrop-filter: blur(18px) saturate(1.1);
    border: 1px solid var(--border);
}
.btn--frost:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-2px); }

/* Блик зачарования — фирменная анимация DREAMAGE (2.6s) */
.enchantment-sweep-bg {
    position: absolute;
    inset: -20%;
    background-image: repeating-linear-gradient(110deg,
        transparent 0%, transparent 20%,
        rgba(216, 180, 254, 0.15) 35%,
        rgba(216, 180, 254, 0.45) 50%,
        rgba(216, 180, 254, 0.15) 65%,
        transparent 80%, transparent 100%);
    background-size: 200% 100%;
    animation: enchantment-sweep 2.6s linear infinite;
    pointer-events: none;
    filter: blur(3px);
    mix-blend-mode: overlay;
}
@keyframes enchantment-sweep {
    from { background-position: -200% 0%; }
    to { background-position: 0% 0%; }
}

/* ========================== HERO ======================================= */
.hero {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 72px) 0 96px;
}

/* Имя слева, портрет справа */
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(300px, 34vw, 500px);
    gap: clamp(28px, 4vw, 56px);
    align-items: center;
}
.hero-text { min-width: 0; }

.hero-portrait {
    margin: 0;
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--glass);
    cursor: zoom-in;
    box-shadow: 0 34px 90px -44px rgba(198, 125, 249, 0.65);
    transition: border-color 0.25s ease;
}
.hero-portrait:hover { border-color: rgba(198, 125, 249, 0.5); }
.hero-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hero-portrait figcaption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 40px 20px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    pointer-events: none;
}
.hero-portrait::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(198, 125, 249, 0.16), transparent 45%);
    pointer-events: none;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    backdrop-filter: blur(18px) saturate(1.1);
    border: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.hero-title-wrap {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    line-height: 1;
    overflow: visible;
}
.hero-title {
    display: inline-block;
    font-size: clamp(48px, 8.5vw, 130px);
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    transform: skewX(-10deg);
    transform-origin: center;
    overflow: visible !important;
}
.hero-title--accent {
    background: linear-gradient(100deg, #ffffff 20%, var(--accent) 50%, #ffffff 80%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShiftSlow 6s ease-in-out infinite;
}
@keyframes gradientShiftSlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-sub {
    margin-top: 28px;
    max-width: 640px;
    font-size: 17px;
    line-height: 1.65;
    color: var(--muted);
}
.hero-sub em { color: var(--ink); font-style: italic; font-weight: 700; padding-right: 0.15em; }

.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; }

.hero-meta {
    margin-top: 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    font-size: 12.5px;
    font-weight: 700;
    color: #4ade80;
}
.status-light {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
    animation: pulse-light 2s ease-in-out infinite;
}
@keyframes pulse-light { 50% { opacity: 0.45; } }

.meta-chip {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
}

.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    opacity: 0.6;
    transition: opacity 0.2s;
}
.scroll-hint:hover { opacity: 1; }
.scroll-hint__mouse {
    display: block;
    width: 24px; height: 38px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    position: relative;
}
.scroll-hint__mouse span {
    position: absolute;
    top: 7px; left: 50%;
    width: 3px; height: 7px;
    margin-left: -1.5px;
    border-radius: 3px;
    background: var(--accent);
    animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(12px); opacity: 0; }
}

/* ========================== Статы ====================================== */
.stats { padding: 8px 0 40px; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.stat { padding: 28px 26px; text-align: left; }
.stat-num {
    font-size: clamp(36px, 4vw, 52px);
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.02em;
    background: linear-gradient(120deg, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}
.stat-label { margin-top: 10px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* ========================== Секции ===================================== */
.section { padding: 96px 0; }
.section-head { max-width: 860px; margin-bottom: 48px; }

/* Заголовок+описание слева, плашки «Суть / Что извлёк» справа */
.section-head--split {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 44px;
    align-items: start;
}
.section-head--split .section-head__main { min-width: 0; }
.section-head--split .section-head__notes { min-width: 0; }
.section-head--split .insight-row {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 46px;
}
.section-head--split .insight { background: transparent; border-style: dashed; }

.section-pill {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    backdrop-filter: blur(18px) saturate(1.1);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.section-title {
    display: block;
    margin-top: 18px;
    font-size: clamp(40px, 6vw, 76px);
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    transform: skewX(-6deg);
    transform-origin: left center;
}

.section-lead {
    margin-top: 22px;
    font-size: 16.5px;
    line-height: 1.7;
    color: var(--muted);
    max-width: 760px;
}

.sub-title {
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    transform: skewX(-6deg);
    transform-origin: left center;
    display: inline-block;
}
.sub-lead { margin-top: 12px; color: var(--muted); max-width: 720px; }

/* Frost-пилюля заголовка (dshop-frost-card стиль) */
.section-pill + .section-title { margin-top: 18px; }

/* ========================== Карточки режимов =========================== */
.modes-block { margin-top: 8px; }
.modes-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}
.mode-card {
    position: relative;
    display: block;
    aspect-ratio: 1 / 2;
    border-radius: var(--radius-premium);
    overflow: hidden;
    cursor: default;
    transition: box-shadow 0.25s var(--ease-soft);
}
.mode-card:hover { box-shadow: 0 18px 40px -18px rgba(198, 125, 249, 0.45); }
.mode-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mode-card__color {
    opacity: 0;
    transition: opacity 0.5s ease;
    transition-delay: var(--rd, 0ms) !important;
}
.mode-card.is-lit .mode-card__color,
.mode-card:hover .mode-card__color { opacity: 1; }
.mode-card__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.4) 42%, transparent 70%);
    pointer-events: none;
}
.mode-card__label {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 14px;
    text-align: center;
    pointer-events: none;
}
.mode-card__label h4 {
    font-size: clamp(13px, 1.1vw, 18px);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.15;
}
.mode-card__label span {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}
.modes-caption {
    margin-top: 16px;
    font-size: 13px;
    color: var(--faint);
    text-align: center;
}

/* ========================== Экосистема ================================= */
.eco-head { margin: 72px 0 32px; }
.eco-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.eco-card {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-premium);
    transition: border-color 0.25s ease, transform 0.25s var(--ease-soft);
    overflow: hidden;
}
.eco-card:hover { border-color: rgba(198, 125, 249, 0.35); transform: translateY(-3px); }
.eco-icon {
    width: 46px; height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(198, 125, 249, 0.12);
    color: var(--accent);
    margin-bottom: 18px;
}
.eco-icon svg { width: 24px; height: 24px; }
.eco-card h4 {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.eco-card p { margin-top: 10px; font-size: 14px; line-height: 1.6; color: var(--muted); }

.chips { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 7px; }
.chips span {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.02em;
}

/* ========================== Факты ====================================== */
.facts {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 34px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.fact { text-align: center; }
.fact b {
    display: block;
    font-size: clamp(34px, 3.6vw, 50px);
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1;
}
.fact span { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ========================== Рейл-галереи =============================== */
.gallery-head {
    margin-top: 64px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.gallery-arrows { display: flex; gap: 8px; }
.arrow-btn {
    width: 46px; height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.arrow-btn:hover {
    background: rgba(198, 125, 249, 0.16);
    border-color: rgba(198, 125, 249, 0.5);
    transform: scale(1.06);
}
.arrow-btn svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.rail {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
    overscroll-behavior-x: contain;
}
.rail::-webkit-scrollbar { height: 6px; }
.rail-card {
    position: relative;
    flex: 0 0 clamp(260px, 24vw, 380px);
    scroll-snap-align: start;
    border-radius: var(--radius-premium);
    overflow: hidden;
    background: var(--glass);
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.rail-card:hover {
    border-color: rgba(198, 125, 249, 0.4);
    box-shadow: 0 18px 40px -20px rgba(198, 125, 249, 0.5);
}
.rail-card img { width: 100%; height: 230px; object-fit: cover; }
.rail-card--fit img { object-fit: contain; background: #060606; }
.rail-card figcaption {
    padding: 12px 16px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.rail--tight .rail-card { flex-basis: clamp(300px, 30vw, 480px); }

/* ========================== Ранги ====================================== */
.ranks { margin-top: 64px; }
.ranks-row {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}
.ranks-row--full { grid-template-columns: repeat(8, 1fr); }
.rank {
    padding: 18px 12px 14px;
    text-align: center;
    border: 1px solid var(--border);
    transition: border-color 0.25s ease;
    cursor: zoom-in;
}
.rank:hover { border-color: rgba(198, 125, 249, 0.4); }
/* Цвет свечения — из системы привилегий DREAMAGE (data/ranks.ts) */
.rank {
    --glow: rgba(198, 125, 249, 0.55);
    position: relative;
}
.rank[data-role="whisper"]    { --glow: #9581bf; }
.rank[data-role="essence"]    { --glow: #8e32a9; }
.rank[data-role="nova"]       { --glow: #d15e1d; }
.rank[data-role="dreamer"]    { --glow: #b080d0; }
.rank[data-role="visionary"]  { --glow: #7f68c2; }
.rank[data-role="ephemeral"]  { --glow: #5a9db7; }
.rank[data-role="celestial"]  { --glow: #dec28d; }
.rank[data-role="elysium"]    { --glow: #fbbf24; }
.rank[data-role="player"]     { --glow: #9ca3af; }
.rank[data-role="helper"]     { --glow: #34d399; }
.rank[data-role="curator"]    { --glow: #60a5fa; }
.rank[data-role="c-curator"]  { --glow: #38bdf8; }
.rank[data-role="admin"]      { --glow: #f87171; }
.rank[data-role="c-admin"]    { --glow: #fbbf24; }
.rank[data-role="dev"]        { --glow: #a78bfa; }

/* Ореол позади иконки */
.rank::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: min(96px, 70%);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow) 0%, transparent 68%);
    opacity: 0.34;
    filter: blur(8px);
    pointer-events: none;
    z-index: 0;
    animation: halo-wave 2.6s ease-in-out infinite;
}
.rank:hover::after { opacity: 0.6; }
.rank img {
    position: relative;
    z-index: 1;
    width: min(96px, 70%);
    margin: 0 auto;
    animation: glow-wave 2.6s ease-in-out infinite;
    border-radius: 18px;
    filter: drop-shadow(0 0 10px var(--glow));
}
.rank:hover img { animation-duration: 1.6s; }
@keyframes halo-wave {
    0%, 100% { opacity: 0.24; transform: translateX(-50%) scale(0.94); }
    50% { opacity: 0.48; transform: translateX(-50%) scale(1.06); }
}
@keyframes glow-wave {
    0%, 100% { filter: drop-shadow(0 0 10px var(--glow)); }
    50% { filter: drop-shadow(0 0 24px var(--glow)); }
}
.rank span {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Группы: администрация и привилегии */
.rank-group { margin-top: 26px; }
.rank-group__label { display: block; margin-bottom: 14px; color: var(--accent); }
.ranks-row--group { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.rank[data-role] { cursor: pointer; }
.rank[data-role]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ========================== Карточка роли ============================== */
.role-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.22s ease;
}
.role-modal.is-open { opacity: 1; }
.role-modal[hidden] { display: none; }
.role-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.role-modal__card {
    position: relative;
    width: min(760px, 100%);
    max-height: 86vh;
    overflow-y: auto;
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid rgba(198, 125, 249, 0.35);
    border-radius: var(--radius-premium);
    background: rgba(10, 10, 14, 0.92);
    box-shadow: 0 40px 110px -40px rgba(198, 125, 249, 0.6);
}
.role-modal__close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 34px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s, transform 0.2s;
}
.role-modal__close:hover { color: #fff; transform: rotate(90deg); }
.role-modal__head {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-right: 36px;
}
.role-modal__titles { min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.role-modal__icon {
    width: 92px;
    height: 92px;
    flex: 0 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 0 14px var(--glow, rgba(198, 125, 249, 0.55))) drop-shadow(0 0 34px var(--glow, rgba(198, 125, 249, 0.35)));
    margin-bottom: 0;
}
.role-modal__group {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(198, 125, 249, 0.14);
    border: 1px solid rgba(198, 125, 249, 0.4);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}
.role-modal__title {
    margin-top: 12px;
    font-size: clamp(26px, 3.4vw, 38px);
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    transform: skewX(-6deg);
    transform-origin: left center;
    display: inline-block;
}
.role-modal__summary {
    margin-top: 12px;
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--muted);
}
.role-modal__cols {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.role-modal__col .rail-label { display: block; margin-bottom: 10px; color: var(--accent); }
.role-modal__col ul { list-style: none; display: grid; gap: 8px; }
.role-modal__col li {
    position: relative;
    padding: 10px 12px 10px 32px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.78);
}
.role-modal__col li::before {
    content: '✦';
    position: absolute;
    left: 12px;
    top: 11px;
    color: var(--accent);
    font-size: 11px;
}
.role-modal__meta {
    margin-top: 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
}
.role-modal__meta:empty { display: none; }

@media (max-width: 640px) {
    .role-modal__cols { grid-template-columns: minmax(0, 1fr); }
}

/* ========================== О себе ===================================== */
.logo-mark--face { border-radius: 50%; object-fit: cover; }

.about-body { margin-top: 0; }
.about-label { display: block; margin-bottom: 16px; color: var(--accent); }
.about-bio {
    font-size: 17px;
    line-height: 1.7;
    color: var(--muted);
    max-width: 780px;
}
.about-bio b { color: var(--ink); font-weight: 800; }

.dao-card {
    margin-top: 28px;
    padding: clamp(24px, 3vw, 36px);
    border: 1px solid var(--border);
    border-radius: var(--radius-premium);
    overflow: hidden;
}
.dao-title {
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    transform: skewX(-6deg);
    transform-origin: left center;
    display: inline-block;
}
.dao-lead { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.dao-list { margin-top: 18px; list-style: none; display: grid; gap: 14px; }
.dao-list li {
    position: relative;
    padding: 14px 16px 14px 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.72);
}
.dao-list li::before {
    content: '✦';
    position: absolute;
    left: 17px;
    top: 15px;
    color: var(--accent);
    font-size: 13px;
}
.dao-list b { color: var(--ink); font-weight: 800; }

.about-bio--second { margin-top: 18px; }

/* История слева, цитата справа */
.about-top {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}
.about-story { min-width: 0; }
.about-top .quote {
    margin-top: 34px;
    max-width: none;
    position: sticky;
    top: calc(var(--header-h) + 24px);
}

/* Цитата */
.quote {
    margin-top: 30px;
    padding: clamp(22px, 3vw, 32px) clamp(22px, 3vw, 36px);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 16px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    max-width: 860px;
}
.quote-emoji { font-size: 26px; line-height: 1.3; flex: 0 0 auto; }
.quote p {
    font-size: clamp(16px, 1.7vw, 20px);
    font-style: italic;
    font-weight: 600;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
    text-wrap: pretty;
}

/* Суть / что извлёк */
.insight-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.insight-row--project { margin-top: 18px; }
.insight {
    padding: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    border-radius: 16px;
}
.insight .rail-label { display: block; margin-bottom: 8px; color: var(--accent); }
.insight p { font-size: 13.5px; line-height: 1.6; color: rgba(255, 255, 255, 0.7); }

/* 14 принципов Toyota Way */
.toyota14 {
    margin-top: 34px;
    padding: clamp(24px, 3vw, 36px);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-premium);
}
.toyota14__head { max-width: 760px; }
.toyota14__grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}
.pillar .rail-label { display: block; margin-bottom: 12px; color: var(--accent); }
.pillar ol {
    list-style: none;
    counter-reset: toyota;
    display: grid;
    gap: 10px;
}
.pillar li {
    counter-increment: toyota;
    position: relative;
    padding: 12px 12px 12px 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.74);
}
.pillar li::before {
    content: counter(toyota);
    position: absolute;
    left: 12px;
    top: 11px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(198, 125, 249, 0.16);
    border: 1px solid rgba(198, 125, 249, 0.4);
    font-size: 11.5px;
    font-weight: 800;
    color: var(--accent);
}
.pillar ol li { counter-reset: none; }

@media (max-width: 1279px) {
    .toyota14__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .toyota14__grid,
    .insight-row,
    .insight-row--project { grid-template-columns: minmax(0, 1fr); }
}

/* ========================== Онлайн-презентация ========================= */
.deck {
    max-width: 1100px;
    margin: 0 auto;
}
.deck__stage {
    border-radius: var(--radius-premium);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #060606;
    box-shadow: 0 40px 110px -50px rgba(198, 125, 249, 0.55);
    cursor: pointer;
}
.deck__stage img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    display: block;
    background: #060606;
}
.deck__bar {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
}
.deck__counter {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--muted);
    min-width: 74px;
    text-align: center;
}
.deck__counter b { color: var(--accent); font-size: 18px; }

/* ========================== Контакты: карточки ========================= */
.contacts-cards {
    margin-top: 34px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 860px;
    margin-inline: auto;
}
.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-premium);
    overflow: hidden;
    transition: border-color 0.25s ease;
    text-align: center;
}
a.contact-card { cursor: pointer; }
.contact-card:hover { border-color: rgba(198, 125, 249, 0.45); }
.contact-badge {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.contact-badge--tg { background: rgba(42, 171, 238, 0.16); color: #2AABEE; border: 1px solid rgba(42, 171, 238, 0.5); }
.contact-badge--ds { background: rgba(88, 101, 242, 0.18); color: #5865F2; border: 1px solid rgba(88, 101, 242, 0.55); }
.contact-badge--vk { background: rgba(0, 119, 255, 0.16); color: #2688EB; border: 1px solid rgba(0, 119, 255, 0.5); }
.contact-name {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}
.contact-val { font-size: 15.5px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }

/* ========================== CTA DREAMAGE =============================== */
.dreamage-cta { margin-top: 64px; }
.dreamage-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.dreamage-cta__btns { display: flex; gap: 12px; flex-shrink: 0; flex-wrap: wrap; }

/* ========================== Проекты ==================================== */
/* Структура: шапка (название+описание слева | суть и уроки справа) → обложка → галерея */
.project {
    padding: 56px 0;
    border-top: 1px solid var(--border);
}
.project-head {
    display: grid;
    grid-template-columns: minmax(0, 640px) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}
.project-head__id { min-width: 0; }
.project-head__notes { min-width: 0; }
.project-head__notes .insight-row { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
.project-head__notes .insight { background: transparent; border-style: dashed; }
.project-head__id > p {
    margin-top: 16px;
    color: var(--muted);
    font-size: 15.5px;
    line-height: 1.65;
}
.project-head__id > .chips { margin-top: 16px; }
.project-tag {
    display: flex;
    width: fit-content;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(198, 125, 249, 0.12);
    border: 1px solid rgba(198, 125, 249, 0.3);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}
.project-title {
    margin-top: 16px;
    font-size: clamp(26px, 3vw, 40px);
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 1.08;
    overflow-wrap: anywhere;
    transform: skewX(-6deg);
    transform-origin: left center;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    max-width: 100%;
}
.project-icon {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(198, 125, 249, 0.12);
    border: 1px solid rgba(198, 125, 249, 0.32);
    color: var(--accent);
    transform: skewX(6deg);
}
.project-icon svg { width: 24px; height: 24px; }
.project-icon--img {
    background: #ffffff;
    border: none;
    overflow: hidden;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.6);
}
.project-icon--img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 7px;
    border-radius: inherit;
    display: block;
}
.project-head__text p { color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.project-head__text .chips { margin-top: 16px; }

/* Обложка проекта — во всю ширину, под шапкой */
.project-cover {
    margin-top: 30px;
    width: 100%;
    border-radius: var(--radius-premium);
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 16 / 9;
    background: var(--glass);
    cursor: zoom-in;
    position: relative;
    max-height: 620px;
}
.project-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}
.project-cover--contain img { object-fit: contain; background: #060606; }
.project-cover:hover { border-color: rgba(198, 125, 249, 0.45); }
.project-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent 40%);
    pointer-events: none;
}

/* Галерея проекта — под обложкой, полноширинная */
.rail--wide .rail-card { flex: 0 0 clamp(340px, 44vw, 600px); }
.rail--wide .rail-card img {
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #050505;
}
.rail--wide .rail-card--fit img { object-fit: contain; }

/* Шапка собственной галереи проекта */
.rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 26px 0 14px;
}
.rail-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}

/* ========================== Масонри 3D/Арт ============================= */
.masonry {
    columns: 4 260px;
    column-gap: 16px;
}
.masonry-item {
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: var(--radius-premium);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--glass);
    cursor: zoom-in;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.masonry-item:hover {
    border-color: rgba(198, 125, 249, 0.4);
    box-shadow: 0 18px 40px -20px rgba(198, 125, 249, 0.5);
}
.masonry-item img { width: 100%; }
.masonry-item figcaption {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ========================== Навыки ===================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.skill-card {
    padding: 30px 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-premium);
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s var(--ease-soft);
}
.skill-card:hover { border-color: rgba(198, 125, 249, 0.35); transform: translateY(-3px); }
.skill-card h3 {
    font-size: 17px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--accent);
}
.skill-card ul { margin-top: 16px; list-style: none; }
.skill-card li {
    position: relative;
    padding: 7px 0 7px 20px;
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.78);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
}
.skill-card li:last-child { border-bottom: none; }
.skill-card li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 11px;
    top: 9px;
}

/* ========================== Контакты =================================== */
.section--contacts { padding-bottom: 110px; }
.contacts {
    padding: clamp(40px, 6vw, 72px);
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.contacts .section-title { transform-origin: center; }
.contacts .section-lead { margin-inline: auto; }
.contacts-row { margin-top: 34px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ========================== Футер ====================================== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    background: rgba(3, 3, 3, 0.7);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    backdrop-filter: blur(18px) saturate(1.1);
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.site-footer p { font-size: 13px; color: var(--faint); }
.to-top { font-size: 13px; font-weight: 700; color: var(--accent); }
.to-top:hover { text-decoration: underline; }

/* ========================== Lightbox =================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 40px;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lightbox figure {
    max-width: min(1200px, 92vw);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
.lightbox img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 30px 80px -30px rgba(198, 125, 249, 0.5);
}
.lightbox figcaption {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}
.lightbox-close {
    position: absolute;
    top: 18px; right: 26px;
    font-size: 42px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s, transform 0.2s;
}
.lightbox-close:hover { color: #fff; transform: rotate(90deg); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px; height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    font-size: 30px;
    display: grid;
    place-items: center;
    transition: background 0.2s, border-color 0.2s;
}
.lightbox-nav:hover { background: rgba(198, 125, 249, 0.2); border-color: rgba(198, 125, 249, 0.5); }
.lightbox-nav--prev { left: 22px; }
.lightbox-nav--next { right: 22px; }

/* ========================== Reveal-on-scroll =========================== */
/* Как useRevealOnScroll на DREAMAGE: стартовый сдвиг до появления,
   power2.out ≈ cubic-bezier(0.22, 1, 0.36, 1), start «top 85%» */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s),
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s);
    will-change: transform;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================== Адаптив ==================================== */
@media (min-width: 1024px) {
    .container,
    .header-inner { width: min(1600px, calc(100% - 80px)); }
    .dao-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1279px) {
    .modes-grid { grid-template-columns: repeat(4, 1fr); }
    .mode-card:nth-child(n+5) { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .eco-grid { grid-template-columns: repeat(2, 1fr); }
    .ranks-row,
    .ranks-row--full { grid-template-columns: repeat(4, 1fr); }
    .masonry { columns: 3 220px; }
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    :root { --header-h: 66px; }

    .nav {
        position: fixed;
        top: var(--header-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 14px 24px 22px;
        background: rgba(3, 3, 3, 0.95);
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border);
        transform: translateY(-130%);
        transition: transform 0.35s var(--ease-out);
        margin-left: 0;
    }
    .nav.is-open { transform: translateY(0); }
    .nav-item { height: 46px; font-size: 15px; }

    .header-cta { display: none; }
    .burger { display: flex; margin-left: auto; }
    .burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .burger.is-open span:nth-child(2) { opacity: 0; }
    .burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .hero { min-height: auto; padding-top: calc(var(--header-h) + 56px); padding-bottom: 72px; }
    .scroll-hint { display: none; }

    .modes-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .mode-card--center { order: 0; }

    .project { padding: 40px 0; }
    .project-head { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .section-head--split { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .section-head--split .insight-row { margin-top: 0; }
    .about-top { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .about-top .quote { position: static; margin-top: 4px; }

    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .hero-portrait { max-width: 420px; }

    .dreamage-cta__inner { flex-direction: column; align-items: flex-start; padding: 30px; }

    .section { padding: 72px 0; }
    .facts { grid-template-columns: repeat(2, 1fr); gap: 26px 12px; }
}

@media (max-width: 640px) {
    .container { width: calc(100% - 32px); }
    .modes-grid { grid-template-columns: repeat(2, 1fr); }
    .eco-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 20px 18px; }
    .ranks-row,
    .ranks-row--full { grid-template-columns: repeat(3, 1fr); }
    .contacts-cards { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
    .skills-grid { grid-template-columns: 1fr; }
    .masonry { columns: 2 150px; column-gap: 10px; }
    .masonry-item { margin-bottom: 10px; }
    .hero-actions .btn { width: 100%; }
    .footer-inner { flex-direction: column; text-align: center; }
    .lightbox { padding: 16px; }
    .lightbox-nav { width: 44px; height: 44px; font-size: 24px; }
    .lightbox-nav--prev { left: 8px; }
    .lightbox-nav--next { right: 8px; }
}

/* ========================== Reduced motion ============================= */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .orb, .enchantment-sweep-bg, .rank img, .hero-title--accent,
    .status-light, .scroll-hint__mouse span { animation: none !important; }
    .mode-card, .rail-card, .masonry-item, .eco-card, .skill-card, .btn { transition: none !important; }
}
