:root {
  --bg: #0b0f14;
  --panel: #111823;
  --panel-2: #151f2c;
  --line: #243247;
  --ink: #e8eef6;
  --muted: #9aacc0;
  --faint: #6f8197;
  --accent: #ff6b4a;
  --accent-2: #ffd23f;
  --ok: #3ddc97;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 560px at 82% -8%, rgb(255 107 74 / 10%), transparent 60%),
    radial-gradient(800px 450px at -10% 15%, rgb(61 220 151 / 6%), transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: #ff9a82; }
a:hover { color: #ffb19f; }
img, svg { max-width: 100%; }
.wrap { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; z-index: 10; background: var(--ink); color: var(--bg); padding: 8px 12px; }

.site-header { display: flex; align-items: center; gap: 24px; min-height: 82px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 29px; height: 29px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a { color: var(--muted); font-size: 14px; font-weight: 650; text-decoration: none; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--ink); }
.status-link { color: var(--muted); font-size: 13px; text-decoration: none; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--ok); }
.language-switch { display: inline-flex; align-items: center; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.language-switch:hover { border-color: #425771; color: var(--ink); }

.page-hero { padding: 54px 0 32px; }
.eyebrow { margin: 0 0 12px; color: var(--accent-2); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.015em; }
h1 { max-width: 850px; margin: 0 0 18px; font-size: clamp(36px, 6vw, 64px); }
h2 { margin: 52px 0 18px; font-size: clamp(25px, 4vw, 36px); }
h3 { margin: 22px 0 8px; font-size: 19px; }
.lede { max-width: 760px; margin: 0; color: var(--muted); font-size: clamp(17px, 2.4vw, 21px); }
.updated { margin-top: 12px; color: var(--faint); font-size: 13px; }
.button-row { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 28px; }
.button { display: inline-flex; align-items: center; padding: 11px 17px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-weight: 750; text-decoration: none; }
.button.primary { border-color: var(--accent); background: var(--accent); color: #1a0d08; }
.button:hover { border-color: #425771; background: var(--panel); color: var(--ink); }
.button.primary:hover { border-color: #ff805f; background: #ff805f; color: #1a0d08; }

.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.pill { display: inline-flex; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.pill[aria-current="page"], .pill:hover { border-color: #425771; background: var(--panel); color: var(--ink); }

.quake-app { min-height: 560px; }
.controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px 14px 0 0; background: var(--panel); }
.field { display: grid; gap: 5px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 750; }
input, select { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #33465e; border-radius: 9px; background: #0c131c; color: var(--ink); font: inherit; }
.result-count { align-self: end; min-width: 110px; padding-bottom: 8px; color: var(--muted); font-size: 14px; text-align: right; }

.quake-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.6fr; gap: 1px; overflow: hidden; border-inline: 1px solid var(--line); background: var(--line); }
.insight { min-width: 0; padding: 16px; background: #0e1621; }
.insight-label { display: block; margin-bottom: 5px; color: var(--faint); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.insight-value { display: block; overflow: hidden; color: var(--ink); font-size: 17px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.insight-detail { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.histogram { display: flex; height: 54px; gap: 7px; align-items: end; margin-top: 6px; }
.histogram-bin { display: grid; flex: 1; grid-template-rows: 1fr auto; height: 100%; gap: 4px; align-items: end; text-align: center; }
.histogram-bar { width: 100%; min-height: 3px; border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, #ff9a7d, #ff6044); opacity: .82; transform-origin: bottom; animation: growBar .28s ease-out both; }
.histogram-label { color: var(--faint); font-size: 9px; line-height: 1; white-space: nowrap; }
@keyframes growBar { from { transform: scaleY(.08); opacity: .25; } }

.map-shell { position: relative; overflow: hidden; border-inline: 1px solid var(--line); background: #09111a; }
.leaflet-map { width: 100%; height: clamp(390px, 55vw, 610px); background: #09111a; }
.leaflet-container { font-family: inherit; }
.leaflet-control-zoom a { border-color: #33465e !important; background: #111b27 !important; color: var(--ink) !important; }
.leaflet-control-zoom a:hover { background: #1b2938 !important; }
.leaflet-control-attribution { background: rgb(8 14 20 / 82%) !important; color: #8293a8; font-size: 10px; }
.leaflet-control-attribution a { color: #b4c2d2; }
.leaflet-control-scale-line { border-color: #9bacc0; background: rgb(8 14 20 / 72%); color: #c6d1dc; }
.quake-tooltip { border: 1px solid #40536b; border-radius: 9px; background: rgb(10 17 25 / 96%); box-shadow: 0 8px 30px rgb(0 0 0 / 35%); color: var(--ink); }
.quake-tooltip::before { border-top-color: #40536b !important; }
.tooltip-mag { color: var(--accent-2); font-size: 15px; font-weight: 850; }
.tooltip-place { max-width: 260px; margin: 2px 0 5px; font-weight: 750; }
.tooltip-meta { color: var(--muted); font-size: 11px; }
.quake-marker-pulse { animation: mapPulse 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes mapPulse { 0% { opacity: .95; stroke-width: 2.5; } 75%, 100% { opacity: 0; stroke-width: 8; } }

.map-legend { position: absolute; z-index: 500; top: 12px; right: 12px; width: min(270px, calc(100% - 24px)); padding: 12px 13px; border: 1px solid rgb(105 127 151 / 45%); border-radius: 11px; background: rgb(8 14 20 / 90%); box-shadow: 0 8px 28px rgb(0 0 0 / 28%); backdrop-filter: blur(7px); }
.legend-title { margin-bottom: 9px; color: var(--ink); font-size: 12px; font-weight: 850; }
.legend-section + .legend-section { margin-top: 10px; }
.legend-caption { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.size-ramp { display: flex; gap: 17px; align-items: end; }
.size-step { display: flex; gap: 5px; align-items: center; color: #c7d2df; font-size: 10px; }
.legend-circle { display: inline-block; flex: 0 0 auto; border: 1px solid rgb(255 255 255 / 70%); border-radius: 50%; background: rgb(255 210 63 / 62%); }
.legend-circle.s { width: 12px; height: 12px; }
.legend-circle.m { width: 18px; height: 18px; }
.legend-circle.l { width: 25px; height: 25px; }
.depth-gradient { height: 7px; border-radius: 999px; background: linear-gradient(90deg, #ffd23f 0%, #ff7a5c 34%, #8f7dff 72%, #5c8dff 100%); }
.depth-labels { display: flex; justify-content: space-between; margin-top: 4px; color: #a8b6c7; font-size: 9px; }
.map-help { position: absolute; z-index: 500; left: 50%; bottom: 20px; margin: 0; padding: 5px 9px; border-radius: 6px; background: rgb(8 14 20 / 80%); color: var(--muted); font-size: 10px; transform: translateX(-50%); white-space: nowrap; }

.quake-list { border: 1px solid var(--line); border-radius: 0 0 14px 14px; background: var(--panel); }
.quake-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 150px; gap: 16px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; transition: background-color .15s, box-shadow .15s; }
.quake-row:first-child { border-top: 0; }
.quake-row:hover { background: var(--panel-2); color: inherit; }
.quake-row.is-highlighted { background: #1a2736; box-shadow: inset 3px 0 var(--magnitude-color, var(--accent)); }
.quake-row > span { min-width: 0; }
.magnitude { display: inline-grid; place-items: center; width: 58px; height: 42px; border: 1px solid color-mix(in srgb, var(--magnitude-color, #ff8c72) 46%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--magnitude-color, #ff8c72) 16%, transparent); color: var(--magnitude-color, #ff8c72); font-size: 18px; font-weight: 850; }
.quake-place { display: inline-block; max-width: 100%; overflow: hidden; font-weight: 700; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; }
.quake-meta { color: var(--muted); font-size: 13px; }
.depth-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border: 1px solid rgb(255 255 255 / 45%); border-radius: 50%; background: var(--depth-color); }
.quake-time { color: var(--muted); font-size: 13px; text-align: right; }
.empty { padding: 28px 16px; color: var(--muted); text-align: center; }
.quake-app.is-updating .quake-list, .quake-app.is-updating .quake-insights { opacity: .55; }
.quake-list, .quake-insights { transition: opacity .16s ease; }

.content-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card { padding: 23px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.card h2, .card h3 { margin-top: 0; }
.card p { color: var(--muted); }
.card-link { color: var(--ink); text-decoration: none; }
.card-link:hover h2, .card-link:hover h3 { color: #ff9a82; }
.article { max-width: 780px; padding-bottom: 50px; }
.article h1 { font-size: clamp(35px, 5.5vw, 58px); }
.article p, .article li { color: #bdc9d7; }
.article strong { color: var(--ink); }
.callout { margin: 26px 0; padding: 18px 20px; border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--panel); }
.callout p { margin: 0; color: var(--ink); }
.byline { color: var(--faint); font-size: 13px; }
.source-list li { margin-bottom: 9px; }

.site-footer { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 56px; padding: 28px 0 44px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer .copyright { margin-left: auto; }

@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; gap: 12px; padding: 17px 0; }
  .site-nav { order: 3; width: 100%; gap: 16px; }
  .status-link { margin-left: auto; }
  .page-hero { padding-top: 35px; }
  .controls { grid-template-columns: 1fr; }
  .result-count { text-align: left; }
  .quake-row { grid-template-columns: 62px minmax(0, 1fr); gap: 11px; }
  .quake-time { grid-column: 2; text-align: left; }
  .quake-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quake-insights > .insight:nth-child(3) { grid-column: 1 / -1; }
  .insight.histogram-insight { grid-column: 1 / -1; }
  .leaflet-map { height: 460px; }
  .map-legend { top: 8px; right: 8px; }
  .map-help { bottom: 10px; }
  .content-grid { grid-template-columns: 1fr; }
  .site-footer .copyright { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .histogram-bar, .quake-marker-pulse { animation: none; }
}
