:root {
    color-scheme: light;
    --ink: #172f3b;
    --muted: #647782;
    --paper: #f3f6f7;
    --panel: #ffffff;
    --line: #e2e9ec;
    --accent: #177d79;
    --accent-dark: #125e5c;
    --accent-soft: #e4f3f1;
    --shadow: 0 12px 34px rgb(22 53 64 / 6%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

button {
    color: inherit;
    font: inherit;
}

.page-width {
    width: min(1120px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    border-bottom: 1px solid rgb(226 233 236 / 80%);
    background: rgb(255 255 255 / 82%);
}

.header-inner {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 750;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 20px;
}

.brand-region {
    color: var(--accent);
}

.header-note,
.section-note {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

main {
    padding-top: 30px;
}

.intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1,
h2 {
    margin: 0;
    letter-spacing: -0.045em;
}

h1 {
    font-size: clamp(29px, 5vw, 42px);
    line-height: 1.08;
}

h2 {
    font-size: 20px;
    line-height: 1.2;
}

.intro-copy {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.data-status {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.city-tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 2px 0 12px;
    scrollbar-width: thin;
}

.city-tab,
.range-tab {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: var(--panel);
    cursor: pointer;
    transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.city-tab {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.city-tab:hover,
.range-tab:hover {
    border-color: #b7d7d4;
    color: var(--accent-dark);
}

.city-tab.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.weather-layout {
    display: grid;
    gap: 14px;
}

.panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.current-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    background:
        radial-gradient(circle at 100% 0%, rgb(101 194 182 / 18%), transparent 42%),
        var(--panel);
}

.current-heading,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.weather-symbol {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 25px;
}

.current-condition {
    min-height: 19px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.current-temperature {
    margin: 2px 0 0;
    font-size: clamp(55px, 12vw, 76px);
    font-weight: 720;
    letter-spacing: -0.085em;
    line-height: 1.08;
}

.current-temperature span {
    margin-left: 5px;
    color: var(--muted);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.04em;
    vertical-align: 20px;
}

.current-source,
.current-updated {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

.metric {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgb(226 233 236 / 85%);
    border-radius: 13px;
    background: rgb(255 255 255 / 68%);
}

.metric-label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
}

.metric strong {
    display: block;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forecast-card {
    padding: 20px 16px 14px;
}

.forecast-heading {
    align-items: flex-start;
    flex-wrap: wrap;
}

.range-tabs {
    display: flex;
    gap: 4px;
    padding: 3px;
    border-radius: 11px;
    background: var(--paper);
}

.range-tab {
    min-height: 32px;
    padding: 0 10px;
    border-color: transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.range-tab.is-active {
    border-color: var(--line);
    background: var(--panel);
    color: var(--accent-dark);
    box-shadow: 0 1px 3px rgb(22 53 64 / 7%);
}

.chart-wrap {
    position: relative;
    height: 270px;
    margin-top: 18px;
}

.chart-wrap canvas {
    max-width: 100%;
}

.empty-state {
    margin: 0;
    padding: 22px 10px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.chart-legend-note {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 10px;
    text-align: right;
}

.map-panel,
.cameras-panel {
    margin-top: 16px;
    padding: 20px;
}

.section-heading {
    align-items: flex-end;
    margin-bottom: 15px;
}

.section-note {
    max-width: 250px;
    text-align: right;
}

.map-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: #e7eef0;
}

#weather-map {
    z-index: 0;
    height: 340px;
    background: #e7eef0;
}

.map-empty {
    position: absolute;
    z-index: 400;
    top: 12px;
    left: 50%;
    width: max-content;
    max-width: calc(100% - 24px);
    margin: 0;
    padding: 8px 12px;
    transform: translateX(-50%);
    border: 1px solid rgb(226 233 236 / 90%);
    border-radius: 10px;
    background: rgb(255 255 255 / 95%);
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.button-secondary {
    border-color: var(--line);
    background: var(--panel);
    color: var(--accent-dark);
}

.button-secondary:hover {
    border-color: #b7d7d4;
    background: var(--accent-soft);
}

.button-secondary span {
    font-size: 17px;
    line-height: 1;
}

.camera-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.camera-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafb;
}

.camera-image-wrap {
    display: grid;
    min-height: 185px;
    place-items: center;
    overflow: hidden;
    background: #e9eff1;
}

.camera-image {
    display: block;
    width: 100%;
    min-height: 185px;
    max-height: 280px;
    object-fit: cover;
}

.camera-fallback {
    display: none;
    padding: 20px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.camera-caption {
    margin: 0;
    padding: 11px 13px;
    font-size: 12px;
    font-weight: 700;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 0 30px;
    color: var(--muted);
    font-size: 10px;
}

.noscript-note {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto 20px;
    color: #9c3d36;
    font-size: 13px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #65bdb4;
    outline-offset: 3px;
}

@media (min-width: 680px) {
    .page-width {
        width: min(1120px, calc(100% - 48px));
    }

    main {
        padding-top: 42px;
    }

    .city-tabs {
        gap: 9px;
        padding-bottom: 15px;
    }

    .city-tab {
        min-height: 42px;
        padding-inline: 19px;
    }

    .weather-layout {
        grid-template-columns: minmax(270px, 0.82fr) minmax(0, 1.5fr);
        gap: 16px;
    }

    .current-card {
        padding: 25px;
    }

    .forecast-card {
        padding: 22px;
    }

    .chart-wrap {
        height: 300px;
    }

    .camera-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (min-width: 980px) {
    .camera-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #weather-map {
        height: 390px;
    }
}

@media (max-width: 520px) {
    .header-note,
    .section-note {
        display: none;
    }

    .intro {
        display: block;
    }

    .data-status {
        margin-top: 12px;
        text-align: left;
    }

    .current-card {
        padding: 19px;
    }

    .forecast-heading {
        align-items: center;
    }

    .map-panel,
    .cameras-panel {
        padding: 16px;
    }

    #weather-map {
        height: 300px;
    }

    .section-heading {
        align-items: flex-start;
    }

    .cameras-panel .section-heading {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
