/* =========================================================
   Tokens — "Piedmont" warm light palette
   ========================================================= */
:root {
  color-scheme: light;

  /* Color */
  --bg: #faf6ee;
  --bg-tint: #f3ecdc;
  --surface: #ffffff;
  --surface-hover: #fbfaf5;
  --border: #ebe3d4;
  --border-strong: #d8cdb6;
  --fg: #2a2520;
  --fg-dim: #4d4639;
  --muted: #74695b;

  /* Accents */
  --accent: #c54d2b;            /* Atlanta Clay — ties to the wx-clear weather hero */
  --accent-warm: #c54d2b;
  --accent-glow: rgba(197, 77, 43, 0.20);
  --accent-gold: #c19238;       /* Peachtree Gold — live / now indicator */
  --success: #1d8a5e;
  --warn: #b87f1f;

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: ui-serif, "Iowan Old Style", "Apple Garamond", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 0.72rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.85rem;
  --fs-3xl: 2.5rem;
  --tracking-tight: -0.02em;
  --tracking-wide: 0.12em;

  /* Spacing */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Shadows — soft, warm-anchored */
  --shadow-sm: 0 1px 3px rgba(60, 40, 20, 0.06), 0 1px 2px rgba(60, 40, 20, 0.04);
  --shadow-md: 0 6px 18px rgba(60, 40, 20, 0.09), 0 2px 6px rgba(60, 40, 20, 0.05);
  --shadow-lg: 0 16px 40px rgba(60, 40, 20, 0.12), 0 4px 12px rgba(60, 40, 20, 0.06);
  --shadow-hero: 0 24px 60px rgba(60, 40, 20, 0.18), 0 6px 18px rgba(60, 40, 20, 0.08);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 140ms;
  --t-base: 220ms;

  --card: var(--surface);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 100% 70% at 50% 0%, var(--tod-tint, transparent) 0%, transparent 75%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Time-of-day canvas tint */
body[data-tod="dawn"]  { --tod-tint: rgba(197, 77, 43, 0.10); }
body[data-tod="day"]   { --tod-tint: rgba(110, 168, 220, 0.05); }
body[data-tod="dusk"]  { --tod-tint: rgba(193, 146, 56, 0.14); }
body[data-tod="night"] { --tod-tint: rgba(80, 60, 130, 0.06); }

/* Generic header (help page, etc.) */
header { padding: var(--s-6) var(--s-5) var(--s-4); }
h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
}
.tagline {
  margin: var(--s-1) 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.tagline a { color: var(--muted); text-decoration: none; }
.tagline a:hover { color: var(--accent); text-decoration: underline; }

/* =========================================================
   Hub header band
   ========================================================= */
.hub-header {
  position: relative;
  padding: 0;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg-tint) 65%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hub-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--s-7) var(--s-5) var(--s-6);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-5);
  align-items: end;
  position: relative;
  z-index: 1;
}

.hh-eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-weight: 700;
}

.hh-title {
  margin: var(--s-2) 0 var(--s-3);
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  color: var(--fg);
}
.hh-title #greet {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}

.hh-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 7px var(--s-3);
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.chip-time { color: var(--fg); font-weight: 600; }
.chip-sun .sun-icon { color: var(--accent-gold); font-weight: 700; }

.chip-air .aq-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--muted);
}
.chip-air[data-aq="good"] .aq-dot { background: var(--success); }
.chip-air[data-aq="moderate"] .aq-dot { background: var(--warn); }
.chip-air[data-aq="usg"] .aq-dot,
.chip-air[data-aq="unhealthy"] .aq-dot,
.chip-air[data-aq="very-unhealthy"] .aq-dot,
.chip-air[data-aq="hazardous"] .aq-dot { background: var(--accent); }

.hh-skyline {
  width: min(440px, 45vw);
  height: 88px;
  color: var(--accent);
  opacity: 0.20;
  filter: drop-shadow(0 8px 18px var(--accent-glow));
  align-self: end;
}

.hh-help {
  position: absolute;
  top: var(--s-4);
  right: var(--s-5);
  color: var(--muted);
  font-size: var(--fs-sm);
  text-decoration: none;
  letter-spacing: 0.02em;
  z-index: 2;
}
.hh-help:hover { color: var(--accent); }

@media (max-width: 640px) {
  .hub-header-inner {
    grid-template-columns: 1fr;
    padding: var(--s-5) var(--s-4) var(--s-4);
  }
  .hh-skyline { display: none; }
  .hh-title { font-size: var(--fs-2xl); }
}

