:root {
    --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --page-bg: #eef0f4;
    --glass-bg: rgba(255, 255, 255, 0.28);
    --glass-bg-hover: rgba(255, 255, 255, 0.38);
    --glass-border: rgba(255, 255, 255, 0.85);
    --glass-highlight: rgba(255, 255, 255, 0.95);
    --glass-shadow: rgba(0, 0, 0, 0.08);
    --glass-text: #1d1d1f;
    --glass-muted: #6b7280;
    --glass-accent-bg: rgba(255, 149, 0, 0.18);
    --glass-accent-border: rgba(255, 149, 0, 0.45);
    --glass-accent-highlight: rgba(255, 220, 170, 0.75);
    --glass-accent-shadow: rgba(255, 149, 0, 0.25);
    --glass-reflex-dark: 1;
    --glass-reflex-light: 1;
    --glass-saturation: 180%;
    --switcher-track: rgba(255, 255, 255, 0.38);
    --switcher-thumb: rgba(255, 255, 255, 0.72);
    --switcher-icon: #86868b;
    --switcher-icon-active: #1d1d1f;
    --tx: 0px;
    --ty: 0px;
    --blob-1-core: rgb(220, 38, 38);
    --blob-1-mid: rgb(248, 113, 113);
    --blob-2-core: rgb(185, 28, 28);
    --blob-2-mid: rgb(252, 165, 165);
    --blob-3-core: rgb(255, 149, 0);
    --blob-3-mid: rgb(251, 146, 60);
    --blob-4-core: rgb(234, 88, 12);
    --blob-4-mid: rgb(249, 115, 22);
    --blob-5-core: rgb(234, 179, 8);
    --blob-5-mid: rgb(250, 204, 21);
    --blob-6-core: rgb(253, 224, 71);
    --blob-6-mid: rgb(254, 240, 138);
    --accent-from: rgb(220, 38, 38);
    --accent-mid: rgb(255, 149, 0);
    --accent-to: rgb(234, 179, 8);
}

@property --blob-1-core { syntax: '<color>'; inherits: true; initial-value: rgb(220, 38, 38); }
@property --blob-1-mid { syntax: '<color>'; inherits: true; initial-value: rgb(248, 113, 113); }
@property --blob-2-core { syntax: '<color>'; inherits: true; initial-value: rgb(185, 28, 28); }
@property --blob-2-mid { syntax: '<color>'; inherits: true; initial-value: rgb(252, 165, 165); }
@property --blob-3-core { syntax: '<color>'; inherits: true; initial-value: rgb(255, 149, 0); }
@property --blob-3-mid { syntax: '<color>'; inherits: true; initial-value: rgb(251, 146, 60); }
@property --blob-4-core { syntax: '<color>'; inherits: true; initial-value: rgb(234, 88, 12); }
@property --blob-4-mid { syntax: '<color>'; inherits: true; initial-value: rgb(249, 115, 22); }
@property --blob-5-core { syntax: '<color>'; inherits: true; initial-value: rgb(234, 179, 8); }
@property --blob-5-mid { syntax: '<color>'; inherits: true; initial-value: rgb(250, 204, 21); }
@property --blob-6-core { syntax: '<color>'; inherits: true; initial-value: rgb(253, 224, 71); }
@property --blob-6-mid { syntax: '<color>'; inherits: true; initial-value: rgb(254, 240, 138); }
@property --accent-from { syntax: '<color>'; inherits: true; initial-value: rgb(220, 38, 38); }
@property --accent-mid { syntax: '<color>'; inherits: true; initial-value: rgb(255, 149, 0); }
@property --accent-to { syntax: '<color>'; inherits: true; initial-value: rgb(234, 179, 8); }

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--page-bg);
    color: var(--glass-text);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.45s ease, color 0.35s ease;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Ambient background --- */
.ambient-canvas {
    position: fixed;
    inset: -25%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translate(var(--tx), var(--ty));
    transition: transform 0.4s ease-out;
}

.ambient-nature {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: #f5f5f7;
    background-image: url('../images/aa_bg.webp');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    filter: grayscale(100%) brightness(1.05) contrast(1.02);
}

.ambient-nature::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.45) 0%,
        rgba(248, 250, 252, 0.35) 50%,
        rgba(255, 255, 255, 0.42) 100%
    );
    pointer-events: none;
}

.ambient-blobs {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    contain: layout style paint;
    transition: opacity 2.8s ease-in-out;
}

