:root {
  --bg: #081119;
  --bg-2: #111d28;
  --bg-base: #040a11;
  --panel: rgba(10, 18, 28, 0.76);
  --panel-strong: rgba(11, 19, 30, 0.92);
  --panel-grad-a: rgba(17, 28, 41, 0.92);
  --panel-grad-b: rgba(8, 15, 24, 0.82);
  --line: rgba(170, 224, 255, 0.14);
  --ink: #eef6ff;
  --muted: #9ab5cc;
  --accent: #ff8f43;
  --accent-2: #61e0ff;
  --accent-3: #ffe16b;
  --hero-glow: rgba(97, 224, 255, 0.18);
  --grid-line: rgba(255, 255, 255, 0.03);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.08);
  --track: rgba(255, 255, 255, 0.04);
  --thumb-a: rgba(97, 224, 255, 0.7);
  --thumb-b: rgba(255, 143, 67, 0.7);
  --focus-ring: rgba(97, 224, 255, 0.16);
  --button-ink: #081119;
  --primary-button-a: #ff9247;
  --primary-button-b: #ffb74f;
  --primary-button-shadow: rgba(255, 143, 67, 0.3);
  --accent-soft: #b4f7ff;
  --accent-warm-soft: #fff0a0;
  --accent-chip-soft: #9ff0ff;
  --input-placeholder: #7f9bb4;
  --hover-line: rgba(97, 224, 255, 0.26);
  --selected-surface-a: rgba(97, 224, 255, 0.1);
  --selected-surface-b: rgba(255, 255, 255, 0.04);
  --timeline-line-a: rgba(255, 143, 67, 0.6);
  --timeline-line-b: rgba(97, 224, 255, 0.55);
  --card-grad-a: rgba(23, 35, 49, 0.96);
  --card-grad-b: rgba(10, 18, 28, 0.92);
  --card-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  --card-shadow-hover: 0 26px 46px rgba(0, 0, 0, 0.28);
  --card-ring: rgba(8, 17, 25, 0.95);
  --ring-line-a: rgba(97, 224, 255, 0.18);
  --ring-line-b: rgba(255, 143, 67, 0.26);
  --ring-core-a: rgba(255, 225, 107, 0.9);
  --ring-core-b: rgba(255, 143, 67, 0.2);
  --ring-core-line: rgba(255, 225, 107, 0.3);
  --ring-core-shadow: rgba(255, 143, 67, 0.35);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

[data-theme="light"] {
  --bg: #edf3f8;
  --bg-2: #dbe7f0;
  --bg-base: #f8fbfd;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.95);
  --panel-grad-a: rgba(255, 255, 255, 0.96);
  --panel-grad-b: rgba(241, 247, 251, 0.9);
  --line: rgba(46, 81, 110, 0.14);
  --ink: #12202d;
  --muted: #506578;
  --accent: #d86b28;
  --accent-2: #1f8fb1;
  --accent-3: #d4a11f;
  --hero-glow: rgba(31, 143, 177, 0.14);
  --grid-line: rgba(41, 74, 101, 0.06);
  --surface: rgba(18, 32, 45, 0.04);
  --surface-2: rgba(18, 32, 45, 0.06);
  --surface-3: rgba(18, 32, 45, 0.1);
  --track: rgba(18, 32, 45, 0.08);
  --thumb-a: rgba(31, 143, 177, 0.75);
  --thumb-b: rgba(216, 107, 40, 0.72);
  --focus-ring: rgba(31, 143, 177, 0.18);
  --button-ink: #ffffff;
  --primary-button-a: #1f8fb1;
  --primary-button-b: #59b7d4;
  --primary-button-shadow: rgba(31, 143, 177, 0.22);
  --accent-soft: #d6f4fb;
  --accent-warm-soft: #f6e4ae;
  --accent-chip-soft: #d7f0f6;
  --input-placeholder: #6a8094;
  --hover-line: rgba(31, 143, 177, 0.3);
  --selected-surface-a: rgba(31, 143, 177, 0.12);
  --selected-surface-b: rgba(18, 32, 45, 0.02);
  --timeline-line-a: rgba(216, 107, 40, 0.58);
  --timeline-line-b: rgba(31, 143, 177, 0.48);
  --card-grad-a: rgba(255, 255, 255, 0.96);
  --card-grad-b: rgba(243, 248, 252, 0.94);
  --card-shadow: 0 12px 28px rgba(73, 101, 128, 0.12);
  --card-shadow-hover: 0 20px 38px rgba(73, 101, 128, 0.16);
  --card-ring: rgba(233, 242, 248, 0.96);
  --ring-line-a: rgba(31, 143, 177, 0.2);
  --ring-line-b: rgba(216, 107, 40, 0.26);
  --ring-core-a: rgba(212, 161, 31, 0.85);
  --ring-core-b: rgba(216, 107, 40, 0.12);
  --ring-core-line: rgba(212, 161, 31, 0.28);
  --ring-core-shadow: rgba(216, 107, 40, 0.22);
  --shadow: 0 24px 60px rgba(73, 101, 128, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 143, 67, 0.18), transparent 20%),
    radial-gradient(circle at 85% 12%, rgba(97, 224, 255, 0.18), transparent 22%),
    radial-gradient(circle at 60% 85%, rgba(255, 225, 107, 0.12), transparent 18%),
    linear-gradient(160deg, var(--bg-base) 0%, var(--bg) 42%, var(--bg-2) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 92%);
}

