/* =========================================================
   World Clock — holographic globe
   ========================================================= */

:root {
  --font-display: 'Parkinsans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 68px;
  --panel-w: min(460px, calc(100vw - 48px));
  --drawer-w: 380px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Theme tokens ---------- */
:root,
:root[data-theme="dark"] {
  --bg: #020814;
  --bg-2: #061430;
  --text: #e8f7ff;
  --muted: #8fb2cb;
  --faint: #5d7d95;
  --accent: #3fd8ff;
  --accent-2: #6aa8ff;
  --accent-ink: #001826;
  --accent-soft: rgba(63, 216, 255, .1);
  --accent-glow: rgba(63, 216, 255, .55);
  --major: #7ff5ff;
  --minor: #4d8dff;
  --night: #1a3d74;
  --warn: #ffb547;
  --panel: rgba(3, 16, 36, .62);
  --panel-strong: rgba(3, 14, 32, .86);
  --panel-hover: rgba(63, 216, 255, .07);
  --line: rgba(110, 210, 255, .15);
  --line-strong: rgba(110, 210, 255, .34);
  --shadow: 0 24px 70px rgba(0, 0, 0, .5);
  --text-glow: 0 0 18px rgba(63, 216, 255, .55);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef4fb;
  --bg-2: #dce8f5;
  --text: #0a2240;
  --muted: #45607b;
  --faint: #7a91a7;
  --accent: #0a6fd8;
  --accent-2: #2b59c3;
  --accent-ink: #ffffff;
  --accent-soft: rgba(10, 111, 216, .08);
  --accent-glow: rgba(10, 111, 216, .25);
  --major: #0050c8;
  --minor: #0b8fb0;
  --night: #a9bdd6;
  --warn: #c76a00;
  --panel: rgba(255, 255, 255, .7);
  --panel-strong: rgba(255, 255, 255, .92);
  --panel-hover: rgba(10, 111, 216, .06);
  --line: rgba(16, 80, 150, .13);
  --line-strong: rgba(16, 80, 150, .3);
  --shadow: 0 24px 60px rgba(20, 60, 110, .16);
  --text-glow: none;
  color-scheme: light;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.muted { color: var(--muted); }

/* ---------- Canvas + labels ---------- */
#globe {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: pan-y;
  cursor: grab;
}
#globe.dragging { cursor: grabbing; }
#globe.pointing { cursor: pointer; }

#labels {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.glabel {
  position: absolute;
  left: 0; top: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--line-strong);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s var(--ease), visibility 0s linear .25s, border-color .2s;
  will-change: transform, opacity;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.glabel.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity .25s var(--ease), visibility 0s, border-color .2s;
}
.glabel::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--minor);
  box-shadow: 0 0 8px var(--minor);
}
.glabel.major::before { background: var(--major); box-shadow: 0 0 10px var(--major); }
.glabel .gl-name { font-weight: 600; color: var(--text); font-family: var(--font-display); }
.glabel .gl-time { font-family: var(--font-body); color: var(--accent); font-variant-numeric: tabular-nums; }
.glabel .gl-wx { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-family: var(--font-body); }
.glabel .gl-wx svg { width: 13px; height: 13px; }
.glabel.minor { font-size: 10.5px; padding: 3px 8px 3px 6px; }
.glabel.minor .gl-wx { display: none; }
.glabel.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 22px var(--accent-glow); }
.glabel:hover { border-color: var(--accent); }

