/* ===========================================================
   Kirill.dev — винтажный чёрно-белый минимализм
   • заголовки рукописным шрифтом (Parisienne)
   • проявляются с 3D-анимацией при наведении
   • тело — благородный серив (EB Garamond)
   • фон: тёмный монохром + зерно плёнки + виньетка + свет за курсором
   =========================================================== */

:root {
    --bg:       #0c0c0d;
    --bg-2:     #141416;
    --ink:      #ece9e1;   /* тёплый почти-белый (винтаж) */
    --ink-dim:  #8d8a82;
    --line:     rgba(236, 233, 225, 0.16);
    --line-soft:rgba(236, 233, 225, 0.08);

    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --pop:  cubic-bezier(0.34, 1.56, 0.64, 1);   /* лёгкий «вылет» вперёд */
    --slow: 0.8s var(--ease);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
    font-family: 'EB Garamond', Georgia, serif;
    color: var(--ink);
    background-color: var(--bg);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.9s ease, color 0.9s ease;
}

/* плавная смена цвета у всех элементов при переключении темы */
body * { transition: background-color 0.9s ease, color 0.9s ease, border-color 0.9s ease; }

/* СВЕТЛАЯ тема — включается при прокрутке вниз */
body.light {
    --bg:        #efece3;   /* винтажная бумага */
    --bg-2:      #e4e0d4;
    --ink:       #1a1712;
    --ink-dim:   #6b6459;
    --line:      rgba(26, 23, 18, 0.20);
    --line-soft: rgba(26, 23, 18, 0.08);
}

/* ===========================================================
   ФОНОВЫЕ СЛОИ
   =========================================================== */
#bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
#bg canvas { display: block; width: 100% !important; height: 100% !important; }

/* свет, идущий за курсором (эффект при наведении на фон) */
.spotlight {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 50%),
        rgba(236, 233, 225, 0.08), transparent 55%);
}

/* виньетка по краям — винтажный кадр */
.vignette {
    position: fixed; inset: 0; z-index: 100; pointer-events: none;
    background: radial-gradient(circle at center, transparent 52%, rgba(0, 0, 0, 0.6));
    box-shadow: inset 0 0 220px 40px rgba(0, 0, 0, 0.85);
}

/* зерно киноплёнки */
.grain {
    position: fixed; top: -60%; left: -60%; width: 220%; height: 220%;
    z-index: 200; pointer-events: none; opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain 0.5s steps(4) infinite;
}
@keyframes grain {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(-4%, -3%); }
    50%  { transform: translate(3%, -5%); }
    75%  { transform: translate(-3%, 4%); }
    100% { transform: translate(4%, 3%); }
}

/* ПЕРЕХОД: кружок из левого нижнего угла разрастается в фон */
.wave-cover {
    position: fixed; inset: 0; z-index: -2;
    background: #efece3;
    pointer-events: none;
    clip-path: circle(0% at 7% 90%);
    transition: clip-path 1.1s cubic-bezier(0.76, 0, 0.24, 1);
}
body.light .wave-cover { clip-path: circle(150% at 7% 90%); }

/* ВИНТАЖНЫЕ РОЗЕТКИ-ПЕЧАТИ (гильош) в углах — рисуются в script.js */
.vintage-mark {
    position: fixed; width: 560px; height: 560px; z-index: 0;
    pointer-events: none; opacity: 0.16;
    background-size: contain; background-repeat: no-repeat;
    will-change: transform;
}
.vm-tl { top: -210px; left: -210px; animation: vmspin 120s linear infinite; }
.vm-br { bottom: -210px; right: -210px; animation: vmspin 150s linear infinite reverse; }
@keyframes vmspin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .vintage-mark { width: 340px; height: 340px; } }

/* в светлой теме — светлый хотбар, мягкая виньетка и тёмный свет за курсором */
body.light .navbar.scrolled {
    background: rgba(239, 236, 227, 0.82);
    border-bottom-color: var(--line-soft);
}
body.light .vignette {
    background: radial-gradient(circle at center, transparent 58%, rgba(0, 0, 0, 0.12));
    box-shadow: inset 0 0 180px 30px rgba(0, 0, 0, 0.08);
}
body.light .spotlight {
    background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 50%),
        rgba(0, 0, 0, 0.06), transparent 55%);
}

