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

:root {
  --bg: #0a0a0a;
  --bg-subtle: #111;
  --text: #e8e4df;
  --text-dim: #8a8580;
  --accent: #c9a84c;
  --accent-dim: #8a7535;
  --bar-bg: #1a1a1a;
  --bar-fill: #c9a84c;
  --bar-fill-highlight: #e2c36b;
  --timeline-line: #333;
  --sans: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Shared Layout ---- */

.section {
  padding: 6rem 1.5rem;
  max-width: 52rem;
  margin: 0 auto;
}

.section + .section {
  border-top: 1px solid var(--timeline-line);
}

/* ---- Section 1: The Opening ---- */

.opening {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 1.5rem;
  border-top: none;
}

.opening + .section {
  border-top: none;
}

.opening h1 {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.opening .dates {
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.opening .tagline {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  max-width: 28rem;
}

.opening .grave {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--text-dim);
  opacity: 0.6;
  margin-bottom: 4rem;
}

.opening .epigraph {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-dim);
  max-width: 36rem;
  line-height: 1.8;
}

.opening .epigraph .attribution {
  display: block;
  margin-top: 1rem;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--accent-dim);
}

/* ---- Section 2: The Numbers ---- */

.numbers h2,
.timeline-section h2,
.music-section h2,
.words-section h2,
.closing h2 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 1rem;
  color: var(--text);
}

.numbers .subtitle,
.timeline-section .subtitle,
.music-section .subtitle {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 3rem;
}

.chart {
  margin-bottom: 3rem;
}

.chart-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.bar-label {
  width: 7rem;
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: right;
  padding-right: 1rem;
}

.bar-track {
  flex: 1;
  background: var(--bar-bg);
  height: 2rem;
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--bar-fill);
  border-radius: 2px;
  display: flex;
  align-items: center;
  padding-left: 0.6rem;
  min-width: 2.5rem;
  transition: width 0.8s ease;
}

.bar-fill.highlight {
  background: var(--bar-fill-highlight);
}

.bar-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bg);
  white-space: nowrap;
}

.bar-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.chart-caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--accent);
  text-align: center;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

/* ---- Section 3: The Timeline ---- */

.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--timeline-line);
}

.timeline-entry {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 1.5rem;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -2.05rem;
  top: 0.4rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-entry:last-child::before {
  background: var(--text);
  box-shadow: 0 0 0 3px rgba(232, 228, 223, 0.2);
}

.timeline-age {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.timeline-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.timeline-title a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--timeline-line);
  transition: border-color 0.2s;
}

.timeline-title a:hover {
  border-color: var(--accent);
}

.timeline-detail {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 38rem;
}

/* ---- Section 4: The Music ---- */

.music-entry {
  margin-bottom: 4rem;
}

.music-entry:last-child {
  margin-bottom: 0;
}

.music-entry h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.music-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.music-context {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  max-width: 42rem;
}

.embed-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: var(--bar-bg);
  border-radius: 4px;
}

.embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- Section 5: The Words ---- */

.quote-block {
  margin-bottom: 3rem;
}

.quote-block:last-child {
  margin-bottom: 0;
}

.quote-text {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 0.75rem;
  max-width: 40rem;
}

.quote-text::before {
  content: '\201C';
  color: var(--accent-dim);
}

.quote-text::after {
  content: '\201D';
  color: var(--accent-dim);
}

.quote-attribution {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

.quote-role {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 400;
}

/* ---- Section 6: The Closing ---- */

.closing {
  text-align: center;
}

.closing p {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--text-dim);
  line-height: 1.8;
  max-width: 34rem;
  margin: 0 auto 1.5rem;
}

.closing .coda {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--accent);
  margin-top: 3rem;
  margin-bottom: 0;
}

.lacrimosa {
  margin-top: 4rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.lacrimosa-context {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 1.25rem;
}

/* ---- Footer ---- */

.site-footer {
  text-align: center;
  padding: 3rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--timeline-line);
  max-width: 52rem;
  margin: 0 auto;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .section {
    padding: 4rem 1.25rem;
  }

  .opening h1 {
    font-size: 2.2rem;
  }

  .opening .tagline {
    font-size: 1.15rem;
  }

  .bar-label {
    width: 5.5rem;
    font-size: 0.8rem;
  }

  .timeline {
    padding-left: 2rem;
  }

  .timeline-entry {
    padding-left: 1rem;
  }

  .quote-text {
    font-size: 1.15rem;
  }
}
