/* =========================================================
   QUARK · BASE
   Токены, reset, контейнер, хедер, навигация, флэш-сообщения.
   Подключается на всех страницах.
   ========================================================= */


/* =========================================================
   TOKENS
   ========================================================= */
:root {
    --bg:           #ffffff;
    --bg-elevated:  #fafafa;
    --surface:      #f5f5f5;
    --surface-hover:#ececec;

    --text:         #0a0a0a;
    --text-muted:   #6b6b6b;
    --text-dim:     #9b9b9b;

    --border:       #e5e5e5;
    --border-strong:#d0d0d0;

    --accent:         #0a0a0a;
    --accent-text:    #ffffff;
    --accent-hover:   #2a2a2a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --container-max: 1000px;
    --container-pad-desktop: 24px;
    --container-pad-mobile:  10px;

    --t-fast: 0.15s ease;
    --t-mid:  0.25s ease;

    --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:           #0a0a0a;
        --bg-elevated:  #141414;
        --surface:      #1a1a1a;
        --surface-hover:#242424;

        --text:         #f5f5f5;
        --text-muted:   #a0a0a0;
        --text-dim:     #6b6b6b;

        --border:       #262626;
        --border-strong:#3a3a3a;

        --accent:         #f5f5f5;
        --accent-text:    #0a0a0a;
        --accent-hover:   #d4d4d4;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    }
}


/* =========================================================
   RESET / BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition: background var(--t-mid), color var(--t-mid);
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; }


/* =========================================================
   CONTAINER
   ========================================================= */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--container-pad-desktop);
    padding-right: var(--container-pad-desktop);
}


/* =========================================================
   SITE HEADER + NAV
   ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.01em;
}
.logo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
}
.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    color: var(--text-muted);
    transition: color var(--t-fast), background var(--t-fast);
}
.nav-link:hover  { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--text); background: var(--surface); }
.nav-link-cta {
    background: var(--accent);
    color: var(--accent-text) !important;
}
.nav-link-cta:hover { background: var(--accent-hover); color: var(--accent-text); }


/* Burger */
.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: background var(--t-fast), border-color var(--t-fast);
}
.nav-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}
.nav-toggle span {
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--t-mid), opacity var(--t-mid);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* =========================================================
   FLASH MESSAGES
   ========================================================= */
.messages-container {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.message {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    transition: opacity 0.3s;
}


/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 768px) {
    .container {
        padding-left: var(--container-pad-mobile);
        padding-right: var(--container-pad-mobile);
    }

    .nav-toggle { display: flex; }

    .nav {
        position: absolute;
        top: 100%;
        left: 8px;
        right: 8px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 8px;
        background: var(--bg-elevated);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: max-height var(--t-mid), opacity var(--t-fast);
        z-index: 201;
    }
    .nav.open {
        max-height: 80vh;
        opacity: 1;
        pointer-events: auto;
    }
    .nav-link {
        border-radius: var(--radius-sm);
        padding: 12px 14px;
        font-size: 15px;
    }
}