/* ============================================================
   Kaj.VG — Design System v2
   Bento dashboard · Velika Gorica
   ============================================================ */

/* --- Design Tokens ----------------------------------------- */
:root {
    /* Palette */
    --bg:            #06090f;
    --surface:       #0d1117;
    --card:          rgba(255, 255, 255, 0.028);
    --card-hover:    rgba(255, 255, 255, 0.048);
    --border:        rgba(255, 255, 255, 0.06);
    --border-hover:  rgba(255, 255, 255, 0.10);

    /* Text */
    --t1: rgba(255, 255, 255, 0.93);
    --t2: rgba(255, 255, 255, 0.52);
    --t3: rgba(255, 255, 255, 0.26);

    /* Accents */
    --blue:    #5ac8fa;
    --green:   #32d74b;
    --orange:  #ff9f0a;
    --red:     #ff453a;
    --purple:  #bf5af2;
    --yellow:  #ffd60a;

    /* Radius */
    --r-sm:   10px;
    --r-md:   16px;
    --r-lg:   22px;
    --r-xl:   28px;
    --r-full: 100px;

    /* Layout */
    --page-max:  1200px;
    --page-px:   24px;
    --gap:       16px;
    --card-px:   24px;
    --card-py:   24px;

    /* Motion */
    --ease:    cubic-bezier(0.25, 0.1, 0.25, 1);
    --spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur:     0.25s;
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 16px;
    color: var(--t1);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100dvh;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; }
ul, ol { list-style: none; }

/* --- Background -------------------------------------------- */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 70% 50% at 8% 15%, rgba(90, 200, 250, 0.055) 0%, transparent 60%),
        radial-gradient(ellipse 55% 45% at 88% 78%, rgba(191, 90, 242, 0.045) 0%, transparent 50%),
        radial-gradient(ellipse 65% 40% at 45% 110%, rgba(50, 215, 75, 0.035) 0%, transparent 45%),
        var(--bg);
    animation: bg-drift 45s ease-in-out infinite alternate;
}

/* Subtle noise grain */
.bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    opacity: 0.018;
    mix-blend-mode: overlay;
    pointer-events: none;
}

@keyframes bg-drift {
    0%   { filter: hue-rotate(0deg)  brightness(1); }
    50%  { filter: hue-rotate(6deg)  brightness(1.015); }
    100% { filter: hue-rotate(-4deg) brightness(0.985); }
}

/* --- Page Container ---------------------------------------- */
.page {
    position: relative;
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--page-px);
}

/* --- Header ------------------------------------------------ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 8px;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    flex-shrink: 0;
    user-select: none;
}

.header__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header__brand {
    font-size: 1.1rem;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.header__location {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--t2);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.header__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.header__meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header__date {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--t3);
    text-align: right;
}

.header__clock {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--t2);
    letter-spacing: 0.015em;
    min-width: 5.5ch;
    text-align: right;
}

.header__sun {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--t3);
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
}

.header__sun-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.header__sun-icon {
    font-size: 0.8rem;
    line-height: 1;
}

/* --- Intro ------------------------------------------------- */
.intro {
    padding: 16px 0 28px;
}

.intro__heading {
    font-size: clamp(1.4rem, 3.5vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
    margin: 0 0 4px;
}

.intro__sub {
    font-size: 0.9rem;
    color: var(--t2);
    font-weight: 400;
    margin: 0;
}

/* --- Dashboard Grid ---------------------------------------- */
.dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
    padding-bottom: 20px;
}

/* --- Card Base --------------------------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--card-py) var(--card-px);
    position: relative;
    transition:
        background var(--dur) var(--ease),
        border-color var(--dur) var(--ease),
        box-shadow var(--dur) var(--ease);

    /* Scroll reveal */
    opacity: 0;
    transform: translateY(18px);
}

.card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.55s var(--ease),
        transform 0.55s var(--ease),
        background var(--dur) var(--ease),
        border-color var(--dur) var(--ease),
        box-shadow var(--dur) var(--ease);
}

/* Glass light overlay */
.card__glass-light {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s var(--ease);
    border-radius: inherit;
    z-index: 1;
}

/* Noise dither to eliminate gradient banding */
.card__glass-light::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.04;
    mix-blend-mode: overlay;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .card:hover {
        border-color: var(--border-hover);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    }
}

/* --- Card Label -------------------------------------------- */
.card__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.card__icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card__icon svg {
    width: 17px;
    height: 17px;
}

.card__icon--blue   { background: rgba(90, 200, 250, 0.12); color: var(--blue); }
.card__icon--orange { background: rgba(255, 159, 10, 0.12); color: var(--orange); }
.card__icon--green  { background: rgba(50, 215, 75, 0.12); color: var(--green); }

