:root {
  --red: #ed1c24;
  --red-dark: #c91018;
  --red-soft: #fff0f1;
  --ink: #242529;
  --muted: #71737a;
  --line: #e5e5e7;
  --soft: #f4f4f5;
  --paper: #ffffff;
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; scroll-behavior: smooth; }
body {
  margin: 0; max-width: 100%; overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -120px, rgba(237,28,36,.08), transparent 320px),
    #f6f6f7;
  font-family: "Manrope", sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.app-shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; min-height: 68px; padding: 0 max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(15px);
}
.brand img { display: block; width: 145px; height: auto; }
.site-header.logo-centered {
  justify-content: center; min-height: 86px; padding-inline: 20px;
}
.logo-centered .brand {
  position: absolute; left: 50%; transform: translateX(-50%);
}
.logo-centered .brand img { width: clamp(132px, 14.4vw, 176px); }
.logo-centered .header-title,
.logo-centered nav,
.logo-centered .live-pill { display: none; }
.header-title { margin-left: 15px; padding-left: 15px; border-left: 1px solid var(--line); color: var(--muted); font-size: 15px; font-weight: 800; }
nav { display: flex; align-self: stretch; gap: 24px; margin-left: auto; margin-right: 30px; }
nav a { display: flex; align-items: center; border-bottom: 3px solid transparent; color: var(--muted); font-size: 12px; font-weight: 800; }
nav a.active { border-color: var(--red); color: var(--ink); }
.live-pill { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 11px; font-weight: 700; }
.live-pill span, .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(237,28,36,.12); }

