/* ==========================================================================
   Airatom · Real Time Air Quality dashboard
   Mobile-first. Breakpoints: 560 · 768 (tablet) · 1024 · 1200 (desktop) · 1920+ (TV)
   All sizing is rem-based so the root font-size scales the whole UI on large screens.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
    --navy-900: #0b1d45;
    --navy-700: #24365f;
    --slate-500: #5d6d84;
    --slate-400: #8392a7;
    --line: #e4eaf1;
    --line-strong: #d3dce7;

    --blue-700: #1747ad;
    --blue-600: #1b5fd0;
    --blue-500: #2f7de1;
    --blue-100: #e2eefb;
    --blue-50: #f1f7fd;

    --green-700: #1b7a2f;
    --green-600: #24913b;
    --green-500: #3aab49;
    --green-100: #e0f3dd;
    --green-50: #f1f9ef;

    --amber-400: #f7b844;
    --amber-500: #f29f1d;
    --orange-600: #d4570c;
    --red-500: #e5484d;
    --red-600: #c22a2a;
    --red-100: #fde9e9;
    --purple-500: #7a4fd0;

    --surface: #ffffff;
    --page-bg: #f3f8fc;

    --radius-xl: 1.75rem;
    --radius-lg: 1.25rem;
    --radius-md: 0.875rem;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(16, 40, 90, 0.04), 0 4px 14px rgba(16, 40, 90, 0.05);
    --shadow-md: 0 1px 3px rgba(16, 40, 90, 0.05), 0 12px 32px rgba(16, 40, 90, 0.07);
    --shadow-lg: 0 2px 6px rgba(16, 40, 90, 0.06), 0 18px 44px rgba(16, 40, 90, 0.1);

    --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: Georgia, "Times New Roman", Times, serif;

    --container: 80rem;
    --gutter: clamp(0.75rem, 3.2vw, 2.5rem);
    --stack-gap: clamp(0.875rem, 1.8vw, 1.5rem);
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--navy-900);
    background:
        radial-gradient(60rem 30rem at 0% 0%, rgba(214, 233, 248, 0.9), transparent 70%),
        radial-gradient(50rem 30rem at 100% 10%, rgba(226, 243, 225, 0.75), transparent 70%),
        linear-gradient(180deg, #f6fafd 0%, var(--page-bg) 45%, #eef6f3 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: lining-nums;
}

h1, h2, h3, p, ul {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

sub {
    font-size: 0.62em;
    line-height: 0;
    vertical-align: -0.25em;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 1em;
    height: 1em;
    flex: none;
}

/* ---------- Page shell ---------- */
.page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-x: clip;
}

