:root {
  --red: #d71920;
  --ink: #161616;
  --paper: #f6f3ed;
  --white: #ffffff;
  --muted: #746f68;
  --line: #d9d4cb;
  --pending: #aaa59d;
  --ease: cubic-bezier(.22, 1, .36, 1);
  font-family: "PingFang SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  background:
    linear-gradient(rgba(22,22,22,.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 24px;
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

.page-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  border-inline: 1px solid rgba(22,22,22,.06);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: max(14px, env(safe-area-inset-top)) 20px 10px;
  border-bottom: 1px solid var(--ink);
}

.brand-logo {
  display: block;
  width: min(66%, 254px);
  height: auto;
}

.replay-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.replay-button:focus-visible,
.filter-button:focus-visible,
.hotspot:focus-visible,
.sheet-close:focus-visible {
  outline: 3px solid rgba(215,25,32,.28);
  outline-offset: 3px;
}

.replay-mark { color: var(--red); font-size: 20px; }

.intro { padding: 28px 20px 14px; }

.eyebrow,
.section-index {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

h1 {
  margin: 0;
  font-size: clamp(47px, 14vw, 72px);
  line-height: .95;
  letter-spacing: -.065em;
  text-wrap: balance;
}

h1 span { color: var(--red); }

.deck {
  max-width: 390px;
  margin: 22px 0 0;
  color: #3f3c38;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.75;
  text-wrap: pretty;
}

.status-line {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: end;
  margin-top: 28px;
  padding: 14px 0 13px;
  border-top: 1px solid var(--ink);
}

.status-line > strong {
  color: var(--red);
  font-size: 42px;
  line-height: 1;
  letter-spacing: -.05em;
}

.status-line small { color: var(--ink); font-size: 17px; }
.status-copy span { font-size: 14px; font-weight: 800; }
.status-copy p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.progress-track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  overflow: hidden;
  background: var(--line);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width 420ms var(--ease);
}

.map-section { padding: 0 12px 22px; }

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
}

.map-toolbar p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(215,25,32,.10);
}

.filter-group { display: flex; gap: 4px; }

.filter-button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.filter-button.is-active {
  border-color: var(--ink);
  color: var(--paper);
  background: var(--ink);
}

.map-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 14px 34px rgba(22,22,22,.08);
}

.map-image { display: block; width: 100%; height: auto; }
.hotspots { position: absolute; inset: 0; }

.hotspot {
  position: absolute;
  width: 46px;
  height: 46px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity 320ms ease, filter 220ms ease;
}

.hotspot::before,
.hotspot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.hotspot::before {
  width: 11px;
  height: 11px;
  border: 2px solid var(--white);
  background: var(--red);
  box-shadow: 0 2px 7px rgba(22,22,22,.3);
}

.hotspot::after {
  width: 21px;
  height: 21px;
  border: 1px solid rgba(215,25,32,.48);
}

.hotspot.is-visible { opacity: 1; }
.hotspot.is-visible:not(.is-pending)::after {
  animation: coordinatePulse 2.8s var(--ease) infinite;
  animation-delay: var(--pulse-delay, 0s);
}
.hotspot:hover { filter: brightness(.88); }
.hotspot:active { transform: translate(-50%, -50%) scale(.88); }

.hotspot.is-pending { opacity: 1; }
.hotspot.is-pending::before { background: var(--pending); }
.hotspot.is-pending::after {
  border: 1px dashed var(--pending);
  animation: pendingPulse 1.8s ease-out infinite;
}

.hotspot.is-muted { opacity: .13; filter: grayscale(1); }
.hotspot.is-highlighted { z-index: 2; opacity: 1; }
.hotspot.is-highlighted::after { animation: embodiedPulse 1.4s ease-out infinite; }

.map-caption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 8px 10px;
  color: var(--white);
  background: rgba(22,22,22,.86);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.observation {
  margin: 14px 20px 0;
  padding: 26px 0 30px;
  border-top: 5px solid var(--red);
}

.observation h2 {
  margin: 0;
  font-size: clamp(27px, 8vw, 37px);
  line-height: 1.18;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.observation-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.observation-link h2 {
  transition: color 180ms ease;
}

.observation-link:hover h2,
.observation-link:focus-visible h2 {
  color: var(--red);
}

.observation-link:focus-visible,
.inline-read-more:focus-visible {
  outline: 3px solid rgba(215,25,32,.28);
  outline-offset: 5px;
}

.observation > p:not(.section-index) {
  margin: 18px 0 0;
  color: #504c47;
  font-size: 16px;
  line-height: 1.8;
  text-wrap: pretty;
}

.logic-row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
}

.logic-row span { font-size: 12px; font-weight: 800; }
.logic-row i { height: 1px; background: var(--red); }

.inline-read-more {
  display: inline;
  margin-left: .15em;
  color: var(--red);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.inline-read-more:hover,
.inline-read-more:active {
  text-decoration: underline;
  text-underline-offset: .2em;
}

.scrim {
  position: fixed;
  z-index: 20;
  inset: 0;
  background: rgba(22,22,22,.52);
  backdrop-filter: blur(3px);
}

.detail-sheet {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 520px);
  max-height: 82vh;
  margin: 0 auto;
  padding: 28px 22px calc(22px + env(safe-area-inset-bottom));
  overflow: auto;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(110%);
  border-radius: 22px 22px 0 0;
  background: var(--white);
  box-shadow: 0 -20px 70px rgba(22,22,22,.22);
  transition: transform 420ms var(--ease), visibility 0s linear 420ms;
}

.detail-sheet.is-open {
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.sheet-handle {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 42px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--line);
}

.sheet-close {
  position: absolute;
  top: 22px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.sheet-location {
  margin: 0 54px 10px 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
}

.detail-sheet h2 {
  margin: 0 48px 0 0;
  font-size: clamp(27px, 8vw, 38px);
  line-height: 1.16;
  letter-spacing: -.04em;
  text-wrap: pretty;
}

.keyword-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }

.keyword-list span {
  padding: 7px 10px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.sheet-explainer {
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.75;
  text-wrap: pretty;
}

.sheet-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sheet-meta span { color: var(--muted); font-size: 12px; }
.sheet-meta strong { font-size: 17px; }

@keyframes pendingPulse {
  0% { opacity: .75; transform: translate(-50%, -50%) scale(.65); }
  75%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.45); }
}

@keyframes coordinatePulse {
  0%, 12% {
    opacity: .7;
    transform: translate(-50%, -50%) scale(.72);
  }
  58% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.72);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.72);
  }
}

@keyframes embodiedPulse {
  0% { opacity: .75; transform: translate(-50%, -50%) scale(.7); }
  80%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55); }
}

@media (min-width: 720px) {
  body { padding: 28px 0; }
  .page-shell { box-shadow: 0 24px 80px rgba(22,22,22,.15); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
