:root {
  color-scheme: dark;
  --bg: #07080c;
  --bg-2: #101218;
  --ink: #f4f1ea;
  --muted: #9a958c;
  --line: rgba(244, 241, 234, 0.12);
  --crimson: #e11d48;
  --orange: #fb923c;
  --signal: var(--orange);
  --sea: var(--crimson);
  --stamp: var(--orange);
  --dormant: #c8b39a;
  --sans: "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: Consolas, "Cascadia Mono", ui-monospace, monospace;
  --serif: Georgia, "Iowan Old Style", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(225, 29, 72, 0.16), transparent 55%),
    radial-gradient(800px 480px at 100% 0%, rgba(251, 146, 60, 0.12), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--signal); }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 560;
}
h2 {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

body { overflow-x: clip; }
.top, main, .colophon { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
main > *, .split, .split > * { min-width: 0; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 8px;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-decoration: none;
}
.mark img { height: 84px; width: auto; display: block; }
.pip {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(251, 146, 60, 0.16);
}
nav { display: flex; gap: 18px; font-family: var(--mono); font-size: 0.86rem; }
nav a { text-decoration: none; color: var(--muted); }
nav a[aria-current="page"] { color: var(--ink); }
main { padding: 28px 0 64px; display: grid; gap: 22px; }
.hero { display: grid; gap: 14px; max-width: 740px; }
.kicker {
  font-family: var(--mono);
  color: var(--crimson);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
}
.lede { color: var(--muted); font-size: 1.05rem; max-width: 46rem; }
.stats { display: flex; gap: 28px; margin: 8px 0 0; }
.stats div { display: grid; gap: 2px; }
.stats dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0; font-family: var(--mono); font-size: 1.6rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.9fr); gap: 18px; align-items: stretch; }
.agent-split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; }
.panel {
  background: rgba(16, 18, 24, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.map-panel figcaption, .panel h2 { display: flex; justify-content: space-between; gap: 12px; }
.map-panel figcaption { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.quiet { color: var(--muted); letter-spacing: 0; text-transform: none; font-family: var(--sans); }
figure.map-panel { margin: 0; padding: 16px 16px 12px; width: 100%; }
.split { width: 100%; }
.world { width: 100%; max-width: 100%; height: auto; display: block; }
.empty { display: grid; gap: 4px; margin: 0; color: var(--muted); }
.empty strong { color: var(--ink); font-weight: 560; }
.empty a { color: var(--signal); }
.ocean { fill: #0c121c; }
.graticule line { stroke: rgba(244, 241, 234, 0.06); stroke-width: 1; }
.land { fill: #1a2333; stroke: #31445f; stroke-width: 0.6; }
.arcs path { fill: none; stroke: rgba(225, 29, 72, 0.85); }
.pins circle { fill: var(--orange); stroke: #07080c; stroke-width: 1.5; }
.pins .pin-count { fill: #1c0a08; font-family: var(--mono); font-size: 11px; font-weight: 700; }
.pins .pin-label {
  opacity: 0;
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  paint-order: stroke;
  stroke: #07080c;
  stroke-width: 4px;
}
.pins a:hover .pin-label,
.pins a:focus .pin-label,
.pins a:focus-visible .pin-label,
.pins .cluster:hover .pin-label,
.pins .cluster:focus .pin-label { opacity: 1; }
.ranked, .plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ranked li, .plain li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; min-width: 0; }
.ranked li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 1px;
  align-items: baseline;
}
.ranked .rank { grid-row: 1 / span 2; }
.ranked a { min-width: 0; overflow-wrap: anywhere; }
.ranked li .meta { white-space: normal; text-align: left; line-height: 1.35; }
.rank { font-family: var(--mono); color: var(--signal); }
.meta { font-family: var(--mono); color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.graph-slot { position: relative; }
.graph-skeleton {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-content: center;
  padding: 22px 18px;
  pointer-events: none;
}
.graph {
  position: relative;
  height: 260px;
  border-radius: 14px;
  background:
    radial-gradient(500px 180px at 20% 0%, rgba(225, 29, 72, 0.1), transparent 60%),
    #0c0e13;
}
.graph.short { height: 240px; }
.graph-skeleton span {
  display: block;
  height: 14px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(244, 241, 234, 0.06), rgba(251, 146, 60, 0.4), rgba(244, 241, 234, 0.06));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.graph-skeleton span:nth-child(2) { transform: translateY(18px); }

.ticker { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; max-width: 100%; }
.ticker-viewport { position: relative; overflow: hidden; min-width: 0; }
.ticker-track { display: flex; gap: 14px; width: max-content; }
.ticker.is-looping .ticker-track { animation: ticker 70s linear infinite; }
.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track,
.ticker.is-paused .ticker-track { animation-play-state: paused; }
.ticker-set, .ticker-clone { display: flex; gap: 14px; }
.ticker-fade, .ticker-fade.end {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  z-index: 1;
  pointer-events: none;
}
.ticker-fade { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.ticker-fade.end { right: 0; left: auto; background: linear-gradient(270deg, var(--bg), transparent); }
.ticker-nav {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #12141b;
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.postcard {
  width: min(320px, 86vw);
  display: flex;
  background: linear-gradient(180deg, #17140f, #12110e);
  border: 1px solid rgba(244, 241, 234, 0.16);
  border-radius: 14px;
  overflow: hidden;
}
.stack .postcard { opacity: 1; }
.airmail {
  width: 12px;
  flex: none;
  background: linear-gradient(180deg, var(--crimson), var(--orange));
}
.card-body { position: relative; padding: 14px 14px 12px; display: grid; gap: 8px; flex: 1; min-width: 0; }
.card-stamp {
  position: absolute;
  top: 2px;
  right: 0;
  width: 48px;
  height: 48px;
  padding: 3px;
  object-fit: cover;
  background: #0b0f17;
  border: 1.5px dashed rgba(244, 241, 234, 0.75);
  border-radius: 2px;
  transform: rotate(8deg);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.card-body header { padding-right: 58px; }
.card-body header, .card-body footer { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.card-body header { align-items: flex-start; }
.domains { display: flex; flex-wrap: wrap; align-items: baseline; min-width: 0; }
.domains .sep { color: var(--muted); padding: 0 0.4em; }
.domain { font-family: var(--mono); text-decoration: none; }
h1.route {
  font-family: var(--mono);
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1.3;
  letter-spacing: -0.03em;
  font-weight: 500;
}
h1.route a { text-decoration: none; }
.count {
  font-family: var(--mono);
  border: 1px dashed var(--stamp);
  color: var(--stamp);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 0.78rem;
  flex: none;
}
.when { font-family: var(--mono); color: var(--muted); font-size: 0.78rem; }
.note { font-family: var(--serif); font-size: 1.05rem; }
.stack { display: grid; gap: 12px; }
.stack .postcard { width: auto; }
.browse { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; min-width: 0; }
.browse-main { min-width: 0; max-width: 100%; display: grid; gap: 18px; align-content: start; overflow-x: clip; }
.browse-main > * { min-width: 0; max-width: 100%; }
.travelers {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-x: clip;
  overflow-y: auto;
  text-align: center;
}
.travelers a { color: var(--ink); }
.travelers.panel > h2 { display: block; text-align: center; }
.travelers ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; min-width: 0; justify-items: center; }
.travelers li { width: 100%; }
.travelers a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 12px 8px;
  border-radius: 14px;
  text-align: center;
  text-decoration: none;
}
.travelers a[aria-current="page"] { background: rgba(225, 29, 72, 0.16); }
.travelers .meta { white-space: normal; text-align: center; line-height: 1.35; }
.traveler-name { justify-content: center; font-family: var(--mono); }
.traveler-all { font-family: var(--mono); letter-spacing: 0.04em; }
.sheet { max-width: 640px; }
.sheet .postcard { width: 100%; }
.trail { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.trail li { display: grid; gap: 2px; }
.trail li > span:first-child { font-family: var(--mono); font-size: 0.86rem; }
.trail .note { font-size: 0.98rem; }
.badge, .fiction {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 2px 7px;
}
.badge.active { color: #fff7f4; background: var(--crimson); }
.badge.dormant { color: #2a2118; background: var(--dormant); }
.fiction { color: #ffd0c4; border: 1px solid rgba(225, 29, 72, 0.8); }
.spark { width: 100%; height: 84px; }
.spark polyline { fill: none; stroke: var(--signal); stroke-width: 2; }
.prose { display: grid; gap: 14px; max-width: 42rem; }
.prose p { font-size: 1.08rem; }
.hint { color: var(--muted); font-family: var(--mono); font-size: 0.82rem; }
.hint button, .rotate button, .rotate input {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.hint button, .rotate button { padding: 6px 10px; cursor: pointer; }
.rotate { display: grid; gap: 12px; max-width: 560px; }
.rotate input { padding: 12px; font-family: var(--mono); }
.rotate button { background: var(--crimson); color: #fff7f4; border: 0; width: fit-content; }
.colophon { padding: 10px 0 40px; color: var(--muted); display: grid; gap: 6px; font-size: 0.88rem; text-align: center; justify-items: center; }
.colophon p { margin: 0; }
.mark-line { margin: 8px 0 0; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.journal-event { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; color: var(--muted); font-family: var(--mono); font-size: 0.86rem; }
.sister { margin-top: 4px; }
.day-list { margin-top: 8px; }

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 800px) {
  .split, .agent-split, .browse, .top, .colophon { grid-template-columns: 1fr; display: grid; }
  .travelers { position: static; max-height: 240px; }
  .top { display: flex; flex-wrap: wrap; }
  .mark img { height: 60px; }
  .graph, .graph.short { height: 220px; }
  .ticker { grid-template-columns: minmax(0, 1fr); }
  .ticker-nav, .ticker-fade { display: none; }
  .ticker-track, .ticker.is-looping .ticker-track { animation: none; flex-direction: column; width: auto; }
  .ticker-clone { display: none; }
  .postcard { width: auto; }
  h1 .badge { display: inline-flex; vertical-align: middle; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .ticker-track, .ticker.is-looping .ticker-track { animation: none; transform: none; }
  .ticker-clone { display: none; }
  .graph-skeleton span { animation: none; }
}