.dashboard {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.dash-main {
    display: flex;
    flex-direction: column;
    gap: var(--stack-gap);
}

/* ---------- Reusable: card ---------- */
.card {
    background: var(--surface);
    border: 1px solid rgba(228, 234, 241, 0.85);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

/* ---------- Reusable: tone system ----------
   Any element with data-tone exposes --tone-* variables to its children. */
[data-tone="good"] {
    --tone-text: var(--green-700);
    --tone-bg: var(--green-100);
    --tone-dot: var(--green-500);
    --tone-fill: linear-gradient(90deg, #2e9e44, #55c162);
}

[data-tone="elevated"] {
    --tone-text: var(--orange-600);
    --tone-bg: #fff1dc;
    --tone-dot: var(--amber-500);
    --tone-fill: linear-gradient(90deg, #f29f1d, #f7c04f);
}

[data-tone="high"] {
    --tone-text: var(--red-600);
    --tone-bg: var(--red-100);
    --tone-dot: var(--red-500);
    --tone-fill: linear-gradient(90deg, #d93a3f, #f06a6e);
}

[data-tone="info"] {
    --tone-text: var(--navy-700);
    --tone-bg: var(--blue-100);
    --tone-dot: var(--blue-500);
    --tone-icon: var(--blue-500);
}

[data-tone="warn-info"] {
    --tone-text: #8a4b06;
    --tone-bg: #fff1dc;
    --tone-icon: var(--amber-500);
}

[data-tone="none"] {
    --tone-text: var(--slate-400);
    --tone-bg: #eef2f6;
    --tone-dot: var(--slate-400);
    --tone-fill: #cbd5e1;
}

/* ---------- Reusable: pill / status badge ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.4em 1em;
    border-radius: var(--radius-pill);
    background: var(--tone-bg, var(--green-100));
    color: var(--tone-text, var(--green-700));
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

.pill--caps {
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pill__dot {
    width: 0.6em;
    height: 0.6em;
    border-radius: 50%;
    background: var(--tone-dot, var(--green-500));
    flex: none;
}

.pill--comfort {
    gap: 0.4em;
    padding: 0.45em 0.95em;
    font-size: 0.8125rem;
    font-weight: 500;
}

.pill--comfort .icon {
    width: 1.05em;
    height: 1.05em;
    color: var(--tone-icon, var(--blue-500));
}

/* ---------- Reusable: icon circle ---------- */
.icon-circle {
    --size: 2.75rem;
    --ring: transparent;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 0 0 0.25rem var(--ring), var(--shadow-sm);
    font-size: calc(var(--size) * 0.5);
}

.icon-circle--indoor {
    --ring: rgba(47, 125, 225, 0.16);
    color: var(--blue-600);
}

.icon-circle--outdoor {
    --ring: rgba(58, 171, 73, 0.18);
    color: var(--green-600);
}

.icon-circle--param {
    --size: 2.75rem;
    background: #f7f9fc;
    box-shadow: inset 0 0 0 1px var(--line), 0 2px 6px rgba(16, 40, 90, 0.04);
    font-size: calc(var(--size) * 0.56);
}

.icon-circle--pm25 { color: #1a2f6b; }
.icon-circle--pm10 { color: var(--amber-500); }
.icon-circle--tvoc { color: var(--purple-500); }
.icon-circle--co2 { color: var(--blue-500); font-size: calc(var(--size) * 0.66); }

.icon-circle--lg {
    --size: 3.25rem;
}

.icon-circle--temp {
    background: #fdecec;
    box-shadow: 0 0 0 0.25rem rgba(229, 72, 77, 0.08);
    color: var(--red-500);
}

.icon-circle--humidity {
    background: var(--blue-100);
    box-shadow: 0 0 0 0.25rem rgba(47, 125, 225, 0.08);
    color: var(--blue-500);
}

.icon-circle--feature {
    --size: 2.5rem;
    background: var(--green-50);
    box-shadow: none;
    color: var(--green-600);
}

/* ---------- Reusable: progress bar ---------- */
.bar {
    display: block;
    width: min(100%, 11rem);
    height: 0.5rem;
    border-radius: var(--radius-pill);
    background: #e7ecf2;
    overflow: hidden;
}

.bar__fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--tone-fill, var(--green-500));
    transform: scaleX(var(--fill-scale, 0));
    transform-origin: left center;
    transition-property: transform, filter, box-shadow;
    transition-duration: 1.15s;
    transition-timing-function: var(--ease);
    will-change: transform;
}

.bars-pending .bar__fill {
    --fill-scale: 0;
    transform: scaleX(0);
    transition: none !important;
}

.metrics-pending .aqi-card__value,
.metrics-pending .sensor-value [data-field="value"],
.metrics-pending .reading__value [data-field="value"] {
    opacity: 0;
}

.bar__fill.bar-animating {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

.bar__fill.bar-pulse {
    animation: bar-glow 0.55s var(--ease);
}

@keyframes bar-glow {
    0% {
        filter: brightness(1);
    }
    45% {
        filter: brightness(1.14);
    }
    100% {
        filter: brightness(1);
    }
}

/* Animated metric numbers */
.aqi-card__value.is-animating,
.sensor-value [data-field="value"].is-animating,
.reading__value [data-field="value"].is-animating {
    display: inline-block;
    transform: translateZ(0);
}

.aqi-card__value.is-animating-done,
.sensor-value [data-field="value"].is-animating-done,
.reading__value [data-field="value"].is-animating-done {
    animation: value-settle 0.42s var(--ease);
}

@keyframes value-settle {
    0% {
        transform: scale(1);
    }
    55% {
        transform: scale(1.045);
    }
    100% {
        transform: scale(1);
    }
}

/* ==========================================================================
   Brand wordmark
   ========================================================================== */
.brand {
    --brand-size: clamp(1.625rem, 1.05rem + 2.6vw, 3.25rem);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    flex: none;
    line-height: 1;
    user-select: none;
}

.brand__word {
    position: relative;
    font-size: var(--brand-size);
    font-weight: 800;
    font-style: italic;
    letter-spacing: -0.035em;
    line-height: 1.05;
    padding-right: 0.32em;
    background: linear-gradient(95deg, #1452c4 0%, #1b68d8 52%, #22a04a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand__reg {
    position: absolute;
    top: 0.1em;
    right: 0;
    font-size: 0.28em;
    font-style: normal;
    font-weight: 600;
    color: var(--navy-900);
    -webkit-text-fill-color: var(--navy-900);
}

.brand__sub {
    margin-top: 0.12em;
    font-family: var(--font-serif);
    font-size: calc(var(--brand-size) * 0.4);
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--navy-900);
    margin-right: -0.18em;
}

/* ==========================================================================
   Header
   ========================================================================== */
.dash-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2.6vw, 2.25rem);
    padding-block: clamp(1rem, 3.4vw, 2.5rem) clamp(1rem, 2.6vw, 2rem);
}

.dash-header__divider {
    align-self: stretch;
    width: 1px;
    flex: none;
    background: linear-gradient(180deg, transparent, var(--line-strong) 20%, var(--line-strong) 80%, transparent);
}

.dash-title {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.dash-title__heading {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    color: var(--navy-900);
}

.dash-title__eyebrow {
    font-size: clamp(0.625rem, 0.48rem + 0.55vw, 0.9375rem);
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--navy-700);
}

.dash-title__main {
    font-size: clamp(1.25rem, 0.72rem + 2.75vw, 3.125rem);
    line-height: 1.08;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    white-space: nowrap;
}

.live {
    display: inline-flex;
    align-items: center;
    gap: 0.7em;
    font-size: clamp(0.5625rem, 0.44rem + 0.5vw, 0.875rem);
    font-weight: 500;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--navy-700);
    white-space: nowrap;
}

.live__dot {
    position: relative;
    width: 0.85em;
    height: 0.85em;
    border-radius: 50%;
    background: var(--green-500);
    flex: none;
}

.live__dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    animation: live-pulse 2.4s ease-out infinite;
}

@keyframes live-pulse {
    0% { transform: scale(1); opacity: 0.55; }
    70%, 100% { transform: scale(2.4); opacity: 0; }
}

.dash-header__tagline {
    display: none;
    margin-left: auto;
    padding-top: clamp(2.5rem, 4vw, 3.5rem);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.75;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    text-align: center;
    color: var(--slate-500);
}

.dash-header__tagline span {
    display: block;
}

/* Corner foliage */
.decor-leaves {
    position: absolute;
    pointer-events: none;
}

.decor-leaves--top {
    display: none;
    top: 0;
    right: calc(-1 * var(--gutter));
    width: clamp(6rem, 11vw, 11rem);
    height: auto;
}

/* ==========================================================================
   AQI hero
   ========================================================================== */
.hero {
    --panel-head-h: 3.25rem;
    --panel-gap: 1rem;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: linear-gradient(100deg, #f1f4f6 0%, #eef5fb 42%, #eef8f0 58%, #f5f7f0 100%);
    box-shadow: var(--shadow-md);
    padding: 1rem;
}

.hero__scene {
    display: none;
    position: absolute;
    top: 0;
    height: 100%;
    aspect-ratio: 4 / 3;
    z-index: -1;
    pointer-events: none;
}

.hero__scene svg {
    display: block;
    width: 100%;
    height: 100%;
}

.hero__scene--indoor {
    left: 0;
    -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent 92%);
    mask-image: linear-gradient(90deg, #000 30%, transparent 92%);
}

.hero__scene--outdoor {
    right: 0;
    -webkit-mask-image: linear-gradient(270deg, #000 30%, transparent 92%);
    mask-image: linear-gradient(270deg, #000 30%, transparent 92%);
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "indoor"
        "center"
        "outdoor";
    gap: 0.75rem;
}

.aqi-panel--indoor { grid-area: indoor; }
.aqi-panel--outdoor { grid-area: outdoor; }
.hero__center { grid-area: center; }

/* Narrow phones: each panel is a compact card, header above the reading */
.aqi-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.875rem;
    min-width: 0;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
}

.aqi-panel__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.aqi-panel__titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.aqi-panel__title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--navy-900);
}

.aqi-panel__sub {
    position: relative;
    margin-top: 0.2rem;
    padding-bottom: 0.3rem;
    font-size: 0.625rem;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--slate-500);
}

