/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 99999;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0;
}

.back-link {
    font-weight: 600;
    color: var(--muted);
}

.site-brand {
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.nav-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--muted);
    font-weight: 600;
}

.nav-links a:hover {
    color: var(--text);
}

.header-switcher {
    display: flex;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
    position: sticky;
    top: 0;
    z-index: 12;
}

.header-switcher .content-switcher {
    max-width: 420px;
}

.content-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

.switcher-tab {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s ease, box-shadow 0.2s ease;
}

.switcher-tab.is-active {
    background: #ffffff;
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.switcher-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.6);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    background: #f9fafb;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--muted);
}

.footer-note {
    font-weight: 600;
}

/* Legal Modal (index) */
.legal-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.6);
    z-index: 1000;
}

.legal-modal.is-open {
    display: flex;
}

.legal-dialog {
    width: min(860px, 92vw);
    max-height: 85vh;
    overflow: auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.legal-title {
    margin: 0;
    font-family: "Outfit", sans-serif;
    font-size: 1.6rem;
    color: var(--accent);
}

.legal-close {
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--muted);
}

.legal-close:hover {
    color: var(--text);
}

.legal-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
}

.legal-text a {
    color: var(--accent-strong);
}

/* Legal Modal (project) */
.hidden {
    display: none !important;
}

.bk-footer-link {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.bk-footer-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

#bk-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bk-modal-card {
    background: #fff;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 16px;
    padding: 40px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.bk-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.bk-modal-close:hover {
    background: var(--surface);
    color: var(--text);
}

.bk-modal-icon {
    width: 24px;
    height: 24px;
}

.bk-modal-content h2 {
    font-family: "Outfit", sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--accent);
    line-height: 1.2;
}

.bk-modal-content p {
    line-height: 1.6;
    color: var(--text);
    font-size: 1rem;
}

@media (max-width: 700px) {
    .content-switcher {
        gap: 4px;
        padding: 4px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links {
        gap: 12px;
    }

    .switcher-tab {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 6px;
    }
}
