/* ============================================
   BASE — общие стили для всех страниц STILS
   ============================================ */

/* ===== THEME VARIABLES ===== */
:root {
    --green:       #5C9D7F;
    --green-light: #7AB69A;

    /* Accent */
    --blue:   #5B8FB9;
    --coral:  #D4847C;
    --purple: #8B7CB5;
    --gold:   #C9A962;

    /* Typography */
    --font-display: 'Manrope', sans-serif;
    --font-body:    'Inter', sans-serif;

    /* Transitions */
    --transition-smooth: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Светлая тема — значения по умолчанию для страниц без data-theme (EN) */
:root {
    --bg:           #f5f5f0;
    --bg-card:      #fefefe;
    --bg-elevated:  #ededea;
    --border:       rgba(26,26,26,0.08);
    --border-hover: rgba(92,157,127,0.5);
    --text:         #1a1a1a;
    --text-muted:   rgba(26,26,26,0.55);
    --text-dim:     rgba(26,26,26,0.3);
    --nav-bg:       rgba(245,245,240,0.75);
    --footer-bg:    #1a1a1a;

    /* Алиасы для home/en разметки */
    --black:      #1a1a1a;
    --gray:       #666;
    --light-gray: #f3f3f3;
    --bg-warm:    #f5f5f0;
    --card-bg:    #fefefe;
    --surface:    #FFFFFF;
    --white:      #FFFFFF;
    --ink:        #1a1a1a;
}

[data-theme="dark"] {
    --bg:           #0e0e0e;
    --bg-card:      #161616;
    --bg-elevated:  #1c1c1c;
    --border:       rgba(255,255,255,0.07);
    --border-hover: rgba(92,157,127,0.4);
    --text:         #f0efe9;
    --text-muted:   rgba(240,239,233,0.45);
    --text-dim:     rgba(240,239,233,0.22);
    --nav-bg:       rgba(14,14,14,0.65);
    --footer-bg:    #0a0a0a;

    --black:      #f0efe9;
    --gray:       rgba(240,239,233,0.5);
    --light-gray: #1c1c1c;
    --bg-warm:    #0e0e0e;
    --card-bg:    #161616;
    --surface:    #161616;
    --ink:        #0a0a0a;
}

[data-theme="light"] {
    --bg:           #f5f5f0;
    --bg-card:      #fefefe;
    --bg-elevated:  #ededea;
    --border:       rgba(26,26,26,0.08);
    --border-hover: rgba(92,157,127,0.5);
    --text:         #1a1a1a;
    --text-muted:   rgba(26,26,26,0.55);
    --text-dim:     rgba(26,26,26,0.3);
    --nav-bg:       rgba(245,245,240,0.75);
    --footer-bg:    #1a1a1a;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    overflow-x: clip;
    max-width: 100%;
    -webkit-font-smoothing: antialiased;
    transition: background 0.35s ease, color 0.35s ease;
}
a { text-decoration: none; color: inherit; }

/* ===== NOISE OVERLAY (используется на блоге) ===== */
.noise-overlay {
    position: fixed; inset: 0; pointer-events: none; z-index: 9997;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"]  .noise-overlay { opacity: 0.025; }
[data-theme="light"] .noise-overlay { opacity: 0.012; }

/* ===== NAVIGATION ===== */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 20px 0;
    background: var(--nav-bg);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: background 0.35s ease, border-color 0.35s ease;
}
nav .container {
    max-width: 1600px; margin: 0 auto; padding: 0 80px;
    display: flex; justify-content: space-between; align-items: center;
}
.logo {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text);
    transition: color 0.35s ease;
}
.nav-links { display: flex; gap: 40px; list-style: none; align-items: center; }
.nav-links a {
    font-family: var(--font-display); font-size: 14px; font-weight: 500;
    color: var(--text-muted); transition: color 0.3s ease; position: relative;
}
.nav-links a::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 1px; background: var(--green); transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--green); }
.nav-links a.active::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 20px; }

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    display: flex; align-items: center;
    background: none; border: none; cursor: pointer; padding: 0;
}
.theme-toggle-pill {
    position: relative;
    width: 56px; height: 28px; border-radius: 999px;
    border: 1px solid var(--border-hover);
    background: var(--bg-elevated);
    transition: background 0.35s ease, border-color 0.35s ease;
    flex-shrink: 0;
}
.theme-toggle-thumb {
    position: absolute; top: 50%; left: 25%;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--green);
    transform: translate(-50%, -50%);
    transition: left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}
