:root {
  color-scheme: light;
  --ink: #0d1117;
  --ink-soft: #222b36;
  --paper: #f9f6f2;
  --paper-strong: #ffffff;
  --accent: #f05a28;
  --accent-2: #00796b;
  --accent-3: #1a4d8f;
  --muted: #6c727f;
  --border: rgba(13, 17, 23, 0.08);
  --shadow: 0 24px 60px rgba(12, 16, 21, 0.12);
  --glow: 0 0 40px rgba(240, 90, 40, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  letter-spacing: 0.3px;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-orbit {
  position: fixed;
  inset: -30% 15% auto 15%;
  height: 420px;
  background: radial-gradient(circle at 20% 20%, rgba(240, 90, 40, 0.2), transparent 60%),
              radial-gradient(circle at 80% 30%, rgba(0, 121, 107, 0.18), transparent 55%),
              radial-gradient(circle at 50% 80%, rgba(26, 77, 143, 0.2), transparent 65%);
  filter: blur(10px);
  z-index: -2;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(13, 17, 23, 0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(13, 17, 23, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.35;
  z-index: -3;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 64px;
  position: sticky;
  top: 0;
  background: rgba(249, 246, 242, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: 10px;
  letter-spacing: 2px;
  font-size: 12px;
}

.brand-title {
  font-weight: 600;
  font-size: 18px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.nav-link {
  position: relative;
  padding-bottom: 6px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  gap: 12px;
}

button {
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.primary {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--glow);
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 999px;
}

main {
  padding: 40px 64px 80px;
}

.route {
  display: none;
  animation: fadeUp 0.5s ease;
}

.route.active {
  display: block;
}

.api-down {
  position: fixed;
  inset: 0;
  background: rgba(249, 246, 242, 0.96);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 24px;
}

.api-down.hidden {
  display: none;
}

.api-down-card {
  max-width: 620px;
  width: 100%;
  background: var(--paper-strong);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 32px;
  text-align: center;
}

.api-down-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 36px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  color: var(--muted);
}

.lead {
  font-size: 18px;
  color: var(--ink-soft);
  margin: 16px 0 24px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

.hero-card {
  background: var(--paper-strong);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chip {
  background: rgba(0, 121, 107, 0.15);
  color: var(--accent-2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.hero-card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.hero-card-tags span {
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.section-title {
  margin: 64px 0 24px;
}

.section-title h2 {
  font-size: 32px;
}

.section-title p {
  color: var(--muted);
}

.search-panel {
  background: var(--paper-strong);
  border-radius: 24px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.search-box {
  display: grid;
  grid-template-columns: 1fr 180px 140px;
  gap: 12px;
  margin-top: 20px;
}

.search-box input,
.search-box select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
}

.results {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.result-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-card small {
  color: var(--muted);
}

.result-title {
  display: inline-block;
  font-weight: 600;
  color: var(--ink);
}

.result-title:hover {
  color: var(--accent-3);
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.browse {
  margin-top: 64px;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.index-card {
  background: var(--paper-strong);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 20px;
  min-height: 180px;
}

.index-more {
  margin-top: 12px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip-list button {
  background: rgba(13, 17, 23, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
}

.about {
  margin-top: 64px;
}

.directory {
  margin-top: 64px;
}

.directory-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.about-card {
  background: var(--paper-strong);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--border);
}

.report-header {
  display: grid;
  grid-template-columns: 120px 1fr 200px;
  gap: 20px;
  align-items: center;
  margin-bottom: 32px;
}

.report-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.report-tags span {
  background: rgba(240, 90, 40, 0.12);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.report-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.report-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.report-card {
  background: var(--paper-strong);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--border);
}

.report-summary-card {
  grid-column: 1 / -1;
}

.report-highlights {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.report-highlight {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px 14px;
}

.report-highlight .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.report-highlight .value {
  font-size: 16px;
  font-weight: 600;
  margin-top: 6px;
}

.similar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  vertical-align: middle;
}

.similar-link::before {
  content: "\2197";
  font-size: 10px;
  line-height: 1;
}

.similar-link:hover {
  border-color: var(--accent-3);
}

.report-narrative-card {
  margin-top: 20px;
}

.report-summary p {
  margin-bottom: 10px;
}

.report-cause {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.report-cause h4 {
  margin: 0 0 8px;
}

.narrative-heading {
  margin: 18px 0 8px;
  font-size: 14px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent-2);
}

.rich-text p {
  margin-bottom: 12px;
  font-size: 15px;
}

.rich-text a {
  color: var(--accent-3);
  text-decoration: underline;
}

.report-facts {
  display: grid;
  gap: 10px;
}

.fact {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.report-meta-small {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.report-links a {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  color: var(--accent-3);
  font-size: 13px;
}

.report-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-links a {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
}

.report-links a:hover {
  border-color: var(--accent-3);
}

.sequence-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.sequence-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.sequence-step {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.sequence-event {
  margin-top: 4px;
  font-weight: 600;
}

.sequence-phase {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.hidden {
  display: none;
}

mark {
  background: rgba(240, 90, 40, 0.25);
  color: inherit;
  padding: 0 2px;
  border-radius: 4px;
}

.report-links-card {
  padding: 14px 16px;
}

.report-sections {
  margin-top: 36px;
}

.section-block {
  background: var(--paper-strong);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.section-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.section-block th,
.section-block td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}

.site-footer {
  padding: 40px 64px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    gap: 16px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  main {
    padding: 32px 24px 60px;
  }

  #home {
    display: flex;
    flex-direction: column;
  }

  .search-panel {
    order: -1;
    margin-top: 0;
  }

  .search-box {
    grid-template-columns: 1fr;
  }

  .report-header {
    grid-template-columns: 1fr;
  }

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

  .report-actions {
    display: flex;
    gap: 10px;
  }

  .site-footer {
    flex-direction: column;
    gap: 12px;
  }
}
