:root {
  color-scheme: light;
  --ink: #1e2428;
  --muted: #64717a;
  --line: #d6dde1;
  --paper: #f7f4ed;
  --panel: #ffffff;
  --teal: #006c67;
  --brick: #a8442f;
  --gold: #c99a2e;
  --water: #9fc4cf;
  --land: #d7c6a1;
  --selected: #0b4f8a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 5vw, 72px) 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.subtitle {
  max-width: 520px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 1rem;
}

.layout {
  padding: 24px clamp(18px, 5vw, 72px) 48px;
}

.overview-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: 18px 0 24px;
}

.overview-band p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.stat {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stat dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.stat dd {
  margin: 8px 0 0;
  font-size: 1.7rem;
  font-weight: 780;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: start;
}

.map-panel,
.timeline-panel {
  min-width: 0;
}

.section-heading {
  margin-bottom: 12px;
}

.bay-map {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #c5e2e1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  isolation: isolate;
}

.chart-fallback,
.chart-tile-layer {
  position: absolute;
  inset: 0;
}

.chart-fallback {
  background:
    radial-gradient(ellipse at 61% 39%, rgba(215, 198, 161, 0.9) 0 13%, transparent 13.5%),
    linear-gradient(105deg, transparent 0 62%, rgba(215, 198, 161, 0.92) 62% 100%),
    repeating-radial-gradient(
      ellipse at 34% 51%,
      rgba(255, 255, 255, 0.38) 0 2px,
      transparent 2px 46px
    ),
    repeating-linear-gradient(
      152deg,
      rgba(0, 108, 103, 0.12) 0 1px,
      transparent 1px 42px
    ),
    #9fc4cf;
}

.chart-fallback::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(140deg, transparent 0 57%, rgba(0, 108, 103, 0.24) 57% 60%, transparent 60%),
    linear-gradient(25deg, transparent 0 50%, rgba(255, 255, 255, 0.28) 50% 52%, transparent 52%),
    linear-gradient(90deg, transparent 0 64%, rgba(95, 78, 42, 0.22) 64% 64.5%, transparent 64.5%);
}

.chart-tile-layer {
  opacity: 0.86;
  filter: saturate(0.95) contrast(1.02);
}

.chart-tile-layer::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.25), transparent 16% 84%, rgba(255, 255, 255, 0.14)),
    radial-gradient(circle at 50% 52%, transparent 0 52%, rgba(30, 36, 40, 0.12) 100%);
}

.chart-tile-layer img {
  position: absolute;
  display: block;
}

.bay-map::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.07) 1px, transparent 1px);
  background-size: 96px 96px;
  mix-blend-mode: multiply;
  opacity: 0.18;
}

.map-label {
  position: absolute;
  z-index: 3;
  padding: 2px 6px;
  border-radius: 4px;
  color: rgba(30, 36, 40, 0.76);
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(247, 244, 237, 0.65);
  backdrop-filter: blur(2px);
}

.map-label.downtown {
  top: 42%;
  right: 9%;
}

.map-label.bay {
  top: 17%;
  left: 26%;
}

.map-label.west-seattle {
  bottom: 18%;
  left: 9%;
}

.map-point {
  position: absolute;
  z-index: 5;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brick);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  box-shadow:
    0 3px 12px rgba(30, 36, 40, 0.35),
    0 0 0 4px rgba(168, 68, 47, 0.18);
  cursor: pointer;
  transform: translate(
    calc(-50% + var(--point-offset-x, 0px)),
    calc(-50% + var(--point-offset-y, 0px))
  );
}

.map-point.business {
  background: var(--teal);
  box-shadow:
    0 3px 12px rgba(30, 36, 40, 0.35),
    0 0 0 4px rgba(0, 108, 103, 0.18);
}

.map-point:hover,
.map-point:focus-visible,
.map-point.is-selected {
  z-index: 6;
  outline: none;
  transform: translate(
      calc(-50% + var(--point-offset-x, 0px)),
      calc(-50% + var(--point-offset-y, 0px))
    )
    scale(1.16);
}

.map-point.is-selected {
  background: var(--selected);
  box-shadow:
    0 4px 18px rgba(30, 36, 40, 0.42),
    0 0 0 5px rgba(255, 255, 255, 0.92),
    0 0 0 10px rgba(11, 79, 138, 0.25);
}

.map-tooltip {
  position: absolute;
  z-index: 7;
  display: grid;
  width: min(250px, calc(100% - 24px));
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(30, 36, 40, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 32px rgba(30, 36, 40, 0.22);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.35;
}

.map-tooltip strong {
  font-size: 0.9rem;
}

.map-tooltip span {
  color: var(--muted);
}

.chart-attribution {
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 4;
  margin: 0;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.74);
  color: rgba(30, 36, 40, 0.72);
  font-size: 0.68rem;
  font-weight: 650;
}

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

.clip-list {
  display: grid;
  gap: 12px;
}

.clip-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  scroll-margin: 24px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.clip-card:focus {
  outline: none;
}

.clip-card.is-hovered,
.clip-card.is-selected {
  border-color: rgba(11, 79, 138, 0.65);
  box-shadow:
    inset 4px 0 0 var(--selected),
    0 10px 26px rgba(30, 36, 40, 0.12);
}

.clip-card.is-selected {
  transform: translateX(-3px);
}

.clip-index {
  border-color: rgba(11, 79, 138, 0.25);
  background: rgba(11, 79, 138, 0.08);
  color: var(--selected);
  font-weight: 750;
}

.clip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfaf6;
}

.clip-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.clip-card blockquote {
  margin: 0 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--gold);
  color: #343b40;
  line-height: 1.5;
}

audio {
  width: 100%;
  height: 38px;
}

.empty {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

@media (max-width: 860px) {
  .topbar,
  .overview-band,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: block;
  }

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

  .bay-map {
    min-height: 380px;
  }
}
