:root {
  color-scheme: light;
  --bg: #eaf6fb;
  --ink: #0d1b2a;
  --text: #14263a;
  --muted: #65778a;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-solid: #ffffff;
  --line: rgba(255, 255, 255, 0.66);
  --line-dark: rgba(13, 27, 42, 0.08);
  --blue: #1467ff;
  --cyan: #0abde3;
  --green: #14a66f;
  --yellow: #f3b63f;
  --orange: #e67e22;
  --red: #df4f4f;
  --violet: #6554ff;
  --shadow: 0 30px 90px rgba(25, 77, 124, 0.22);
  --soft-shadow: 0 18px 45px rgba(25, 77, 124, 0.13);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.95), transparent 18rem),
    linear-gradient(135deg, #9bdcff 0%, #d8f1ff 46%, #f8fbff 100%);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.32) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 74%);
  content: "";
}

.aurora {
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.72;
  pointer-events: none;
}

.aurora-one {
  top: 8vh;
  right: -10vw;
  width: 42vw;
  height: 42vw;
  background: radial-gradient(circle, rgba(20, 103, 255, 0.3), transparent 68%);
}

.aurora-two {
  left: -12vw;
  bottom: 6vh;
  width: 38vw;
  height: 38vw;
  background: radial-gradient(circle, rgba(10, 189, 227, 0.3), transparent 66%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-symbol {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--soft-shadow);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.86rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 30px rgba(25, 77, 124, 0.08);
  padding: 6px;
}

.main-nav a {
  border-radius: 999px;
  color: #31506c;
  font-size: 0.94rem;
  font-weight: 780;
  padding: 10px 14px;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--blue);
}

.refresh-button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ink), #204c75);
  box-shadow: 0 14px 36px rgba(13, 27, 42, 0.22);
  color: #ffffff;
  cursor: pointer;
  font-weight: 850;
  padding: 13px 18px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.refresh-button:hover {
  box-shadow: 0 18px 42px rgba(13, 27, 42, 0.28);
  transform: translateY(-1px);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(390px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  min-height: 560px;
}

.current-panel,
.camera-panel,
.content-section,
.history-card,
.insight-strip {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.current-panel {
  display: flex;
  min-height: 560px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 34px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.66)),
    radial-gradient(circle at 75% 20%, rgba(243, 182, 63, 0.22), transparent 20rem);
  backdrop-filter: blur(24px);
  padding: 34px;
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.live-pill,
.station-chip,
.camera-overlay span {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 9px 12px;
}

.live-pill::before {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--yellow);
  content: "";
}

.live-pill.ok {
  color: var(--green);
}

.live-pill.ok::before {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(20, 166, 111, 0.12);
}

.live-pill.error {
  color: var(--red);
}

.live-pill.error::before {
  background: var(--red);
}

.current-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: clamp(3.8rem, 8vw, 6.8rem);
  letter-spacing: -0.08em;
  line-height: 0.86;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

h3 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1.22rem;
}

.updated-text {
  max-width: 360px;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 720;
}

.condition-orb {
  position: relative;
  display: grid;
  width: clamp(86px, 12vw, 138px);
  height: clamp(86px, 12vw, 138px);
  place-items: center;
}

.sun-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 36%, transparent 37%),
    conic-gradient(from 15deg, #ffd166, #ff9f1c, #ffd166, #fff3b0, #ffd166);
  filter: drop-shadow(0 20px 40px rgba(255, 159, 28, 0.34));
  animation: rotateSun 16s linear infinite;
}

.sun-core {
  position: relative;
  z-index: 1;
  width: 58%;
  height: 58%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff7c4, #ffd166 52%, #ff9f1c);
  box-shadow: inset -12px -14px 25px rgba(194, 102, 0, 0.18);
}

.condition-orb.cloudy .sun-ring {
  background:
    radial-gradient(circle at 34% 56%, rgba(255, 255, 255, 0.96) 0 26%, transparent 27%),
    radial-gradient(circle at 58% 44%, rgba(255, 255, 255, 0.94) 0 32%, transparent 33%),
    radial-gradient(circle at 70% 62%, rgba(255, 255, 255, 0.94) 0 24%, transparent 25%),
    linear-gradient(135deg, #c6d7e4, #ffffff);
  animation: none;
}

.condition-orb.rainy .sun-ring {
  background:
    repeating-linear-gradient(115deg, transparent 0 12px, rgba(20, 103, 255, 0.45) 13px 17px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(173, 199, 219, 0.9));
  animation: none;
}

.condition-orb.night .sun-ring {
  background:
    radial-gradient(circle at 60% 34%, #ffffff 0 10%, transparent 11%),
    radial-gradient(circle at 48% 50%, #e7f0ff 0 34%, transparent 35%),
    linear-gradient(135deg, #1c2d59, #496a9f);
  animation: none;
}

.condition-orb.cloudy .sun-core,
.condition-orb.rainy .sun-core,
.condition-orb.night .sun-core {
  display: none;
}

@keyframes rotateSun {
  to {
    transform: rotate(360deg);
  }
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hero-metrics article,
.insight-strip article,
.detail-card,
.air-card {
  border: 1px solid var(--line-dark);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.67);
  box-shadow: 0 12px 34px rgba(25, 77, 124, 0.08);
}

.hero-metrics article {
  min-height: 128px;
  padding: 18px;
}

.hero-metrics span,
.insight-strip span,
.detail-card span,
.air-reading span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 820;
}

.hero-metrics strong,
.insight-strip strong,
.detail-card strong {
  display: block;
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1.12;
}

.hero-metrics small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.camera-panel {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border-radius: 34px;
  background: #d7ecf7;
}

.camera-panel a,
.camera-panel img {
  display: block;
  width: 100%;
  height: 100%;
}

.camera-panel img {
  min-height: 560px;
  object-fit: contain;
  background: #d7ecf7;
}

.camera-panel::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13, 27, 42, 0.02) 0%, rgba(13, 27, 42, 0.32) 100%),
    linear-gradient(90deg, rgba(13, 27, 42, 0.12), transparent 45%);
  content: "";
  pointer-events: none;
}