.card__title {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card__badge {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--t3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* --- Grid Placement ---------------------------------------- */
.card--aqi       { grid-column: span 2; }
.card--weather   { grid-column: span 1; }
.card--pm25,
.card--pm10,
.card--co2       { grid-column: span 1; }
.card--radiation       { grid-column: span 2; }
.card--news-showcase   { grid-column: 1 / -1; display: none; }

/* ── AQI status-driven borders & glow ────────────────── */
.card--aqi {
    --aqi-glow: 90, 200, 250;
    border-top: 2px solid rgba(var(--aqi-glow), 0.30);
    background: linear-gradient(to top, rgba(var(--aqi-glow), 0.06) 0%, transparent 50%), var(--card);
    transition: border-top-color 0.6s var(--ease), background 0.6s var(--ease);
}

/* ── Radiation status-driven borders ─────────────────── */
.card--radiation {
    --rad-glow: 50, 215, 75;
    border-top: 2px solid rgba(var(--rad-glow), 0.30);
    transition: border-top-color 0.6s var(--ease);
}

/* ============================================================
   AQI CARD
   ============================================================ */
.aqi-body {
    display: flex;
    align-items: flex-start;
    gap: 28px;
}

.aqi-hero {
    flex-shrink: 0;
}

.aqi-number {
    font-size: clamp(3.2rem, 7vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1;
    color: rgb(var(--aqi-glow, 90, 200, 250));
    transition: color 0.6s var(--ease);
}

.aqi-unit {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--t3);
    margin-top: 4px;
}

.aqi-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 6px;
}

.aqi-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--r-full);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
    background: rgba(var(--aqi-glow), 0.12);
    color: rgb(var(--aqi-glow));
}

.aqi-badge__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgb(var(--aqi-glow));
    box-shadow: 0 0 6px rgba(var(--aqi-glow), 0.4);
}

[data-alert] .aqi-badge__dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

.aqi-desc {
    font-size: 0.84rem;
    color: var(--t2);
    line-height: 1.45;
}

/* AQI Scale — Modern */
.aqi-scale {
    position: relative;
    z-index: 2;
    margin-top: 22px;
    padding-top: 44px;
    padding-bottom: 6px;
}

.aqi-scale__bar {
    position: relative;
    height: 8px;
    border-radius: 4px;
    overflow: visible;
}

.aqi-scale__bar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        to right,
        var(--green)  0%,
        var(--green)  12%,
        var(--yellow) 30%,
        var(--orange) 50%,
        var(--red)    70%,
        var(--purple) 100%
    );
    opacity: 0.5;
}

/* Current value — dot on bar + pill label above */
.aqi-scale__current {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgb(var(--aqi-glow));
    border: 3px solid var(--bg);
    box-shadow:
        0 0 0 2px rgba(var(--aqi-glow), 0.35),
        0 0 10px rgba(var(--aqi-glow), 0.25);
    z-index: 2;
    transition: left 1s var(--ease);
}

.aqi-scale__current::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 8px;
    background: rgba(var(--aqi-glow), 0.45);
    border-radius: 1px;
}

.aqi-scale__current-label {
    position: absolute;
    bottom: calc(100% + 11px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(var(--aqi-glow), 0.14);
    color: rgb(var(--aqi-glow));
    font-size: 0.62rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--r-full);
    letter-spacing: 0.03em;
    white-space: nowrap;
    border: 1px solid rgba(var(--aqi-glow), 0.1);
}

/* 24-hour average — subtle tick + label below bar */
.aqi-scale__avg {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 18px;
    background: var(--t1);
    border-radius: 1px;
    opacity: 0.4;
    z-index: 1;
    transition: left 1s var(--ease);
}

.aqi-scale__avg-label {
    display: none;
}

/* ============================================================
   WEATHER CARD
   ============================================================ */
.weather-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.weather-icon {
    font-size: 2.4rem;
    line-height: 1;
}

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

.weather-deg {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--t2);
}

.weather-condition {
    font-size: 0.88rem;
    color: var(--t2);
    font-weight: 500;
    margin-bottom: 20px;
}

.weather-details {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.weather-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.weather-detail:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.weather-detail__label {
    font-size: 0.78rem;
    color: var(--t3);
    font-weight: 500;
}

.weather-detail__value {
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--t1);
}

/* ============================================================
   METRIC CARDS
   ============================================================ */
.metric-label {
    font-size: 0.65rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--t3);
    margin-bottom: 4px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.card--pm25 .metric-value { color: var(--blue); }
