.header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 20;
    border-bottom: 1px solid var(--border);
    background-color: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.header .wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 64px;
}
.wordmark {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-decoration: none;
    white-space: nowrap;
}
.nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
}
.nav a {
    padding: 8px 14px;
    border-radius: var(--r-md);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    color: var(--dimmed);
    transition:
        background-color 0.15s,
        color 0.15s;
}
.nav a:hover {
    background: var(--g1);
    color: var(--text);
}

.theme-toggle {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s;
}
.theme-toggle:hover {
    background: var(--g1);
}
.theme-toggle + .btn {
    margin-left: -16px;
}
.theme-toggle svg {
    width: 17px;
    height: 17px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.theme-toggle:active svg {
    transform: rotate(-30deg) scale(0.9);
}

@media (max-width: 760px) {
    .nav {
        display: none;
    }
    .theme-toggle {
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .header .btn {
        padding-inline: 12px;
    }
}
