:root {
  --dusk-900: #161d33;
  --dusk-800: #1f2a4a;
  --dusk-700: #2c3b5e;
  --sky-100: #eef2f6;
  --paper: #ffffff;
  --ink: #141a2e;
  --ink-soft: #5a6480;
  --ink-faint: #8891a8;
  --amber: #e8a33d;
  --amber-dim: #f3cf95;
  --teal: #3e7c8c;
  --line: #dde3ec;

  --font-ui: 'Public Sans', system-ui, sans-serif;
  --font-display: 'Archivo', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--sky-100);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--dusk-900) 0%, var(--dusk-700) 100%);
  color: #f4f7fb;
  padding: 2.4rem 1.5rem 2.8rem;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.92rem;
  color: #b9c2d8;
  margin-bottom: 1.4rem;
}

.station-name {
  font-weight: 600;
  color: #f4f7fb;
  letter-spacing: 0.01em;
}

.hero-main {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-temp {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.2rem, 12vw, 6.5rem);
  line-height: 0.9;
  color: var(--amber);
}

.hero-details {
  padding-bottom: 0.6rem;
}

.hero-condition {
  font-size: 1.3rem;
  font-weight: 500;
}

.hero-sub {
  margin-top: 0.35rem;
  color: #c3cbdf;
  font-size: 0.95rem;
}

/* ---------- Content ---------- */
.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
}

.panel {
  margin-bottom: 2.2rem;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 0.85rem;
}

/* ---------- Hour strip ---------- */
.hour-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
}

.hour-card {
  flex: 0 0 auto;
  width: 84px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 0.7rem 0.5rem;
  text-align: center;
}

.hour-card.is-night {
  background: #eef1f8;
  border-color: #d7deec;
}

.hour-card.is-now {
  border-color: var(--amber);
  box-shadow: inset 0 0 0 1px var(--amber);
}

.hour-time {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

.hour-temp {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
}

.hour-cond {
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin-top: 0.3rem;
  line-height: 1.2;
  min-height: 2.2em;
}

.hour-precip {
  font-size: 0.68rem;
  color: var(--teal);
  margin-top: 0.25rem;
  font-weight: 600;
}

/* ---------- Metric tabs ---------- */
.metric-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.metric-tab {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

.metric-tab:hover {
  border-color: var(--ink-faint);
}

.metric-tab.is-active {
  background: var(--dusk-900);
  border-color: var(--dusk-900);
  color: #f4f7fb;
}

/* ---------- Live panel (CumulusMX "right now" data) ---------- */
/* ---------- Live panel (CumulusMX "right now" data) ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.stat-tile {
  background: var(--paper);
  padding: 0.75rem 0.9rem;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.stat-value .unit {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-left: 0.15rem;
}

.live-panel {
  border: 1px solid #cfe3e6;
  border-radius: 10px;
  background: #f3f9fa;
  padding: 1rem 1.1rem 1.1rem;
}

.live-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.7rem;
}

.live-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--ink);
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  display: inline-block;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(62,124,140,0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(62,124,140,0); }
}

.live-updated {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.live-panel .stat-grid {
  border-color: #cfe3e6;
  background: #cfe3e6;
}

.live-panel .stat-tile {
  background: #fbfefe;
}

.live-panel .stat-value {
  color: var(--teal);
}

/* ---------- Chart ---------- */
.chart-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 1rem 0.5rem 0.5rem;
}

.chart-tooltip {
  position: absolute;
  display: none;
  background: var(--dusk-900);
  color: #f4f7fb;
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}

.chart-tooltip strong {
  font-weight: 600;
}

.chart-axis-label {
  font-size: 0.68rem;
  fill: var(--ink-faint);
  font-family: var(--font-ui);
}

/* ---------- Day strip ---------- */
.day-strip {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.day-card {
  flex: 0 0 auto;
  width: 128px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 0.9rem 0.8rem;
}

.day-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.day-cond {
  font-size: 0.75rem;
  color: var(--ink-soft);
  min-height: 2.4em;
  margin-bottom: 0.6rem;
}

.day-temps {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.day-lo {
  color: var(--ink-faint);
  font-weight: 500;
}

.day-precip {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--teal);
  font-weight: 600;
}

/* ---------- Footer ---------- */
.footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 2.5rem;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .hero-temp { font-size: 4rem; }
}