.ambient-blobs.is-visible {
    opacity: 1;
}

.ambient-blob {
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    filter: blur(85px) saturate(160%);
    opacity: 0.92;
    will-change: transform;
}

.ambient-blob--1 {
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, var(--blob-1-core) 0%, color-mix(in srgb, var(--blob-1-mid) 42%, transparent) 45%, transparent 72%);
    top: 15%;
    left: 10%;
    animation: driftWarm1 32s ease-in-out infinite;
}

.ambient-blob--2 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, var(--blob-2-core) 0%, color-mix(in srgb, var(--blob-2-mid) 38%, transparent) 45%, transparent 72%);
    top: 50%;
    left: 55%;
    animation: driftWarm2 38s ease-in-out infinite;
    animation-delay: -8s;
}

.ambient-blob--3 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, var(--blob-3-core) 0%, color-mix(in srgb, var(--blob-3-mid) 42%, transparent) 45%, transparent 72%);
    top: 25%;
    left: 70%;
    animation: driftWarm3 26s ease-in-out infinite;
    animation-delay: -14s;
}

.ambient-blob--4 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, var(--blob-4-core) 0%, color-mix(in srgb, var(--blob-4-mid) 40%, transparent) 45%, transparent 72%);
    top: 65%;
    left: 15%;
    animation: driftOrange 34s ease-in-out infinite;
    animation-delay: -6s;
}

.ambient-blob--5 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--blob-5-core) 0%, color-mix(in srgb, var(--blob-5-mid) 42%, transparent) 45%, transparent 72%);
    top: 75%;
    left: 45%;
    animation: driftWarm4 28s ease-in-out infinite;
    animation-delay: -12s;
}

.ambient-blob--6 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--blob-6-core) 0%, color-mix(in srgb, var(--blob-6-mid) 45%, transparent) 45%, transparent 72%);
    top: 40%;
    left: 30%;
    animation: driftWarm5 30s ease-in-out infinite;
    animation-delay: -18s;
}

@keyframes driftWarm1 {
    0% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(35vw, 20vh) scale(1.1); }
    50% { transform: translate(15vw, 45vh) scale(0.92); }
    75% { transform: translate(-25vw, 25vh) scale(1.08); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes driftWarm2 {
    0% { transform: translate(0, 0) scale(1.05); }
    25% { transform: translate(-30vw, -15vh) scale(0.95); }
    50% { transform: translate(-45vw, 20vh) scale(1.12); }
    75% { transform: translate(-10vw, 35vh) scale(1); }
    100% { transform: translate(0, 0) scale(1.05); }
}

@keyframes driftWarm3 {
    0% { transform: translate(0, 0) scale(0.95); }
    33% { transform: translate(-35vw, 30vh) scale(1.1); }
    66% { transform: translate(20vw, -25vh) scale(1.05); }
    100% { transform: translate(0, 0) scale(0.95); }
}

@keyframes driftWarm4 {
    0% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(40vw, -30vh) scale(1.08); }
    45% { transform: translate(25vw, -10vh) scale(0.9); }
    70% { transform: translate(-15vw, -35vh) scale(1.1); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes driftOrange {
    0% { transform: translate(0, 0) scale(1.02); }
    30% { transform: translate(-40vw, -20vh) scale(0.94); }
    60% { transform: translate(-20vw, -40vh) scale(1.1); }
    100% { transform: translate(0, 0) scale(1.02); }
}

@keyframes driftWarm5 {
    0% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30vw, 35vh) scale(1.12); }
    50% { transform: translate(-25vw, 15vh) scale(0.88); }
    75% { transform: translate(10vw, -30vh) scale(1.06); }
    100% { transform: translate(0, 0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .ambient-blob { animation: none !important; }
    .ambient-canvas { transition: none; }
    .ambient-blobs { transition: none; }
}

/* --- Liquid glass panels --- */
.liquidGlass-wrapper {
    position: relative;
    display: flex;
    overflow: hidden;
    box-shadow: 0 6px 24px var(--glass-shadow), 0 0 40px rgba(255, 255, 255, 0.15);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2), box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2);
    transform: translateZ(0);
    isolation: isolate;
}

.liquidGlass-wrapper--hover:hover {
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.1), 0 0 50px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.liquidGlass-effect {
    position: absolute;
    z-index: 0;
    inset: 0;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: inherit;
}