.hero {
  display: grid; grid-template-columns: 1.35fr .65fr; min-height: 380px; margin-top: 36px;
  overflow: hidden; border: 1px solid rgba(237,28,36,.06); border-radius: 24px;
  background: var(--paper); box-shadow: 0 18px 55px rgba(34,34,37,.08);
}
.hero-copy { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 68px 68px 62px; text-align: center; }
.eyebrow { margin: 0 0 13px; color: var(--red); font: 500 10px "DM Mono"; letter-spacing: .16em; }
h1, h2 { margin: 0; letter-spacing: -.065em; line-height: 1.02; }
h1 { max-width: 780px; font-size: clamp(46px, 5vw, 68px); }
h1 strong { color: var(--red); }
.hero-lead { max-width: 620px; margin: 24px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 34px; }
.primary-button { display: inline-flex; gap: 14px; align-items: center; padding: 13px 18px; border-radius: 8px; color: #fff; background: var(--red); font-size: 13px; font-weight: 800; }
.primary-button:hover { background: var(--red-dark); }
.text-button { border: 0; color: var(--muted); background: transparent; font-size: 13px; font-weight: 800; }
.text-button span { color: var(--red); font-size: 18px; }
.hero-visual { position: relative; overflow: hidden; background: linear-gradient(145deg, #f5f5f6, #dedee1); }
.hero-visual::before, .hero-visual::after, .signal-line { position: absolute; content: ""; border: 1px solid rgba(237,28,36,.22); border-radius: 50%; }
.hero-visual::before { inset: -30% -35% -35% -20%; }
.hero-visual::after { inset: -6% -15%; }
.signal-one { inset: 15% 1%; }
.signal-two { inset: 33% 19%; }
.epicenter { position: absolute; top: 51%; left: 52%; }
.epicenter-dot { width: 14px; height: 14px; border: 3px solid white; border-radius: 50%; background: var(--red); box-shadow: 0 2px 8px rgba(237,28,36,.3); }
.epicenter span { position: absolute; top: 20px; left: 15px; color: var(--ink); font: 500 9px "DM Mono"; letter-spacing: .13em; white-space: nowrap; }
.pulse { position: absolute; top: 7px; left: 7px; border: 1px solid rgba(237,28,36,.35); border-radius: 50%; transform: translate(-50%,-50%); animation: radiate 4s infinite ease-out; }
.pulse-one { width: 66px; height: 66px; }
.pulse-two { width: 140px; height: 140px; animation-delay: .6s; }
.pulse-three { width: 230px; height: 230px; animation-delay: 1.2s; }
@keyframes radiate { 0%,100% { opacity: .35; transform: translate(-50%,-50%) scale(.87); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.04); } }
.hero-stamp { position: absolute; right: 22px; bottom: 20px; color: #8b8c91; text-align: right; font: 500 9px/1.7 "DM Mono"; letter-spacing: .05em; }

.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; }
.summary-strip p { display: flex; align-items: center; gap: 13px; min-height: 74px; margin: 0; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.summary-strip b, .summary-strip small { display: block; }
.summary-strip b { font-size: 14px; }
.summary-strip small { margin-top: 3px; color: var(--muted); font: 500 8px "DM Mono"; letter-spacing: .08em; }
.summary-icon { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--red); background: var(--red-soft); font-size: 14px; }
.summary-strip .status-dot { width: 32px; height: 32px; box-shadow: none; }
.summary-strip .status-dot::after { width: 8px; height: 8px; border-radius: 50%; background: white; content: ""; }

.monitor { padding: 86px 0 92px; }
.section-heading { display: flex; justify-content: space-between; gap: 25px; margin-bottom: 24px; }
h2 { font-size: clamp(40px, 5vw, 58px); }
.section-heading > p, .explain > p { max-width: 490px; margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.monitor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.quake-panel, .side-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px; border-bottom: 1px solid var(--line); }
.panel-toolbar > span { color: var(--muted); font: 500 9px "DM Mono"; letter-spacing: .06em; }
.segmented { display: flex; gap: 5px; }
.segmented button { padding: 8px 11px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.segmented button.active { border-color: rgba(237,28,36,.12); color: var(--red); background: var(--red-soft); }
.quake-list { overflow-y: auto; max-height: 540px; }
.quake-row { display: grid; grid-template-columns: 78px 1fr 94px 84px; align-items: center; gap: 18px; padding: 18px; border-bottom: 1px solid var(--line); transition: background .2s; }
.quake-row:hover { background: #fafafa; }
.magnitude { display: flex; align-items: baseline; gap: 5px; color: var(--red); font: 500 36px "DM Mono"; letter-spacing: -.12em; }
.magnitude small { color: var(--muted); font-size: 10px; letter-spacing: 0; }
.quake-detail h3 { margin: 0 0 6px; font-size: 14px; letter-spacing: -.02em; }
.quake-detail p { margin: 0; color: var(--muted); font: 400 10px "DM Mono"; line-height: 1.75; }
.quake-time { display: grid; justify-items: end; gap: 2px; }
.quake-time span { color: var(--ink); font: 800 24px/1 "Manrope"; letter-spacing: -.05em; }
.quake-time small { color: var(--muted); font: 500 9px "DM Mono"; letter-spacing: .02em; }
.quake-card-button {
  justify-self: end; padding: 9px 10px; border: 1px solid rgba(237,28,36,.16); border-radius: 8px;
  color: var(--red); background: var(--red-soft); font-size: 10px; font-weight: 900; text-transform: uppercase;
}
.quake-card-button:hover { border-color: rgba(237,28,36,.35); background: #ffe6e8; }
.load-more-wrap { padding: 14px; border-top: 1px solid var(--line); background: linear-gradient(#fff, #fafafa); }
.load-more-button {
  width: 100%; padding: 13px 16px; border: 1px solid rgba(237,28,36,.18); border-radius: 10px;
  color: var(--red); background: white; font-size: 12px; font-weight: 900; text-transform: uppercase;
}
.load-more-button:hover { background: var(--red-soft); }
.load-more-button[hidden] { display: none; }
.loading-state, .empty-state { padding: 55px 24px; color: var(--muted); text-align: center; font-size: 14px; line-height: 1.6; }
.side-heading { padding: 18px 18px 14px; }
.side-heading h3 { margin: 0; font-size: 21px; letter-spacing: -.05em; }
.side-heading p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.map-card { position: relative; height: 360px; overflow: hidden; border-top: 1px solid var(--line); background: #e9e9eb; }
.google-map { width: 100%; height: 100%; border: 0; filter: saturate(1.08) contrast(1.03); }
.map-card::after {
  position: absolute; inset: 0; z-index: 400; pointer-events: none; content: "";
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(36,37,41,.03));
}
.map-badge {
  position: absolute; z-index: 500; left: 14px; top: 14px; display: grid; gap: 2px;
  padding: 9px 11px; border: 1px solid rgba(237,28,36,.12); border-radius: 9px;
  background: rgba(255,255,255,.9); box-shadow: 0 10px 24px rgba(36,37,41,.08);
}
.map-badge strong { color: var(--ink); font-size: 12px; letter-spacing: -.02em; }
.map-badge span { color: var(--muted); font: 500 8px "DM Mono"; letter-spacing: .06em; text-transform: uppercase; }
.map-key { position: absolute; z-index: 500; right: 10px; bottom: 10px; left: 10px; display: flex; align-items: center; gap: 13px; padding: 9px 10px; border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.92); box-shadow: 0 10px 24px rgba(36,37,41,.08); font: 500 8px "DM Mono"; }
.map-key i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.key-valley { border: 2px solid var(--red); background: white; }
.key-quake { background: var(--red); }
.map-open {
  position: absolute; right: 10px; top: 12px; z-index: 500; padding: 8px 10px;
  border-radius: 8px; color: white; background: var(--red); box-shadow: 0 10px 24px rgba(237,28,36,.2);
  font-size: 10px; font-weight: 900; text-transform: uppercase;
}

.quake-dialog { width: min(760px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 18px; background: transparent; }
.quake-dialog::backdrop { background: rgba(20,20,24,.62); backdrop-filter: blur(4px); }
.dialog-card { position: relative; overflow: hidden; border-radius: 18px; background: white; box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.dialog-close {
  position: absolute; right: 14px; top: 14px; z-index: 2; width: 34px; height: 34px;
  border: 0; border-radius: 50%; color: var(--ink); background: rgba(255,255,255,.92); font-size: 24px; line-height: 1;
}
.dialog-hero { padding: 30px 30px 24px; color: white; background: linear-gradient(135deg, #2d2e32, #17181b); }
.dialog-hero h2 { max-width: 620px; font-size: clamp(29px, 5vw, 46px); }
.dialog-hero p:last-child { margin: 12px 0 0; color: rgba(255,255,255,.72); }
.dialog-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); }
.dialog-stat { padding: 16px; background: white; }
.dialog-stat span { display: block; margin-bottom: 6px; color: var(--muted); font: 500 9px "DM Mono"; letter-spacing: .08em; text-transform: uppercase; }
.dialog-stat strong { color: var(--ink); font-size: 16px; letter-spacing: -.03em; }
.dialog-map { height: 250px; border-top: 1px solid var(--line); }
.dialog-map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(.12) saturate(.95); }
.dialog-actions { display: flex; gap: 10px; padding: 16px; background: #fafafa; }
.dialog-actions a { flex: 1; padding: 12px 14px; border-radius: 10px; text-align: center; color: white; background: var(--red); font-size: 12px; font-weight: 900; }
.dialog-actions a:last-child { color: var(--red); background: var(--red-soft); }

.explain { display: grid; grid-template-columns: 1fr 1fr; gap: 55px; padding: 65px max(20px, calc((100vw - 1180px) / 2)); color: white; background: #2d2e32; }
.explain h2 { max-width: 610px; font-size: clamp(37px, 4.4vw, 55px); }
.explain > p { align-self: end; color: rgba(255,255,255,.68); }
.site-footer { padding: 28px 20px; background: #f6f6f7; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  width: min(1180px, 100%); margin-inline: auto; padding: 20px 22px;
  border: 1px solid var(--line); border-radius: 16px; background: white;
}
.footer-brand { display: grid; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 800; }
.footer-brand img { display: block; width: 178px; height: auto; }
.site-footer p { max-width: 520px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; text-align: right; }
.site-footer a { color: var(--red); font-weight: 800; }

@media (max-width: 820px) {
  .app-shell { width: min(100% - 24px, 600px); }
  .site-header { min-height: 62px; padding-inline: 14px; }
  .site-header.logo-centered { min-height: 74px; }
  .brand img { width: 120px; }
  .logo-centered .brand img { width: min(40vw, 152px); }
  .header-title { margin-left: 10px; padding-left: 10px; font-size: 13px; }
  nav { display: none; }
  .live-pill { margin-left: auto; font-size: 0; }
  .hero { grid-template-columns: 1fr; margin-top: 20px; border-radius: 22px; }
  .hero-copy { padding: 34px 24px 28px; }
  .eyebrow { margin-bottom: 10px; font-size: 9px; }
  h1 { font-size: clamp(36px, 9vw, 48px); letter-spacing: -.07em; }
  .hero-lead { margin-top: 18px; font-size: 13px; line-height: 1.6; }
  .hero-actions { gap: 12px; margin-top: 24px; }
  .primary-button { padding: 12px 14px; font-size: 12px; }
  .text-button { font-size: 12px; }
  .hero-visual { min-height: 110px; }
  .hero-stamp { bottom: 14px; }
  .summary-strip { grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
  .summary-strip p { min-height: 58px; padding: 10px; gap: 9px; }
  .summary-icon, .summary-strip .status-dot { flex-basis: 27px; width: 27px; height: 27px; }
  .monitor { padding: 52px 0 58px; }
  .section-heading { display: block; }
  .section-heading > p { font-size: 13px; line-height: 1.55; }
  .monitor-layout { grid-template-columns: 1fr; }
  .side-panel { order: -1; }
  .side-heading { display: none; }
  .map-card { height: 220px; border-top: 0; }
  .map-badge { left: 10px; top: 10px; }
  .quake-list { max-height: none; }
  .explain { grid-template-columns: 1fr; gap: 18px; padding: 54px 20px; }
  .site-footer { padding: 18px 12px; }
  .footer-inner { display: grid; gap: 16px; padding: 18px; }
  .footer-brand img { width: 160px; }
  .site-footer p { text-align: left; }
}

@media (max-width: 480px) {
  .panel-toolbar { align-items: flex-start; flex-direction: column; gap: 9px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
  .panel-toolbar > span { align-self: flex-end; }
  .quake-row {
    grid-template-columns: 72px 1fr auto;
    grid-template-areas:
      "mag detail time"
      "mag detail action";
    align-items: center; gap: 8px 12px; padding: 13px;
  }
  .magnitude { grid-area: mag; font-size: 32px; align-self: center; }
  .quake-detail { grid-area: detail; min-width: 0; }
  .quake-detail h3 { margin-bottom: 5px; font-size: 13px; line-height: 1.22; }
  .quake-detail p { font-size: 9px; line-height: 1.45; }
  .quake-time { grid-area: time; justify-items: center; align-self: start; text-align: center; min-width: 58px; }
  .quake-time span { font-size: 21px; }
  .quake-time small { font-size: 8px; }
  .quake-card-button { grid-area: action; justify-self: center; padding: 7px 9px; font-size: 9px; }
  .map-card { height: 205px; }
  .map-open { top: auto; right: 10px; bottom: 45px; }
  .map-key { font-size: 7px; }
  .dialog-grid { grid-template-columns: 1fr 1fr; }
  .dialog-actions { flex-direction: column; }
}