/* тонкая линия прогресса прокрутки */
.progress {
    position: fixed; top: 0; left: 0; height: 1px; width: 0;
    background: var(--ink); opacity: 0.55; z-index: 300;
}

.container { width: min(1080px, 90%); margin: 0 auto; }

/* ===========================================================
   РУКОПИСНЫЕ ЗАГОЛОВКИ — проявление с 3D-анимацией при наведении
   =========================================================== */
.hand {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    line-height: 1.3;
    display: inline-block;
    /* отступы, чтобы наклонные росчерки шрифта не обрезались clip-path */
    padding: 0.1em 0.35em;
    /* «дописывается» слева направо при появлении (чистый CSS, без JS) */
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    animation: inkIn 0.9s var(--ease) 0.2s both;
    transition: transform 0.45s var(--pop), text-shadow 0.45s ease;
    cursor: default;
}
@keyframes inkIn {
    from { opacity: 0; clip-path: inset(0 100% 0 0); }
    to   { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* при наведении — лёгкий «росчерк»: подскок и наклон */
.hand:hover,
.card:hover .hand {
    transform: scale(1.06) rotate(-1.5deg);
    text-shadow: 0 6px 30px rgba(236, 233, 225, 0.25);
}

/* ===========================================================
   НАВИГАЦИЯ
   =========================================================== */
.navbar {
    position: sticky; top: 0; z-index: 90;
    border-bottom: 1px solid transparent;
    /* хотбар перекрашивается быстрее, чем фон */
    transition: background 0.3s ease, border-color 0.3s ease;
}
.navbar * { transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease; }
.navbar.scrolled {
    background: rgba(12, 12, 13, 0.7);
    backdrop-filter: blur(10px);
    border-bottom-color: var(--line-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 78px; }

.logo {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 2.1rem;
    letter-spacing: 1px;
    color: var(--ink);
    text-decoration: none;
}
.nav-links { display: flex; gap: 4px; list-style: none; align-items: center; }
.nav-links a {
    color: var(--ink-dim); text-decoration: none;
    text-transform: uppercase; letter-spacing: 2.5px; font-size: 0.74rem;
    padding: 10px 18px; border-radius: 999px;
    transition: color 0.3s ease, background 0.3s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--line-soft); }
.nav-links .btn-nav { border: 1px solid var(--line); }
.nav-links .btn-nav:hover { background: var(--ink); color: var(--bg); }

.burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.burger span { width: 26px; height: 1.5px; background: var(--ink); transition: var(--slow); }

/* ===========================================================
   HERO
   =========================================================== */
.hero {
    text-align: center;
    min-height: calc(100vh - 78px);          /* на весь экран: следующий заголовок не виден сверху */
    display: flex; flex-direction: column; justify-content: center;
    padding: 60px 0;
    position: relative; z-index: 1;
}

.eyebrow {
    text-transform: uppercase; letter-spacing: 6px; font-size: 0.72rem;
    color: var(--ink-dim); margin-bottom: 30px;
}
.hero h1 { font-size: clamp(4rem, 15vw, 9rem); margin-bottom: 10px; }

.hero .subtitle {
    font-size: 1.2rem; font-style: italic; color: var(--ink-dim);
    max-width: 540px; margin: 18px auto 12px;
}
.hint {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 3px;
    color: var(--ink-dim); opacity: 0.7; margin-bottom: 38px;
}
.hint::before { content: "— "; }
.hint::after  { content: " —"; }

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Кнопки ---------- */
.btn {
    position: relative;
    display: inline-block;
    font-family: 'EB Garamond', serif;
    text-transform: uppercase; letter-spacing: 3px; font-size: 0.82rem;
    padding: 16px 38px; cursor: pointer; text-decoration: none;
    color: var(--ink); background: transparent;
    border: 1px solid var(--ink); border-radius: 999px;
    overflow: hidden; z-index: 0;
    transition: color 0.5s var(--ease), letter-spacing 0.5s var(--ease), border-color 0.9s ease;
}
/* внутренняя двойная рамка — винтажная гравировка */
.btn::after {
    content: ""; position: absolute; inset: 4px; z-index: 1;
    border: 1px solid var(--line); border-radius: 999px; pointer-events: none;
    transition: inset 0.5s var(--ease), border-color 0.5s var(--ease);
}
/* чернильная заливка, наезжающая при наведении */
.btn::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: var(--ink);
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.5s var(--ease);
}
.btn:hover { color: var(--bg); letter-spacing: 5px; }
.btn:hover::before { transform: scaleX(1); }
.btn:hover::after { inset: 7px; border-color: rgba(12, 12, 13, 0.4); }

/* основная кнопка — изначально залита; при наведении чернила «уходят» */
.btn-primary { color: var(--bg); }
.btn-primary::before { transform: scaleX(1); transform-origin: right; }
.btn-primary:hover { color: var(--ink); }
.btn-primary:hover::before { transform: scaleX(0); }
.btn-primary:hover::after { border-color: var(--line); }

/* ===========================================================
   СЕКЦИИ
   =========================================================== */
section { padding: 100px 0; position: relative; z-index: 1; }

.section-head { text-align: center; margin-bottom: 64px; }
.section-head .eyebrow {
    margin-bottom: 16px;
    transition: letter-spacing var(--slow), color var(--slow);
}
.section-head:hover .eyebrow { letter-spacing: 9px; color: var(--ink); }
.section-title { font-size: clamp(3rem, 8vw, 5.5rem); }

/* линия-разделитель — раздвигается при наведении на заголовок */
.rule {
    width: 70px; height: 2px; background: var(--line);
    border-radius: 2px; margin: 22px auto 0;
    transition: width var(--slow), background var(--slow);
}
.section-head:hover .rule { width: 150px; background: var(--ink-dim); }

/* ---------- Карточки: 3D-наклон + монохромное свечение ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

.card {
    position: relative; background: var(--bg);
    border: 1px solid var(--line); border-radius: 24px;
    padding: 48px 38px; overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.18s var(--ease), background var(--slow),
                border-color var(--slow), box-shadow var(--slow);
}
.card::before {
    content: ""; position: absolute; inset: 0; border-radius: 24px; opacity: 0;
    transition: opacity var(--slow);
    background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
        rgba(236, 233, 225, 0.12), transparent 60%);
}
.card:hover::before { opacity: 1; }
.card:hover {
    background: var(--bg-2);
    border-color: var(--ink-dim);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}

.card .index {
    display: inline-flex; align-items: center; justify-content: center;
    width: 54px; height: 54px; border: 1px solid var(--line);
    border-radius: 50%; font-size: 1.1rem; letter-spacing: 1px;
    margin-bottom: 26px; color: var(--ink-dim);
    transition: transform var(--slow), color var(--slow);
}
.card:hover .index { transform: translateZ(40px) rotate(360deg); color: var(--ink); border-color: var(--ink-dim); }

.card h3 { font-size: 2.6rem; margin-bottom: 12px; }
.card p { color: var(--ink-dim); }

/* ===========================================================
   VPN-КОМПОНЕНТЫ: описание, тарифы, баннеры
   =========================================================== */
.lead {
    max-width: 760px; margin: 0 auto 52px; text-align: center;
    font-size: 1.3rem; line-height: 1.6; font-style: italic; color: var(--ink-dim);
}

/* карточки тарифов */
.plan { display: flex; flex-direction: column; }
.plan-name {
    text-transform: uppercase; letter-spacing: 2px;
    font-size: 0.78rem; color: var(--ink-dim); margin-bottom: 12px;
}
.price { font-family: 'EB Garamond', serif; font-size: 2.8rem; font-weight: 600; line-height: 1; }
.price span { font-size: 1rem; color: var(--ink-dim); margin-left: 4px; }
.plan-features { list-style: none; margin: 22px 0 28px; padding: 0; }
.plan-features li {
    padding: 8px 0; border-bottom: 1px solid var(--line-soft);
    color: var(--ink-dim); font-size: 0.98rem;
}
.plan-features li::before { content: "— "; color: var(--ink); }
.plan .btn { margin-top: auto; width: 100%; text-align: center; }
.card.featured { border-color: var(--ink-dim); }
.badge-pop {
    position: absolute; top: 18px; right: 18px;
    font-family: 'EB Garamond', serif; text-transform: uppercase;
    letter-spacing: 2px; font-size: 0.62rem; color: var(--ink-dim);
    border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
}

/* баннер «временно недоступно» */
.notice {
    max-width: 760px; margin: 0 auto 44px; padding: 22px 26px;
    border: 1px dashed var(--line); border-radius: 18px; text-align: center;
    text-transform: uppercase; letter-spacing: 1.5px; font-size: 0.82rem;
    color: var(--ink-dim); line-height: 1.7;
}
.notice strong { color: var(--ink); }

.note { text-align: center; margin-top: 32px; color: var(--ink-dim); font-style: italic; }
.note a:not(.btn), .contact-box a:not(.btn) { color: var(--ink); }

/* блок контакта */
.contact-box { text-align: center; max-width: 580px; margin: 0 auto; }
.contact-box .btn { margin: 20px 0; }
.contact-box .muted { color: var(--ink-dim); font-size: 0.95rem; }

/* выключенная кнопка (оплата/бот — скоро) */
.btn.disabled, .btn[aria-disabled="true"] {
    opacity: 0.4; cursor: not-allowed; pointer-events: none;
}

/* ===========================================================
   ФОРМА
   =========================================================== */
.form-card { max-width: 620px; margin: 0 auto; }
.field { position: relative; margin-bottom: 34px; }
.field input, .field textarea {
    width: 100%; padding: 12px 2px; font-family: inherit; font-size: 1.1rem;
    color: var(--ink); background: transparent;
    border: none; border-bottom: 1px solid var(--line);
    transition: border-color var(--slow);
}
.field textarea { resize: vertical; min-height: 90px; }
.field label {
    position: absolute; left: 2px; top: 12px; color: var(--ink-dim);
    font-size: 1.1rem; pointer-events: none; transition: all 0.3s var(--ease);
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
    top: -14px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 2px;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.form-card .btn { width: 100%; margin-top: 6px; }

.flash {
    max-width: 620px; margin: 0 auto 30px; padding: 16px;
    border: 1px solid var(--line); text-align: center;
    text-transform: uppercase; letter-spacing: 2px; font-size: 0.82rem;
}

/* ===========================================================
   ПОДВАЛ
   =========================================================== */
.footer {
    text-align: center; padding: 60px 0; color: var(--ink-dim);
    border-top: 1px solid var(--line-soft); font-size: 0.9rem;
    position: relative; z-index: 1;
}
.footer a { position: relative; color: var(--ink); text-decoration: none; }
.footer a::after {
    content: ""; position: absolute; left: 0; bottom: -2px;
    width: 0; height: 1px; background: currentColor;
    transition: width 0.45s var(--ease);
}
.footer a:hover::after { width: 100%; }

/* логотип — лёгкая анимация при наведении */
.logo { display: inline-block; transition: transform var(--slow), color 0.3s ease; }
.logo:hover { transform: scale(1.06) rotate(-2deg); }

/* ===========================================================
   ПОЯВЛЕНИЕ ПРИ ПРОКРУТКЕ (для блоков, не заголовков)
   =========================================================== */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity var(--slow), transform var(--slow); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===========================================================
   АДАПТИВ
   =========================================================== */
@media (max-width: 760px) {
    .burger { display: flex; }
    .nav-links {
        position: absolute; top: 78px; right: 0; left: 0;
        flex-direction: column; align-items: stretch; gap: 0; padding: 10px 5%;
        background: rgba(12, 12, 13, 0.97); backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--line-soft);
        transform: translateY(-180%); transition: transform var(--slow);
    }
    .nav-links.open { transform: translateY(0); }
    .nav-links a { text-align: center; padding: 14px; }
    section { padding: 70px 0; }
    .hero { padding: 80px 0 70px; }
}

/* ===========================================================
   УВАЖЕНИЕ К «УМЕНЬШИТЬ ДВИЖЕНИЕ»
   (показываем заголовки сразу, гасим анимации фона)
   =========================================================== */
@media (prefers-reduced-motion: reduce) {
    .hand { opacity: 1; filter: none; transform: none; clip-path: none; }
    .grain { display: none; }
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}