.card--pm10 .metric-value { color: var(--purple); }
.card--co2  .metric-value { color: var(--orange); }

.metric-unit {
    font-size: 0.62rem;
    color: var(--t3);
    font-weight: 500;
    margin-bottom: 12px;
}

.metric-spark {
    width: 100%;
    height: 56px;
    margin-top: auto;
}

.metric-spark svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================================================
   RADIATION CARD
   ============================================================ */
.rad-body {
    display: flex;
    gap: 28px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rad-readings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rad-cpm {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.rad-cpm__value {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: rgb(var(--rad-glow));
    transition: color 0.6s var(--ease);
}

.rad-cpm__unit {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--t3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rad-dose {
    font-size: 0.84rem;
    color: var(--t2);
}

.rad-dose strong {
    color: var(--t1);
    font-weight: 700;
}

.rad-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--r-full);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
    background: rgba(var(--rad-glow), 0.12);
    color: rgb(var(--rad-glow));
}

.rad-status__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgb(var(--rad-glow));
    box-shadow: 0 0 6px rgba(var(--rad-glow), 0.4);
}

[data-alert] .rad-status__dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

/* Isotopes */
.rad-isotopes {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rad-isotopes__label {
    font-size: 0.62rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--t3);
}

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

.rad-isotope {
    display: inline-block;
    padding: 4px 11px;
    border-radius: var(--r-full);
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 159, 10, 0.08);
    color: var(--orange);
    border: 1px solid rgba(255, 159, 10, 0.14);
    letter-spacing: 0.01em;
}

.rad-isotope--empty {
    background: rgba(255, 255, 255, 0.03);
    color: var(--t3);
    border-color: rgba(255, 255, 255, 0.06);
    font-style: italic;
    font-weight: 500;
}

/* Radiation graphs */
.rad-graphs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.rad-graph {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--r-md);
    padding: 14px 14px 10px;
}

.rad-graph__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.rad-graph__title {
    font-size: 0.62rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--t3);
}

.rad-graph__value {
    font-size: 0.95rem;
    font-weight: 800;
    color: rgb(var(--rad-glow));
    transition: color 0.6s var(--ease);
}

.rad-graph__spark {
    width: 100%;
    height: 48px;
}

.rad-graph__spark svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================================================
   LOCATION CARD
   ============================================================ */
.card--location {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    border-top: 2px solid rgba(90, 200, 250, 0.30);
}

.loc-desc {
    font-size: 0.82rem;
    color: var(--t2);
    line-height: 1.45;
    margin-bottom: 14px;
}

.loc-map {
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.loc-map__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Dark theme filter for standard OSM tiles */
    filter: brightness(0.55) contrast(1.15) saturate(0.3) hue-rotate(180deg) invert(1);
    user-select: none;
    pointer-events: none;
}

/* Blur dot — station marker */
.loc-map__dot {
    position: absolute;
    top: 50.2%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(90, 200, 250, 0.7) 0%, rgba(90, 200, 250, 0.25) 45%, transparent 70%);
    box-shadow: 0 0 20px 8px rgba(90, 200, 250, 0.2);
    pointer-events: none;
    animation: loc-pulse 3s ease-in-out infinite;
}

@keyframes loc-pulse {
    0%, 100% {
        opacity: 0.85;
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 20px 8px rgba(90, 200, 250, 0.2);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 0 28px 12px rgba(90, 200, 250, 0.3);
    }
}

.loc-attr {
    margin-top: 8px;
    font-size: 0.52rem;
    color: var(--t3);
    text-align: right;
    opacity: 0.6;
}

.loc-attr a {
    text-decoration: underline;
    text-underline-offset: 1px;
}

.loc-attr a:hover {
    color: var(--t2);
}

/* ============================================================
   NEWS SHOWCASE CARD
   ============================================================ */
.card--news-showcase {
    border-top: 2px solid rgba(50, 215, 75, 0.30);
    overflow: hidden;
    padding-top: 16px;
    padding-bottom: 12px;
}

.card--news-showcase .card__label {
    margin-bottom: 8px;
}

/* Showcase container — rolodex with bottom clip */
.news-showcase {
    position: relative;
    overflow: hidden;
    height: 190px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 65%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 65%, transparent 100%);
}

