.container {
    width: min(100% - 32px, var(--max-width));
    margin-inline: auto;
}

.section {
    padding: 96px 0;
}

.site-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .site-header {
    background: rgba(16, 24, 39, 0.8);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
    position: relative;
}

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

.brand {
    display: grid;
    gap: 4px;
    flex-shrink: 0;
}

.brand-mark {
    font-weight: 700;
    letter-spacing: 0.6px;
}

.brand-mark__primary {
    color: var(--accent);
}

.brand-mark__secondary {
    color: var(--text);
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 6px 10px;
    box-shadow: var(--shadow-soft);
    margin: 0 auto;
    width: auto;
    flex-shrink: 0;
}

.nav--dropdown {
    position: static;
}

.nav a {
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 160ms ease, color 160ms ease;
    color: var(--text-muted);
    text-align: center;
}

.nav a:hover,
.nav a:focus-visible {
    color: var(--text);
    background: var(--surface-muted);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
}

.nav-toggle__bar {
    width: 18px;
    height: 2px;
    background: var(--text);
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 12px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    box-shadow: var(--shadow-soft);
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
}

.theme-toggle__icon {
    font-size: 14px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle [data-icon="sun"] {
    color: #fbbf24;
}

.theme-toggle__label {
    font-size: 14px;
    color: var(--text-muted);
}

.theme-toggle [data-icon="sun"] {
    display: none;
}

.theme-toggle[data-theme-mode="dark"] [data-icon="sun"] {
    display: inline-flex;
}

.theme-toggle[data-theme-mode="dark"] [data-icon="moon"] {
    display: none;
}

.page {
    display: flex;
    flex-direction: column;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid transparent;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.btn--primary {
    background: linear-gradient(120deg, var(--accent), #4f46e5);
    color: #f8fafc;
    box-shadow: var(--shadow-soft);
}

.btn--primary:hover {
    transform: translateY(-1px);
}

.btn--secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn--secondary:hover {
    border-color: var(--accent);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.tag,
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.pill {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.stack {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
}

.stack strong {
    display: block;
    margin-bottom: 2px;
}

.stack span {
    color: var(--text-muted);
    font-size: 14px;
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer__inner {
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.footer__links {
    display: flex;
    gap: 12px;
}

.footer__links a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.footer__links a:hover {
    color: var(--text);
    border-bottom-color: var(--text);
}

@media (max-width: 768px) {
    .header__inner {
        flex-direction: row;
        align-items: center;
    }

    .nav {
        position: absolute;
        top: 64px;
        right: 16px;
        display: none;
        flex-direction: column;
        gap: 6px;
        margin: 0;
        min-width: 140px;
        width: auto;
    }

    .nav.nav--open {
        display: flex;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .header__actions {
        margin-left: auto;
    }

    .theme-toggle__label {
        display: none;
    }

    .footer__inner {
        flex-direction: column;
        align-items: center;
    }
}