[data-theme="light"] .theme-toggle-thumb { left: 75%; }
.toggle-icon {
    position: absolute; display: flex; align-items: center; justify-content: center;
    z-index: 2; transition: color 0.3s ease; pointer-events: none;
}
.toggle-icon svg {
    width: 11px; height: 11px; stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.toggle-icon-moon { left: 25%; top: 50%; transform: translate(-50%,-50%); color: rgba(240,239,233,0.9); }
.toggle-icon-sun  { left: 75%; top: 50%; transform: translate(-50%,-50%); color: var(--text-muted); }
[data-theme="light"] .toggle-icon-moon { color: var(--text-muted); }
[data-theme="light"] .toggle-icon-sun  { color: #fff; }

/* ===== BURGER ===== */
.burger {
    display: none; flex-direction: column; justify-content: center; align-items: center;
    gap: 5px; width: 40px; height: 40px;
    background: none; border: none; cursor: pointer; padding: 8px; z-index: 1100;
}
.burger span {
    display: block; width: 22px; height: 1.5px; background: var(--text);
    border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease, background 0.35s ease;
}
.burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ===== MOBILE NAV ===== */
.mobile-nav {
    display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 1050;
    background: var(--nav-bg); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column; align-items: stretch;
    padding: 64px 28px 20px; border-bottom: 1px solid var(--border);
    opacity: 0; transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.mobile-nav.is-open { display: flex; opacity: 1; transform: translateY(0); }
.mobile-nav-close { display: none; }
.mobile-nav-links { list-style: none; }
.mobile-nav-links li { border-bottom: 1px solid var(--border); }
.mobile-nav-links li:first-child { border-top: 1px solid var(--border); }
.mobile-nav-link {
    display: block; font-family: var(--font-display); font-size: 16px; font-weight: 500;
    color: var(--text); padding: 14px 4px; transition: color 0.2s ease;
}
.mobile-nav-link.active { color: var(--green); }
.mobile-nav-link:active { color: var(--green); }
.mobile-nav-cta {
    display: block; text-align: center; font-family: var(--font-display);
    font-size: 14px; font-weight: 600; color: #fff; background: var(--green);
    padding: 14px 28px; border-radius: 999px; margin-top: 16px;
    transition: background 0.2s ease, transform 0.2s ease;
}
.mobile-nav-cta:hover { background: var(--green-light); transform: translateY(-1px); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 16px 36px;
    font-family: var(--font-display);
    font-size: 15px; font-weight: 500;
    text-decoration: none; border-radius: 999px;
    transition: color 0.4s var(--transition-smooth), background-color 0.4s var(--transition-smooth),
                border-color 0.4s var(--transition-smooth), transform 0.4s var(--transition-smooth),
                box-shadow 0.4s var(--transition-smooth), opacity 0.4s var(--transition-smooth);
    cursor: pointer; position: relative; overflow: hidden;
}
.btn-primary {
    background: var(--green); color: var(--white); border: 2px solid var(--green);
}
.btn-primary:hover {
    box-shadow: 0 8px 22px rgba(92, 157, 127, 0.28); transform: translateY(-2px);
}
.btn-secondary {
    background: transparent; color: var(--black); border: 2px solid var(--black);
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease,
                transform 0.3s ease, box-shadow 0.3s ease;
}
.btn-secondary:hover {
    background: var(--ink); color: var(--bg-warm);
    transform: translateY(-3px); box-shadow: 0 12px 32px rgba(26, 26, 26, 0.2);
}
[data-theme="dark"] .btn-secondary:hover { color: #fff; }

/* ===== FOOTER ===== */
footer {
    padding: 48px 0 0; background: var(--footer-bg);
    border-top: 1px solid rgba(255,255,255,0.07);
    overflow: hidden;
    transition: background 0.35s ease;
}
.footer-container { max-width: 1600px; margin: 0 auto; padding: 0 80px; }
.footer-top {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.footer-logo {
    font-family: var(--font-display); font-size: 16px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase; color: #f0efe9;
}
.footer-links { display: flex; gap: 28px; }
.footer-links a { font-size: 14px; color: rgba(240,239,233,0.45); transition: color 0.3s ease; }
.footer-links a:hover { color: var(--green); }
.footer-bottom { display: flex; justify-content: center; padding-top: 18px; }
.footer-copy { font-size: 13px; color: rgba(240,239,233,0.22); }
.footer-requisites { text-align: center; font-size: 11px; color: rgba(240,239,233,0.16); padding: 6px 0; }

.footer-wordmark-wrap { margin-top: 32px; line-height: 0; }
.footer-wordmark {
    font-family: var(--font-display);
    font-size: clamp(140px, 22vw, 380px);
    font-weight: 800; letter-spacing: -0.03em; line-height: 0.82;
    display: block; text-align: center; padding-left: 0;
    background: linear-gradient(105deg,
        rgba(45,107,82,0.7) 0%, rgba(92,157,127,0.9) 20%, rgba(175,230,205,1) 42%,
        rgba(220,255,240,1) 52%, rgba(175,230,205,1) 62%, rgba(92,157,127,0.9) 80%, rgba(45,107,82,0.7) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; user-select: none;
}

/* ===== COOKIE BANNER ===== */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--ink); padding: 20px 24px; z-index: 9997;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid rgba(255,255,255,0.1);
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner-inner {
    max-width: 1600px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.cookie-text { font-size: 14px; color: rgba(255,255,255,0.7); line-height: 1.5; }
.cookie-text a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.cookie-buttons { display: flex; gap: 12px; flex-shrink: 0; }
.cookie-btn {
    padding: 10px 20px; border-radius: 999px; font-size: 13px; font-weight: 500;
    cursor: pointer; border: none; font-family: var(--font-display);
    transition: all 0.3s ease;
}
.cookie-btn-accept { background: var(--green); color: #fff; }
.cookie-btn-accept:hover { background: var(--green-light); }
.cookie-btn-decline {
    background: transparent; color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.2);
}
.cookie-btn-decline:hover { border-color: rgba(255,255,255,0.4); color: rgba(255,255,255,0.8); }

/* ===== LEGAL MODALS ===== */
.legal-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 10000;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.legal-modal.active { opacity: 1; visibility: visible; }
.legal-modal-content {
    background: var(--bg-warm); border-radius: 16px;
    max-width: 800px; width: 100%; max-height: 85vh; overflow: hidden;
    transform: translateY(20px) scale(0.98); transition: transform 0.3s ease;
    display: flex; flex-direction: column;
}
.legal-modal.active .legal-modal-content { transform: translateY(0) scale(1); }
.legal-modal-header {
    padding: 24px 32px; border-bottom: 1px solid var(--light-gray);
    display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}
.legal-modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--black); }
.legal-modal-close {
    width: 40px; height: 40px; border: none; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
    transition: background 0.3s ease;
}
.legal-modal-close:hover { background: var(--light-gray); }
.legal-modal-close svg { width: 20px; height: 20px; color: var(--gray); }
.legal-modal-body { padding: 32px; overflow-y: auto; flex: 1; }
.legal-modal-body h2 { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--black); margin: 24px 0 12px; }
.legal-modal-body h2:first-child { margin-top: 0; }
.legal-modal-body p { font-size: 14px; line-height: 1.7; color: var(--gray); margin-bottom: 12px; }
.legal-modal-body ul { margin: 12px 0; padding-left: 20px; }
.legal-modal-body li { font-size: 14px; line-height: 1.7; color: var(--gray); margin-bottom: 8px; }
.legal-date { font-size: 13px; color: var(--gray); opacity: 0.7; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--light-gray); }

/* ===== SCROLL REVEAL (общий) ===== */
.reveal {
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.19,1,0.22,1), transform 0.6s cubic-bezier(0.19,1,0.22,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== ACCESSIBILITY ===== */
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.btn:focus-visible, .cookie-btn:focus-visible, .legal-modal-close:focus-visible,
.faq-question:focus-visible, .strategy-btn:focus-visible {
    outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px;
}

/* ===== RESPONSIVE (навигация/футер/cookie) ===== */
@media (max-width: 1024px) {
    nav .container, .footer-container { padding-left: 40px; padding-right: 40px; }
}
@media (max-width: 768px) {
    nav .container { padding: 0 24px; }
    .nav-links { display: none; }
    .burger { display: flex; }

    footer { padding: 32px 0 0; }
    .footer-container { padding: 0 24px; }
    .footer-top { flex-direction: column; gap: 16px; align-items: flex-start; }
    .footer-links { flex-wrap: wrap; gap: 14px; }

    .cookie-banner-inner { flex-direction: column; text-align: center; }
    .cookie-buttons { width: 100%; }
    .cookie-btn { flex: 1; }

    .legal-modal { padding: 16px; }
    .legal-modal-content { max-height: 90vh; }
    .legal-modal-header { padding: 16px 20px; }
    .legal-modal-body { padding: 20px; }
    .legal-modal-title { font-size: 18px; }
}