/* ---------- Loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background: radial-gradient(circle at 50% 45%, var(--bg-2), var(--bg) 70%);
  transition: opacity .8s var(--ease), visibility 0s linear .8s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-orb { position: relative; width: 92px; height: 92px; margin-bottom: 12px; }
.loader-orb span {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 18px var(--accent-glow), inset 0 0 18px var(--accent-glow);
  animation: orb 2.4s linear infinite;
}
.loader-orb span:nth-child(2) { transform: rotateY(60deg); animation-delay: -.8s; opacity: .7; }
.loader-orb span:nth-child(3) { transform: rotateX(70deg); animation-delay: -1.6s; opacity: .5; }
@keyframes orb {
  0% { transform: rotate3d(1, 1, 0, 0deg); }
  100% { transform: rotate3d(1, 1, 0, 360deg); }
}
.loader-title { font-family: var(--font-display); font-size: 18px; letter-spacing: .14em; text-transform: uppercase; color: var(--text); text-shadow: var(--text-glow); }
.loader-status { color: var(--muted); font-size: 13px; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 82%, transparent), color-mix(in srgb, var(--bg) 0%, transparent));
}
.topbar::after {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask: linear-gradient(to bottom, #000 40%, transparent);
  mask: linear-gradient(to bottom, #000 40%, transparent);
}
.progress { position: absolute; left: 0; right: 0; top: 0; height: 2px; }
.progress span {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px var(--accent-glow);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  flex: none;
}
.brand-mark { width: 28px; height: 28px; color: var(--accent); stroke-width: 1.4; filter: drop-shadow(0 0 6px var(--accent-glow)); }
.brand-name { font-family: var(--font-display); font-size: 18px; letter-spacing: .02em; font-weight: 500; }
.brand-name b { font-weight: 700; color: var(--accent); margin-left: 1px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

.topnav { display: flex; gap: 2px; margin: 0 auto; }
.topnav a {
  padding: 7px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none;
  transition: color .2s, background-color .2s;
  white-space: nowrap;
}
.topnav a:hover { color: var(--text); background: var(--accent-soft); }
.topnav a.active { color: var(--accent); background: var(--accent-soft); }

.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topnav + .tools { margin-left: 0; }

.tool-btn {
  height: 38px; min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color .2s, background-color .2s, color .2s, box-shadow .2s;
}
.tool-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 16px var(--accent-glow); }
.tool-btn svg { width: 17px; height: 17px; }
.theme-btn { font-family: var(--font-body); font-size: 13px; padding: 0 14px 0 12px; }
.theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }

/* Search */
.search { position: relative; }
.search-icon { position: absolute; z-index: 1; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input {
  width: 230px; height: 38px;
  padding: 0 34px 0 36px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font: inherit; font-size: 14px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color .2s, box-shadow .2s, width .3s var(--ease);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px var(--accent-glow); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-body); font-size: 11px; color: var(--faint);
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 6px; line-height: 18px;
  pointer-events: none;
}
.search input:focus ~ kbd { opacity: 0; }

.search-results {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px; max-height: 360px; overflow: auto;
  margin: 0; padding: 6px; list-style: none;
  border-radius: 16px;
  background: var(--panel-strong);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  display: none;
}
.search-results.open { display: block; }
.search-results li {
  display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
}
.search-results li[aria-selected="true"], .search-results li:hover { background: var(--accent-soft); }
.search-results .sr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--minor); }
.search-results .sr-dot.major { background: var(--major); box-shadow: 0 0 8px var(--major); }
.search-results .sr-name { font-weight: 600; font-size: 14px; }
.search-results .sr-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.search-results .sr-time { font-family: var(--font-body); font-size: 13px; color: var(--accent); }
.search-results .sr-empty { display: block; color: var(--muted); cursor: default; font-size: 13px; }
.search-results .sr-empty:hover { background: none; }

/* ---------- Section rail ---------- */
.rail {
  position: fixed;
  right: 22px; top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex; flex-direction: column; gap: 14px;
  transition: opacity .3s;
}
.rail a {
  position: relative;
  display: block; width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  transition: transform .25s var(--ease), background-color .25s, border-color .25s, box-shadow .25s;
}
.rail a:hover { border-color: var(--accent); transform: scale(1.25); }
.rail a.active { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); transform: scale(1.3); }
.rail a span {
  position: absolute; right: 22px; top: 50%; transform: translate(6px, -50%);
  padding: 4px 10px; border-radius: 8px;
  background: var(--panel-strong); border: 1px solid var(--line);
  font-size: 12px; white-space: nowrap; color: var(--text);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s var(--ease);
}
.rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: translate(0, -50%); }
body.drawer-open .rail { opacity: 0; pointer-events: none; }

/* ---------- Panels ---------- */
main { position: relative; z-index: 10; pointer-events: none; }
main [data-panel], main .panel, main a, main button, .footer { pointer-events: auto; }

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  transition: background-color .5s var(--ease), border-color .5s var(--ease);
}
/* HUD corner brackets */
.panel::before,
.panel::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 1.5px solid var(--accent);
  opacity: .7;
  pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.panel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.eyebrow .idx { color: var(--muted); }

.lede { color: var(--muted); font-size: 16.5px; line-height: 1.6; max-width: 46ch; }
.lede.small { font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 20px;
  border-radius: 14px;
  font-weight: 600; font-size: 14.5px; text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s, background-color .2s, border-color .2s, color .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); box-shadow: 0 0 26px var(--accent-glow); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 0 36px var(--accent-glow); }
