/* Hitmux shared interface styles */
:root {
    --bg-primary: #f7f4ee;
    --bg-secondary: #eee8dd;
    --bg-tertiary: #e3dbce;
    --surface-primary: rgba(255, 253, 248, 0.82);
    --surface-solid: #fffdf8;
    --surface-muted: #f1ece4;
    --text-primary: #181816;
    --text-secondary: #535149;
    --text-tertiary: #7a746a;
    --border-light: rgba(24, 24, 22, 0.1);
    --border-medium: rgba(24, 24, 22, 0.18);
    --accent-primary: #243a32;
    --accent-hover: #15241f;
    --accent-light: #dfe8df;
    --focus-ring: rgba(36, 58, 50, 0.28);
    --shadow-soft: 0 24px 70px rgba(58, 48, 35, 0.08);
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --radius-pill: 999px;
    --nav-height: 72px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 14% 0%, rgba(112, 128, 101, 0.16), transparent 34rem),
        linear-gradient(180deg, #faf7f1 0%, var(--bg-primary) 34%, #f4efe6 100%);
    color: var(--text-primary);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
    text-rendering: optimizeLegibility;
}

body.dark-mode {
    --bg-primary: #1a1916;
    --bg-secondary: #24221d;
    --bg-tertiary: #302d27;
    --surface-primary: rgba(35, 33, 29, 0.82);
    --surface-solid: #24221d;
    --surface-muted: #2b2822;
    --text-primary: #f2eee5;
    --text-secondary: #ccc2b3;
    --text-tertiary: #9a9286;
    --border-light: rgba(242, 238, 229, 0.12);
    --border-medium: rgba(242, 238, 229, 0.22);
    --accent-primary: #d8e2d2;
    --accent-hover: #ffffff;
    --accent-light: #2f392f;
    --focus-ring: rgba(216, 226, 210, 0.3);
    --shadow-soft: 0 24px 70px rgba(0, 0, 0, 0.32);
    background:
        radial-gradient(circle at 14% 0%, rgba(136, 151, 124, 0.12), transparent 34rem),
        linear-gradient(180deg, #1c1b18 0%, var(--bg-primary) 50%, #151411 100%);
}

body::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

a {
    color: inherit;
}

a,
button,
select,
[role="button"] {
    cursor: pointer;
}

button,
select,
input,
textarea {
    font: inherit;
}

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

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

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2000;
    transform: translateY(-140%);
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-radius: var(--radius-pill);
    padding: 10px 14px;
    text-decoration: none;
    transition: transform 0.18s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0 max(2rem, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid var(--border-light);
    background: color-mix(in srgb, var(--bg-primary) 84%, transparent);
    backdrop-filter: blur(18px) saturate(145%);
}

.logo,
.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.04rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.logo-mark {
    display: block;
    width: auto;
    height: 30px;
    flex-shrink: 0;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    flex: 1;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 520;
    transition: color 0.18s ease;
    white-space: nowrap;
}

.nav-menu a:hover {
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 36px;
    padding: 0 0.95rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: var(--surface-primary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.nav-pill:hover {
    border-color: var(--border-medium);
    background: var(--surface-solid);
}

.theme-switcher select,
.language-switcher select {
    min-width: 82px;
    min-height: 36px;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: var(--surface-primary);
    padding: 0 1.95rem 0 0.8rem;
    font-size: 0.82rem;
    font-weight: 520;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: var(--surface-primary);
    color: var(--text-primary);
    font-size: 1.18rem;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: var(--surface-primary);
    padding: 8px;
    font-size: 1rem;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.sidebar-toggle:hover {
    color: var(--accent-hover);
    border-color: var(--border-medium);
}

body.dark-mode .sidebar {
    background: rgba(26, 25, 22, 0.95);
    border-right-color: var(--border-light);
}

.footer {
    border-top: 1px solid var(--border-light);
    margin-top: 6rem;
    padding: 3rem max(2rem, calc((100vw - 1180px) / 2));
    color: var(--text-secondary);
}

.footer a {
    color: var(--text-primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(120px, 0.7fr));
    gap: 2rem;
}

.footer-brand strong {
    display: block;
    margin-bottom: 0.7rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.footer-brand p,
.footer-column a,
.footer-column span {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

.footer-column strong {
    display: block;
    margin-bottom: 0.7rem;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
}

.footer-column a {
    display: block;
    margin-bottom: 0.45rem;
}

.hidden {
    opacity: 0;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease;
}

@media (max-width: 980px) {
    .navbar {
        padding: 0 1.2rem;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: calc(var(--nav-height) + 0.75rem);
        left: 1rem;
        right: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.6rem;
        border: 1px solid var(--border-light);
        border-radius: 22px;
        background: var(--surface-solid);
        box-shadow: var(--shadow-soft);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        padding: 0.95rem 1rem;
        border-radius: 14px;
    }

    .nav-menu a:hover {
        background: var(--bg-secondary);
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .nav-pill {
        display: none;
    }
}

@media (max-width: 620px) {
    :root {
        --nav-height: 66px;
    }

    .navbar {
        gap: 0.75rem;
        padding: 0 0.9rem;
    }

    .brand-lockup {
        gap: 0.45rem;
        font-size: 1rem;
    }

    .logo-mark {
        height: 28px;
    }

    .nav-right {
        gap: 0.45rem;
    }

    .theme-switcher select,
    .language-switcher select {
        min-width: 70px;
        min-height: 34px;
        padding-left: 0.65rem;
        padding-right: 1.55rem;
        font-size: 0.76rem;
    }

    .language-switcher {
        display: none;
    }

    .footer {
        padding: 2rem 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}