.aqi-panel__sub::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1.5rem;
    height: 2px;
    border-radius: 2px;
    background: var(--blue-500);
    opacity: 0.55;
}

.aqi-panel--outdoor .aqi-panel__sub::after {
    background: var(--green-500);
}

.aqi-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: none;
    text-align: center;
}

.aqi-card__label {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--navy-900);
}

.aqi-card__value {
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--tone-text);
    font-variant-numeric: tabular-nums;
}

.aqi-card__status {
    margin-top: 0.35rem;
    font-size: 0.75rem;
}

/* Center trust badge (mobile: pill) */
.hero__center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.trust-badge {
    display: inline-flex;
    padding: 2px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, #6eaef0, #2f7de1 35%, #6cc070 70%, #3aab49);
    box-shadow: var(--shadow-sm);
}

.trust-badge__inner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem 0.4rem 0.75rem;
    border-radius: inherit;
    background: #fff;
    text-transform: uppercase;
    white-space: nowrap;
}

.trust-badge__icon {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--green-500);
}

.trust-badge__title {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--navy-900);
}

.trust-badge__text {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--slate-500);
}

/* ==========================================================================
   Sensor parameters
   ========================================================================== */
.sensors {
    padding: 0.75rem;
}

.sensor-head {
    /* Column headers stay in the accessibility tree; on mobile each cell carries its own visible label. */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.sensor-head__cell {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--navy-700);
}