.page-shell {
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.panel-card {
  background:
    linear-gradient(180deg, var(--panel-grad-a), var(--panel-grad-b)),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-intro,
.hero-spotlight,
.control-dock,
.timeline-column,
.detail-card,
.legend-card {
  border-radius: 28px;
}

.hero-intro {
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.hero-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-switch,
.language-switch {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-3);
}

.theme-button,
.lang-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
}

.theme-button.active,
.lang-button.active {
  color: var(--button-ink);
  background: linear-gradient(135deg, var(--accent-2), var(--accent-soft));
}

.hero-intro::after {
  content: "";
  position: absolute;
  inset: auto auto -20% -10%;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--hero-glow), transparent 70%);
}

.hero-spotlight {
  padding: 26px;
  display: grid;
  gap: 20px;
}

.spotlight-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.spotlight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 18px;
  align-items: center;
}

.spotlight-year {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 800;
}

.spotlight-context {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 58ch;
}

.spotlight-rings {
  position: relative;
  height: 180px;
}

.spotlight-rings span {
  position: absolute;
  inset: 50%;
  border-radius: 999px;
  border: 1px solid var(--ring-line-a);
  transform: translate(-50%, -50%);
}

.spotlight-rings span:nth-child(1) {
  width: 180px;
  height: 180px;
}

.spotlight-rings span:nth-child(2) {
  width: 120px;
  height: 120px;
  border-color: var(--ring-line-b);
}

.spotlight-rings span:nth-child(3) {
  width: 48px;
  height: 48px;
  background: radial-gradient(circle, var(--ring-core-a), var(--ring-core-b));
  border-color: var(--ring-core-line);
  box-shadow: 0 0 30px var(--ring-core-shadow);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  line-height: 0.94;
}

h1 {
  font-size: clamp(3.4rem, 7vw, 6rem);
  max-width: 9ch;
}

h2 {
  font-size: clamp(2.2rem, 4.2vw, 3.5rem);
}

.hero-text,
.helper-text,
.results-count,
.timeline-card p,
.detail-body,
.detail-meta span,
.legend-card li,
.stat-card p {
  color: var(--muted);
}

.hero-text {
  margin: 18px 0 0;
  max-width: 58ch;
  line-height: 1.75;
  font-size: 1.02rem;
}

.hero-actions,
.search-row,
.mode-switch {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 28px;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease;
}

button:hover {
  transform: translateY(-2px);
}

.primary-button,
.secondary-button,
.mode-button {
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary-button-a), var(--primary-button-b));
  color: var(--button-ink);
  box-shadow: 0 14px 30px var(--primary-button-shadow);
}

.secondary-button {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--surface-3);
}

.compact-button {
  padding-inline: 16px;
}

.app-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 360px;
  gap: 18px;
}

.control-dock {
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--thumb-a) var(--track);
}

.control-dock::-webkit-scrollbar,
.insight-column::-webkit-scrollbar {
  width: 10px;
}

.control-dock::-webkit-scrollbar-track,
.insight-column::-webkit-scrollbar-track {
  background: var(--track);
  border-radius: 999px;
}

.control-dock::-webkit-scrollbar-thumb,
.insight-column::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--thumb-a), var(--thumb-b));
  border-radius: 999px;
}

.dock-block {
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface), var(--selected-surface-b));
  border: 1px solid var(--surface-2);
}

.dock-block-wide {
  padding-bottom: 18px;
}

.dock-filters {
  padding-bottom: 12px;
}

.filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filters-caption {
  font-size: 0.75rem;
  color: var(--muted);
}

