/* ==========================================================================
   eugeniusone.com — Live location page modules
   Weather, plane wall, live camera, timelapse gallery, seismic placeholder.
   Follows the base editorial vocabulary — hairline rules, wide tracking,
   monochrome ink. Tabular figures for anything numeric.
   ========================================================================== */

/* ---------- Section error state ("Sorry, I'm not working") ---------- */

.section-error {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.section-error img {
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.section-error .section-error-copy {
  min-width: 0;
}

.section-error-title {
  font-family: var(--font-display);
  font-size: var(--text-lg, 1.25rem);
  color: #000;
  margin: 0 0 var(--space-2) 0;
  line-height: 1.25;
}

.section-error-body {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3) 0;
  line-height: 1.5;
}

.section-error-code {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-3);
  display: inline-block;
}

@media (max-width: 640px) {
  .section-error {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .section-error img {
    max-height: 200px;
  }
}

/* ---------- Heading emphasis (card titles + section titles) ---------- */

.card h2,
.section-title,
.page-hero h1 {
  color: #000;
  font-weight: 500; /* Sorts Mill Goudy caps at 400/700; 500 falls back to 400
                       but stays semantically bolder than body */
  letter-spacing: 0.003em;
}

.card h2 {
  font-size: var(--text-lg, 1.25rem);
  margin-bottom: var(--space-4);
}

/* ---------- News hero (below H1) ---------- */

.news-hero {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.news-hero-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.news-hero-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin: 0;
}

.news-hero-source {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--color-divider);
}

.news-hero-source:hover {
  color: var(--place-accent, var(--color-text-strong));
  border-bottom-color: currentColor;
}

.news-hero-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 300px);
  gap: var(--space-6);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-3);
  /* Subtle right-side fade to hint that content scrolls */
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
}

/* Thin scrollbar (WebKit) */
.news-hero-scroll::-webkit-scrollbar {
  height: 4px;
}
.news-hero-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}
.news-hero-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.news-card {
  display: grid;
  gap: var(--space-2);
  padding: 0 var(--space-5) 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease;
  scroll-snap-align: start;
  border-right: 1px solid var(--color-divider);
}

.news-card:last-child {
  border-right: 0;
}

.news-card:hover {
  transform: translateY(-1px);
}

.news-card:hover .news-card-title {
  color: var(--place-accent, var(--color-text-strong));
}

.news-card-more {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--place-accent, var(--color-text-muted));
  margin-top: var(--space-2);
  align-self: end;
}

.news-card-more::after {
  content: " →";
}

.news-card-when {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.news-card-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.28;
  font-weight: 400;
  color: var(--color-text-strong);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 160ms ease;
}

.news-card-summary {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-empty {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  padding: var(--space-4) 0;
}

@media (max-width: 880px) {
  .news-hero-scroll {
    grid-auto-columns: minmax(220px, 78%);
  }
  .news-card-title {
    font-size: var(--text-md);
  }
}

.live-section {
  padding-block: clamp(var(--space-12), 7vw, var(--space-24));
}

.live-section + .live-section {
  border-top: 1px solid var(--color-divider);
}

.live-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-text);
}

.live-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  letter-spacing: 0.005em;
}

.live-meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

.live-meta .dot {
  display: inline-block;
  margin-right: var(--space-2);
  transform: translateY(-1px);
}

/* ---------- Weather module ---------- */

.wx-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--space-10);
  align-items: stretch;
}

/* When a camera tile is present, expand to 3 columns on wide viewports.
   The camera lives as a sibling of [data-weather-mount] under
   .wx-grid-with-cam so the JS render stays a pure 2-child sub-grid. */
.wx-grid-with-cam {
  display: grid;
  /* Cam gets ~half the row, two data cards split the other half so
     everything fits on one line without the cam feeling like an
     afterthought. align-items: stretch keeps all three columns the
     same height. */
  grid-template-columns:
    minmax(0, 0.85fr)
    minmax(0, 0.85fr)
    minmax(360px, 1.9fr);
  gap: var(--space-6);
  align-items: stretch;
}

/* The [data-weather-mount] itself still holds .wx-primary + .wx-stats
   as its own 2-col subgrid on wide screens; when nested inside
   .wx-grid-with-cam we let it flow the two children into columns 1 and 2. */
.wx-grid-with-cam > [data-weather-mount] {
  display: contents;
}

