*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --pine-dark:    #0a1a0e;
  --pine-deep:    #112010;
  --pine-mid:     #1a3520;
  --pine-light:   #2d5c38;
  --pine-bright:  #4a8c5c;
  --snow:         #e8eff5;
  --sky-top:      #6a9ab8;
  --stone:        #a0a898;
  --gold:         #c8a96e;
  --gold-bright:  #ffe680;
  --cream:        #f0ede6;
  --text:         #1a2218;
  --text-muted:   #4a5e44;
  --glass:        rgba(240, 237, 230, 0.90);
  --glass-border: rgba(200, 169, 110, 0.30);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  color: var(--snow);
  overflow-x: hidden;
  background: var(--pine-dark);
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.4rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: linear-gradient(to bottom, rgba(6, 15, 8, 0.82) 0%, transparent 100%);
  transition: background 0.4s, backdrop-filter 0.4s;
  pointer-events: none; /* let map receive clicks through empty nav area */
}

nav > * { pointer-events: all; }

nav.scrolled {
  background: rgba(8, 18, 10, 0.93);
  backdrop-filter: blur(16px);
}

.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--snow);
  letter-spacing: 0.10em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition: color 0.3s;
}

.nav-logo svg { width: 26px; height: 26px; flex-shrink: 0; }
.nav-logo:hover { color: var(--gold); }

.nav-sub {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(200, 169, 110, 0.55);
}

/* ── MAP ── */
#map-wrap {
  position: relative;
  height: 100dvh;
  width: 100%;
}

#map {
  width: 100%;
  height: 100%;
  background: var(--pine-dark);
}

/* Leaflet controls — match design */
.leaflet-control-zoom a {
  background: rgba(240, 237, 230, 0.88) !important;
  color: var(--text) !important;
  border-color: rgba(200, 169, 110, 0.3) !important;
  font-family: 'Jost', sans-serif !important;
  font-size: 1.1rem !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(240, 237, 230, 1) !important;
}

.leaflet-control-attribution {
  background: rgba(10, 22, 14, 0.75) !important;
  color: rgba(232, 239, 245, 0.4) !important;
  font-size: 0.6rem !important;
  backdrop-filter: blur(8px);
}

.leaflet-control-attribution a { color: var(--gold) !important; }

/* ── MAP PANELS ── */
.map-panel {
  position: absolute;
  z-index: 400;
  padding: 1.1rem 1.4rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fade-up 0.9s ease both;
}

.map-panel--tl {
  top: 5.5rem;
  left: 1.5rem;
  min-width: 190px;
  animation-delay: 0.1s;
}

.map-panel--tr {
  top: 5.5rem;
  right: 1.5rem;
  min-width: 185px;
  animation-delay: 0.2s;
}

.map-panel--bc {
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  animation-delay: 0.3s;
}

.map-filter {
  bottom: 3.5rem;
  right: 1.5rem;
  padding: 0.45rem 0.55rem;
  display: flex;
  gap: 0.35rem;
  animation-delay: 0.4s;
}

/* Panel content */
.panel-eyebrow {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.panel-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1.1;
}

.panel-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-top: 0.1rem;
  margin-bottom: 0.75rem;
}

/* WS status */
.ws-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.ws-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--stone);
}

.ws-dot--live {
  background: var(--pine-bright);
  animation: ws-pulse 2.2s ease-in-out infinite;
}

.ws-dot--connecting { background: var(--gold); }
.ws-dot--error      { background: #b34343; }
.ws-dot--offline    { background: var(--stone); }

@keyframes ws-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 140, 92, 0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(74, 140, 92, 0); }
}

/* Stats panel */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.25rem 0;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--text);
  min-width: 2.5rem;
  text-align: right;
}

.stat-value.flash {
  animation: num-flash 0.4s ease;
}

@keyframes num-flash {
  0%   { color: var(--gold); transform: scale(1.15); }
  100% { color: var(--text); transform: scale(1); }
}

.stat-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 0.4rem 0;
}

/* Closest panel */
.closest-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.closest-km {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1;
}

