:root {
  --navy: #0a2744;
  --navy-2: #123a60;
  --gold: #c59a47;
  --gold-soft: #f2e6c9;
  --paper: #f8f5ee;
  --card: #fffdf8;
  --ink: #1f2933;
  --muted: #66717d;
  --line: #ded8ca;
  --blue: #7e98af;
  --shadow: 0 8px 28px rgba(12, 35, 56, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }

.wrap {
  width: min(100% - 28px, 820px);
  margin-inline: auto;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(255,255,255,.08), transparent 23%),
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.05), transparent 18%),
    linear-gradient(150deg, #061b30 0%, var(--navy) 55%, var(--navy-2) 100%);
  color: white;
  padding: 54px 0 50px;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 54px;
  background:
    linear-gradient(155deg, transparent 68%, rgba(255,255,255,.06) 69%) 0 0/74px 54px repeat-x;
  opacity: .55;
}
.hero-stars::before,
.hero-stars::after {
  content: "✦  ·  ✦  ·  ✦  ·  ✦";
  position: absolute;
  color: rgba(255,255,255,.14);
  letter-spacing: 14px;
  font-size: 11px;
  white-space: nowrap;
}
.hero-stars::before { top: 18px; left: 8%; }
.hero-stars::after { right: 4%; bottom: 18px; }
.hero-inner { position: relative; z-index: 1; text-align: center; }
.eyebrow {
  color: #e4bd73;
  text-transform: uppercase;
  letter-spacing: .34em;
  font-size: 12px;
  font-weight: 700;
}
h1 {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(36px, 8vw, 58px);
  line-height: 1.08;
  margin: 12px 0 0;
}
.gold-rule { width: 84px; height: 2px; background: var(--gold); margin: 20px auto 17px; }
.hero-kicker { margin: 0; text-transform: uppercase; letter-spacing: .22em; font-size: 12px; color: #e9d4ab; }
.hero-copy { max-width: 610px; margin: 18px auto 0; color: rgba(255,255,255,.82); line-height: 1.6; font-size: 15px; }

.main-wrap { padding: 18px 0 48px; }
.intro-card,
.controls,
.closing-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.intro-card { padding: 16px 18px; line-height: 1.55; font-size: 14px; }
.intro-card p { margin: 0; }

.controls {
  position: sticky;
  top: 8px;
  z-index: 20;
  margin-top: 14px;
  padding: 12px;
  backdrop-filter: blur(12px);
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}
.chip.active { background: var(--navy); color: white; border-color: var(--navy); }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 10px; }
.search-row input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  padding: 11px 12px;
  outline: none;
}
.search-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(197,154,71,.14); }
.share-main {
  border: 0;
  border-radius: 13px;
  background: var(--navy);
  color: white;
  padding: 10px 16px;
  font-weight: 700;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin: 16px 2px 8px;
  color: var(--muted);
  font-size: 12px;
}
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; }
.dot-gold { background: var(--gold); }
.dot-blue { background: var(--blue); }

.timeline {
  position: relative;
  margin-top: 10px;
  padding-left: 26px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 16px;
  width: 1px;
  background: var(--line);
}
.event {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 12px;
  overflow: visible;
  box-shadow: 0 5px 18px rgba(20, 41, 56, .04);
}
.event::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 24px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--gold);
  z-index: 3;
}
.event.thematic::before { border-color: var(--blue); }
.event-toggle {
  display: grid;
  grid-template-columns: 66px 1fr 20px;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 16px;
  align-items: start;
}
.event-year {
  color: var(--gold);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}
.event.thematic .event-year { color: var(--navy-2); }
.event-title {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
}
.event-teaser { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.chev { color: var(--muted); font-size: 22px; line-height: 1; transition: transform .2s ease; }
.event.open .chev { transform: rotate(180deg); }
.event-body {
  display: none;
  border-top: 1px solid var(--line);
  padding: 0 16px 18px 92px;
}
.event.open .event-body { display: block; animation: reveal .18s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.status-badge {
  display: inline-flex;
  margin-top: 14px;
  background: var(--gold-soft);
  color: #624c1d;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
}
.event.thematic .status-badge { background: #e9f0f5; color: #365269; }
.section-label {
  margin-top: 17px;
  color: #9a7025;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 14px;
  font-weight: 700;
}
.event-body p { margin: 6px 0 0; font-size: 14px; line-height: 1.65; }
.quote {
  margin-top: 12px;
  border-left: 3px solid var(--gold);
  padding: 2px 0 2px 12px;
  font-family: "Libre Baskerville", Georgia, serif;
  font-style: italic;
  line-height: 1.6;
  color: #39434c;
}
.source {
  margin-top: 15px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.source a { color: var(--navy-2); }
.event-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.event-share,
.source-link {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.empty-state { padding: 38px 10px; text-align: center; color: var(--muted); }
.closing-card { margin-top: 18px; padding: 26px 20px; text-align: center; }
.closing-kicker { font-family: "Libre Baskerville", Georgia, serif; font-size: 23px; font-weight: 700; color: var(--navy); }
.closing-card p { margin: 10px auto 0; max-width: 560px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.share-wide { margin-top: 16px; border-radius: 999px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  background: #061b30;
  color: white;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .wrap { width: min(100% - 20px, 820px); }
  .hero { padding: 44px 0 42px; }
  .hero-copy { font-size: 14px; }
  .controls { top: 6px; }
  .timeline { padding-left: 22px; }
  .timeline::before { left: 6px; }
  .event::before { left: -21px; }
  .event-toggle { grid-template-columns: 54px 1fr 18px; padding: 14px 13px; gap: 8px; }
  .event-year { font-size: 15px; }
  .event-title { font-size: 15px; }
  .event-body { padding: 0 13px 16px; }
  .legend { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