.liquidGlass-tint {
    z-index: 1;
    position: absolute;
    inset: 0;
    background: var(--glass-bg);
    border-radius: inherit;
}

.liquidGlass-shine {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    box-shadow: inset 2px 2px 1px 0 rgba(255, 255, 255, 0.6), inset -1px -1px 1px 1px rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.liquidGlass-text {
    z-index: 3;
    position: relative;
    width: 100%;
    color: var(--glass-text);
}

.rounded-3xl { border-radius: 1.5rem; }
.rounded-2xl { border-radius: 1rem; }

/* --- Nav --- */
.glass {
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(30px) saturate(220%);
    -webkit-backdrop-filter: blur(30px) saturate(220%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.glass.shadow-sm {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 1rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 1024px) {
    .nav-inner { padding-left: 2rem; padding-right: 2rem; }
}

.brand {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--glass-text);
    text-decoration: none;
}

.text-theme { color: var(--glass-text); }

.text-gradient-warm {
    font-weight: 700;
    background-image: linear-gradient(105deg, var(--accent-from) 0%, var(--accent-mid) 50%, var(--accent-to) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* --- Theme switcher --- */
.theme-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0.3rem;
    border: none;
    border-radius: 9999px;
    background: var(--switcher-track);
    backdrop-filter: blur(22px) saturate(var(--glass-saturation));
    -webkit-backdrop-filter: blur(22px) saturate(var(--glass-saturation));
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, calc(0.55 * var(--glass-reflex-light))),
        inset 0 -1px 2px rgba(0, 0, 0, calc(0.12 * var(--glass-reflex-dark))),
        0 4px 18px var(--glass-shadow);
}

.theme-switcher::after {
    content: '';
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 50%;
    background: var(--switcher-thumb);
    backdrop-filter: blur(14px) saturate(var(--glass-saturation));
    -webkit-backdrop-filter: blur(14px) saturate(var(--glass-saturation));
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, calc(0.65 * var(--glass-reflex-light))),
        inset 0 -1px 2px rgba(0, 0, 0, calc(0.1 * var(--glass-reflex-dark))),
        0 2px 10px rgba(0, 0, 0, calc(0.12 * var(--glass-reflex-dark)));
    transition: transform 0.5s cubic-bezier(0.34, 1.45, 0.64, 1);
    pointer-events: none;
    z-index: 0;
}

.theme-switcher:has(.theme-switcher__input[data-option='2']:checked)::after {
    transform: translateX(2.65rem);
}

.theme-switcher__option {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.65rem;
    height: 2.65rem;
    cursor: pointer;
    border-radius: 50%;
}

.theme-switcher__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.theme-switcher__icon {
    width: 1.35rem;
    height: 1.35rem;
    color: var(--switcher-icon);
    transition: color 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.theme-switcher:has(.theme-switcher__input[data-option='1']:checked) .theme-switcher__option:first-of-type .theme-switcher__icon,
.theme-switcher:has(.theme-switcher__input[data-option='2']:checked) .theme-switcher__option:last-of-type .theme-switcher__icon {
    color: var(--switcher-icon-active);
    transform: scale(1.08);
}

/* --- Layout --- */
.page-content {
    position: relative;
    z-index: 10;
    min-height: 100vh;
}

.main {
    max-width: 90rem;
    margin: 0 auto;
    padding: 7rem 1.5rem 3rem;
}

@media (min-width: 1024px) {
    .main { padding: 7.5rem 2rem 3rem; }
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 1100px) {
    .dashboard {
        grid-template-columns: minmax(0, 1fr) min(22rem, 30vw);
    }
}

.dashboard__links,
.dashboard__weather {
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--glass-text);
}

.page-meta {
    margin: 0;
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--glass-muted);
    text-align: right;
}

.panel-padding {
    padding: 1.75rem 1.5rem 2rem;
}

@media (min-width: 640px) {
    .panel-padding { padding: 2rem 2rem 2.25rem; }
}

/* --- Search --- */
.search-block { margin-bottom: 2.5rem; }

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .search-form { flex-direction: row; align-items: stretch; }
}

.search-input-wrap { flex: 1; min-width: 0; }

.glass-input {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    padding: 0.875rem 1.25rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--glass-text);
    outline: none;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.glass-input::placeholder { color: var(--glass-muted); }

.glass-input:focus {
    background: rgba(255, 255, 255, 0.38);
    border-color: color-mix(in srgb, var(--accent-from) 55%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-from) 20%, transparent);
}