.sensor-table__body {
    display: grid;
    gap: 0.75rem;
}

/* Mobile: each parameter is a card */
.sensor-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "param status"
        "indoor outdoor";
    align-items: center;
    gap: 0.875rem 0.625rem;
    padding: 0.875rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #f9fbfd;
}

.sensor-param { grid-area: param; }
.sensor-row > [data-location="indoor"] { grid-area: indoor; }
.sensor-row > [data-location="outdoor"] { grid-area: outdoor; }
.sensor-status { grid-area: status; }

.sensor-param {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.sensor-param__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.sensor-param__name {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--navy-900);
    white-space: nowrap;
}

.sensor-param__unit {
    font-size: 0.8125rem;
    color: var(--slate-500);
}

.sensor-cell {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.75rem 0.875rem 0.875rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.sensor-cell__label {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--slate-500);
}

.sensor-cell__label .icon {
    width: 1.1em;
    height: 1.1em;
}

.sensor-row > [data-location="indoor"] .sensor-cell__label .icon { color: var(--blue-500); }
.sensor-row > [data-location="outdoor"] .sensor-cell__label .icon { color: var(--green-500); }

.sensor-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--tone-text, var(--green-700));
    font-variant-numeric: tabular-nums;
}

.sensor-status {
    justify-self: end;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem 1.25rem;
    padding: 0.875rem 0.25rem 0.25rem;
    font-size: 0.75rem;
    color: var(--slate-500);
}

.legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
}

.legend__item::before {
    content: "";
    width: 1.25em;
    height: 0.45em;
    border-radius: var(--radius-pill);
    background: var(--tone-fill);
}

/* ==========================================================================
   Temperature + humidity
   ========================================================================== */
.climate {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 0.5rem 1rem;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    padding-block: 1rem 1.25rem;
}

.metric + .metric {
    border-top: 1px solid var(--line);
}

.metric__head {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.metric__title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--navy-900);
}

.metric__unit {
    font-size: 0.875rem;
    color: var(--slate-500);
}

.metric__readings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    padding-inline: 0.375rem;
    text-align: center;
}

.reading + .reading {
    border-left: 1px solid var(--line);
}

.reading__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--navy-700);
}

.reading__value {
    font-size: 2.125rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--blue-700);
    font-variant-numeric: tabular-nums;
}

.reading .pill {
    margin-top: 0.25rem;
}

/* ==========================================================================
   Scenery (waves + plant) and footer
   ========================================================================== */
.scenery {
    position: relative;
    z-index: 0;
    height: 5.5rem;
    margin-top: -2.5rem;
    pointer-events: none;
}

.scenery__waves {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.scenery__plant {
    display: none;
    position: absolute;
    left: -1rem;
    bottom: 0;
    width: clamp(7rem, 15vw, 17rem);
    height: auto;
}

.site-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin-inline: auto;
    padding: 1.25rem var(--gutter) 1.5rem;
}

.features {
    display: grid;
    gap: 0.875rem;
    width: 100%;
    max-width: 22rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
}

.feature__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.feature__title {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--navy-900);
}

.feature__sub {
    font-size: 0.75rem;
    color: var(--slate-500);
}

.brand--footer {
    --brand-size: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    width: 100%;
    max-width: 22rem;
}

/* ==========================================================================
   Mobile — center header & footer text (below tablet)
   ========================================================================== */
@media (max-width: 47.9375em) {
    /* Header: logo + title as two boxes side by side, centered on the page */
    .dash-header {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: clamp(0.625rem, 3.2vw, 1rem);
        padding-right: var(--gutter);
    }

    .dash-header .brand {
        flex: 0 1 auto;
    }

    .dash-header__divider {
        width: 1px;
        height: auto;
        align-self: stretch;
        min-height: 3.25rem;
        flex: none;
        background: linear-gradient(180deg, transparent, var(--line-strong) 20%, var(--line-strong) 80%, transparent);
    }

    .dash-title {
        align-items: center;
        flex: 0 1 auto;
        min-width: 0;
        max-width: 55%;
    }

    .dash-title__heading {
        align-items: center;
    }

    .dash-title__main {
        white-space: normal;
    }

    .live {
        justify-content: center;
        margin-inline: auto;
    }

    .legend {
        justify-content: center;
    }

    .site-footer__inner {
        align-items: center;
        text-align: center;
    }

    /* Footer: items 1–2 side by side; item 3 centered on its own row */
    .features {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem 0.75rem;
        width: 100%;
        max-width: 22rem;
        margin-inline: auto;
        justify-items: center;
    }

    .feature {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        text-align: center;
        gap: 0.5rem;
        width: 100%;
        max-width: 11rem;
    }

    .feature:nth-child(3) {
        grid-column: 1 / -1;
        justify-self: center;
        max-width: 14rem;
    }

    .feature__text {
        align-items: center;
        text-align: center;
    }

    .icon-circle--feature {
        --size: 2.25rem;
    }

    .feature__title {
        font-size: 0.75rem;
    }

    .feature__sub {
        font-size: 0.6875rem;
    }

    .brand--footer {
        display: inline-flex;
        align-items: center;
        width: auto;
        max-width: none;
        margin-inline: auto;
    }
}

/* ==========================================================================
   ≥ 360px — header beside the AQI reading once there is room for both
   ========================================================================== */
@media (min-width: 22.5em) {
    .aqi-panel {
        flex-direction: row;
        gap: 0.75rem;
    }
}

