/* Experimental home variant — fixed Monte Sano backdrop, glass panels scroll. */

* { box-sizing: border-box; }

:root {
  --brand-orange: #ff8c42;
  --brand-orange-soft: #ffb380;
  --ink: #f4f5f8;
  --ink-dim: #cdd2dc;
  --ink-faint: #8a90a0;
  --panel-bg-day: rgba(8, 10, 16, 0.58);
  --panel-bg-night: rgba(8, 10, 16, 0.62);
  --panel-border: rgba(255, 255, 255, 0.10);
  --panel-radius: 18px;
}

html, body {
  margin: 0;
  padding: 0;
  /* No background here — the fixed .x-bg layer at z-index:-1 needs to show. */
  background: transparent;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  font-feature-settings: "ss01", "tnum";
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

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

/* ---------- fixed backdrop ---------- */

.x-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #0b0d12;
}

.x-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transition: opacity 700ms cubic-bezier(.4,0,.2,1);
  will-change: opacity;
}

/* Pre-JS fallback: show the day base shot, swap to night by body class.
 * (Avoids a flash before the photo engine runs.) */
.x-bg-night { opacity: 0; }
.x-bg-extra { opacity: 0; }
body.night .x-bg-day   { opacity: 0; }
body.night .x-bg-night { opacity: 1; }

/* Once the JS photo engine runs (body.js), .is-active is the single source of
 * truth for which layer shows — for both auto time-of-day and gallery mode.
 * CSS cross-fades to it via the .x-bg-img opacity transition. */
body.js .x-bg-img            { opacity: 0; }
body.js .x-bg-img.is-active  { opacity: 1; }
body.gallery .x-banner       { display: none; } /* clear the top for the cycle bar */

.x-gallery-bar { display: none; }      /* only shown in gallery mode (body.gallery) */
body.gallery .x-gallery-bar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: stretch;
  gap: 2px;
  max-width: calc(100vw - 24px);
  background: rgba(8, 10, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.x-gal-btn {
  flex: 0 0 auto;
  width: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease;
}
.x-gal-btn:hover { background: rgba(255, 255, 255, 0.10); }
.x-gal-btn:active { background: rgba(255, 255, 255, 0.18); }
.x-gal-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1px;
  padding: 8px 14px;
  min-width: 0;
  text-align: center;
}
.x-gal-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.x-gal-sub {
  font-size: 11px;
  color: var(--brand-orange-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: 0.02em;
}

/* Soft overlay over image — strong enough to make hero text readable,
 * but light enough that the image stays visible at every scroll position.
 * Glass panels themselves do the heavy lifting for content contrast. */
.x-bg-overlay {
  position: absolute;
  inset: 0;
  /* Darkening scrim DISABLED 2026-05-23 (Kyle testing photos without it).
   * To restore the readability gradient, put the linear-gradient backgrounds
   * back here + in body.night .x-bg-overlay (see git history). */
  background: none;
  transition: background 700ms ease;
}

/* ---------- top bar ---------- */

.x-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(11,13,18,0.55) 0%, rgba(11,13,18,0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.x-brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.85), 0 2px 14px rgba(0,0,0,0.7);
}
.x-brand .wx { color: var(--brand-orange); }
.x-brand .tld { color: var(--ink-dim); font-weight: 500; }

.x-nav {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}
.x-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
  transition: color 180ms, background 180ms;
}
.x-nav a:hover { color: var(--ink); background: rgba(255,255,255,0.06); }

.x-banner {
  position: relative;
  z-index: 11;
  display: block;
  text-align: center;
  font-size: 13px;
  padding: 8px 16px;
  background: rgba(11, 13, 18, 0.72);
  color: var(--ink-dim);
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 180ms, color 180ms;
}
.x-banner:hover { background: rgba(11, 13, 18, 0.88); color: var(--ink); }
.x-banner strong { color: var(--brand-orange); font-weight: 700; }
.x-banner .icon { margin-right: 6px; }

