:root {
    --surface-bg: rgba(255, 255, 255, 0.17);
    --surface-border: rgba(255, 255, 255, 0.28);
    --surface-shadow: 0 18px 35px rgba(7, 24, 51, 0.2);
    --text-strong: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.82);
    --scene-gradient: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    --scene-image: url("https://images.unsplash.com/photo-1530908295418-a12e326966ba?auto=format&fit=crop&w=1800&q=70");
    --rain-opacity: 0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", "Roboto", sans-serif;
    min-height: 100vh;
    color: var(--text-strong);
    background: #0a1a3a;
    position: relative;
    overflow-x: hidden;
}

.weather-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    /* background-image: var(--scene-gradient), var(--scene-image); */
    background-size: cover;
    background-position: center;
    transition: background-image 0.4s ease;
}

.weather-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(5, 14, 36, 0.08), rgba(7, 19, 45, 0.55)),
        repeating-linear-gradient(
            160deg,
            rgba(255, 255, 255, 0.22) 0 1px,
            transparent 1px 18px
        );
    opacity: var(--rain-opacity);
    animation: rainFlow 0.6s linear infinite;
    pointer-events: none;
}

@keyframes rainFlow {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -12px 24px;
    }
}

.page-shell {
    position: relative;
    z-index: 1;
    max-width: 1220px;
    margin: 0 auto;
    padding: 20px 16px 42px;
}

.glass-surface {
    background: var(--surface-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--surface-border);
    border-radius: 18px;
    box-shadow: var(--surface-shadow);
}

.weather-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.brand-link img {
    width: 250px;
    height: auto;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.topbar-link {
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    padding: 6px 12px;
    transition: background-color 0.25s ease;
}

.topbar-link:hover {
    background: rgba(255, 255, 255, 0.16);
}

.hero-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    margin-bottom: 16px;
    min-height: 248px;
    isolation: isolate;
}

.hero-media {
    position: absolute;
    inset: 0;
    background-image: var(--scene-image);
    background-size: cover;
    background-position: center;
    opacity: 0.42;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        120deg,
        rgba(8, 17, 40, 0.68),
        rgba(8, 17, 40, 0.3)
    );
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 18px;
    align-items: center;
}

.hero-location {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

.hero-temp-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.hero-temp {
    font-size: clamp(56px, 9vw, 78px);
    line-height: 0.92;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.hero-condition {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-muted);
}

.hero-subline {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-icon {
    width: 140px;
    height: 140px;
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-icon img,
.hero-icon span {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card {
    padding: 16px;
}

.metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 10px;
    font-weight: 600;
}

.metric-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.metric-unit {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 4px;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.timeline-card,
.aqi-card {
    padding: 18px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
}

.timeline-hours {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.sun-track {
    position: relative;
    height: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
    margin-bottom: 10px;
}

.sun-track-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 221, 102, 0.32),
        rgba(255, 190, 11, 0.9)
    );
    transition: width 0.4s ease;
}

.sun-marker {
    position: absolute;
    top: 50%;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.94);
    background: radial-gradient(circle at 30% 30%, #fff7cc, #ffbe0b);
    box-shadow: 0 0 20px rgba(255, 220, 102, 0.82);
    transform: translate(-50%, -50%);
    transition: left 0.4s ease;
}

.timeline-caption {
    font-size: 13px;
    color: var(--text-muted);
}

.aqi-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.aqi-number {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.aqi-status {
    font-size: 15px;
    font-weight: 700;
}

.aqi-scale {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin: 12px 0;
}

.aqi-step {
    border-radius: 8px;
    padding: 8px 6px;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    opacity: 0.48;
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.aqi-step.active {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.aqi-note {
    font-size: 13px;
    color: var(--text-muted);
}
.forecast-card {
    padding: 18px;
}

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

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(115px, 1fr));
    gap: 10px;
}

.forecast-item {
    border-radius: 14px;
    padding: 12px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(10, 24, 58, 0.32);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 156px;
}

.forecast-day {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.forecast-icon {
    width: 46px;
    height: 46px;
    position: relative;
    overflow: hidden;
}

.forecast-icon img,
.forecast-icon span {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.forecast-temp {
    margin-top: auto;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.forecast-condition {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(6, 12, 30, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffd166;
}

.load-state {
    padding: 22px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    display: none;
}

.load-state.show {
    display: block;
}

@media (max-width: 1080px) {
    .cards-grid {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .forecast-grid {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .forecast-item {
        min-width: 128px;
        flex: 0 0 128px;
    }
}

@media (max-width: 780px) {
    .weather-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-card {
        padding: 18px;
    }

    .hero-content {
        grid-template-columns: 1fr;
    }

    .hero-icon {
        width: 120px;
        height: 120px;
        justify-self: flex-start;
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .aqi-scale {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .page-shell {
        padding: 14px 10px 28px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .hero-temp {
        font-size: 56px;
    }
}