/* ==========================================================================
   ≥ 400px — small phones and up
   ========================================================================== */
@media (min-width: 25em) {
    .hero,
    .sensors {
        padding: 1rem;
    }

    .aqi-panel {
        padding: 1.125rem 1.25rem;
    }

    .aqi-card__value {
        font-size: 3.5rem;
    }

    .sensor-row {
        padding: 1rem;
    }

    .sensor-value {
        font-size: 2rem;
    }
}

/* ==========================================================================
   ≥ 560px — large phones / small tablets portrait
   ========================================================================== */
@media (min-width: 35em) {
    .decor-leaves--top {
        display: block;
        width: 5.5rem;
        opacity: 0.85;
    }

    .dash-header {
        padding-right: 3.5rem;
    }

    /* Two AQI cards side by side, badge below */
    .hero__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "indoor outdoor"
            "center center";
        gap: 1rem;
    }

    .aqi-panel {
        flex-direction: column;
        align-items: stretch;
        gap: var(--panel-gap);
        padding: 0;
        background: none;
        box-shadow: none;
    }

    .aqi-panel__head {
        justify-content: center;
        min-height: var(--panel-head-h);
    }

    .aqi-card {
        flex: 1;
        padding: 1.25rem 1rem 1.375rem;
        border-radius: var(--radius-lg);
        border: 1px solid rgba(255, 255, 255, 0.95);
        background: rgba(255, 255, 255, 0.95);
        box-shadow: var(--shadow-md);
        transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    }

    .aqi-card__label {
        font-size: 1rem;
    }

    .aqi-card__value {
        font-size: 4rem;
    }

    .aqi-card__status {
        min-width: 7.5rem;
        font-size: 0.8125rem;
    }

    .climate {
        padding-inline: 1.5rem;
    }
}

/* ==========================================================================
   ≥ 768px — tablet
   ========================================================================== */