/* The HTML `hidden` attribute must always win. Author rules like
   `.x-tornado{display:flex}` otherwise beat the UA `[hidden]{display:none}`
   (same specificity, author origin wins) and leak hidden elements onto the
   page. Bit us on the tornado bar + rdr-alert 2026-05-23; see lessons #2. */
[hidden] { display: none !important; }

/* ---------- tornado bar (loud red — take cover) ---------- */
/* The ONLY full-bleed alarm treatment, reserved for an active Tornado
   Warning. Sits at the top of <main>, links to live radar. Everything
   lesser uses the small hero chip below. */
.x-tornado {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  border-radius: 14px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, rgba(214,69,47,0.97), rgba(176,38,26,0.97));
  border: 1px solid rgba(255,255,255,0.24);
  box-shadow: 0 8px 26px rgba(170,30,20,0.42);
}
.x-storm-ico { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.x-storm-body { flex: 1 1 auto; display: flex; flex-direction: column; line-height: 1.28; min-width: 0; }
.x-storm-event { font-weight: 800; font-size: 15px; letter-spacing: -0.2px; }
.x-storm-sub { font-size: 12.5px; opacity: 0.93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-storm-go { flex: 0 0 auto; font-weight: 700; font-size: 13px; opacity: 0.95; }

/* ---------- main ---------- */

.x-main {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 18px 56px;
}

/* ---------- hero ---------- */

.x-hero {
  padding: 24px 4px 28px;
  min-height: 56vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-shadow: 0 2px 18px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.6);
}

.x-loc {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 4px;
}

.x-temp {
  font-size: 124px;
  font-weight: 200;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--ink);
}
.x-temp .deg {
  font-weight: 200;
  color: var(--ink-dim);
}

/* ---------- NOW module: one glass card under the temp ---------- */
/* The single cohesive card that holds conditions + feel (tier 1), today's
   merged rain/thunder outlook (tier 2), and the one act-now strip (tier 3),
   with a quiet H/L + date footer. Built from the EXACT panel tokens the
   Downtown/Pool cards use, so NOW · DOWNTOWN · POOL read as one card family
   instead of a temp followed by a pile of badges. Loudness = position inside
   the card; on a calm day it collapses to one line + footer. */
.x-now {
  align-self: stretch;
  width: 100%;
  max-width: 480px;
  margin-top: 16px;
  background: var(--panel-bg-day);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  overflow: hidden;            /* lets the urgent strip's tint bleed edge-to-edge */
  text-shadow: none;           /* glass restores contrast; no hero text-shadow inside */
}
body.night .x-now { background: var(--panel-bg-night); }

/* tier 1: conditions + feel, ONE line */
.x-now-cond {
  padding: 13px 16px;
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink);
}
.x-now-cond .nc-cond { text-transform: lowercase; }
.x-now-cond .nc-feel { color: var(--ink-dim); }                  /* muggy/humid: cool-neutral */
.x-now-cond .nc-feel.is-hot { color: var(--brand-orange-soft); } /* feels-like X°: warm */

/* tier 2: outlook, under a hairline — same object, one step quieter */
.x-now-outlook {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 16px;
  padding: 11px 0 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 150ms ease;
}
a.x-now-outlook:hover, a.x-now-outlook:active { color: var(--ink); }
.x-now-outlook .no-ico { flex: 0 0 auto; font-size: 14px; }
.x-now-outlook .no-text { min-width: 0; }

/* footer: today's H/L + date, quiet, INSIDE the card so nothing dangles */
.x-now-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 16px;
  padding: 11px 0 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13.5px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.x-now-meta .nm-hi { color: var(--brand-orange); font-weight: 600; }
