@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap");

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 5%, rgba(44, 108, 128, 0.18), transparent 29rem),
    radial-gradient(circle at 91% 35%, rgba(63, 82, 144, 0.14), transparent 34rem),
    #071015;
  color: #edf5f7;
  font-family: "Manrope", system-ui, sans-serif;
  line-height: 1.5;
}

a {
  color: #94d8e6;
  text-underline-offset: 0.2em;
}

button,
select,
input {
  font: inherit;
}

button,
a,
select,
input {
  outline-offset: 3px;
}

:focus-visible {
  outline: 3px solid #f4d27a;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10000;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #f4d27a;
  color: #071015;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar,
main,
footer {
  width: min(1500px, calc(100% - 3rem));
  margin-inline: auto;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid #23343b;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.topbar nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: #aebec3;
  text-decoration: none;
  font-size: 0.9rem;
}

.topbar nav a:hover {
  color: #ffffff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid #6ec4d5;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.38rem #071015, inset 0 0 0 0.48rem #6ec4d5;
}

main {
  padding-block: 4.5rem 2rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.6fr);
  align-items: end;
  gap: 4rem;
  margin-bottom: 2.5rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: #77bac8;
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 1000px;
  margin-bottom: 1.2rem;
  font-size: clamp(2.7rem, 6vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

h2 {
  margin-bottom: 0.25rem;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.intro {
  max-width: 760px;
  margin-bottom: 0;
  color: #acbdc3;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.hero-note {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.2rem;
  border: 1px solid #28414b;
  border-radius: 1rem;
  background: rgba(12, 25, 31, 0.8);
}

.hero-note-icon {
  width: 0.8rem;
  height: 0.8rem;
  flex: 0 0 auto;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: #f4d27a;
  box-shadow: 0 0 0 0.3rem rgba(244, 210, 122, 0.12);
}

.hero-note p {
  margin: 0;
  color: #9fb1b7;
  font-size: 0.88rem;
}

.hero-note strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #f3f7f8;
}

.source-strip {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  min-height: 74px;
  padding: 0.9rem 1.1rem;
  border: 1px solid #29414a;
  border-radius: 0.9rem;
  background: #0c191f;
}

.source-copy {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.source-copy strong,
.source-copy span {
  display: block;
}

.source-copy strong {
  font-size: 0.92rem;
}

.source-copy div > span {
  margin-top: 0.15rem;
  color: #91a5ac;
  font-size: 0.8rem;
}

.status-dot {
  width: 0.7rem;
  height: 0.7rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #e0b75a;
  box-shadow: 0 0 0 0.3rem rgba(224, 183, 90, 0.12);
}

.status-dot.fresh {
  background: #73d3ab;
  box-shadow: 0 0 0 0.3rem rgba(115, 211, 171, 0.12);
}

.status-dot.stale {
  background: #efad75;
  box-shadow: 0 0 0 0.3rem rgba(239, 173, 117, 0.12);
}

.source-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.source-actions a,
.text-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: none;
  color: #9bcfdb;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.stale-banner {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid #715338;
  border-radius: 0.75rem;
  background: #261c14;
  color: #e9d5c4;
}

.stale-banner strong {
  margin-right: 0.5rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-block: 2rem;
  overflow: hidden;
  border: 1px solid #263940;
  border-radius: 1rem;
  background: #263940;
}

.summary-card {
  min-height: 145px;
  padding: 1.3rem;
  background: #0b171c;
}

.summary-card span,
.summary-card small {
  display: block;
  color: #879ba2;
}

.summary-card span {
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  min-height: 2.2rem;
  margin-block: 0.65rem 0.4rem;
  font-size: clamp(1.35rem, 2.5vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.summary-card small {
  font-size: 0.76rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.controls-panel,
.map-panel,
.list-panel,
.information-grid,
.disclaimer {
  border: 1px solid #253840;
  border-radius: 1rem;
  background: rgba(10, 22, 27, 0.92);
}

.controls-panel {
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}

.controls-heading,
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.secondary-button,
.icon-button {
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border: 1px solid #38515b;
  border-radius: 0.6rem;
  background: #11242b;
  color: #eaf3f5;
  cursor: pointer;
}

.secondary-button:hover,
.icon-button:hover {
  background: #17323b;
}

.control-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(5, minmax(8.5rem, 1fr));
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.control-grid fieldset,
.control-grid label {
  min-width: 0;
  margin: 0;
}

.control-grid fieldset {
  padding: 0;
  border: 0;
}

.control-grid legend,
.control-grid label > span {
  display: block;
  margin-bottom: 0.45rem;
  color: #8da1a8;
  font-size: 0.72rem;
  font-weight: 600;
}

.control-grid select {
  width: 100%;
  min-height: 46px;
  padding: 0 2rem 0 0.75rem;
  border: 1px solid #304750;
  border-radius: 0.6rem;
  background: #0d1c22;
  color: #edf5f7;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid #304750;
  border-radius: 0.6rem;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 0.65rem;
  color: #9bb0b7;
  font-size: 0.8rem;
  cursor: pointer;
}

.segmented input:checked + label {
  background: #1d5461;
  color: #ffffff;
}

.segmented input:focus-visible + label {
  outline: 3px solid #f4d27a;
  outline-offset: -3px;
}

.control-help {
  margin: 1rem 0 0;
  color: #82969d;
  font-size: 0.75rem;
}

.data-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  gap: 1rem;
}

.map-panel,
.list-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-heading {
  min-height: 86px;
  padding: 1.15rem 1.3rem;
  border-bottom: 1px solid #253840;
}

.panel-heading h2 {
  margin: 0;
}

.panel-heading .eyebrow {
  margin-bottom: 0.35rem;
}

#visible-count {
  color: #8ea2a9;
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
}

.map-frame {
  position: relative;
  min-height: 620px;
  background: #101f25;
}

#map,
.map-placeholder {
  position: absolute;
  inset: 0;
}

.map-placeholder {
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 2rem;
  background:
    linear-gradient(rgba(37, 68, 77, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 68, 77, 0.2) 1px, transparent 1px),
    #0c1a20;
  background-size: 48px 48px;
  text-align: center;
}

.map-placeholder p {
  max-width: 300px;
  color: #8ea2a9;
}

.map-placeholder strong {
  display: block;
  margin-bottom: 0.3rem;
  color: #eaf3f5;
}

.map-loader,
.list-loader {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
  border: 2px solid #2a4d57;
  border-top-color: #78c5d5;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.legend {
  min-height: 54px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid #253840;
  color: #8da1a8;
  font-size: 0.68rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-circle {
  display: inline-block;
  border: 2px solid #e7fbff;
  border-radius: 50%;
  background: #42a3b8;
}

.legend-circle.small {
  width: 0.55rem;
  height: 0.55rem;
}

.legend-circle.large {
  width: 0.9rem;
  height: 0.9rem;
}

.legend-swatch {
  width: 0.75rem;
  height: 0.75rem;
  display: inline-block;
  border-radius: 0.2rem;
}

.legend-swatch.shallow {
  background: #f2bd68;
}

.legend-swatch.intermediate {
  background: #6ebdd0;
}

.legend-swatch.deep {
  background: #8a7dcc;
}

.map-attribution {
  margin: 0;
  padding: 0 1rem 0.75rem;
  color: #73888f;
  font-size: 0.64rem;
}

.event-list {
  max-height: 730px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.event-item {
  border-bottom: 1px solid #22343b;
}

.event-button {
  width: 100%;
  min-height: 126px;
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.event-button:hover {
  background: #10242b;
}

.event-button[aria-current="true"] {
  border-left-color: #79cad9;
  background: #122a32;
}

.magnitude {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-content: center;
  border: 1px solid #31505a;
  border-radius: 50%;
  background: #112830;
  color: #f4fafb;
  font-size: 1rem;
  font-weight: 700;
}

.event-copy {
  min-width: 0;
}

.event-copy strong {
  display: block;
  margin-bottom: 0.4rem;
  overflow: hidden;
  color: #f0f6f7;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  color: #8ca0a7;
  font-size: 0.72rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-badge::before {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #d6ab5d;
  content: "";
}

.status-badge.reviewed::before {
  background: #70c9a6;
}

.feed-message {
  min-height: 420px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 2rem;
  color: #91a5ac;
  text-align: center;
}

.feed-message .secondary-button {
  margin-top: 0.5rem;
}

.information-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 1rem;
  padding: 2rem;
}

.information-grid p {
  color: #93a7ad;
}

.status-explainer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #283e46;
  border-radius: 0.75rem;
  background: #283e46;
}

.status-explainer article {
  padding: 1.2rem;
  background: #0d1b21;
}

.status-explainer p {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
}

.disclaimer {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.5rem;
}

.disclaimer-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  flex: 0 0 auto;
  place-content: center;
  border: 1px solid #46626c;
  border-radius: 50%;
  color: #a9d9e2;
  font-family: serif;
}

.disclaimer p {
  margin: 0.5rem 0 0;
  color: #98abb1;
}

footer {
  min-height: 110px;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  border-top: 1px solid #23343b;
  color: #71868d;
  font-size: 0.78rem;
}

footer p {
  margin: 0;
}

dialog {
  width: min(610px, calc(100% - 2rem));
  max-height: min(820px, calc(100vh - 2rem));
  padding: 0;
  overflow: auto;
  border: 1px solid #3a555e;
  border-radius: 1rem;
  background: #0c191f;
  color: #edf5f7;
  box-shadow: 0 2rem 6rem #000000;
}

dialog::backdrop {
  background: rgba(1, 6, 9, 0.78);
  backdrop-filter: blur(4px);
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid #2b4048;
  background: #0c191f;
}

.dialog-header h2 {
  margin: 0;
}

#dialog-content {
  padding: 1.4rem;
}

.detail-lead {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  align-items: start;
}

.detail-lead .magnitude {
  width: 4.7rem;
  height: 4.7rem;
  font-size: 1.35rem;
}

.detail-lead h3 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
}

.detail-lead p {
  color: #91a5ac;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-block: 1.3rem;
  overflow: hidden;
  border: 1px solid #293f47;
  border-radius: 0.75rem;
  background: #293f47;
}

.detail-grid div {
  padding: 1rem;
  background: #0f2026;
}

.detail-grid dt {
  color: #7e9299;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
}

.detail-note {
  padding: 1rem;
  border-left: 3px solid #d2ae67;
  background: #221d14;
  color: #d7c9ad;
  font-size: 0.8rem;
}

.detail-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.detail-actions a,
.detail-actions button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 0.85rem;
  border: 1px solid #38515b;
  border-radius: 0.6rem;
  background: #11242b;
  color: #d8f0f5;
  text-decoration: none;
  cursor: pointer;
}

.mobile-view-switch {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.maplibregl-ctrl-attrib {
  font-size: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .control-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .data-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  }
}

@media (max-width: 880px) {
  .topbar,
  main,
  footer {
    width: min(100% - 2rem, 1500px);
  }

  main {
    padding-top: 3rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-note {
    max-width: 600px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .data-layout {
    grid-template-columns: 1fr;
  }

  .map-frame {
    min-height: 520px;
  }

  .event-list {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 64px;
  }

  .topbar nav a:first-child {
    display: none;
  }

  .topbar nav {
    gap: 0.5rem;
  }

  .topbar nav a {
    font-size: 0.72rem;
  }

  h1 {
    font-size: clamp(2.7rem, 14vw, 4.2rem);
  }

  .source-strip,
  .source-actions {
    align-items: flex-start;
  }

  .source-strip {
    flex-direction: column;
  }

  .source-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .summary-card {
    min-height: 132px;
    padding: 1rem;
  }

  .summary-card strong {
    font-size: 1.45rem;
  }

  .control-grid {
    grid-template-columns: 1fr 1fr;
  }

  .control-grid fieldset {
    grid-column: 1 / -1;
  }

  .controls-heading {
    align-items: flex-end;
  }

  .controls-heading h2 {
    font-size: 1.15rem;
  }

  .mobile-view-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 0.75rem;
    padding: 0.3rem;
    border: 1px solid #304750;
    border-radius: 0.7rem;
    background: #0d1c22;
  }

  .mobile-view-switch button {
    min-height: 44px;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: #9bb0b7;
  }

  .mobile-view-switch button[aria-pressed="true"] {
    background: #1d5461;
    color: #ffffff;
  }

  .data-layout[data-mobile-view="list"] .map-panel,
  .data-layout[data-mobile-view="map"] .list-panel {
    display: none;
  }

  .map-frame {
    min-height: 450px;
  }

  .information-grid,
  .status-explainer {
    grid-template-columns: 1fr;
  }

  .information-grid {
    gap: 1.5rem;
    padding: 1.3rem;
  }

  .disclaimer {
    padding: 1.2rem;
  }

  footer {
    min-height: 140px;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 0;
  }
}

@media (max-width: 430px) {
  .topbar,
  main,
  footer {
    width: min(100% - 1.25rem, 1500px);
  }

  main {
    padding-top: 2.25rem;
  }

  .brand span:last-child {
    font-size: 0.88rem;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .control-grid fieldset {
    grid-column: auto;
  }

  .panel-heading {
    min-height: 78px;
    padding: 1rem;
  }

  .event-button {
    grid-template-columns: 3.3rem minmax(0, 1fr);
    padding: 0.9rem 0.75rem;
  }

  .magnitude {
    width: 3rem;
    height: 3rem;
  }

  .legend {
    gap: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