.liquid-glass {
    appearance: none;
    border: none;
    outline: none;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    backdrop-filter: blur(30px) saturate(220%);
    -webkit-backdrop-filter: blur(30px) saturate(220%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s, box-shadow 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: inherit;
}

.liquid-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.liquid-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 4px 14px rgba(255, 255, 255, 0.2), inset 0 -4px 14px rgba(0, 0, 0, 0.06);
    pointer-events: none;
}

.liquid-glass:hover:not(:disabled) { transform: translateY(-3px) scale(1.02); }
.liquid-glass:active:not(:disabled) { transform: translateY(1px) scale(0.98); }

.glass-white {
    background-color: rgba(255, 255, 255, 0.25);
    color: var(--glass-text);
    box-shadow: 0 12px 32px var(--glass-shadow);
}

.glass-white::before {
    background: linear-gradient(135deg, var(--glass-highlight) 0%, rgba(255, 255, 255, 0.15) 35%, rgba(255, 255, 255, 0) 65%, var(--glass-border) 100%);
}

.glass-white:hover:not(:disabled) {
    background-color: var(--glass-bg-hover);
}

.btn-pill-lg {
    border-radius: 9999px;
    padding: 1rem 2rem;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

/* --- Categories --- */
.categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .categories {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

.category {
    min-width: 0;
}

.category__title {
    margin: 0 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--glass-muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.link-card {
    text-decoration: none;
    color: inherit;
}

.link-card .liquidGlass-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 5.5rem;
    padding: 0.875rem 0.5rem;
    text-align: center;
}

.link-card i {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    background-image: linear-gradient(105deg, var(--accent-from) 0%, var(--accent-mid) 50%, var(--accent-to) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.2s ease;
}

.link-card:hover i { transform: scale(1.08); }

.link-card__mark {
    margin-bottom: 0.5rem;
    line-height: 0;
}

.link-card__mark svg {
    width: 2.5rem;
    height: 2.5rem;
    display: block;
    border-radius: 0.65rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-card:hover .link-card__mark svg {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.link-card span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--glass-text);
}

.page-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--glass-muted);
}

/* --- Dark theme --- */
[data-theme='dark'] {
    --page-bg: #0a0b0e;
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-bg-hover: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-highlight: rgba(255, 255, 255, 0.32);
    --glass-shadow: rgba(0, 0, 0, 0.5);
    --glass-text: #f5f5f7;
    --glass-muted: #98989d;
    --glass-accent-bg: rgba(255, 149, 0, 0.24);
    --glass-accent-border: rgba(255, 149, 0, 0.5);
    --glass-accent-highlight: rgba(255, 200, 120, 0.45);
    --glass-accent-shadow: rgba(255, 149, 0, 0.35);
    --glass-reflex-dark: 2;
    --glass-reflex-light: 0.28;
    --glass-saturation: 150%;
    --switcher-track: rgba(255, 255, 255, 0.09);
    --switcher-thumb: rgba(255, 255, 255, 0.16);
    --switcher-icon: #636366;
    --switcher-icon-active: #f5f5f7;
}

[data-theme='dark'] .ambient-nature {
    background-color: #0a0b0e;
    filter: grayscale(100%) brightness(0.38) contrast(1.08);
}

[data-theme='dark'] .ambient-nature::after {
    background: linear-gradient(160deg, rgba(10, 11, 14, 0.78) 0%, rgba(10, 11, 14, 0.58) 50%, rgba(10, 11, 14, 0.72) 100%);
}

[data-theme='dark'] .glass {
    background: rgba(255, 255, 255, 0.07);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .liquidGlass-wrapper {
    box-shadow: 0 6px 28px var(--glass-shadow), 0 0 36px rgba(0, 0, 0, 0.25);
}

[data-theme='dark'] .liquidGlass-wrapper--hover:hover {
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45), 0 0 48px rgba(0, 0, 0, 0.2);
}

[data-theme='dark'] .liquidGlass-shine {
    box-shadow: inset 2px 2px 1px 0 rgba(255, 255, 255, 0.14), inset -1px -1px 1px 1px rgba(255, 255, 255, 0.06);
}

[data-theme='dark'] .glass-input {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

[data-theme='dark'] .glass-input:focus {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .glass-white {
    background-color: rgba(255, 255, 255, 0.09);
}

[data-theme='dark'] .page-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .glass.shadow-sm {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* --- Weather widget --- */
.weather-widget.is-loading .weather-hero {
    opacity: 0.6;
}

.weather-widget__title {
    margin: 0 0 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--glass-muted);
}

.weather-hero {
    position: relative;
    margin-bottom: 1.25rem;
    border-radius: 1.25rem;
    overflow: visible;
    transition: opacity 0.4s ease;
}

.weather-sky {
    position: relative;
    height: 8.5rem;
    border-radius: 1.25rem;
    overflow: hidden;
    background: linear-gradient(180deg, #87ceeb 0%, #b8dff5 55%, rgba(255, 255, 255, 0.15) 100%);
    transition: background 1.2s ease;
}

.weather-sky[data-phase='dawn'] {
    background: linear-gradient(180deg, #4a5568 0%, #f6ad55 45%, #fde68a 100%);
}

.weather-sky[data-phase='day'] {
    background: linear-gradient(180deg, #3b82f6 0%, #87ceeb 50%, rgba(255, 255, 255, 0.2) 100%);
}

.weather-sky[data-phase='dusk'] {
    background: linear-gradient(180deg, #553c9a 0%, #ed8936 45%, #fbd38d 100%);
}

.weather-sky[data-phase='night'] {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 55%, #334155 100%);
}

.weather-sky[data-phase='night'] .weather-sky__cloud {
    opacity: 0.12;
}

.weather-stars {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
    background-image:
        radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1px 1px at 28% 42%, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(1.5px 1.5px at 45% 12%, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(1px 1px at 62% 35%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 78% 22%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1.5px 1.5px at 88% 48%, rgba(255, 255, 255, 0.65), transparent),
        radial-gradient(1px 1px at 18% 58%, rgba(255, 255, 255, 0.55), transparent),
        radial-gradient(1px 1px at 52% 52%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 70% 62%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 35% 28%, rgba(255, 255, 255, 0.7), transparent);
    animation: starsTwinkle 6s ease-in-out infinite alternate;
}

.weather-stars.is-visible {
    opacity: 1;
}

@keyframes starsTwinkle {
    0% { opacity: 0.55; }
    100% { opacity: 1; }
}

.weather-sky__arc {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.weather-sky__arc-line {
    fill: none;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    stroke-width: 1.25;
    stroke: rgba(255, 255, 255, 0.42);
    opacity: 0;
    transition: stroke 0.6s ease, opacity 0.5s ease;
}

.weather-sky.has-celestial-arc .weather-sky__arc-line {
    opacity: 1;
}

.weather-sky.is-moon-track .weather-sky__arc-line {
    stroke: rgba(255, 255, 255, 0.22);
}

.weather-sky:not(.is-moon-track) .weather-sky__arc-line {
    stroke: rgba(255, 255, 255, 0.48);
}

.weather-sky__horizon {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 28%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    opacity: 0.6;
    transition: opacity 0.6s ease;
}

.weather-sky.is-moon-track .weather-sky__horizon {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    opacity: 0.7;
}

.weather-celestial {
    position: absolute;
    width: 2.25rem;
    height: 2.25rem;
    margin: -1.125rem 0 0 -1.125rem;
    z-index: 3;
    transition: left 1s cubic-bezier(0.34, 1.2, 0.64, 1), top 1s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.weather-sun-disc,
.weather-moon-disc {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.45, 0.64, 1);
    pointer-events: none;
}

.weather-sun-disc.is-active,
.weather-moon-disc.is-active {
    opacity: 1;
    transform: scale(1);
}

.weather-sun-disc {
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff7c2, #fbbf24 45%, #f59e0b 100%);
    box-shadow:
        0 0 20px rgba(251, 191, 36, 0.85),
        0 0 40px rgba(245, 158, 11, 0.45);
    animation: sunPulse 3s ease-in-out infinite;
}

.weather-moon-disc {
    border-radius: 50%;
    overflow: hidden;
    box-shadow:
        0 0 calc(18px * var(--moon-glow, 0.5)) rgba(203, 213, 225, calc(0.35 + var(--moon-glow, 0.5) * 0.45)),
        0 0 calc(32px * var(--moon-glow, 0.5)) rgba(148, 163, 184, calc(0.2 + var(--moon-glow, 0.5) * 0.25));
    animation: moonGlow 4s ease-in-out infinite;
}

.weather-moon-disc__light {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 38% 38%, #ffffff 0%, #e2e8f0 38%, #94a3b8 100%);
}

.weather-moon-disc__shadow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #0f172a;
    transition: transform 1.2s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.weather-sky[data-phase='night'] .weather-moon-disc__shadow,
.weather-sky[data-phase='dawn'] .weather-moon-disc__shadow,
.weather-sky[data-phase='dusk'] .weather-moon-disc__shadow {
    background: #1e293b;
}

@keyframes sunPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.12); }
}

@keyframes moonGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.08); }
}

.weather-sky__cloud {
    position: absolute;
    color: rgba(255, 255, 255, 0.55);
    font-size: 1.25rem;
    animation: cloudDrift linear infinite;
    pointer-events: none;
}

.weather-sky__cloud--1 { top: 18%; left: 8%; animation-duration: 28s; }
.weather-sky__cloud--2 { top: 32%; left: 55%; font-size: 1rem; animation-duration: 36s; animation-delay: -8s; opacity: 0.7; }
.weather-sky__cloud--3 { top: 12%; left: 78%; font-size: 0.85rem; animation-duration: 42s; animation-delay: -14s; opacity: 0.5; }

@keyframes cloudDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(120%); }
}

.weather-time-block {
    padding: 1rem 0.25rem 0.75rem;
    text-align: center;
}

.weather-clock {
    display: block;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--glass-text);
}

