:root {
    color-scheme: dark;
    --bg: #0d131b;
    --panel: #121b26;
    --panel-2: #172230;
    --text: #f4f7fa;
    --muted: #9eabba;
    --line: #2b3948;
    --accent: #7fb5da;
    --accent-soft: rgba(127, 181, 218, .13);
    --warning: #d8b56b;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 15% -10%, rgba(76, 115, 145, .13), transparent 32rem),
        var(--bg);
    color: var(--text);
}

body { min-height: 100vh; }

a { color: inherit; }

.shell {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: clamp(16px, 2.4vw, 36px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.locations {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.location-link, .refresh {
    text-decoration: none;
    color: var(--muted);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: .93rem;
    transition: background .15s ease, color .15s ease;
}

.location-link:hover, .refresh:hover {
    background: var(--panel-2);
    color: var(--text);
}

.location-link.active {
    background: var(--accent-soft);
    color: var(--text);
}

.refresh {
    white-space: nowrap;
    border: 1px solid var(--line);
}

.notice {
    margin-top: 18px;
    border: 1px solid rgba(216, 181, 107, .35);
    background: rgba(216, 181, 107, .08);
    color: #e8cf9b;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: .9rem;
}

.current-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: clamp(28px, 5vw, 76px);
    padding: clamp(34px, 6vw, 78px) 0;
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: clamp(.85rem, 1.2vw, 1rem);
    text-transform: uppercase;
    letter-spacing: .15em;
    font-weight: 650;
}

.condition-row {
    display: flex;
    align-items: center;
    gap: clamp(20px, 4vw, 54px);
}

.weather-symbol {
    width: clamp(100px, 13vw, 175px);
    height: clamp(100px, 13vw, 175px);
    display: grid;
    place-items: center;
    font-family: "Segoe UI Symbol", sans-serif;
    font-size: clamp(5rem, 10vw, 9rem);
    font-weight: 200;
    color: var(--accent);
    line-height: 1;
}

.temperature {
    font-size: clamp(6rem, 14vw, 12.5rem);
    font-weight: 250;
    line-height: .78;
    letter-spacing: -.065em;
}

.temperature span {
    font-size: .44em;
    vertical-align: top;
    position: relative;
    top: -.06em;
    margin-left: .04em;
}

.condition {
    margin-top: 22px;
    color: #d8e0e8;
    font-size: clamp(1.35rem, 2.4vw, 2.4rem);
    font-weight: 450;
}

.summary {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    color: var(--muted);
    font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.updated {
    margin: 20px 0 0;
    color: #718091;
    font-size: .88rem;
}

.metrics {
    align-self: center;
    border-left: 1px solid var(--line);
    padding-left: clamp(26px, 4vw, 58px);
}

.metric {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    padding: 17px 0;
    border-bottom: 1px solid rgba(43, 57, 72, .7);
}

.metric:last-child { border-bottom: 0; }

.metric-label { color: var(--muted); }
.metric strong { font-weight: 550; }

.forecast-section {
    border-top: 1px solid var(--line);
    padding: 28px 0 34px;
}

.section-heading h2 {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-weight: 650;
}

.hourly-strip {
    display: grid;
    grid-template-columns: repeat(12, minmax(88px, 1fr));
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 4px;
}

.hour-card {
    min-width: 88px;
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 13px 8px;
    border-right: 1px solid var(--line);
}

.hour-card:last-child { border-right: 0; }

.hour-card time, .day-card time {
    color: var(--muted);
    font-size: .85rem;
}

.small-symbol, .day-symbol {
    font-family: "Segoe UI Symbol", sans-serif;
    color: var(--accent);
    font-size: 2rem;
    line-height: 1.2;
}

.hour-card strong { font-size: 1.2rem; }

.precip {
    color: #8295a8;
    font-size: .78rem;
}

.daily-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}

.day-card {
    background: var(--panel);
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 20px 10px;
}

.day-symbol { font-size: 2.5rem; }

.day-temp {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.day-temp strong {
    font-size: 1.3rem;
    font-weight: 600;
}

.day-temp span { color: var(--muted); }

.error-panel {
    margin-top: 40px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px;
}

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

    .current-grid {
        grid-template-columns: 1fr;
        padding-top: 34px;
    }

    .metrics {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 20px 0 0;
    }

    .daily-grid {
        grid-template-columns: repeat(7, minmax(104px, 1fr));
        overflow-x: auto;
    }
}

@media (max-width: 520px) {
    .shell { padding: 14px; }

    .locations {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .location-link {
        text-align: center;
        padding-inline: 7px;
        font-size: .78rem;
    }

    .condition-row { gap: 8px; }

    .weather-symbol {
        width: 84px;
        height: 84px;
        font-size: 4rem;
    }

    .temperature { font-size: 6.5rem; }

    .summary {
        gap: 14px;
        flex-wrap: wrap;
    }
}

/* GPi Case 2's 640x480 viewport: compact but still a real web UI. */
@media (max-width: 680px) and (max-height: 520px) {
    .shell { padding: 10px 14px; }
    .topbar { padding-bottom: 8px; }
    .refresh { display: none; }
    .current-grid {
        grid-template-columns: 1.4fr .6fr;
        gap: 18px;
        padding: 14px 0 12px;
    }
    .eyebrow { margin-bottom: 5px; font-size: .72rem; }
    .weather-symbol { width: 72px; height: 72px; font-size: 3.6rem; }
    .temperature { font-size: 5.4rem; }
    .condition { margin-top: 7px; font-size: 1.05rem; }
    .summary { margin-top: 9px; gap: 10px; font-size: .82rem; }
    .updated { margin-top: 6px; font-size: .7rem; }
    .metrics {
        border-top: 0;
        border-left: 1px solid var(--line);
        padding: 0 0 0 15px;
    }
    .metric { padding: 7px 0; font-size: .77rem; }
    .forecast-section { padding: 10px 0; }
    .section-heading h2 { margin-bottom: 7px; font-size: .7rem; }
    .hourly-strip { grid-template-columns: repeat(12, 65px); }
    .hour-card { min-width: 65px; gap: 4px; padding: 5px 3px; }
    .small-symbol { font-size: 1.3rem; }
    .hour-card strong { font-size: .9rem; }
    .daily-grid { grid-template-columns: repeat(7, 78px); }
    .day-card { gap: 5px; padding: 7px 4px; }
    .day-symbol { font-size: 1.45rem; }
    .day-temp strong { font-size: .9rem; }
}