/* =========================================================
   Grid + basic cards (whole-card click)
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-5);
  padding: var(--s-6) var(--s-5) var(--s-7);
  max-width: 1400px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-height: 140px;
  color: var(--fg);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-base) var(--ease);
}

a.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
a.card:active { transform: translateY(-1px); }

.card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.card .status {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  align-self: flex-start;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-tint);
  font-weight: 700;
}
.card .status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.card .status.live    { color: var(--success); background: rgba(29, 138, 94, 0.10); }
.card .status.wip     { color: var(--warn); background: rgba(184, 127, 31, 0.10); }
.card .status.planned { color: var(--muted); background: var(--bg-tint); }

/* =========================================================
   Weather hero — colorful tile floating on the warm canvas
   ========================================================= */
.card.hero {
  grid-column: 1 / -1;
  padding: 1.75rem 2rem;
  border-radius: var(--r-xl);
  border: none;
  background: linear-gradient(135deg, #1a2030 0%, #0f1115 100%);
  color: #fff;
  text-decoration: none;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1.4fr);
  gap: 1.5rem 2.5rem;
  align-items: center;
  position: relative;
  overflow: hidden;
  min-height: 210px;
  box-shadow: var(--shadow-hero);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease);
}
a.card.hero:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 64px rgba(60, 40, 20, 0.22), 0 8px 22px rgba(60, 40, 20, 0.12);
}

.weather-hero.wx-clear   { background: linear-gradient(135deg, #f3a062 0%, #c0563f 55%, #3b2342 100%); }
.weather-hero.wx-partly  { background: linear-gradient(135deg, #5d92be 0%, #345878 100%); }
.weather-hero.wx-cloudy  { background: linear-gradient(135deg, #6c7585 0%, #353c4d 100%); }
.weather-hero.wx-rain    { background: linear-gradient(135deg, #345877 0%, #182b42 100%); }
.weather-hero.wx-storm   { background: linear-gradient(135deg, #2a2a48 0%, #14142a 100%); }
.weather-hero.wx-snow    { background: linear-gradient(135deg, #88a0c2 0%, #455976 100%); }
.weather-hero.wx-fog     { background: linear-gradient(135deg, #6a7085 0%, #353b4f 100%); }
.weather-hero.wx-default { background: linear-gradient(135deg, #1a2030 0%, #0f1115 100%); }
.weather-hero.wx-night {
  background-image: linear-gradient(135deg, #1a2545 0%, #0a1024 60%, #050816 100%);
}

.weather-hero .hero-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}
.weather-hero .hero-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.weather-hero .hero-icon {
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}
.weather-hero .hero-temp {
  font-size: 5rem;
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.weather-hero .hero-location { font-size: 1.1rem; font-weight: 600; }
.weather-hero .hero-cond {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}
.weather-hero .hero-range {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.weather-hero .hero-hourly {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
}
.weather-hero .h {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.92);
}
.weather-hero .h-t {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
}
.weather-hero .h-i {
  font-size: 1.25rem;
  margin: 0.15rem 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}
.weather-hero .h-d {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.weather-hero .hero-cta {
  position: absolute;
  right: 1.4rem;
  bottom: 0.85rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.02em;
}

.weather-hero .hero-skeleton {
  color: rgba(255, 255, 255, 0.55);
  grid-column: 1 / -1;
  padding: 1rem 0;
}

@media (max-width: 720px) {
  .card.hero {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem 1.25rem 2rem;
  }
  .weather-hero .hero-temp { font-size: 4rem; }
  .weather-hero .hero-icon { font-size: 3rem; }
  .weather-hero .hero-cta { position: static; text-align: right; }
}

/* =========================================================
   Tablet + small-phone refinements
   ========================================================= */
@media (min-width: 640px) and (max-width: 1024px) {
  .hh-skyline { width: min(360px, 40vw); }
  .hub-header-inner { padding: var(--s-6) var(--s-5) var(--s-5); }
  .grid { padding: var(--s-5) var(--s-5) var(--s-6); }
}

@media (max-width: 480px) {
  .hub-header-inner { padding: var(--s-5) var(--s-4) var(--s-3); }
  .hh-title { font-size: var(--fs-xl); margin: var(--s-1) 0 var(--s-3); }
  .hh-eyebrow { font-size: 0.68rem; }
  .hh-meta { gap: 6px; }
  .chip { padding: 5px var(--s-3); font-size: 0.8rem; }
  .hh-help { top: var(--s-3); right: var(--s-4); }
  .grid { padding: var(--s-5) var(--s-4) var(--s-6); gap: var(--s-3); }
  .card { padding: var(--s-4) var(--s-5); min-height: 120px; }
  .card.hero { padding: 1.1rem 1.25rem 1.6rem; border-radius: var(--r-lg); }
  .weather-hero .hero-temp { font-size: 3.25rem; }
  .weather-hero .hero-icon { font-size: 2.5rem; }
  .weather-hero .hero-location { font-size: 1rem; }
}

@media (hover: none) {
  a.card:hover { transform: none; box-shadow: var(--shadow-sm); }
  a.card.hero:hover { transform: none; box-shadow: var(--shadow-hero); }
}