.weather-moon-phase {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--glass-muted);
}

.weather-now {
    position: relative;
    padding: 0 0.25rem;
}

.weather-location {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--glass-muted);
    text-align: center;
}

.weather-now__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.weather-now__icon {
    font-size: 2rem;
    background-image: linear-gradient(105deg, var(--accent-from) 0%, var(--accent-mid) 50%, var(--accent-to) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.weather-temp {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

.weather-desc {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--glass-muted);
}

.weather-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.weather-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 0.375rem;
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--glass-muted);
    text-align: center;
}

.weather-stat i {
    font-size: 0.875rem;
    background-image: linear-gradient(105deg, var(--accent-from) 0%, var(--accent-mid) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.weather-stat strong {
    font-size: 0.8125rem;
    color: var(--glass-text);
    font-weight: 700;
}

.weather-section {
    margin-top: 1.25rem;
}

.weather-section__title {
    margin: 0 0 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--glass-muted);
}

.weather-hourly {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.weather-hour {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.625rem 0.25rem;
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.25s ease, background 0.25s ease;
}

.weather-hour.is-now {
    background: color-mix(in srgb, var(--accent-from) 12%, rgba(255, 255, 255, 0.18));
    border-color: color-mix(in srgb, var(--accent-from) 35%, rgba(255, 255, 255, 0.25));
    transform: scale(1.04);
}

.weather-hour__time {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--glass-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.weather-hour__icon {
    font-size: 1rem;
    color: var(--accent-mid);
}

.weather-hour__temp {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--glass-text);
}

.weather-daily {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.weather-day {
    display: grid;
    grid-template-columns: 3.5rem 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.25s ease, transform 0.25s ease;
}

.weather-day.is-today {
    background: color-mix(in srgb, var(--accent-from) 10%, rgba(255, 255, 255, 0.12));
    border-color: color-mix(in srgb, var(--accent-from) 30%, rgba(255, 255, 255, 0.2));
}

.weather-day__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--glass-text);
    text-transform: capitalize;
}

.weather-day__icon {
    justify-self: center;
    font-size: 1rem;
    color: var(--accent-mid);
}

.weather-day__temps {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.weather-day__max { color: var(--glass-text); }
.weather-day__min { color: var(--glass-muted); font-weight: 500; }

.weather-status {
    margin: 0 0 0.75rem;
    font-size: 0.75rem;
    color: var(--glass-muted);
    min-height: 1rem;
}

[data-theme='dark'] .weather-stat,
[data-theme='dark'] .weather-hour,
[data-theme='dark'] .weather-day {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .weather-hour.is-now,
[data-theme='dark'] .weather-day.is-today {
    background: color-mix(in srgb, var(--accent-from) 14%, rgba(255, 255, 255, 0.08));
}

@media (prefers-reduced-motion: reduce) {
    .weather-sun-disc,
    .weather-moon-disc,
    .weather-sky__cloud,
    .weather-stars { animation: none !important; }
    .weather-celestial,
    .weather-moon-disc__shadow { transition: none; }
}
