/* Header liquid glass refresh — visual-only, keeps existing behaviour intact. */

:root {
    --liquid-glass-fill: rgba(255, 255, 255, 0.075);
    --liquid-glass-edge: rgba(255, 255, 255, 0.42);
    --liquid-glass-inner: rgba(255, 255, 255, 0.12);
    --liquid-glass-shadow: rgba(0, 0, 0, 0.34);
    --liquid-glass-pink: rgba(251, 114, 153, 0.58);
}

#header {
    position: sticky;
    isolation: isolate;
    height: 74px;
    padding: 0 clamp(18px, 3vw, 52px);
    gap: 28px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
        radial-gradient(circle at 26% -140%, rgba(251, 114, 153, 0.25), transparent 52%),
        rgba(7, 7, 10, 0.62);
    border-bottom-color: rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        inset 0 -1px 0 rgba(255, 255, 255, 0.07),
        0 18px 46px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    overflow: hidden;
}

#header::before,
#header::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#header::before {
    z-index: -1;
    background:
        radial-gradient(120px 48px at 28% 0%, rgba(255, 255, 255, 0.18), transparent 68%),
        radial-gradient(200px 68px at 68% 120%, rgba(251, 114, 153, 0.15), transparent 72%),
        linear-gradient(115deg, transparent 8%, rgba(255, 255, 255, 0.08) 28%, transparent 44%);
    filter: blur(2px);
}

#header::after {
    z-index: 0;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.10), transparent),
        repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 22px);
    opacity: 0.42;
    mix-blend-mode: screen;
}

[data-theme="light"] #header {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42)),
        radial-gradient(circle at 28% -100%, rgba(251, 114, 153, 0.22), transparent 54%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.86),
        inset 0 -1px 0 rgba(150, 120, 130, 0.16),
        0 14px 34px rgba(44, 20, 30, 0.08);
}

.header-left,
.header-center,
.header-right {
    position: relative;
    z-index: 1;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 124px;
    color: #fff;
}

.logo svg {
    width: 35px;
    height: 35px;
    filter:
        drop-shadow(0 5px 10px rgba(251, 114, 153, 0.30))
        drop-shadow(0 -1px 1px rgba(255, 255, 255, 0.20));
}

.logo::after {
    content: 'tilitili';
    font-size: 17px;
    font-weight: 780;
    letter-spacing: 0;
    color: var(--text-primary);
    text-shadow: 0 1px 10px rgba(255, 255, 255, 0.18);
}

.header-center {
    max-width: 780px;
    gap: 14px;
}

.search-box,
#navTabs,
#themeToggle {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.055)),
        var(--liquid-glass-fill);
    border: 1px solid rgba(255, 255, 255, 0.20);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.44),
        inset 0 -10px 22px rgba(255, 255, 255, 0.055),
        0 12px 30px var(--liquid-glass-shadow);
    backdrop-filter: blur(26px) saturate(185%) contrast(1.05);
    -webkit-backdrop-filter: blur(26px) saturate(185%) contrast(1.05);
    overflow: hidden;
}

.search-box::before,
#navTabs::before,
#themeToggle::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background:
        radial-gradient(circle at 25% 0%, rgba(255, 255, 255, 0.58), transparent 28%),
        radial-gradient(circle at 92% 100%, rgba(91, 214, 255, 0.14), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.20), transparent 45%);
    opacity: 0.52;
    pointer-events: none;
}

.search-box::after,
#navTabs::after,
#themeToggle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, transparent 10%, rgba(255, 255, 255, 0.24) 34%, transparent 54%);
    transform: translateX(-130%);
    transition: transform 0.7s cubic-bezier(.2, .8, .2, 1);
    pointer-events: none;
}

.search-box:hover::after,
#navTabs:hover::after,
#themeToggle:hover::after {
    transform: translateX(130%);
}

.search-box {
    height: 43px;
    min-width: 248px;
    border-radius: 999px;
}

[data-theme="light"] .search-box,
[data-theme="light"] #navTabs,
[data-theme="light"] #themeToggle {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.36)),
        rgba(255, 255, 255, 0.44);
    border-color: rgba(255, 255, 255, 0.62);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.78),
        inset 0 -10px 22px rgba(255, 255, 255, 0.20),
        0 12px 28px rgba(44, 20, 30, 0.10);
}

.search-box input {
    position: relative;
    z-index: 1;
    padding-left: 17px;
    font-size: 13px;
}

.search-box button {
    position: relative;
    z-index: 1;
    min-width: 62px;
    padding: 0 17px;
    margin: 4px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 28% 15%, rgba(255, 255, 255, 0.46), transparent 34%),
        linear-gradient(135deg, #ff8ab4, #f15d90 62%, #e84b82);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        0 5px 14px rgba(251, 114, 153, 0.34);
}

#navTabs {
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
}

.nav-tab {
    position: relative;
    z-index: 1;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.nav-tab.active {
    background:
        radial-gradient(circle at 25% 12%, rgba(255, 255, 255, 0.52), transparent 32%),
        linear-gradient(135deg, rgba(255, 145, 184, 0.98), rgba(236, 82, 132, 0.98));
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        0 5px 16px rgba(251, 114, 153, 0.32);
}

#themeToggle {
    width: 43px;
    height: 43px;
    border-radius: 999px;
}

#themeToggle:hover {
    color: var(--accent);
    border-color: rgba(255, 255, 255, 0.34);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.50),
        inset 0 -10px 22px rgba(255, 255, 255, 0.065),
        0 10px 28px rgba(251, 114, 153, 0.24);
}

@media (max-width: 780px) {
    #header { height: 64px; gap: 12px; }
    .logo { min-width: auto; }
    .logo::after { display: none; }
    .header-center { gap: 8px; }
    .search-box { min-width: 0; }
    .nav-tab { padding: 7px 9px; }
}

@media (max-width: 520px) {
    html { overflow-x: clip; }
    #header { height: 60px; padding: 0 12px; gap: 8px; }
    .logo svg { width: 30px; height: 30px; }
    .search-box { height: 38px; }
    .search-box input { padding-left: 10px; }
    .search-box button { min-width: 44px; padding: 0 9px; margin: 3px; }
    #navTabs { padding: 3px; }
    .nav-tab { padding: 6px 6px; font-size: 11px; }
    #themeToggle { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    .search-box::after,
    #navTabs::after,
    #themeToggle::after {
        transition: none;
    }
}