@media (max-width: 1100px) {
  .wx-grid-with-cam {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .wx-grid-with-cam > .wx-cam {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .wx-grid-with-cam {
    grid-template-columns: 1fr;
  }
  .wx-grid-with-cam > [data-weather-mount] {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

.wx-cam {
  position: relative;
  border: 1px solid var(--color-border);
  /* Cinema-black tile background so object-fit: contain letterboxes
     against a proper black bar top/bottom (or left/right) instead of
     the page surface. Hardcoded to the site's near-black rather than
     a token so the bars stay black in both light and dark themes. */
  background: #0c0c0b;
  overflow: hidden;
  display: block;
  min-height: 220px;
}

.wx-cam-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  /* Match tile so any 1px sub-pixel seam disappears. */
  background: #0c0c0b;
}

.wx-cam.is-offline {
  /* Only offline state needs the minimum height reservation; a real
     image drives its own dimensions. */
  min-height: 220px;
}

.wx-cam.is-offline .wx-cam-img { display: none; }

.wx-cam-offline {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.wx-cam.is-offline .wx-cam-offline { display: flex; }

.wx-primary {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Tighter padding so the card can compress into its narrower
     column when the cam tile is expanded. */
  padding: var(--space-6) var(--space-6) var(--space-5);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  min-height: 220px;
}

.wx-primary .eyebrow {
  margin-bottom: var(--space-4);
}

.wx-temp {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.wx-temp .val {
  font-size: clamp(3.5rem, 3rem + 3vw, 5.75rem);
}

.wx-temp .unit {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
}

.wx-condition {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  margin-top: var(--space-3);
}

.wx-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 0;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.wx-stat {
  /* Denser padding pairs with the narrower stats column when the cam
     tile is expanded to ~half the row. */
  padding: var(--space-4) var(--space-5);
  border-right: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}

.wx-stat:nth-child(2n) {
  border-right: none;
}

.wx-stat:nth-last-child(-n+2) {
  border-bottom: none;
}

.wx-stat .k {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.wx-stat .v {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.wx-stat .v small {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: var(--track-wide);
  margin-left: var(--space-1);
}

@media (max-width: 780px) {
  .wx-grid { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* ---------- Sky view / live camera ---------- */

.sky-view {
  position: relative;
  border: 1px solid var(--color-border);
  aspect-ratio: 16 / 9;
  background: var(--color-surface-offset-2);
  overflow: hidden;
  isolation: isolate;
  margin-bottom: var(--space-10);
}

.sky-view video,
.sky-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sky-view-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  padding: var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
  background:
    linear-gradient(135deg, transparent 46%, var(--color-divider) 46%, var(--color-divider) 54%, transparent 54%),
    var(--color-surface-offset);
  background-size: 22px 22px, 100% 100%;
}

.sky-view-placeholder .eyebrow {
  margin-bottom: var(--space-3);
}

.sky-view-placeholder p {
  font-size: var(--text-sm);
  max-width: 44ch;
}

.sky-view-badge {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(17,17,17,.72);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  z-index: 2;
}

.sky-view-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d63b3b;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { opacity: 1; }
  50%     { opacity: .3; }
}

@media (prefers-reduced-motion: reduce) {
  .sky-view-badge .dot { animation: none; }
}

/* ---------- Sky map (Leaflet) ---------- */

.sky-map {
  width: 100%;
  height: 100%;
  background: #0e1116;
}

/* Give OSM tiles a dark, muted look similar to OpenSky */
.sky-map .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.55);
}

.sky-map .leaflet-control-attribution {
  background: rgba(17,17,17,.72);
  color: #d9d9d9;
  font-size: 10px;
}
.sky-map .leaflet-control-attribution a { color: #f0c7a1; }

.sky-map .leaflet-control-zoom a {
  background: rgba(17,17,17,.82);
  color: #fff;
  border: 1px solid rgba(255,255,255,.15);
}
.sky-map .leaflet-control-zoom a:hover { background: rgba(40,40,40,.9); }

/* Plane icon: SVG rotated by heading via inline transform on child */
.plane-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  pointer-events: auto;
}
.plane-icon svg {
  width: 22px;
  height: 22px;
  fill: #f7c948;
  stroke: #1a1a1a;
  stroke-width: 1.2;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
  transition: transform 200ms linear;
}
.plane-icon.plane-icon-military svg { fill: #7ad3ff; }
.plane-icon.plane-icon-emergency svg { fill: #ff6b6b; }

.plane-popup {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 1.5;
}
.plane-popup .cs { font-weight: 600; font-size: 13px; }
.plane-popup .op { color: #555; }
.plane-popup .route { margin-top: 4px; letter-spacing: .04em; }
.plane-popup .facts { margin-top: 4px; color: #333; }

/* Center marker for the site */
.site-center-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #d63b3b; border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(214,59,59,.35);
}

/* Ring showing search radius */
.sky-map .leaflet-interactive.site-radius-ring {
  stroke: rgba(247, 201, 72, .55);
  stroke-dasharray: 4 4;
  fill: rgba(247, 201, 72, .06);
}

/* ---------- Plane wall ---------- */

.plane-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0;
  border-top: 1px solid var(--color-divider);
  border-left: 1px solid var(--color-divider);
}

.plane-card {
  padding: var(--space-6);
  border-right: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-bg);
  display: grid;
  gap: var(--space-4);
  min-height: 200px;
}

.plane-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.plane-logo {
  flex-shrink: 0;
  width: 56px;
  height: 28px;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.plane-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.plane-logo.no-logo {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--color-text-faint);
  letter-spacing: 0.08em;
}

.plane-callsign {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: 0.02em;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.plane-operator {
  font-size: 0.6875rem;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.plane-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
}

.plane-fact {
  font-size: var(--text-xs);
}

.plane-fact .k {
  display: block;
  color: var(--color-text-faint);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  font-size: 0.625rem;
  margin-bottom: 2px;
}

.plane-fact .v {
  color: var(--color-text);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
}

.plane-route {
  display: grid;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-offset);
  border-left: 2px solid var(--color-accent, var(--color-text-muted));
}

.plane-route-codes {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-text);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.plane-route-cities {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.plane-seen {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Aircraft photo strip -
   Sits above the plane-card-head when the poller has enriched the
   observation with a thumbnail (adsbdb.com / planespotters.net).
   Fixed aspect keeps the wall visually consistent even when photos
   have different native ratios. */
.plane-photo {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--color-surface-offset);
  overflow: hidden;
  position: relative;
  margin: calc(var(--space-6) * -1) calc(var(--space-6) * -1) 0;
  border-bottom: 1px solid var(--color-divider);
}

.plane-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.plane-photo.no-photo { display: none; }

/* Small metadata badges (MIL / PIA / LADD) shown on the right of the card head */
.plane-badges {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.plane-badge {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
}

.plane-badge-mil {
  color: var(--color-accent, #b04a2a);
  border-color: var(--color-accent, #b04a2a);
}

/* Empty state */
.plane-empty {
  padding: var(--space-16) var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
}

.plane-empty .eyebrow {
  margin-bottom: var(--space-3);
}

/* ---------- Timelapse gallery ---------- */

.timelapse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.timelapse-card {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  overflow: hidden;
}

.timelapse-video-wrap {
  aspect-ratio: 16 / 9;
  background: var(--color-surface-offset-2);
  position: relative;
}

.timelapse-video-wrap video,
.timelapse-video-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.timelapse-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: var(--space-6);
}

.timelapse-caption {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-divider);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.timelapse-caption .name {
  font-family: var(--font-display);
  font-size: var(--text-base);
}

.timelapse-caption .date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Recent quakes (USGS) ---------- */

.quakes-panel {
  display: grid;
  gap: var(--space-4);
}

.quakes-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.quakes-panel-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin: 0;
}

.quakes-panel-meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
}

.quake-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--color-divider);
}

.quake-row {
  display: grid;
  grid-template-columns: 4rem 1fr auto;
  gap: var(--space-4);
  align-items: baseline;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-divider);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.quake-row:hover {
  background: var(--color-surface-offset);
}

.quake-mag {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1;
  color: var(--color-text-strong);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: var(--space-2);
  border-right: 1px solid var(--color-divider);
}

.quake-row.is-strong .quake-mag { color: var(--place-accent, var(--color-warning)); }
.quake-row.is-major  .quake-mag { color: var(--color-error, #b04040); }

.quake-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.quake-place {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quake-when {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

.quake-depth {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
  text-align: right;
  align-self: center;
  white-space: nowrap;
}

.quake-empty {
  padding: var(--space-6) 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  font-style: italic;
  border-bottom: 1px solid var(--color-divider);
}

/* ---------- Seismic (live Raspberry Shake embed) ---------- */

.seismic-card {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: var(--space-10);
  display: grid;
  gap: var(--space-6);
}

/* 3-col grid: trace(s) span 2/3, recent-events sidebar takes 1/3.
   Collapses to a single stacked column below ~880px. */
.seismic-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-8);
  align-items: stretch;
}

.seismic-grid > .seismic-embed,
.seismic-grid > .seismic-panel,
.seismic-grid > .seismic-traces {
  min-width: 0; /* let iframe shrink inside grid track */
}

/* Multi-trace stack (Signal Hill Shake + Boom) fills the 2/3 column */
.seismic-traces {
  display: grid;
  gap: var(--space-6);
}

.seismic-grid > .quakes-panel {
  min-width: 0;
  align-self: start;
}

@media (max-width: 880px) {
  .seismic-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

.seismic-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.seismic-head h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
}

.seismic-meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.seismic-meta a {
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--color-divider);
}

.seismic-meta a:hover {
  color: var(--place-accent, var(--color-text-strong));
  border-bottom-color: currentColor;
}

/* Legacy placeholder status pill — kept in case any page still uses it. */
.seismic-status {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-warning);
  border: 1px solid var(--color-warning);
  padding: var(--space-1) var(--space-3);
}

.seismic-body p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.seismic-panel {
  display: grid;
  gap: var(--space-3);
}

.seismic-panel-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin: 0;
}

.seismic-embed {
  position: relative;
  width: 100%;
  /* Trace needs a wider-than-tall aspect. Sized for 2/3-column layout. */
  height: clamp(440px, 44vw, 680px);
  border: 1px solid var(--color-divider);
  background: var(--color-surface-offset);
  overflow: hidden;
}

/* When two traces are stacked (Signal Hill: Shake + Boom),
   each panel still needs to read comfortably, not feel like a strip.
   Sized so a pair still fits in a typical viewport. */
.seismic-panel .seismic-embed {
  height: clamp(380px, 32vw, 560px);
}

/* When the seismic-card collapses to single-column on mobile,
   drop the trace height back down to a phone-friendly size. */
@media (max-width: 880px) {
  .seismic-embed {
    height: clamp(360px, 66vw, 480px);
  }
  .seismic-panel .seismic-embed {
    height: clamp(300px, 52vw, 420px);
  }
}

.seismic-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.seismic-footnote {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0;
  max-width: 60ch;
}

/* Legacy grid placeholder — kept for older pages */
.seismic-chart {
  aspect-ratio: 4 / 1;
  border: 1px solid var(--color-divider);
  background:
    repeating-linear-gradient(0deg, transparent 0 22px, var(--color-divider) 22px 23px),
    repeating-linear-gradient(90deg, transparent 0 40px, var(--color-divider) 40px 41px),
    var(--color-surface-offset);
  display: grid;
  place-items: center;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Skeleton loading ---------- */

.skel {
  background: linear-gradient(
    90deg,
    var(--color-surface-offset) 0%,
    var(--color-surface-offset-2) 50%,
    var(--color-surface-offset) 100%
  );
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
  color: transparent !important;
}

@keyframes skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
}

/* --- Live camera stream (Signal Hill · cam 1, others in future) --- */
.cam-stream {
  /* inherits sizing from .sky-view video rule above */
  background: var(--color-surface-offset-2);
}
.cam-stream-placeholder {
  position: absolute;
  inset: 0;
  display: none;              /* revealed by JS when stream is unavailable */
  place-items: center;
  padding: var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
  background:
    linear-gradient(135deg, transparent 46%, var(--color-divider) 46%, var(--color-divider) 54%, transparent 54%),
    var(--color-surface-offset);
  background-size: 22px 22px, 100% 100%;
}
.cam-stream-placeholder.is-visible { display: grid; }
.cam-stream-placeholder p {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
}
.cam-stream-hint {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}

/* ============ IN-PAGE SECTION NAV ============
   Sticky jump-nav shown on place pages just below the hero. Cream
   background, hairline bottom border, chip-style link buttons. The
   Home link is anchored left; the section chips flow horizontally
   with wrapping on narrow viewports.

   Anchor targets get scroll-margin-top so the sticky nav doesn't
   overlap the section header when jumped to. */
.section-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  /* Slight backdrop blur to remain readable when content scrolls
     behind. Falls back cleanly if unsupported. */
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}

.section-nav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  flex-wrap: wrap;
}

.section-nav-home {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.section-nav-home:hover {
  color: var(--color-text);
  background: var(--color-bg);
  border-color: var(--color-text);
}

.section-nav-links {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-left: auto;
}

.section-nav-link {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.section-nav-link:hover,
.section-nav-link[aria-current="true"] {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* Ensure sections aren't hidden behind the sticky nav when jumped to. */
.live-section[id] {
  scroll-margin-top: 72px;
}

/* ============ FLOATING BACK-TO-TOP BUTTON ============
   Injected by place-live.js after the DOM loads. Fixed bottom-right,
   hidden by default, revealed once the user scrolls past the hero. */
.floating-top {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-text);
  text-decoration: none;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.floating-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.floating-top:hover {
  background: #0c0c0b;
  color: #fff;
}

@media (max-width: 720px) {
  .section-nav-links {
    /* On mobile, section chips wrap directly under the Home button. */
    margin-left: 0;
    width: 100%;
  }
  .floating-top {
    right: var(--space-4);
    bottom: var(--space-4);
  }
}