.closest-km.alarm {
  color: #c0392b;
  animation: alarm-pulse 1s ease-in-out infinite;
}

@keyframes alarm-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.closest-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Filter buttons */
.filter-btn {
  background: rgba(26, 53, 32, 0.15);
  border: 1px solid rgba(74, 140, 92, 0.2);
  border-radius: 2px;
  color: var(--text-muted);
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: rgba(200, 169, 110, 0.15);
  border-color: var(--gold);
  color: var(--text);
}

/* ── STRIKE MARKERS ── */
.strike-pulse {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 230, 128, 0.85);
  animation: strike-ripple 2s ease-out forwards;
  pointer-events: none;
}

@keyframes strike-ripple {
  0%   { transform: scale(0.3); opacity: 1; box-shadow: 0 0 0 0   rgba(255, 230, 128, 0.8); }
  40%  { transform: scale(1.2); opacity: 0.8; box-shadow: 0 0 0 14px rgba(255, 230, 128, 0); }
  100% { transform: scale(1.5); opacity: 0;   box-shadow: 0 0 0 0   rgba(255, 230, 128, 0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── CONTENT SECTIONS ── */
.content-section {
  position: relative;
  padding: 6rem 2rem;
  background: #060f08;
}

.content-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 60% at 0% 50%, rgba(45, 92, 56, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 80% 80% at 100% 50%, rgba(26, 53, 32, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.section-label {
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--pine-bright);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 2.5rem;
}

.section-title--light { color: var(--snow); }

/* ── GLASS ── */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* ── WEATHER GRID ── */
.w-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
  padding: 1.75rem;
}

.w-loading {
  grid-column: 1 / -1;
  padding: 1rem;
  color: var(--stone);
  font-style: italic;
  font-size: 0.875rem;
}

.w-tile {
  padding: 0.8rem 1rem;
  background: rgba(26, 53, 32, 0.08);
  border: 1px solid rgba(74, 140, 92, 0.14);
  border-left: 2px solid var(--gold);
  border-radius: 0 2px 2px 0;
  transition: background 0.25s;
}

.w-tile:hover { background: rgba(200, 169, 110, 0.07); }

.w-label {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.28rem;
}

.w-value {
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 400;
}

/* ── ASTRONOMY ── */
.astro-layout {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.25rem;
}

.astro-card {
  padding: 1.5rem;
}

.astro-card-title {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--glass-border);
}

.astro-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid rgba(200, 169, 110, 0.08);
}

.astro-row:last-child { border-bottom: none; }

.astro-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.astro-time {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 400;
  text-align: right;
  white-space: nowrap;
}

/* Moon card */
.moon-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 0.6rem;
  text-align: center;
}

.moon-phase {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.3rem;
}

.moon-pct {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.75rem;
}

.moon-times {
  font-size: 0.78rem;
  color: var(--text);
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--glass-border);
}

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.visible    { opacity: 1; transform: translateY(0); }
.reveal-delay-1    { transition-delay: 0.15s; }
.reveal-delay-2    { transition-delay: 0.30s; }

/* ── FOOTER ── */
footer {
  padding: 2.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(200, 169, 110, 0.12);
  background: rgba(6, 15, 8, 0.8);
}

.footer-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 300;
  color: rgba(232, 239, 245, 0.45);
  letter-spacing: 0.10em;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-brand:hover { color: var(--gold); }

.footer-note {
  font-size: 0.7rem;
  color: rgba(232, 239, 245, 0.22);
  letter-spacing: 0.04em;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .astro-layout { grid-template-columns: 1fr 1fr; }
  .astro-layout .astro-card:first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .map-panel--tr { display: none; }
  .map-panel--tl { top: 4.5rem; left: 1rem; right: 1rem; min-width: unset; }
  .map-panel--bc { bottom: 5rem; font-size: 0.9rem; }
  .map-filter    { bottom: 1.2rem; right: 1rem; }
  .content-section { padding: 4rem 1.25rem; }
  .astro-layout { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 0.5rem; text-align: center; padding: 2rem 1.5rem; }
  .w-grid { grid-template-columns: 1fr 1fr; padding: 1.25rem; }
}
