/* Base reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; color: var(--text); background: var(--bg); }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }

:root {
  --bg: #0b1020;
  --bg-elev: #0f162b;
  --surface: #121a31;
  --border: #23314f;
  --text: #e5eaf5;
  --muted: #a7b1c5;
  --primary: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --ring: 0 0 0 3px rgba(59, 130, 246, 0.35);
  --header-h: 64px;
}

.container { max-width: 1120px; margin-inline: auto; padding-inline: 20px; }

.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { left: 16px; top: 12px; width: auto; height: auto; padding: 8px 12px; background: var(--surface); color: var(--text); border-radius: 6px; box-shadow: var(--ring); z-index: 1000; }

/* Header / Nav */
.site-header { position: sticky; top: 0; z-index: 1200; backdrop-filter: saturate(140%) blur(10px); background: color-mix(in oklab, var(--bg) 85%, transparent); border-bottom: 1px solid var(--border); }
.site-header.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.25); }
.nav-wrap { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.2px; }
.logo-img { width: 24px; height: 24px; object-fit: contain; display: block; }

.nav-toggle { display: none; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: transparent; color: var(--text); border: 1px solid var(--border); cursor: pointer; }
.nav-toggle:hover { background: #0d1530; }
.nav-toggle .icon { width: 22px; height: 22px; }

.nav { display: flex; align-items: center; gap: 20px; flex-wrap: nowrap; }
.nav-list { display: flex; align-items: center; gap: 14px; flex-wrap: nowrap; }
.nav-list a { color: var(--muted); padding: 8px 9px; border-radius: 8px; white-space: nowrap; }
.nav-list a:hover { color: var(--text); background: #0d1530; }
.nav-list a.active { color: var(--text); background: #0e1736; box-shadow: inset 0 0 0 1px var(--border); }
.nav-cta { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }

@media (max-width: 1200px) {
  .nav-wrap { gap: 12px; }
  .nav { gap: 16px; }
  .nav-list { gap: 12px; }
  .nav-list a { padding: 7px 9px; font-size: 0.96rem; }
  .nav-cta { gap: 8px; }
  .nav-cta .btn { padding: 8px 12px; font-size: 0.96rem; }
}

@media (max-width: 1100px) {
  .nav-toggle { display: grid; }
  .nav { position: absolute; left: 0; right: 0; top: var(--header-h); transform-origin: top; transform: scaleY(0); transition: transform 160ms ease, opacity 160ms ease; opacity: 0; padding: 12px 0; background: color-mix(in oklab, var(--bg), #0d1530 30%); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); display: grid; gap: 16px; }
  .nav[data-open="true"] { transform: scaleY(1); opacity: 1; }
  .nav-list { flex-direction: column; align-items: stretch; padding-inline: 20px; }
  .nav-list a { padding: 12px 14px; }
  .nav-cta { padding-inline: 20px; padding-bottom: 8px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; font-weight: 600; border-radius: 10px; border: 1px solid transparent; color: var(--text); cursor: pointer; transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 60ms ease; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--primary), var(--primary-600)); border-color: color-mix(in oklab, var(--primary-700), black 10%); }
.btn-primary:hover { background: linear-gradient(180deg, var(--primary-600), var(--primary-700)); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: #0d1530; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: #0d1530; }

/* Hero */
.hero { padding: 56px 0 28px; background: radial-gradient(1200px 600px at 0% -10%, rgba(59,130,246,0.18), transparent 60%), radial-gradient(1000px 600px at 100% 0%, rgba(34,211,238,0.14), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.12fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(32px, 4.6vw, 50px); line-height: 1.05; margin-bottom: 12px; letter-spacing: -0.02em; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 60ch; }
.lead.single-line { white-space: normal; overflow: visible; text-overflow: unset; }
.hero-actions { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }
.trust-row { display: none; }
.pill { display: none; }

.hero-media { display: grid; place-items: center; }
.image-frame { margin: 0; display: grid; gap: 8px; width: 100%; }
.image-crop { width: min(680px, 100%); aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: #0b1220; box-shadow: 0 30px 60px rgba(0,0,0,0.35); }
.image-crop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 1px, 1px); white-space: nowrap; border: 0; }
.image-caption {
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; padding-bottom: 10px; } }

/* Sections */
.section { padding: 56px 0; }
.map-section { padding-bottom: 4px; }
.about-hero-tight { padding-bottom: 1px; padding-top: 1px; }
.image-between { padding-top: 8px; padding-bottom: 1px; }
.legend { padding-top: 12px; }
.limitations { padding-bottom: 16px; }
.disclaimer { padding-top: 12px; }
.section.muted { background: #0c142a; }
.section-title { font-size: 1.8rem; margin-bottom: 8px; margin-top: 1px; }
.section-lead { color: var(--muted); max-width: 100%; margin-top: 3px;}

/* Features */
.feature-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.feature h3 { margin: 10px 0 6px; font-size: 1.05rem; }
.feature p { color: var(--muted); }
.icon-wrap { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #0e1736; color: var(--primary); border: 1px solid var(--border); }

@media (max-width: 960px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .feature-grid { grid-template-columns: 1fr; } }

/* Wide showcase image */
.wide-frame { width: 100%; aspect-ratio: 21 / 9; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: #0b1220; box-shadow: 0 20px 50px rgba(0,0,0,0.35); }
.wide-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-caption { margin-top: 6px; text-align: center; color: var(--muted); font-size: 0.9rem; }
/* Leaflet map sizing inside the showcase frame */
.leaflet-frame { width: 100%; height: 100%; }
.leaflet-container { background: #0b1220; }
.leaflet-container img.leaflet-tile {
    /* See: bugs.chromium.org */
    mix-blend-mode: plus-lighter;
}
.map-shell { margin-top: 16px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 28px 60px rgba(0,0,0,0.35); position: relative; }
#chasing-map { height: 580px; min-height: 520px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.map-meta { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 12px; }
.map-note { margin: 0; color: var(--muted); font-size: 1px; }
.map-note.subtle { color: #94a3b8;}
.map-credit { font-size: 0.62rem; }

.leaflet-control-layers { position: relative; }
.layer-toggle-btn {
  display: block;
  width: 100%;
  padding: 7px 8px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #e5e7eb;
  color: #0b0b0b;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.layer-toggle-btn:hover { background: #d9dce2; }
.leaflet-control-layers.layer-control-collapsed .leaflet-control-layers-list { display: none; }

.legend-card { display: grid; gap: 12px; }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.legend-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: #0f192f; }
.legend-item p { margin: 2px 0 0; color: var(--muted); }
.legend-swatch { width: 16px; height: 16px; border-radius: 5px; box-shadow: 0 0 0 1px #0b1020, 0 0 0 2px var(--border); margin-top: 3px; flex-shrink: 0; }
.swatch-amazing { background: #15b300; }
.swatch-good { background: #67dc31; }
.swatch-mediocre { background: #ded450; }
.swatch-bad { background: #c30006; }
.limitations ul { list-style: disc; padding-left: 26px; margin: 0; display: grid; gap: 6px; color: var(--muted); }
.town-label {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
    -webkit-text-stroke: 0.3px #2b2b2b;
    text-shadow:
      0 1px 2px rgba(0,0,0,0.85),
      1px 0 2px rgba(0,0,0,0.85),
      -1px 0 2px rgba(0,0,0,0.85),
      0 -1px 2px rgba(0,0,0,0.85);
}

/* CTA band */
.cta { background: linear-gradient(0deg, rgba(59,130,246,0.08), rgba(59,130,246,0.08)), #0c142a; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cta-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 700px) { .cta-wrap { flex-direction: column; align-items: flex-start; } }

/* Footer */
.site-footer { padding: 28px 0 40px; background: #0a0f1f; border-top: 1px solid var(--border); }
.footer-wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.foot-brand .logo-img { width: 18px; height: 18px; object-fit: contain; display: block; }
.foot-links { display: inline-flex; gap: 14px; color: var(--muted); }
.foot-links a { padding: 6px 8px; border-radius: 8px; }
.foot-links a:hover { color: var(--text); background: #0d1530; }
.copyright { grid-column: 1 / -1; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 760px) {
  .footer-wrap { grid-template-columns: 1fr; }
  .foot-links { flex-wrap: wrap; justify-content: center; max-width: 100%; }
  .foot-links a { white-space: normal; }
}

/* Focus ring */
button:focus, a:focus { outline: none; box-shadow: var(--ring); }

/* Image caption fix/override */
.image-caption {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  display: block;
  padding-top: 0px;
}

\n/* Hero image frame override */\n.image-frame { margin: 0; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 16px; background: #0d1530; width: 100%; }\n.image-crop { width: min(680px, 100%); aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #0b1220; box-shadow: 0 30px 60px rgba(0,0,0,0.35); }\n.image-caption { color: var(--muted); font-size: 0.9rem; }

/* Hero caption alignment */
.image-caption { text-align: center; display: block; }

/* Under construction page */
.construction-hero { padding: 72px 0 80px; }
.construction-card { position: relative; max-width: 1100px; margin: 0 auto; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: #0b1220; box-shadow: 0 28px 60px rgba(0,0,0,0.35); min-height: 360px; }
.construction-card img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.05); }
.construction-overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: linear-gradient(180deg, rgba(7, 11, 24, 0.25), rgba(7, 11, 24, 0.78))}
.construction-overlay h1 { margin: 10px 0 8px; font-size: clamp(26px, 3.6vw, 44px); letter-spacing: -0.01em; color: #f8fbff; padding: 155px;}
.construction-overlay .lead { color: #dbeafe; font-weight: 600; }
.construction-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(12, 20, 42, 0.8); border: 1px solid var(--border); color: #e5eaf5; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.85rem; }
@media (max-width: 640px) { .construction-card { min-height: 280px; } .construction-overlay { padding: 18px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; } .construction-overlay h1 { padding: clamp(8px, 3vh, 28px); } .construction-overlay .lead { margin: 0; } .construction-kicker { font-size: 0.8rem; } }

/* Under construction text shadow */
.construction-overlay h1,
.construction-overlay .lead,
.construction-kicker { text-shadow: 0 15px 18px rgba(0, 0, 0, 0.48); }

/* Technical articles */
.tech-hero { padding-top: 52px; padding-bottom: 32px; }
.kicker { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: #0e1736; border: 1px solid var(--border); color: var(--primary); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.8rem; }
.article-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.article-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: grid; gap: 10px; box-shadow: 0 16px 40px rgba(0,0,0,0.28); }
.article-card h3 { margin: 4px 0 2px; font-size: 1.12rem; line-height: 1.3; }
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: #9ec5ff; }
.article-card p { margin: 0; color: var(--muted); }
.article-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.9rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: #0e1736; color: var(--text); border: 1px solid var(--border); font-weight: 600; font-size: 0.85rem; }
.meta-date { color: var(--muted); font-size: 0.9rem; }
.article-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.92rem; color: var(--muted); }
.text-link { color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.text-link:hover { color: #9ec5ff; }
.read-length { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: rgba(59, 130, 246, 0.08); color: var(--muted); }
.resource-panel { display: grid; gap: 12px; align-items: center; }
.resource-links { display: flex; flex-wrap: wrap; gap: 10px; }

/* Article layout */
.article-shell { padding: 56px 0; }
.article-card-shell { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: 0 28px 60px rgba(0,0,0,0.35); display: grid; gap: 18px; }
.article-header h1 { margin: 6px 0 4px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.01em; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 0.95rem; }
.article-meta .badge { background: #0e1736; }
.byline { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.meta-author-date { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.article-date { color: #9fb6d8; font-weight: 600; }
.article-body { display: grid; gap: 16px; color: var(--muted); font-size: 1.02rem; }
.article-body p { margin: 0; }
.article-body h2 { color: var(--text); margin: 12px 0 6px; font-size: 1.4rem; }
.article-figure { margin: 8px 0; }
.article-figure figure { margin: 0; display: grid; gap: 10px; }
.article-figure img { width: 100%; border-radius: 14px; border: 1px solid var(--border); background: #0b1220; box-shadow: 0 18px 38px rgba(0,0,0,0.3); }
.article-figure figcaption { color: var(--muted); font-size: 0.9rem; text-align: left; }
.article-footnote { color: var(--muted); font-size: 0.92rem; border-top: 1px solid var(--border); padding-top: 12px; }

@media (max-width: 640px) {
  .article-card-shell { padding: 18px; }
  .article-body { font-size: 1rem; }
}

/* Forecasting page */
.container.narrow { max-width: 880px; }
.container.wide { max-width: 1280px; }
.forecast-hero { padding-top: 48px; padding-bottom: 22px; }
.forecast-hero h1 { margin: 8px 0 4px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.01em; }
.forecast-hero .lead { color: var(--muted); max-width: 70ch; }

.forecast-shell { padding-top: 6px; padding-bottom: 68px; }
.forecast-grid {
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr minmax(260px, 320px);
  gap: 16px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: 0 18px 36px rgba(0,0,0,0.3);
}
.panel-heading h2 { margin: 2px 0 2px; font-size: 1.2rem; }
.panel-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.75rem;
  margin: 0;
}
.panel-left { align-self: start; }
.panel-right { align-self: start; }

.accordion { display: grid; gap: 8px; }
.accordion-toggle {
  width: 100%;
  background: #0e1736;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.accordion-toggle:hover { background: #101b3f; border-color: #2d3c5f; }
.accordion-toggle .arrow { transition: transform 140ms ease; }
.accordion-toggle.open .arrow { transform: rotate(-90deg); }
.accordion-body {
  display: grid;
  gap: 6px;
  padding: 6px 2px 4px 6px;
}
.param-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.param-link:hover {
  color: var(--text);
  background: #0d1530;
  border-color: var(--border);
}

.map-panel {
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.map-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #0e1736;
}
.map-header h3 { margin: 2px 0; }
.map-header .muted { margin: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59,130,246,0.14);
  color: #9ec5ff;
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
}
.forecast-map {
  height: 72vh;
  min-height: 520px;
  width: 100%;
}
.map-panel .map-note {
  padding: 4px 14px 8px;
  margin: -2px 0 0;
  text-align: center;
}

.control-stack { display: grid; gap: 10px; }
.control-block {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0d1530;
  display: grid;
  gap: 8px;
}
.forecast-hour-block {
  padding-top: 6px;
  gap: 4px;
}
.forecast-hour-block .muted.small {
  margin: 0;
  font-weight: 700;
}
.control-label {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
}
.control-value { margin: 1px 0 0; font-size: 1.06rem; }
.control-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hour-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hour-buttons button {
  padding: 10px 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.hour-buttons button:hover { background: #0e1736; }
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}
.checkbox input { accent-color: var(--primary); width: 16px; height: 16px; }
.checkbox + .checkbox { margin-top: 2px; }
.status-block { background: #0e1736; }
.small { font-size: 0.88rem; }
.muted { color: var(--muted); }

@media (max-width: 1100px) {
  .forecast-grid {
    grid-template-columns: 1fr;
  }
  .panel { order: 2; }
  .map-panel { order: 1; }
  .forecast-map { height: 60vh; min-height: 420px; }
}