.btn.ghost { background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 24px) clamp(24px, 6vw, 96px) 80px;
}
.hero-copy { display: grid; gap: 22px; max-width: 520px; }
.hero h1 { font-size: clamp(40px, 5.4vw, 72px); line-height: 1.02; font-weight: 600; }
.glow-text {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px var(--accent-glow));
}
:root[data-theme="light"] .glow-text { filter: none; }

.local-card {
  display: grid; gap: 4px;
  padding: 16px 18px;
  max-width: 400px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.local-head, .local-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); }
.local-head span:first-child { text-transform: uppercase; letter-spacing: .12em; font-family: var(--font-body); font-size: 11px; color: var(--accent); }
.local-tz { font-family: var(--font-body); }
.local-clock {
  font-family: var(--font-body); font-weight: 500;
  font-size: clamp(40px, 4.6vw, 54px); line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-shadow: var(--text-glow);
}
.local-clock .sec { color: var(--accent); font-size: .55em; }
/* Poppins has no tabular figures, so ticking digits sit in fixed cells to stop the clock shifting. */
.dg { display: inline-block; width: .64em; text-align: center; }
.local-clock .ampm { font-size: .32em; color: var(--muted); margin-left: 8px; letter-spacing: .08em; }
.local-foot .utc { font-family: var(--font-body); }
.local-foot .utc b { color: var(--text); font-weight: 500; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.scroll-cue .mouse { width: 22px; height: 34px; border-radius: 12px; border: 1.5px solid var(--line-strong); display: flex; justify-content: center; padding-top: 6px; }
.scroll-cue .mouse i { width: 3px; height: 7px; border-radius: 2px; background: var(--accent); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Region sections ---------- */
.region {
  position: relative;
  min-height: 115vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 40px) clamp(24px, 6vw, 96px) 80px;
}
.region-panel { width: var(--panel-w); padding: 26px 24px 18px; }
.region-head { display: grid; gap: 10px; padding: 0 4px 18px; border-bottom: 1px solid var(--line); }
.region-head h2 { font-size: 34px; line-height: 1.08; font-weight: 600; }
.region-head .blurb { color: var(--muted); font-size: 14.5px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.stats span {
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--accent-soft);
  font-size: 12px; color: var(--muted);
}
.stats b { color: var(--text); font-family: var(--font-body); font-weight: 600; margin-right: 3px; }

.list-title {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 4px 8px;
  font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.list-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.list-title i { width: 8px; height: 8px; border-radius: 50%; }
.list-title i.major { background: var(--major); box-shadow: 0 0 8px var(--major); }
.list-title i.minor { background: var(--minor); }

.city-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.city-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 108px;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.city-row:hover, .city-row.hovered { background: var(--panel-hover); border-color: var(--line); }
.city-row.selected { background: var(--accent-soft); border-color: var(--accent); }

.cr-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cr-name i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--minor); }
.major .cr-name i { width: 10px; height: 10px; background: var(--major); box-shadow: 0 0 10px var(--major); }
.cr-name span { display: grid; min-width: 0; }
.cr-name b { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-name small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cr-time { display: grid; justify-items: end; }
.cr-time b { font-family: var(--font-body); font-weight: 500; font-size: 17px; font-variant-numeric: tabular-nums; }
.cr-time b em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 3px; }
.cr-time small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.cr-time small.ahead { color: var(--accent); }