@media (min-width: 48em) {
    .dash-header {
        padding-right: 0;
    }

    .dash-header__tagline {
        display: block;
    }

    .decor-leaves--top {
        width: clamp(7rem, 11vw, 11rem);
        opacity: 1;
    }

    /* Hero: three columns with the circular trust badge between the cards */
    .hero {
        --panel-head-h: 3.5rem;
        --badge-size: 7.5rem;
        padding: clamp(1.25rem, 2.6vw, 2.5rem) clamp(1rem, 2.6vw, 2.5rem);
    }

    .hero__scene {
        display: block;
        opacity: 0.75;
    }

    .hero__grid {
        grid-template-columns: minmax(0, 22rem) auto minmax(0, 22rem);
        grid-template-areas: "indoor center outdoor";
        justify-content: center;
        gap: 0;
    }

    .hero__center {
        position: relative;
        z-index: 1;
        align-self: stretch;
        align-items: center;
        margin-inline: -1rem;
        padding-top: calc(var(--panel-head-h) + var(--panel-gap));
    }

    .trust-badge {
        width: var(--badge-size);
        height: var(--badge-size);
        padding: 3px;
        border-radius: 50%;
        background: conic-gradient(from 200deg, #9cc9f2, #2f7de1 22%, #7fc4e8 40%, #8fd18a 62%, #3aab49 78%, #9cc9f2);
        box-shadow: 0 0 0 0.45rem rgba(255, 255, 255, 0.75), var(--shadow-lg);
    }

    .trust-badge__inner {
        flex-direction: column;
        justify-content: center;
        gap: 0.15rem;
        width: 100%;
        height: 100%;
        padding: 0;
        border-radius: 50%;
        background: radial-gradient(circle at 50% 30%, #ffffff 0%, #f5f9fc 100%);
        white-space: normal;
        text-align: center;
    }

    .trust-badge__icon {
        width: 1.5rem;
        height: 1.5rem;
        margin-bottom: 0.15rem;
    }

    .trust-badge__title {
        font-size: 0.8125rem;
        letter-spacing: 0.22em;
        margin-right: -0.22em;
    }

    .trust-badge__text {
        font-size: 0.5625rem;
        line-height: 1.6;
        letter-spacing: 0.2em;
        margin-right: -0.2em;
    }

    .trust-badge__text span {
        display: block;
    }

    .aqi-panel__head {
        padding-inline: 0.5rem;
    }

    .aqi-card {
        min-height: 12rem;
        padding: 1.5rem 1.25rem;
    }

    .aqi-panel--indoor .aqi-card { padding-right: 1.75rem; }
    .aqi-panel--outdoor .aqi-card { padding-left: 1.75rem; }

    .aqi-card__value {
        font-size: clamp(4rem, 1.6rem + 4.6vw, 6.25rem);
    }

    .icon-circle--indoor,
    .icon-circle--outdoor {
        --size: 3.25rem;
    }

    .aqi-panel__title {
        font-size: 1.25rem;
    }

    /* Sensor table becomes a real row layout */
    .sensors {
        padding: clamp(1rem, 2vw, 1.5rem) clamp(1.25rem, 2.6vw, 2.25rem) clamp(0.75rem, 1.5vw, 1.25rem);
    }

    .sensor-head,
    .sensor-row {
        --sensor-cols: minmax(10.5rem, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) minmax(7rem, 0.6fr);
        display: grid;
        grid-template-columns: var(--sensor-cols);
        grid-template-areas: "param indoor outdoor status";
        align-items: center;
    }

    .sensor-head {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        padding-bottom: 0.875rem;
    }

    .sensor-head__cell:nth-child(2),
    .sensor-head__cell:nth-child(3) {
        padding-inline: clamp(1rem, 2.6vw, 2.5rem);
    }

    .sensor-table__body {
        gap: 0;
    }

    .sensor-row {
        gap: 0;
        padding: clamp(0.875rem, 1.4vw, 1.25rem) 0;
        border: 0;
        border-top: 1px solid var(--line);
        border-radius: 0;
        background: none;
    }

    .sensor-param {
        gap: 1rem;
    }

    .icon-circle--param {
        --size: clamp(2.75rem, 2rem + 1.4vw, 3.5rem);
    }

    .sensor-param__name {
        font-size: clamp(1.0625rem, 0.9rem + 0.4vw, 1.25rem);
    }

    .sensor-param__unit {
        font-size: 0.875rem;
    }

    .sensor-cell {
        align-self: stretch;
        justify-content: center;
        gap: 0.6rem;
        padding: 0.25rem clamp(1rem, 2.6vw, 2.5rem);
        border: 0;
        border-left: 1px solid var(--line);
        border-radius: 0;
        background: none;
    }

    .sensor-cell__label {
        display: none;
    }

    .sensor-value {
        font-size: clamp(1.75rem, 1.1rem + 1.4vw, 2.5rem);
    }

    .bar {
        height: 0.5625rem;
    }

    .legend {
        padding-top: 0.75rem;
        border-top: 1px solid var(--line);
    }

    /* Climate: side by side */
    .climate {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: clamp(1.25rem, 2.4vw, 2rem) clamp(0.75rem, 1.6vw, 1.5rem);
    }

    .metric {
        padding: 0 clamp(0.75rem, 2vw, 2rem);
        gap: clamp(1rem, 1.8vw, 1.5rem);
    }

    .metric + .metric {
        border-top: 0;
        border-left: 1px solid var(--line);
    }

    .reading__value {
        font-size: clamp(2.125rem, 1.3rem + 1.6vw, 2.875rem);
    }

    /* Scenery & footer */
    .scenery {
        height: clamp(8rem, 15vw, 15rem);
        margin-top: clamp(-6rem, -5vw, -3rem);
    }

    .scenery__plant {
        display: block;
    }

    .site-footer__inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        padding-block: 1.25rem;
    }

    .features {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: none;
        gap: 0;
    }

    .feature {
        justify-content: center;
        padding-inline: 1rem;
    }

    .feature + .feature {
        border-left: 1px solid var(--line);
    }

    .brand--footer {
        max-width: none;
        width: auto;
        padding-top: 1rem;
        border-top: 0;
    }
}

/* ==========================================================================
   ≥ 1024px — small desktop / landscape tablet
   ========================================================================== */
@media (min-width: 64em) {
    .hero {
        --badge-size: 8.75rem;
    }

    .trust-badge__icon {
        width: 1.75rem;
        height: 1.75rem;
    }

    .trust-badge__title {
        font-size: 0.9375rem;
    }

    .trust-badge__text {
        font-size: 0.625rem;
    }

    .site-footer__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0;
    }

    .feature {
        justify-content: flex-start;
        padding-inline: clamp(1rem, 2.4vw, 2.25rem);
    }

    .feature:first-child {
        padding-left: 0;
    }

    .brand--footer {
        --brand-size: 2rem;
        padding: 0 0 0 clamp(1.5rem, 3vw, 3rem);
        border-left: 1px solid var(--line);
    }

    .icon-circle--feature {
        --size: 2.75rem;
    }

    .feature__title {
        font-size: 0.875rem;
    }

    .feature__sub {
        font-size: 0.8125rem;
    }
}

