/* Quake Watch: a dark cartographic look. The floor this product stands on
   is the tokens in :root — the palette, the type scale, the shape — and the
   rules underneath spend them consistently. Change tokens first; add rules
   second. */
:root {
  color-scheme: dark;

  /* Palette. A dark map: deep sea background, light land text, magnitudes
     graded from pale yellow to red. */
  --ink: #e8eef2;
  --muted: #8a9aa6;
  --line: #2a3340;
  --bg: #0d1620;
  --surface: #16212d;
  --surface-2: #1c2836;
  --accent: #e0a440;

  --mag-low: #f5d76e;      /* pale yellow, M5–6 */
  --mag-mod: #f0883e;      /* orange, M6–7 */
  --mag-high: #e0533a;     /* red-orange, M7+ */
  --mag-severe: #c0392b;    /* deep red, M7.5+ */

  /* Type scale. */
  --step-0: 0.9375rem; /* small print */
  --step-1: 1.0625rem; /* body */
  --step-2: 1.375rem; /* section headings */
  --step-3: clamp(2.25rem, 6vw, 3rem); /* the masthead */

  /* Shape. */
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 6px 20px rgb(0 0 0 / 0.25);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    var(--step-1) / 1.6 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.masthead,
main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* The product's name and its one sentence: the first thing a visitor reads,
   so it is the largest thing on the page, marked with the product's own
   colour rather than fenced off by a rule line. */
.masthead {
  padding-top: 4rem;
  padding-bottom: 2rem;
}

.masthead::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 0.3rem;
  border-radius: 999px;
  background: var(--accent);
  margin-bottom: 1.25rem;
}

.masthead h1 {
  margin: 0 0 0.5rem;
  font-size: var(--step-3);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 750;
  text-wrap: balance;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: var(--step-1);
  max-width: 34rem;
  text-wrap: pretty;
}

main {
  padding-bottom: 3rem;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: var(--step-2);
  letter-spacing: -0.015em;
  font-weight: 650;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* The map area: a styled placeholder the real map will fill later. It reads
   as a dark panel with a faint graticule, sized to hold a world map, and the
   centered caption sets the expectation that the map is on its way. */
.map-area {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  overflow: hidden;
}

.map-placeholder {
  position: relative;
  height: 16rem;
  min-height: 40vw;
  display: grid;
  place-items: center;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 2rem,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 2rem 100%,
    radial-gradient(circle at 50% 45%, var(--surface-2), var(--surface));
  background-blend-mode: normal;
}

.map-placeholder span {
  color: var(--muted);
  font-size: var(--step-0);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

/* The ranked list. Biggest first; each row a magnitude badge, the place,
   and how long ago. */
.quakes {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.quake {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "badge place"
    "badge meta";
  column-gap: 0.85rem;
  row-gap: 0.1rem;
  align-items: baseline;
  padding: 0.8rem 0.25rem;
  border-bottom: 1px solid var(--line);
}

.mag-badge {
  grid-area: badge;
  align-self: center;
  display: inline-grid;
  place-items: center;
  min-width: 3rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: var(--step-0);
  letter-spacing: 0.02em;
  color: #1a1408;
  background: var(--mag-low);
}

.quake-place {
  grid-area: place;
  font-weight: 600;
  text-wrap: balance;
}

.quake-meta {
  grid-area: meta;
  color: var(--muted);
  font-size: var(--step-0);
}

/* Magnitude drives the badge colour, graded from pale yellow to red so the
   worst quakes read worst at a glance. */
.mag-badge[data-mag^="7"] { background: var(--mag-high); color: #fff; }
.mag-badge[data-mag^="7.5"], .mag-badge[data-mag^="7.6"], .mag-badge[data-mag^="7.7"], .mag-badge[data-mag^="7.8"], .mag-badge[data-mag^="7.9"], .mag-badge[data-mag^="8"] { background: var(--mag-severe); color: #fff; }
.mag-badge[data-mag^="6"] { background: var(--mag-mod); color: #1a1408; }

/* An empty state is a designed state, not an absence. */
.empty {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

@media (max-width: 30rem) {
  .map-placeholder {
    height: 12rem;
  }
  .quake {
    column-gap: 0.6rem;
  }
}