.cr-wx { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; justify-items: start; }
.cr-wx i { grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.cr-wx i svg { width: 18px; height: 18px; stroke-width: 1.6; }
.cr-wx b { font-family: var(--font-body); font-weight: 500; font-size: 15px; }
.cr-wx small { color: var(--muted); font-size: 11px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.minor .city-row { padding: 7px 10px; grid-template-columns: minmax(0, 1fr) auto 72px; }
.minor .cr-name b { font-size: 14px; font-weight: 500; }
.minor .cr-name small { font-size: 11.5px; }
.minor .cr-time b { font-size: 14.5px; }
.minor .cr-wx i { width: 24px; height: 24px; border-radius: 8px; grid-row: auto; }
.minor .cr-wx i svg { width: 15px; height: 15px; }
.minor .cr-wx small { display: none; }
.minor .cr-wx b { font-size: 13.5px; }

.skeleton { display: inline-block; width: 34px; height: 10px; border-radius: 4px; background: linear-gradient(90deg, var(--line), var(--line-strong), var(--line)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Explore ---------- */
.explore {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 40px) clamp(24px, 6vw, 96px) 40px;
}
.explore-inner { width: var(--panel-w); padding: 26px 24px; display: grid; gap: 14px; }
.explore-inner h2 { font-size: 30px; font-weight: 600; }
.glance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.glance-card {
  display: grid; gap: 4px; align-content: start;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  text-align: left;
}
button.glance-card { cursor: pointer; transition: border-color .2s, transform .2s var(--ease); }
button.glance-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.g-label { font-family: var(--font-body); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.g-value { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--text); }
.g-sub { font-size: 12.5px; color: var(--muted); }

.footer {
  position: relative; z-index: 10;
  display: grid; gap: 4px; justify-items: center; text-align: center;
  padding: 30px 24px 120px;
  font-size: 12.5px; color: var(--muted);
}

/* ---------- Drawer ---------- */
.drawer {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  right: 20px;
  bottom: 20px;
  width: var(--drawer-w);
  z-index: 60;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 22px 20px;
  border-radius: var(--radius);
  background: var(--panel-strong);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow), 0 0 40px var(--accent-soft);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  visibility: hidden;
  transition: transform .45s var(--ease), opacity .35s, visibility 0s linear .45s;
  scrollbar-width: thin;
}
.drawer.open { transform: none; opacity: 1; visibility: visible; transition: transform .45s var(--ease), opacity .35s, visibility 0s; }
.drawer:focus { outline: none; }

.dr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 999px;
  font-family: var(--font-body); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--line-strong); color: var(--minor);
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge.major { color: var(--major); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

.dr-name { font-size: 34px; font-weight: 600; margin-top: 14px; line-height: 1.05; }
.dr-sub { color: var(--muted); margin-top: 4px; }
.dr-clock {
  margin-top: 16px;
  font-family: var(--font-body); font-weight: 500;
  font-size: 54px; line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: var(--text-glow);
}
.dr-clock .sec { font-size: .5em; color: var(--accent); }
.dr-clock .ampm { font-size: .3em; color: var(--muted); margin-left: 8px; }
.dr-date { margin-top: 8px; font-size: 14px; }
.dr-off { margin-top: 2px; font-size: 13px; color: var(--muted); font-family: var(--font-body); }

.dr-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.dr-section h3 { font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

.sunbar { position: relative; height: 10px; border-radius: 999px; background: var(--night); overflow: hidden; }
.sunbar .day { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #ffb547, #ffe08a 50%, #ffb547); opacity: .9; }
.sunbar-wrap { position: relative; }
.sunbar-now {
  position: absolute; top: -5px; width: 20px; height: 20px; margin-left: -10px;
  border-radius: 50%; background: var(--panel-strong); border: 2px solid var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.sun-times { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.sun-times span { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); }
.sun-times svg { width: 16px; height: 16px; color: var(--warn); }

.dr-wx { display: flex; align-items: center; gap: 16px; }
.dr-wx-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: var(--accent-soft); color: var(--accent); }
.dr-wx-icon svg { width: 36px; height: 36px; stroke-width: 1.4; filter: drop-shadow(0 0 8px var(--accent-glow)); }
.dr-temp { font-family: var(--font-display); font-size: 44px; font-weight: 600; line-height: 1; }
.dr-cond { color: var(--muted); font-size: 14px; margin-top: 4px; }

.dr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.dr-grid div { padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--line); }
.dr-grid span { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.dr-grid span svg { width: 13px; height: 13px; }
.dr-grid b { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-family: var(--font-body); font-weight: 500; font-size: 14px; white-space: nowrap; }
.dr-grid b svg { width: 13px; height: 13px; color: var(--accent); }

.hours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(52px, 1fr); gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.hour { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--accent-soft); }
.hour span { font-size: 11px; color: var(--muted); font-family: var(--font-body); }
.hour svg { width: 20px; height: 20px; color: var(--accent); stroke-width: 1.6; }
.hour b { font-family: var(--font-body); font-weight: 500; font-size: 13.5px; }
.hour.now { border-color: var(--accent); }
.hours-msg { color: var(--muted); font-size: 13px; }

.dr-coords { margin-top: 18px; font-family: var(--font-body); font-size: 12px; color: var(--faint); }

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  right: 24px; bottom: 22px;
  z-index: 30;
  display: flex; align-items: center; gap: 12px;
  transition: right .45s var(--ease), opacity .3s;
}
body.drawer-open .hud { right: calc(var(--drawer-w) + 44px); }

.legend, .controls {
  display: flex; align-items: center; gap: 4px;
  padding: 5px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.legend > * {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px;
  font-size: 12px; color: var(--muted);
  white-space: nowrap;
}
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.lg-major { background: var(--major); box-shadow: 0 0 8px var(--major); width: 10px !important; height: 10px !important; }
.lg-minor { background: var(--minor); }
.lg-night { background: linear-gradient(90deg, var(--accent) 50%, var(--night) 50%); border: 1px solid var(--line-strong); width: 12px !important; height: 12px !important; }
.lg-toggle { border: 0; background: transparent; border-radius: 10px; cursor: pointer; transition: background-color .2s, color .2s; }
.lg-toggle:hover { background: var(--accent-soft); color: var(--text); }
.lg-toggle[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }

.ctl {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; border: 0; background: transparent; color: var(--text);
  cursor: pointer; transition: background-color .2s, color .2s;
}
.ctl:hover { background: var(--accent-soft); color: var(--accent); }
.ctl svg { width: 17px; height: 17px; }
#spin-toggle .i-play { display: none; }
#spin-toggle[aria-pressed="false"] .i-pause { display: none; }
#spin-toggle[aria-pressed="false"] .i-play { display: block; }

.noscript { position: fixed; inset: auto 16px 16px; z-index: 300; padding: 14px; border-radius: 12px; background: var(--panel-strong); border: 1px solid var(--line-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .topnav { display: none; }
  /* With the nav hidden nothing pushes the tools over, so right-align them again. */
  .topnav + .tools { margin-left: auto; }
}

@media (max-width: 860px) {
  :root { --header-h: 60px; --drawer-w: 100vw; }
  .topbar { padding: 0 16px; gap: 10px; }
  .brand-name { font-size: 16px; }
  .live-pill { display: none; }
  .search input { width: 44px; padding: 0; padding-left: 40px; cursor: pointer; }
  .search input:focus { width: min(260px, calc(100vw - 32px)); cursor: text; }
  .search kbd { display: none; }
  .search input:not(:focus)::placeholder { color: transparent; }
  .search-icon { left: 14px; color: var(--text); }
  .search:focus-within { position: absolute; left: 16px; right: 16px; z-index: 5; }
  .search:focus-within input { width: 100%; }
  .search-results { width: 100%; left: 0; }
  .theme-label { display: none; }
  .theme-btn { padding: 0 11px; }
  .tool-btn { min-width: 40px; padding: 0 9px; }

  .rail { display: none; }

  .hero {
    align-items: flex-end;
    padding: 52vh 16px 90px;
    padding: 52svh 16px 90px;
  }
  .hero-copy { gap: 16px; }
  .hero-copy .lede { font-size: 15px; }
  .scroll-cue { display: none; }

  .region { padding: 55vh 16px 40px; padding: 55svh 16px 40px; min-height: auto; display: block; }
  .region-panel { width: 100%; padding: 20px 14px 12px; }
  .region-head h2 { font-size: 28px; }
  .city-row { grid-template-columns: minmax(0, 1fr) auto 84px; gap: 10px; padding: 9px 8px; }
  .minor .city-row { grid-template-columns: minmax(0, 1fr) auto 64px; }

  .explore { padding: 55vh 16px 30px; padding: 55svh 16px 30px; min-height: auto; display: block; }
  .explore-inner { width: 100%; }
  .explore-inner { padding: 20px 16px; }
  .footer { padding-bottom: 110px; }

  .drawer {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-height: 72vh;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }
  .drawer.open { transform: none; }
  .dr-name { font-size: 28px; }
  .dr-clock { font-size: 44px; }

  .hud { top: calc(var(--header-h) + 10px); right: 10px; bottom: auto; flex-direction: column; align-items: flex-end; gap: 8px; }
  body.drawer-open .hud { opacity: 0; pointer-events: none; right: 10px; }
  .legend { padding: 3px; }
  .legend > *:not(.lg-toggle) { display: none; }
  .lg-toggle { padding: 6px; font-size: 0; gap: 0; }
  .controls { flex-direction: column; padding: 3px; gap: 2px; }
  .ctl { width: 34px; height: 34px; }
}

@media (max-width: 420px) {
  .brand-name { display: none; }
  .glance { grid-template-columns: 1fr 1fr; gap: 8px; }
  .g-value { font-size: 20px; }
  .cr-name b { font-size: 14.5px; }
  .cr-time b { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
