:root {
    --layout-bg: #0f0f10;
    --layout-surface: #18181b;
    --layout-surface-2: #1f1f23;
    --layout-border: rgba(255, 255, 255, 0.08);
    --layout-border-strong: rgba(255, 255, 255, 0.14);
    --layout-text: #f5f5f7;
    --layout-text-muted: #a1a1aa;
    --layout-text-dim: #71717a;
    --layout-red: #e63946;
    --layout-red-soft: #f06674;
    --layout-yellow: #ffcc00;
    --layout-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --nav-height: 68px;
}

html, body {
    background-color: var(--layout-bg);
    color: var(--layout-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body.bg-gray-100 {
    background-color: var(--layout-bg) !important;
}

a {
    color: inherit;
}

/* ============ TOP BANNERS ============ */
.offline-banner,
.sw-update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.offline-banner {
    background: rgba(230, 57, 70, 0.92);
    color: #fff;
}

.sw-update-banner {
    background: rgba(24, 24, 27, 0.92);
    color: var(--layout-text);
    border-bottom: 1px solid var(--layout-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.sw-update-btn {
    background: var(--layout-red);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s var(--layout-ease);
}

.sw-update-btn:hover {
    background: var(--layout-red-soft);
}

.sw-update-dismiss {
    background: transparent;
    border: none;
    color: var(--layout-text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
}

.sw-update-dismiss:hover {
    color: var(--layout-text);
}

/* ============ HEADER ============ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--nav-height);
    background: rgba(15, 15, 16, 0.75);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--layout-border);
}

.site-header__inner {
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--layout-text);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.site-header__brand img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.site-header__brand span {
    font-size: 15px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav__group {
    position: relative;
    display: flex;
    align-items: center;
}

.site-nav__toggle {
    position: relative;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--layout-text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s var(--layout-ease);
}

.site-nav__toggle:hover,
.site-nav__group.is-expanded .site-nav__toggle,
.site-nav__group:hover .site-nav__toggle {
    color: var(--layout-text);
    background: rgba(255, 255, 255, 0.05);
}

.site-nav__toggle::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform 0.2s var(--layout-ease);
}

.site-nav__group.is-expanded .site-nav__toggle::after,
.site-nav__group:hover .site-nav__toggle::after {
    transform: rotate(225deg) translateY(-1px);
}

.site-nav__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: rgba(24, 24, 27, 0.98);
    border: 1px solid var(--layout-border-strong);
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s var(--layout-ease), transform 0.2s var(--layout-ease);
}

.site-nav__dropdown a {
    width: 100%;
}

.site-nav__group.is-expanded .site-nav__dropdown,
.site-nav__group:hover .site-nav__dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.site-nav a {
    position: relative;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--layout-text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s var(--layout-ease);
}

.site-nav a:hover {
    color: var(--layout-text);
    background: rgba(255, 255, 255, 0.05);
}

.site-nav__cta {
    margin-left: 8px;
    padding: 9px 18px !important;
    background: var(--layout-red);
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 14px rgba(230, 57, 70, 0.3);
}

.site-nav__cta:hover {
    background: var(--layout-red-soft) !important;
    transform: translateY(-1px);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--layout-border);
    color: var(--layout-text);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--layout-ease);
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.menu-toggle__icon,
.menu-toggle__icon::before,
.menu-toggle__icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.3s var(--layout-ease), top 0.3s var(--layout-ease);
}

.menu-toggle__icon {
    position: relative;
}

.menu-toggle__icon::before,
.menu-toggle__icon::after {
    content: '';
    position: absolute;
    left: 0;
}

.menu-toggle__icon::before { top: -6px; }
.menu-toggle__icon::after { top: 6px; }

.menu-toggle[aria-expanded="true"] .menu-toggle__icon {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ============ MAIN ============ */
main.site-main {
    flex: 1;
    padding: 0;
    max-width: none;
}

/* ============ FOOTER ============ */
.site-footer {
    background: #0a0a0b;
    border-top: 1px solid var(--layout-border);
    padding: 60px 24px 40px;
    text-align: center;
    color: var(--layout-text-muted);
}

.site-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.site-footer__tagline {
    display: block;
    font-size: 1.1rem;
    color: var(--layout-text);
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.site-footer img {
    max-height: 110px;
    width: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s var(--layout-ease);
}

.site-footer img:hover {
    transform: scale(1.04);
}

.site-footer__links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 28px;
    font-size: 13px;
}

.site-footer__links a {
    color: var(--layout-text-dim);
    text-decoration: none;
    transition: color 0.2s var(--layout-ease);
}

.site-footer__links a:hover {
    color: var(--layout-text);
}

.site-footer__copy {
    margin-top: 24px;
    font-size: 12px;
    color: var(--layout-text-dim);
    letter-spacing: 0.03em;
}

/* ============ MOBILE ============ */
@media (max-width: 820px) {
    .site-nav {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 4px;
        background: rgba(15, 15, 16, 0.95);
        backdrop-filter: saturate(180%) blur(16px);
        -webkit-backdrop-filter: saturate(180%) blur(16px);
        border-bottom: 1px solid var(--layout-border);
        transform: translateY(-120%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s var(--layout-ease), opacity 0.3s var(--layout-ease);
    }

    .site-nav__group {
        width: 100%;
        display: block;
    }

    .site-nav__toggle {
        width: 100%;
        text-align: left;
        padding: 14px 18px;
        font-size: 16px;
        border-radius: 10px;
    }

    .site-nav__dropdown {
        position: static;
        min-width: 0;
        margin-top: 6px;
        padding: 8px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 12px;
        box-shadow: none;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        display: none;
    }

    .site-nav__group.is-expanded .site-nav__dropdown {
        display: flex;
    }

    .site-nav.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .site-nav a {
        padding: 14px 18px;
        font-size: 16px;
        border-radius: 10px;
    }

    .site-nav__cta {
        margin: 8px 0 0 !important;
        text-align: center;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .site-header__brand span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