.x-now-meta .nm-lo { color: #7ec8ff; font-weight: 600; }
.x-now-meta .nm-date { color: var(--ink-faint); white-space: nowrap; }

/* tier 3: the one act-now strip at the TOP of the card, tinted by state. The
   ONLY part allowed to shout; tap-through to radar. */
.x-now-urgent {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  color: #d6ecff;
  background: rgba(126, 200, 255, 0.16);   /* default: rain/nowcast blue */
}
.x-now-urgent .nu-dot { flex: 0 0 auto; }
.x-now-urgent .nu-dot:not(.is-glyph) { width: 9px; height: 9px; border-radius: 50%; background: #7ec8ff; }
.x-now-urgent .nu-dot.is-glyph { font-size: 15px; line-height: 1; }
.x-now-urgent .nu-text { flex: 1 1 auto; min-width: 0; }
.x-now-urgent .nu-go {
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}
.x-now-urgent.is-wet  { background: rgba(126, 200, 255, 0.18); color: #d6ecff; }
.x-now-urgent.is-live { background: rgba(126, 200, 255, 0.20); color: #d6ecff; }
.x-now-urgent.is-live .nu-dot:not(.is-glyph),
.x-now-urgent.is-wet  .nu-dot:not(.is-glyph) { animation: nu-pulse 1.8s ease-out infinite; }
.x-now-urgent.is-strike, .x-now-urgent.is-thunder {
  background: rgba(255, 165, 70, 0.16);
  border-bottom-color: rgba(255, 165, 70, 0.28);
  color: #ffce9b;
}
.x-now-urgent.is-thunder { background: rgba(255, 165, 70, 0.11); }  /* softest urgent state */
.x-now-urgent.is-warn {
  background: rgba(214, 90, 60, 0.22);
  border-bottom-color: rgba(214, 90, 60, 0.40);
  color: #ffd9cd;
  font-weight: 700;
}
@keyframes nu-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(126, 200, 255, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(126, 200, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(126, 200, 255, 0); }
}
@media (prefers-reduced-motion: reduce) { .x-now-urgent .nu-dot { animation: none; } }

@media (max-width: 480px) {
  .x-now { max-width: 100%; }
  .x-now-cond { font-size: 16px; padding: 12px 14px; }
  .x-now-outlook { margin: 0 14px; font-size: 13.5px; }
  .x-now-meta { margin: 0 14px; font-size: 13px; }
  .x-now-urgent { padding: 10px 14px; font-size: 14px; }
}
@media (min-width: 900px) {
  .x-now-cond { font-size: 18px; }
}

/* ---------- glass panels ---------- */

.x-panel {
  background: var(--panel-bg-day);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  padding: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
body.night .x-panel { background: var(--panel-bg-night); }

.x-section { margin-top: 18px; }
.x-section-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 4px 10px;
}
.x-section-h .title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(0,0,0,0.85), 0 2px 12px rgba(0,0,0,0.7);
}

.x-seg {
  display: inline-flex;
  background: rgba(8, 10, 16, 0.55);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 3px;
}
.x-seg button {
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
}
.x-seg button.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

/* ---------- compare cards ---------- */

.x-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.x-card {
  background: var(--panel-bg-day);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  padding: 16px;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  text-decoration: none;
  color: var(--ink);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 160px;
}
body.night .x-card { background: var(--panel-bg-night); }

.x-card .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.x-card .big {
  font-size: 44px;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 6px 0 2px;
  line-height: 1;
}
.x-card .big .deg { color: var(--ink-dim); font-weight: 300; }
.x-card .sub { color: var(--ink-faint); font-size: 13px; min-height: 16px; }
.x-card .sub .pos { color: var(--brand-orange-soft); }
.x-card .sub .neg { color: #7ec8ff; }
.x-card .card-fcst {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
  color: var(--ink-dim);
}
.x-card .card-fcst .row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.x-card .card-fcst .k { color: var(--ink-faint); }
.x-card .card-fcst .v { color: var(--ink); }
.x-card .card-fcst .hi { color: var(--brand-orange); font-weight: 600; }
.x-card a.x-card-link { color: inherit; text-decoration: none; }
.x-card .card-arrow {
  position: absolute;
  top: 14px;
  right: 16px;
  color: var(--ink-faint);
  font-size: 16px;
}

/* ---------- daily/hourly list ---------- */

.x-list { padding: 6px 6px; }
.x-list .row {
  display: grid;
  grid-template-columns: 64px 1fr 50px 26px 100px;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
}
.x-list .row:last-child { border-bottom: 0; }
.x-list .day { font-weight: 600; color: var(--ink); }
.x-list .cond { color: var(--ink-dim); text-transform: lowercase; font-size: 13px; }
.x-list .pop { color: #4dabf7; text-align: right; font-size: 12px; }
.x-list .pop.zero { color: var(--ink-faint); opacity: 0.5; }
.x-list .icon { text-align: center; font-size: 16px; }
.x-list .hilo {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  font-variant-numeric: tabular-nums;
}
.x-list .hilo .hi { color: var(--brand-orange); font-weight: 600; }
.x-list .hilo .lo { color: var(--ink-faint); }

/* ---------- facts (sun/rain) ---------- */

.x-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.x-facts .x-panel { padding: 14px 16px; }
.x-facts .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.x-facts .row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}
.x-facts .row span:first-child { color: var(--ink-dim); }
.x-facts .row .v { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- chart ---------- */

.x-chart-wrap {
  margin-top: 12px;
  padding: 14px 12px 8px;
}
.x-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 11px;
  color: var(--ink-faint);
  padding: 0 6px 8px;
}
.x-chart-legend .sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}
.x-chart-legend .sw.air  { background: var(--brand-orange); }
.x-chart-legend .sw.pool { background: #22d3ee; }
.x-chart-legend .sw.rain { background: #4dabf7; }
.x-chart-legend .now-pill {
  margin-left: auto;
  color: var(--brand-orange);
  border: 1px solid rgba(255,140,66,0.45);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10px;
}
.x-chart-foot {
  color: var(--ink-faint);
  font-size: 11px;
  padding: 6px 8px 0;
}
.x-chart-box {
  position: relative;
  width: 100%;
  height: 260px;
}
#hourly-chart { width: 100% !important; height: 100% !important; }

/* ---------- footer ---------- */

.x-foot {
  text-align: center;
  padding: 22px 0 36px;
  color: var(--ink-faint);
  font-size: 12px;
}
.x-foot a { color: var(--ink-dim); text-decoration: none; }
.x-foot a:hover { color: var(--ink); }
.x-foot .sep { margin: 0 8px; opacity: 0.5; }

.x-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255,140,66,0.18);
  color: var(--brand-orange);
  border: 1px solid rgba(255,140,66,0.35);
  margin-left: 8px;
  vertical-align: 2px;
}

/* ---------- skeleton ---------- */

.skel {
  display: inline-block;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: skel 1.4s linear infinite;
  border-radius: 6px;
  color: transparent;
}
@keyframes skel { from { background-position: 0% 0; } to { background-position: -200% 0; } }

/* ---------- responsive ---------- */

@media (max-width: 480px) {
  .x-temp { font-size: 96px; }
  .x-hero { min-height: 52vh; padding-top: 16px; }
  .x-list .row { grid-template-columns: 56px 1fr 42px 22px 86px; font-size: 13px; }
  .x-list .cond { font-size: 12px; }
  .x-main { padding: 4px 14px 48px; }
}

@media (min-width: 900px) {
  .x-main { max-width: 880px; padding: 12px 28px 64px; }
  .x-hero { min-height: 60vh; }
  .x-temp { font-size: 152px; }
}

/* fallback when backdrop-filter unsupported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .x-panel, .x-card, .x-now, .x-mode-toggle, .x-seg, .x-top {
    background: rgba(8, 10, 16, 0.82) !important;
  }
}