.camera-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(13, 27, 42, 0.8), rgba(20, 103, 255, 0.46)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 20rem);
  color: #ffffff;
  text-align: center;
}

.camera-fallback strong,
.camera-fallback span {
  display: block;
}

.camera-fallback strong {
  margin-bottom: 8px;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.camera-fallback span {
  color: rgba(255, 255, 255, 0.78);
}

.camera-overlay {
  position: absolute;
  z-index: 2;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.camera-overlay strong {
  color: white;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  letter-spacing: -0.06em;
  line-height: 0.92;
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(20px);
  padding: 12px;
}

.insight-strip article {
  min-height: 114px;
  padding: 18px;
}

.forecast-insight {
  grid-column: span 2;
}

.forecast-insight strong {
  font-size: 1.08rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.uv-low {
  border-color: rgba(20, 166, 111, 0.28) !important;
  background: rgba(20, 166, 111, 0.12) !important;
}

.uv-moderate {
  border-color: rgba(243, 182, 63, 0.34) !important;
  background: rgba(243, 182, 63, 0.16) !important;
}

.uv-high {
  border-color: rgba(230, 126, 34, 0.34) !important;
  background: rgba(230, 126, 34, 0.16) !important;
}

.uv-very-high,
.uv-extreme {
  border-color: rgba(223, 79, 79, 0.34) !important;
  background: rgba(223, 79, 79, 0.14) !important;
}

.uv-extreme strong {
  color: #7f2bbd !important;
}

.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  width: max-content;
  max-width: 240px;
  border-radius: 12px;
  background: var(--ink);
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
  opacity: 0;
  padding: 9px 10px;
  pointer-events: none;
  transform: translateY(5px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.tooltip:hover::after,
.tooltip:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.content-section,
.history-card {
  margin-top: 18px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(22px);
  padding: 26px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.air-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
}

.air-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--blue));
  content: "";
}

.air-card.fair::before,
.air-card.moderate::before {
  background: linear-gradient(90deg, var(--yellow), var(--orange));
}

.air-card.poor::before,
.air-card.very-poor::before,
.air-card.unhealthy::before {
  background: linear-gradient(90deg, var(--orange), var(--red));
}

.air-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.air-card-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.aqi-badge {
  display: grid;
  min-width: 96px;
  min-height: 96px;
  place-items: center;
  border-radius: 28px;
  background: rgba(20, 166, 111, 0.12);
  color: var(--green);
  text-align: center;
}

.aqi-badge strong {
  display: block;
  font-size: 2rem;
  letter-spacing: -0.05em;
  line-height: 1;
}

.aqi-badge span {
  display: block;
  margin-top: 5px;
  font-size: 0.76rem;
  font-weight: 900;
}

.aqi-badge.moderate {
  background: rgba(243, 182, 63, 0.16);
  color: #a86600;
}

.aqi-badge.fair {
  background: rgba(243, 182, 63, 0.13);
  color: #9b7a00;
}

.aqi-badge.poor,
.aqi-badge.very-poor,
.aqi-badge.unhealthy {
  background: rgba(223, 79, 79, 0.14);
  color: var(--red);
}

.air-readings,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.air-reading {
  border-top: 1px solid var(--line-dark);
  padding-top: 14px;
}

.air-reading strong {
  color: var(--ink);
  font-size: 1.12rem;
}

.detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-card {
  min-height: 128px;
  padding: 18px;
}

.history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.5fr);
  align-items: center;
  gap: 22px;
  overflow: hidden;
}

.history-card p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.chart-placeholder {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 12px;
  height: 180px;
  border: 1px solid var(--line-dark);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(20, 103, 255, 0.08), rgba(255, 255, 255, 0.28)),
    rgba(255, 255, 255, 0.48);
  padding: 22px;
}

.chart-placeholder span {
  width: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
  box-shadow: 0 10px 20px rgba(20, 103, 255, 0.2);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 38px;
  color: var(--muted);
  font-size: 0.92rem;
}

.is-loading {
  position: relative;
  color: transparent !important;
  overflow: hidden;
}

.is-loading::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  content: "";
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
  }

  .hero-grid,
  .history-card {
    grid-template-columns: 1fr;
  }

  .current-panel,
  .camera-panel,
  .camera-panel img {
    min-height: 480px;
  }

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

  .forecast-insight {
    grid-column: span 3;
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 22px, 1280px);
  }

  .site-header {
    gap: 14px;
    padding: 16px 0;
  }

  .brand-symbol {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    font-size: 0.72rem;
  }

  .brand small {
    display: none;
  }

  .refresh-button {
    padding: 11px 14px;
  }

  .current-panel,
  .camera-panel,
  .content-section,
  .history-card {
    border-radius: 26px;
  }

  .current-panel {
    min-height: auto;
    padding: 22px;
  }

  .current-main,
  .section-heading,
  .air-grid,
  .air-card-header {
    grid-template-columns: 1fr;
  }

  .current-main {
    align-items: start;
  }

  .condition-orb {
    width: 112px;
    height: 112px;
  }

  .hero-metrics,
  .insight-strip,
  .air-readings,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .forecast-insight {
    grid-column: auto;
  }

  .camera-panel,
  .camera-panel img {
    min-height: 350px;
  }

  .camera-overlay {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    flex-direction: column;
  }
}