.filters-scroll {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
  display: grid;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--thumb-a) var(--track);
}

.filters-scroll::-webkit-scrollbar {
  width: 10px;
}

.filters-scroll::-webkit-scrollbar-track {
  background: var(--track);
  border-radius: 999px;
}

.filters-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--thumb-a), var(--thumb-b));
  border-radius: 999px;
}

.filter-group {
  display: grid;
  gap: 10px;
}

.field-label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

#yearRange {
  width: 100%;
  accent-color: var(--accent);
}

.year-distance,
.timeline-years-ago {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--button-ink);
  background: linear-gradient(135deg, var(--accent-2), var(--accent-chip-soft));
}

.search-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--ink);
  border: 1px solid var(--surface-3);
  background: var(--surface-2);
}

.search-row input::placeholder {
  color: var(--input-placeholder);
}

.search-row input:focus,
#yearRange:focus,
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.helper-text {
  margin: 10px 0 0;
  font-size: 0.84rem;
}

.filter-stack {
  display: grid;
  gap: 9px;
}

.filter-pill {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.filter-pill:hover {
  transform: translateX(3px);
  border-color: var(--hover-line);
}

.filter-pill:has(input:checked) {
  background: linear-gradient(90deg, var(--selected-surface-a), var(--selected-surface-b));
}

.filter-pill input {
  accent-color: var(--accent);
}

.mode-switch {
  background: var(--surface);
  padding: 6px;
  border-radius: 999px;
}

.mode-button {
  background: transparent;
  color: var(--muted);
}

.mode-button.active {
  color: var(--button-ink);
  background: linear-gradient(135deg, var(--accent-3), var(--accent-warm-soft));
}

.timeline-column {
  min-width: 0;
  padding: 18px;
}

.timeline-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
  padding: 0 2px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 8px 4px 20px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 34px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--timeline-line-a), var(--timeline-line-b));
}

.timeline-card {
  position: relative;
  margin-left: 72px;
  padding: 20px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, var(--card-grad-a), var(--card-grad-b)),
    var(--panel-strong);
  border: 1px solid var(--surface-3);
  box-shadow: var(--card-shadow);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: -47px;
  top: 24px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--card-color, var(--accent));
  box-shadow: 0 0 0 8px var(--card-ring);
}

.timeline-card:hover,
.timeline-card.is-active {
  transform: translateX(6px);
  border-color: var(--hover-line);
  box-shadow: var(--card-shadow-hover);
}

.timeline-card h3 {
  font-size: clamp(1.9rem, 3vw, 2.35rem);
  margin-top: 10px;
}

.card-date-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.card-date-row strong {
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.timeline-image-wrap {
  margin-top: 14px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--surface-3);
  background: var(--surface);
}

.timeline-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.timeline-image-credit {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
}

.timeline-image-credit:hover {
  color: var(--accent-2);
}

.timeline-card p {
  margin: 10px 0 0;
  line-height: 1.65;
}

.timeline-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.timeline-meta span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.81rem;
  background: var(--surface-2);
  color: var(--ink);
}

.insight-column {
  display: grid;
  gap: 18px;
  align-content: start;
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--thumb-a) var(--track);
}

.detail-card,
.legend-card {
  padding: 22px;
}

.detail-card {
  min-height: 380px;
}

.detail-date {
  margin: 14px 0 0;
  color: var(--accent-3);
  font-weight: 800;
}

.detail-body {
  margin: 14px 0 0;
  line-height: 1.8;
}

.legend-card ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.stat-card {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--surface-3);
}

.stat-card strong {
  display: block;
  font-size: 1.8rem;
  font-family: "Cormorant Garamond", serif;
  margin-bottom: 4px;
}

@media (max-width: 1220px) {
  .hero-stage,
  .app-grid {
    grid-template-columns: 1fr;
  }

  .control-dock,
  .insight-column {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 16px, 1480px);
    padding-top: 12px;
  }

  .hero-intro,
  .hero-spotlight,
  .control-dock,
  .timeline-column,
  .detail-card,
  .legend-card {
    border-radius: 22px;
  }

  .hero-intro,
  .hero-spotlight,
  .timeline-column,
  .control-dock,
  .detail-card,
  .legend-card {
    padding: 18px;
  }

  .spotlight-grid {
    grid-template-columns: 1fr;
  }

  .spotlight-rings {
    height: 110px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .timeline::before {
    left: 22px;
  }

  .timeline-card {
    margin-left: 48px;
  }

  .timeline-card::before {
    left: -33px;
  }
}
