:root {
  --flag-yellow: #ffd100;
  --flag-blue: #034ea2;
  --flag-red: #d52b1e;
  --ink: #0b2545;
  --muted: #5a6b85;
  --panel: rgba(255, 255, 255, 0.94);
  --inca: #ffd100;
  --spain: #ff5a4e;
  --canari: #5fd3a6;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: #0b2545;
  color: var(--ink);
  font:
    16px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 8px;
  z-index: 5;
  background: linear-gradient(
    var(--flag-yellow) 0 50%,
    var(--flag-blue) 50% 75%,
    var(--flag-red) 75%
  );
}
#map {
  position: fixed;
  inset: 0;
}
.top {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 4;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11, 37, 69, 0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
}
.brand {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.crumb {
  opacity: 0.75;
}
.year {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 3;
  font: 700 clamp(44px, 8vw, 96px) / 1 "Fraunces", Georgia, serif;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: opacity 0.4s;
}
main {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.step {
  pointer-events: auto;
  max-width: 420px;
  margin: 0 0 70vh 40px;
  padding: 22px 26px;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  opacity: 0.35;
  transition: opacity 0.4s;
}
.step.active {
  opacity: 1;
}
.step:first-child {
  margin-top: 30vh;
}
.step:last-child {
  margin-bottom: 30vh;
}
h1,
h2 {
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.15;
  margin: 0 0 10px;
}
h1 {
  font-size: 44px;
}
h2 {
  font-size: 26px;
}
p {
  margin: 0 0 10px;
}
.kicker,
.date {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--flag-blue);
}
.lede {
  font-size: 18px;
}
.hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.why,
.chapters {
  margin: 0;
  padding-left: 20px;
}
.why li {
  margin-bottom: 6px;
}
.chapters {
  list-style: none;
  padding: 0;
}
.chapters li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  color: var(--muted);
}
.chapters li span {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: #e6edf8;
  color: var(--ink);
}
.chapters li.current {
  color: var(--ink);
  font-weight: 700;
}
.chapters li.current span {
  background: var(--flag-yellow);
}
.note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}
a {
  color: var(--flag-blue);
}

/* Place markers drawn as HTML so no glyph server is needed. */
.place {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.place.show {
  opacity: 1;
}
.place::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ink);
}
.place.key::before {
  width: 14px;
  height: 14px;
  background: var(--flag-yellow);
}
.legend {
  position: fixed;
  left: 20px;
  bottom: 28px;
  z-index: 3;
  display: flex;
  gap: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11, 37, 69, 0.75);
  color: #fff;
  font-size: 12px;
}
.legend i {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.maplibregl-ctrl-attrib {
  font-size: 10px;
}
.noscript {
  position: fixed;
  inset: 40% 20px auto;
  color: #fff;
  text-align: center;
}

@media (max-width: 640px) {
  .step {
    margin: 0 16px 80vh;
    padding: 18px 20px;
    max-width: none;
  }
  .step:first-child {
    margin-top: 40vh;
  }
  h1 {
    font-size: 34px;
  }
  .year {
    top: 64px;
    right: 16px;
    bottom: auto;
    font-size: 40px;
  }
  .crumb {
    display: none;
  }
  .legend {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .step,
  .place,
  .year {
    transition: none;
  }
}

/* Quito burning, 1534. */
.fire {
  width: 140px;
  height: 140px;
  pointer-events: none;
}
.fire::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 120, 30, 0.85) 0%, rgba(255, 60, 20, 0.45) 40%, transparent 70%);
  opacity: 0;
  transition: opacity 0.8s;
  animation: flicker 1.6s ease-in-out infinite alternate;
}
.fire.show::before {
  opacity: 1;
}
@keyframes flicker {
  from { transform: scale(0.85); }
  to { transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .fire::before { animation: none; }
}

/* Source line under each panel. */
.src {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid #dde3ee;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
