/**
 * Landing — theme toggle + shared tokens (light/dark switch).
 */

html[data-landing-theme="dark"] {
    color-scheme: dark;
}

html[data-landing-theme="light"] {
    color-scheme: light;
}

.theme-switch {
    display: inline-flex;
    align-items: stretch;
    direction: ltr;
    unicode-bidi: isolate;
    flex-shrink: 0;
    border-radius: 999px;
    padding: 3px;
    gap: 0;
    border: 1px solid color-mix(in srgb, var(--c-primary) 12%, rgba(15, 23, 42, 0.1));
    background: linear-gradient(180deg, #fff, #f8fafc);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.theme-switch:hover {
    border-color: color-mix(in srgb, var(--c-primary) 28%, #e2e8f0);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.theme-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    padding: 0.44rem 0.62rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #52606f;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.22s ease, background-color 0.22s ease, transform 0.2s ease, box-shadow 0.22s ease;
}

.theme-switch button:not(.active):hover {
    color: var(--c-primary);
    background: color-mix(in srgb, var(--c-primary-soft) 85%, transparent);
}

.theme-switch button.active {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    color: #fff;
    box-shadow:
        0 4px 14px color-mix(in srgb, var(--c-primary) 38%, transparent),
        0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.theme-switch button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--c-primary) 50%, transparent);
    outline-offset: 2px;
}

html[data-landing-theme="dark"] .theme-switch {
    background: color-mix(in srgb, var(--c-primary) 10%, #1a2740);
    border-color: color-mix(in srgb, var(--c-primary) 22%, #2a3a52);
    box-shadow: none;
}

html[data-landing-theme="dark"] .theme-switch:hover {
    border-color: color-mix(in srgb, var(--c-primary) 35%, #2a3a52);
}

html[data-landing-theme="dark"] .theme-switch button {
    color: #8fa3bc;
}

html[data-landing-theme="dark"] .theme-switch button:not(.active):hover {
    color: #fff;
    background: color-mix(in srgb, var(--c-primary) 18%, #1a2740);
}

html[data-landing-theme="dark"] .theme-switch button.active {
    background: var(--c-primary);
    color: #fff;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--c-primary) 45%, transparent);
}

.nav-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Language flags — fixed size before landing-refined loads (prevents flash) */
.lang-switch {
    display: inline-flex;
    align-items: stretch;
    direction: ltr;
    unicode-bidi: isolate;
    flex-shrink: 0;
}

.lang-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-decoration: none;
    line-height: 1;
}

.lang-switch .lang-flag {
    display: inline-block;
    width: 22px;
    height: 15px;
    min-width: 22px;
    min-height: 15px;
    max-width: 22px;
    max-height: 15px;
    border-radius: 2px;
    overflow: hidden;
    line-height: 0;
    flex-shrink: 0;
    vertical-align: middle;
}

.lang-switch .lang-flag svg {
    display: block;
    width: 22px !important;
    height: 15px !important;
    max-width: 22px !important;
    max-height: 15px !important;
}

.nav-panel .theme-switch {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.nav-panel .theme-switch button {
    flex: 1 1 0;
}

@media (min-width: 961px) {
    .theme-switch button {
        min-width: 2.5rem;
    }
}

@media (max-width: 720px) {
    .nav-end .theme-switch button {
        min-width: 2.15rem;
        padding: 0.38rem 0.42rem;
    }
}