/* ==========================================================================
   ≥ 1200px — desktop
   ========================================================================== */
@media (min-width: 75em) {
    .hero {
        --panel-head-h: 4rem;
        --panel-gap: 1.25rem;
        --badge-size: 10rem;
        padding: 2.25rem 2.5rem 2.5rem;
    }

    .hero__scene {
        opacity: 1;
    }

    .hero__grid {
        grid-template-columns: minmax(0, 24rem) auto minmax(0, 24rem);
    }

    .hero__center {
        margin-inline: -1.25rem;
    }

    .icon-circle--indoor,
    .icon-circle--outdoor {
        --size: 3.75rem;
    }

    .aqi-panel__title {
        font-size: 1.5rem;
    }

    .aqi-panel__sub {
        font-size: 0.6875rem;
    }

    .aqi-card {
        min-height: 14rem;
    }

    .aqi-card__label {
        font-size: 1.25rem;
    }

    .aqi-card__status {
        min-width: 9.5rem;
        font-size: 0.9375rem;
    }

    .trust-badge__icon {
        width: 2rem;
        height: 2rem;
    }

    .trust-badge__title {
        font-size: 1rem;
    }

    .trust-badge__text {
        font-size: 0.6875rem;
    }

    .bar {
        width: min(100%, 13rem);
        height: 0.625rem;
    }

    .pill {
        font-size: 0.9375rem;
    }

    .pill--comfort {
        font-size: 0.875rem;
    }

    .metric__title {
        font-size: 1.375rem;
    }

    .metric__unit {
        font-size: 1rem;
    }

    .icon-circle--lg {
        --size: 4rem;
    }

    .reading__label {
        font-size: 0.875rem;
    }

    .dash-header__tagline {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Hover polish (precise pointers only)
   ========================================================================== */
@media (hover: hover) and (pointer: fine) and (min-width: 35em) {
    .aqi-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg);
    }

    .card {
        transition: box-shadow 0.3s var(--ease);
    }

    .card:hover {
        box-shadow: var(--shadow-lg);
    }

    .sensor-row {
        transition: background-color 0.2s ease;
    }

    .sensor-row:hover {
        background-color: #fafcfe;
    }
}

/* ==========================================================================
   Large displays — scale the whole rem-based UI instead of stretching it
   ========================================================================== */
@media (min-width: 120em) {
    html { font-size: 112.5%; }   /* 1920px → 18px */
}

@media (min-width: 160em) {
    html { font-size: 137.5%; }   /* 2560px → 22px */
}

@media (min-width: 200em) {
    html { font-size: 162.5%; }   /* 3200px → 26px */
}

@media (min-width: 240em) {
    html { font-size: 187.5%; }   /* 3840px → 30px */
}

/* ==========================================================================
   Motion preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
