:root {
  color-scheme: dark;
  --ink: #f1eee7;
  --body: #dedbd3;
  --muted: #aaaeb4;
  --paper: #181c21;
  --surface: rgba(23, 27, 32, 0.96);
  --background: #111519;
  --line: #3b424a;
  --accent: #efc487;
  --link: #a9ccee;
  --font-heading: 'Lora', Georgia, serif;
  --font-body: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--font-body);
}
#map {
  position: fixed;
  inset: 0;
  z-index: 0;
}
#tinte {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0;
}
#hud {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 3;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  text-align: right;
}
#clock,
.card h1,
.card h2 {
  font-family: var(--font-heading);
}
#clock {
  font-size: 36px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
#date {
  font-size: 12px;
  color: var(--muted);
}
#story {
  position: relative;
  z-index: 2;
}
.card {
  pointer-events: auto;
  width: 400px;
  max-width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}
.card .t {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.card h1 {
  font-size: 30px;
  margin: 6px 0 10px;
  line-height: 1.15;
}
.card h2 {
  margin: 4px 0 8px;
  font-size: 22px;
  line-height: 1.2;
}
.card p {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--body);
}
.card .note {
  font-size: 12.5px;
  color: var(--muted);
}
.ph {
  margin: 0 0 12px;
}
.photo-frame,
.photo-credits {
  display: grid;
}
.photo-frame img,
.photo-credit {
  grid-area: 1 / 1;
}
.photo-frame img {
  opacity: 0;
  transition: opacity 750ms ease;
  pointer-events: none;
}
.photo-frame img.is-current {
  opacity: 1;
}
.photo-credit:not(.is-current) {
  visibility: hidden;
}
.photo-controls {
  margin-top: 6px;
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}
.photo-controls button {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--body);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.ph img {
  width: 100%;
  height: min(24svh, 210px);
  object-fit: cover;
  background: var(--background);
  border-radius: 8px;
  display: block;
}
.ph figcaption {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 5px;
}
.ph figcaption a,
.src a,
.card .note a {
  color: var(--link);
}
.src {
  margin: 10px 0 0;
  padding-left: 18px;
}
.src li {
  font-size: 12.5px;
  margin-bottom: 4px;
  line-height: 1.4;
}
#map {
  background: var(--background);
}
#map .maplibregl-ctrl-attrib {
  background-color: var(--surface);
  color: var(--muted);
}
#map .maplibregl-ctrl-attrib a {
  color: var(--body);
}
#map .maplibregl-ctrl-attrib-button {
  filter: invert(1);
}
#tinte {
  visibility: hidden;
}
.map-ready #tinte {
  visibility: visible;
}
#map-status {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 2;
  margin: 0;
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.8rem;
}
#tinte,
#map-status {
  pointer-events: none;
}
section {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 80px 16px 96px 5vw;
  pointer-events: none;
}
section.end {
  align-items: flex-start;
}
.card > :last-child {
  margin-bottom: 0;
}
.card .t + .ph {
  margin-top: 8px;
}
#tl {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 32px;
  z-index: 3;
  height: 52px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 16px;
}
#track {
  position: relative;
  height: 100%;
}
#bar,
#fill {
  position: absolute;
  left: 0;
  top: 18px;
  height: 2px;
}
#bar {
  right: 0;
  background: var(--line);
}
#fill {
  background: var(--ink);
  width: 0;
}
.time-pin {
  position: absolute;
  top: 17px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}
.hr {
  position: absolute;
  top: 3px;
  font-size: 0.7rem;
  color: var(--muted);
  transform: translateX(-50%);
}
.tick {
  position: absolute;
  bottom: 1px;
  width: 24px;
  height: 28px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.tick::before {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--paper);
}
.tick.on::before {
  background: var(--accent);
}
.tick[aria-current]::before {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}
.tick:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: -2px;
}
@media (max-width: 720px) {
  section {
    align-items: end;
    padding: clamp(106px, 17svh, 144px) 12px 96px;
  }
  section:first-child {
    padding-top: clamp(100px, 17svh, 142px);
  }
  section:first-child .ph img {
    height: 18svh;
  }
  .ph-gallery img {
    height: min(20svh, 155px);
  }
  section.end {
    padding-top: clamp(120px, 30svh, 220px);
  }
  .card {
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
    padding: 14px 16px;
  }
  .card h1 {
    font-size: 1.65rem;
  }
  #clock {
    font-size: 1.5rem;
  }
  #hud {
    top: 10px;
    right: 10px;
    padding: 8px 12px;
  }
  #tl {
    left: 6px;
    right: 6px;
  }
}

.event-ripple {
  width: 30px;
  height: 30px;
  pointer-events: none;
}
.event-ripple span {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--accent);
  border-radius: 50%;
  animation: event-pulse 2.8s ease-out infinite;
}
body:not(.map-ready) .event-ripple {
  visibility: hidden;
}
@keyframes event-pulse {
  0% {
    opacity: 0.64;
    transform: scale(0.65);
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}
@media (prefers-reduced-motion: reduce) {
  .photo-frame img {
    transition: none;
  }
  .event-ripple span {
    animation: none;
    visibility: hidden;
  }
}