/* Inner tape — translateY animated */
.news-showcase__tape {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.news-showcase__tape--animating {
    transition: transform 0.55s var(--ease);
}

/* Individual news slide */
.news-slide {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    text-decoration: none;
    color: inherit;
    border-radius: var(--r-sm);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s var(--ease);
}

.news-slide:last-child {
    border-bottom: none;
}

.news-slide:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* First visible slide — featured */
.news-slide--active {
    grid-template-columns: 44px 1fr;
}

.news-slide--active .news-slide__title {
    font-size: 1.05rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.news-slide--active .news-slide__subtitle {
    -webkit-line-clamp: 1;
    line-clamp: 1;
    color: var(--t2);
}

.news-slide--active .news-slide__logo {
    width: 44px;
    height: 44px;
}

/* Outlet logo bounding box */
.news-slide__logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: all 0.5s var(--ease);
}

.news-slide__logo-text {
    font-size: 0.46rem;
    font-weight: 700;
    color: var(--t2);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1.15;
    padding: 3px;
    word-break: break-word;
}

.news-slide--active .news-slide__logo-text {
    font-size: 0.52rem;
}

/* Content region */
.news-slide__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.news-slide__meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-slide__time {
    font-size: 0.64rem;
    font-weight: 600;
    color: var(--t3);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.news-slide__title {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    transition: font-size 0.4s var(--ease);
}

.news-slide__subtitle {
    font-size: 0.74rem;
    color: var(--t3);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.4s var(--ease);
}

/* Tags */
.news-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 0.54rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-tag--local {
    background: rgba(90, 200, 250, 0.10);
    color: var(--blue);
}

.news-tag--event {
    background: rgba(191, 90, 242, 0.10);
    color: var(--purple);
}

.news-tag--sport {
    background: rgba(50, 215, 75, 0.10);
    color: var(--green);
}

/* ============================================================
   DISCLAIMER
   ============================================================ */
.disclaimer {
    margin: 20px 0 8px;
    padding: 0 4px;
}

.disclaimer p {
    font-size: 0.66rem;
    color: var(--t3);
    line-height: 1.55;
    text-align: center;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 0 36px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer__copy {
    font-size: 0.7rem;
    color: var(--t3);
}

.footer__copy a {
    color: var(--t2);
    transition: color 0.2s;
}

.footer__copy a:hover {
    color: var(--blue);
}

.footer__legal {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--t2);
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 18px;
    border-radius: var(--r-full);
    transition: all 0.2s var(--ease);
}

.footer__legal:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    color: var(--t1);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    display: none;
}

.modal[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal__body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 32px;
    max-width: 560px;
    width: calc(100% - 40px);
    max-height: 85dvh;
    overflow-y: auto;
    position: relative;
    animation: modal-enter 0.35s var(--spring);
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--t2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.modal__close:hover {
    background: rgba(255, 255, 255, 0.10);
    color: var(--t1);
}

.modal__close svg {
    width: 15px;
    height: 15px;
}

.modal__body h2 {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

.modal__body h2:not(:first-of-type) {
    margin-top: 24px;
}

.modal__body p {
    font-size: 0.8rem;
    color: var(--t2);
    line-height: 1.55;
    margin: 0 0 12px;
}

.modal__body ul {
    padding-left: 18px;
    margin: 0 0 12px;
    list-style: disc;
}

.modal__body li {
    font-size: 0.78rem;
    color: var(--t2);
    line-height: 1.55;
    margin-bottom: 4px;
}

.modal__confirm {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 13px 24px;
    border: none;
    border-radius: var(--r-md);
    background: var(--blue);
    color: #000;
    font-size: 0.84rem;
    font-weight: 700;
    transition: all 0.2s;
    letter-spacing: -0.01em;
}

.modal__confirm:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ============================================================
   SPARKLINE SVG
   ============================================================ */
.sparkline-glow {
    filter: blur(6px);
    opacity: 0.35;
}

.sparkline-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sparkline-area {
    opacity: 0;
    transition: opacity 0.8s var(--ease) 0.35s;
}

.sparkline-dot {
    opacity: 0;
    transition: opacity 0.3s var(--ease) 1s;
}

/* Draw animation */
.sparkline-line,
.sparkline-glow {
    transition: stroke-dashoffset 1.2s var(--ease);
}

/* Animated state */
.spark-animated .sparkline-line,
.spark-animated .sparkline-glow {
    stroke-dashoffset: 0 !important;
}

.spark-animated .sparkline-area {
    opacity: 0.12;
}

.spark-animated .sparkline-dot {
    opacity: 1;
    animation: dot-pulse 2.5s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; r: 3; }
    50%      { opacity: 0.5; r: 5; }
}

/* Sparkline colors by metric context */
.card--pm25 .sparkline-line,
.card--pm25 .sparkline-glow { stroke: var(--blue); }
.card--pm25 .sparkline-area { fill: var(--blue); }
.card--pm25 .sparkline-dot  { fill: var(--blue); }

.card--pm10 .sparkline-line,
.card--pm10 .sparkline-glow { stroke: var(--purple); }
.card--pm10 .sparkline-area { fill: var(--purple); }
.card--pm10 .sparkline-dot  { fill: var(--purple); }

.card--co2 .sparkline-line,
.card--co2 .sparkline-glow { stroke: var(--orange); }
.card--co2 .sparkline-area { fill: var(--orange); }
.card--co2 .sparkline-dot  { fill: var(--orange); }

.rad-graph--cpm .sparkline-line,
.rad-graph--cpm .sparkline-glow { stroke: var(--orange); }
.rad-graph--cpm .sparkline-area { fill: var(--orange); }
.rad-graph--cpm .sparkline-dot  { fill: var(--orange); }

.rad-graph--dose .sparkline-line,
.rad-graph--dose .sparkline-glow { stroke: var(--red); }
.rad-graph--dose .sparkline-area { fill: var(--red); }
.rad-graph--dose .sparkline-dot  { fill: var(--red); }

/* ============================================================
   LIVE UPDATE TRANSITIONS
   ============================================================ */

/* Smooth sparkline SVG crossfade */
.metric-spark svg,
.rad-graph__spark svg {
    transition: opacity 0.4s var(--ease);
}

/* Value flash on update */
@keyframes live-flash {
    0%   { opacity: 0.5; transform: scale(0.97); }
    100% { opacity: 1;   transform: scale(1); }
}

.live-updated {
    animation: live-flash 0.4s var(--ease);
}

/* ============================================================
   PULSE ANIMATION (shared)
   ============================================================ */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px currentColor; }
    50%      { opacity: 0.5; box-shadow: 0 0 12px currentColor; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: 2 columns */
@media (max-width: 900px) {
    :root {
        --page-px: 20px;
        --gap: 14px;
        --card-px: 20px;
        --card-py: 20px;
    }

    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .card--aqi       { grid-column: span 2; }
    .card--weather   { grid-column: span 2; }
    .card--pm25      { grid-column: span 1; }
    .card--pm10      { grid-column: span 1; }
    .card--co2       { grid-column: span 2; }
    .card--radiation       { grid-column: span 2; }
    .card--location        { grid-column: span 2; }
    .card--news-showcase   { grid-column: 1 / -1; }

    .header__date {
        display: none;
    }
}

/* Mobile: single column */
@media (max-width: 600px) {
    :root {
        --page-px: 16px;
        --gap: 12px;
        --card-px: 18px;
        --card-py: 18px;
    }

    .intro {
        padding: 12px 0 20px;
    }

    .intro__heading {
        font-size: 1.35rem;
    }

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

    .card--aqi,
    .card--weather,
    .card--pm25,
    .card--pm10,
    .card--co2,
    .card--radiation,
    .card--location,
    .card--news-showcase {
        grid-column: span 1;
    }

    .news-slide {
        grid-template-columns: 32px 1fr;
        gap: 8px;
    }

    .news-slide__logo {
        width: 32px;
        height: 32px;
    }

    .news-slide--active .news-slide__logo {
        width: 36px;
        height: 36px;
    }

    .news-slide--active {
        grid-template-columns: 36px 1fr;
    }

    .news-slide--active .news-slide__title {
        font-size: 0.95rem;
    }

    .card {
        border-radius: var(--r-md);
    }

    /* AQI */
    .aqi-body {
        flex-direction: column;
        gap: 14px;
    }

    .aqi-number {
        font-size: 3rem;
    }

    /* Weather */
    .weather-hero {
        gap: 10px;
    }

    .weather-temp {
        font-size: 2.2rem;
    }

    /* Radiation */
    .rad-body {
        flex-direction: column;
        gap: 14px;
    }

    .rad-isotopes {
        margin-left: 0;
    }

    .rad-cpm__value {
        font-size: 2rem;
    }

    .rad-graphs {
        grid-template-columns: 1fr;
    }

    /* Header */
    .header__mark {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        font-size: 1.1rem;
    }

    .header__meta {
        gap: 0;
    }

    .header__date {
        display: none;
    }

    /* Footer */
    .footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
}

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

    .bg {
        animation: none;
    }

    .card {
        opacity: 1;
        transform: none;
    }

    .sparkline-line,
    .sparkline-glow {
        stroke-dashoffset: 0 !important;
        stroke-dasharray: none !important;
    }

    .sparkline-area {
        opacity: 0.12 !important;
    }

    .sparkline-dot {
        opacity: 1 !important;
        animation: none !important;
    }
}
