/* Startrack — shared layout, header, footer, legal pages */

:root {
    /* Calm neutrals + restrained accent (Material / Google-adjacent tuning) */
    --st-bg: #f4f6f9;
    --st-surface: #ffffff;
    --st-text: #202124;
    --st-muted: #5f6368;
    --st-border: #e8eaed;
    --st-input-bg: #f1f3f4;
    --st-accent: #3767e6;
    --st-accent-mid: #5b7cfa;
    --st-accent-hover: #2d56c4;
    --st-accent-press: #2547a8;
    --st-accent-rgb: 55, 103, 230;
    --st-accent-soft: rgba(55, 103, 230, 0.1);
    --st-star: #e07d14;
    --st-star-rgb: 224, 125, 20;
    --st-of-only: #2d2d2d;
    --st-of-fans: #00a3d9;
    --st-header-h: 60px;
    --st-radius: 16px;
    --st-radius-pill: 999px;
    --st-shadow: 0 1px 3px rgba(60, 64, 67, 0.08), 0 4px 20px rgba(60, 64, 67, 0.06);
    --st-font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

.site-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--st-font);
    background: var(--st-bg);
    color: var(--st-text);
    -webkit-font-smoothing: antialiased;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 1000;
    padding: 10px 16px;
    background: var(--st-surface);
    color: var(--st-accent);
    font-weight: 600;
    border-radius: var(--st-radius-pill);
    box-shadow: var(--st-shadow);
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
    outline: 2px solid var(--st-accent);
    outline-offset: 2px;
}

.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;
}

.site-main:focus {
    outline: none;
}

.site-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

/* ----- Header ----- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--st-header-h);
    padding: 12px clamp(16px, 4vw, 40px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--st-border);
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    line-height: 1;
}

.site-logo:focus-visible {
    outline: 2px solid var(--st-accent);
    outline-offset: 4px;
    border-radius: 8px;
}

.site-logo__mark-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.site-logo__mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: block;
}

.site-logo__wordmark {
    display: inline-flex;
    align-items: baseline;
    font-weight: 700;
    font-size: 1.375rem;
    letter-spacing: -0.042em;
    line-height: 1;
    min-width: 0;
}

/* Wordmark: Star (soft warm) + Track (brand blue) */
.site-logo__part {
    font-weight: 700;
}

