:root {
  --bg: #f3f1ee;
  --surface: #fffdf9;
  --surface-strong: #ffffff;
  --ink: #1e1f24;
  --muted: #5e6169;
  --line: #d9d2ca;
  --brand: #ff0059;
  --brand-soft: rgba(255, 0, 89, 0.1);
  --accent: #1b5c52;
  --shadow: 0 18px 40px rgba(30, 31, 36, 0.08);
  --max: 1180px;
  --radius: 24px;
  --font-display: "Arial Narrow", "Trebuchet MS", sans-serif;
  --font-body: "Verdana", "Geneva", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 0, 89, 0.08), transparent 28%),
    linear-gradient(180deg, #f7f4f0 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-color: rgba(27, 92, 82, 0.35);
  text-underline-offset: 0.16em;
}

img {
  max-width: 100%;
}

.site-shell {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(243, 241, 238, 0.9);
  border-bottom: 1px solid rgba(217, 210, 202, 0.8);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}

.brand {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand span {
  color: var(--brand);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav a {
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
}

.hero {
  padding: 4.5rem 0 3rem;
}

.hero-panel {
  display: grid;
  gap: 1.5rem;
  padding: 2.5rem;
  border: 1px solid rgba(217, 210, 202, 0.9);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(135deg, rgba(255, 0, 89, 0.08), rgba(255, 255, 255, 0.88)),
    var(--surface-strong);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

h1 {
  max-width: 13ch;
  font-size: clamp(3.5rem, 9vw, 6.6rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
}

h3 {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.hero-copy {
  max-width: 74ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-grid,
.section-grid {
  display: grid;
  gap: 1.25rem;
}

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

.info-card,
.article-card,
.sidebar-card,
.definition-card,
.citation-card {
  padding: 1.25rem;
  border: 1px solid rgba(217, 210, 202, 0.9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.info-card strong,
.definition-card strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.section {
  padding: 0 0 3rem;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-header p,
.lede,
.article-body p,
.article-body li,
.citation-card,
.footer-copy {
  color: var(--muted);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}

.article-card {
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}

.article-card:hover,
.article-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255, 0, 89, 0.35);
}

.article-card p {
  margin-bottom: 0;
}

.kicker {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.1rem 0.72rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  align-items: start;
}

.article-body {
  display: grid;
  gap: 1.5rem;
}

.article-body section {
  padding: 1.5rem;
  border: 1px solid rgba(217, 210, 202, 0.9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.support-article > section:nth-last-child(3) {
  order: 3;
}

.support-article > section:nth-last-child(2) {
  order: 2;
}

.support-article > section:last-child {
  order: 1;
}

.support-article > section:last-child .article-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.support-article > section:last-child .article-card {
  position: relative;
  min-height: 100%;
  padding: 1.35rem 1.45rem;
  overflow-wrap: anywhere;
}

.support-article > section:last-child .article-card:first-child::before,
.support-article > section:last-child .article-card:last-child::after {
  position: absolute;
  top: 1.2rem;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink);
}

.support-article > section:last-child .article-card:first-child::before {
  content: "\2190";
  left: 1rem;
}

.support-article > section:last-child .article-card:last-child::after {
  content: "\2192";
  right: 1rem;
}

.support-article > section:last-child .article-card h3 {
  margin-top: 0.65rem;
}

.support-article > section:last-child .article-card:last-child {
  text-align: right;
}

.support-article > section:nth-last-child(3) .article-grid,
.support-article > section:nth-last-child(2) .article-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.next-article-grid {
  grid-template-columns: minmax(0, 360px);
  justify-content: end;
}

.next-article-grid .article-card {
  text-align: right;
}

@media (max-width: 900px) {
  .support-article > section:last-child .article-grid {
    grid-template-columns: 1fr;
  }

  .support-article > section:last-child .article-card:last-child {
    text-align: right;
  }

  .support-article > section:last-child .article-card:last-child::after {
    right: 1rem;
    left: auto;
  }

  .support-article > section:last-child .article-card h3 {
    margin-left: 1.4rem;
    margin-right: 1.4rem;
  }

  .next-article-grid {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
}

.article-body ul {
  padding-left: 1.2rem;
  margin: 0.6rem 0 0;
}

.article-body .subsection-block + .subsection-block {
  margin-top: 1rem;
}

.sidebar {
  display: grid;
  gap: 1rem;
}

.sidebar-card h3 {
  margin-bottom: 0.8rem;
}

.sidebar-list,
.term-list {
  display: grid;
  gap: 0.7rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-list a,
.term-list a {
  color: var(--ink);
  text-decoration: none;
}

.sidebar-list small,
.term-list small,
.meta-list dd,
.meta-list li {
  color: var(--muted);
}

.meta-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.meta-list div {
  display: grid;
  gap: 0.2rem;
}

.meta-list dt {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
}

.meta-list dd {
  margin: 0;
}

.reference-list {
  display: grid;
  gap: 0.9rem;
}

.reference-list a {
  color: var(--accent);
}

.article-figure {
  margin: 1rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.article-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid rgba(217, 210, 202, 0.9);
  border-radius: calc(var(--radius) - 8px);
  background: var(--surface-strong);
}

.article-figure figcaption {
  color: var(--muted);
  font-size: 0.95rem;
}

.timeline-page {
  gap: 1.25rem;
}

.timeline-era h2 {
  margin-bottom: 1rem;
}

.timeline-list {
  position: relative;
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0 0 0 2.6rem;
  list-style: none;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: 0.95rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(27, 92, 82, 0.25), rgba(27, 92, 82, 0.6));
}

.timeline-item {
  position: relative;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(217, 210, 202, 0.9);
  border-radius: calc(var(--radius) - 8px);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 1.2rem;
  left: -1.95rem;
  width: 0.95rem;
  height: 0.95rem;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--surface-strong);
  box-shadow: 0 0 0 4px rgba(27, 92, 82, 0.12);
}

.timeline-date {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.timeline-item h3 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.1rem, 1.9vw, 1.35rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.timeline-item p {
  margin: 0;
}

.timeline-source {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.timeline-source span {
  color: var(--ink);
  font-weight: 700;
}

.timeline-event-figure {
  margin: 0.8rem 0 0;
  display: grid;
  gap: 0.5rem;
}

.timeline-event-figure img {
  border: 1px solid rgba(217, 210, 202, 0.9);
  border-radius: calc(var(--radius) - 12px);
  width: 100%;
  height: auto;
  display: block;
}

.timeline-event-figure figcaption {
  font-size: 0.9rem;
  color: var(--muted);
}

.footer {
  padding: 2.5rem 0 3rem;
}

.footer-panel {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid rgba(217, 210, 202, 0.9);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.85rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(27, 92, 82, 0.07);
}

.data-note {
  margin-top: 0.85rem;
  font-size: 0.94rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    align-items: flex-start;
    padding: 1rem 0;
  }
}

@media (max-width: 720px) {
  .hero-panel,
  .article-body section,
  .info-card,
  .article-card,
  .sidebar-card,
  .definition-card,
  .citation-card {
    padding: 1rem;
    border-radius: 18px;
  }

  h1 {
    max-width: 9ch;
  }

  .hero {
    padding-top: 2.5rem;
  }

  .timeline-list {
    padding-left: 2.15rem;
  }

  .timeline-list::before {
    left: 0.72rem;
  }

  .timeline-item::before {
    left: -1.58rem;
  }
}