.site-logo__part--star {
    background: linear-gradient(
        120deg,
        #4a4d51 0%,
        var(--st-star) 78%,
        #e8b06d 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-logo__part--track {
    background: linear-gradient(118deg, var(--st-accent) 0%, var(--st-accent-mid) 55%, #7c9ef0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Compact Bootstrap nav */
.navbar-brand .site-logo__wordmark {
    font-size: 1.2rem;
    letter-spacing: -0.038em;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 640px) {
    :root {
        --st-header-h: 48px;
    }

    .site-header {
        min-height: 0;
        padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
        padding-top: max(6px, env(safe-area-inset-top));
        gap: 8px;
    }

    .site-logo {
        gap: 8px;
    }

    .site-logo__wordmark {
        font-size: 1.18rem;
    }

    .site-logo__mark {
        width: 30px;
        height: 30px;
    }

    .btn-startrack {
        padding: 6px 12px;
        font-size: 0.8125rem;
        box-shadow: 0 1px 8px rgba(var(--st-accent-rgb), 0.28);
    }

    .navbar-brand {
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
    }

    .navbar .site-logo__mark {
        width: 26px !important;
        height: 26px !important;
    }

    .navbar-brand .site-logo__wordmark {
        font-size: 1.0625rem;
    }

    /* Profiles: только логотип в шапке — ниже, чем общий --st-header-h с главной */
    body.profiles-page {
        --st-header-h: 40px;
    }
}

@media (max-width: 380px) {
    :root {
        --st-header-h: 44px;
    }

    .site-header {
        padding-left: 10px;
        padding-right: 10px;
    }

    .site-logo__wordmark {
        font-size: 1.05rem;
    }

    .site-logo__mark {
        width: 28px;
        height: 28px;
    }

    .btn-startrack {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    body.profiles-page {
        --st-header-h: 38px;
    }
}

.btn-startrack {
    background: linear-gradient(135deg, var(--st-accent) 0%, var(--st-accent-mid) 100%);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--st-radius-pill);
    border: none;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 2px 12px rgba(var(--st-accent-rgb), 0.32);
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.btn-startrack:hover {
    filter: brightness(1.05);
    box-shadow: 0 4px 16px rgba(var(--st-accent-rgb), 0.4);
}

.btn-startrack:active {
    transform: scale(0.98);
}

/* ----- Main ----- */
.site-main {
    flex: 1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.site-main--flush {
    padding: 0;
}

/* Profiles: filter bar below sticky header */
.profiles-page .filter-bar {
    top: var(--st-header-h);
}

/* Мобильная вёрстка: субпиксель / нижняя граница шапки — убираем ~1px зазор */
@media (max-width: 640px) {
    .profiles-page .filter-bar {
        top: calc(var(--st-header-h) - 1px);
        margin-top: -1px;
    }
}

/* ----- Footer ----- */
.site-footer {
    margin-top: auto;
    flex-shrink: 0;
    border-top: 1px solid var(--st-border);
    background: var(--st-surface);
    padding: clamp(40px, 5vw, 56px) clamp(20px, 4vw, 40px) 28px;
}

.site-footer__grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: clamp(28px, 4vw, 48px);
}

.site-footer__brand p {
    margin: 12px 0 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--st-muted);
    max-width: 280px;
}

.site-footer__col h4 {
    margin: 0 0 14px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--st-text);
}

.site-footer__col a {
    display: block;
    color: var(--st-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    margin-bottom: 10px;
    transition: color 0.15s ease;
}

.site-footer__col a:hover {
    color: var(--st-accent);
}

.site-footer__legal {
    max-width: 1100px;
    margin: 36px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--st-border);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--st-muted);
    text-align: center;
}

.site-footer__copy {
    max-width: 1100px;
    margin: 16px auto 0;
    font-size: 0.8125rem;
    color: var(--st-muted);
    text-align: center;
}

@media (max-width: 768px) {
    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .site-footer__grid .site-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .site-footer__grid {
        grid-template-columns: 1fr;
    }
}

/* ----- Legal / static pages ----- */
.legal-page {
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(28px, 4vw, 48px) clamp(20px, 4vw, 40px) 56px;
}

.legal-page h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.75rem, 4vw, 2.125rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.legal-page .legal-updated {
    font-size: 0.875rem;
    color: var(--st-muted);
    margin-bottom: 2rem;
}

.legal-page h2 {
    margin: 2rem 0 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.legal-page p,
.legal-page li {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--st-muted);
}

.legal-page ul {
    padding-left: 1.25rem;
}

.legal-page a {
    color: var(--st-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-page a:hover {
    color: var(--st-accent-hover);
}

.legal-page .legal-faq {
    margin: 0;
}

.legal-page .legal-faq dt {
    margin: 1.25rem 0 0.35rem;
    font-weight: 600;
    color: var(--st-text);
}

.legal-page .legal-faq dd {
    margin: 0 0 0.5rem;
    padding: 0;
}

/* ----- Age confirmation (18+) — cookie, client-side ----- */
html.age-gate-ok .age-gate {
    display: none !important;
    pointer-events: none;
    visibility: hidden;
}

html:not(.age-gate-ok) body {
    overflow: hidden;
    touch-action: none;
}

.age-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    font-family: var(--st-font);
}

.age-gate__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(32, 33, 36, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.age-gate__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: min(90vh, 640px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--st-surface);
    color: var(--st-text);
    border-radius: var(--st-radius);
    box-shadow:
        0 4px 24px rgba(60, 64, 67, 0.12),
        0 24px 48px rgba(60, 64, 67, 0.14);
    border: 1px solid var(--st-border);
    padding: clamp(20px, 5vw, 28px);
}

.age-gate__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 6px 14px;
    margin-bottom: 14px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
    background: linear-gradient(135deg, var(--st-accent) 0%, var(--st-accent-mid) 100%);
    border-radius: var(--st-radius-pill);
}

.age-gate__title {
    margin: 0 0 12px;
    font-size: clamp(1.35rem, 4vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.age-gate__text {
    margin: 0 0 12px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--st-muted);
}

.age-gate__text strong {
    color: var(--st-text);
    font-weight: 600;
}

.age-gate__hint {
    margin: 0 0 20px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--st-muted);
    padding: 10px 12px;
    background: var(--st-input-bg);
    border-radius: 12px;
    border: 1px solid var(--st-border);
}

.age-gate__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.age-gate__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--st-radius-pill);
    border: none;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.age-gate__btn:active {
    transform: scale(0.98);
}

.age-gate__btn:focus-visible {
    outline: 2px solid var(--st-accent);
    outline-offset: 2px;
}

.age-gate__btn--primary {
    background: var(--st-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--st-accent-rgb), 0.35);
}

.age-gate__btn--primary:hover {
    background: var(--st-accent-hover);
}

.age-gate__btn--ghost {
    background: var(--st-surface);
    color: var(--st-muted);
    border: 1px solid var(--st-border);
}

.age-gate__btn--ghost:hover {
    border-color: var(--st-accent);
    color: var(--st-accent);
    background: var(--st-accent-soft);
}

.age-gate__footer {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--st-border);
    font-size: 0.8125rem;
    text-align: center;
    color: var(--st-muted);
}

.age-gate__link {
    color: var(--st-accent);
    text-decoration: none;
    font-weight: 500;
}

.age-gate__link:hover {
    text-decoration: underline;
    color: var(--st-accent-hover);
}

.age-gate__dot {
    margin: 0 6px;
    opacity: 0.5;
}

@media (min-width: 480px) {
    .age-gate__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .age-gate__btn {
        flex: 1 1 auto;
        min-width: 140px;
    }

    .age-gate__btn--primary {
        flex: 1 1 58%;
    }

    .age-gate__btn--ghost {
        flex: 1 1 38%;
    }
}
