/* Global Demographic Institute — static site */

:root {
  --bg: #0d0d0d;
  --yellow: #f4e540;
  --logo-yellow: #d4c84a;
  --olive: #7a7a6a;
  --cream: #e8e2d0;
  --grid: #2a2a2a;
  --muted: #5a5a4e;
  --font-sans: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
  --pad-x: clamp(1.25rem, 4vw, 3.5rem);
  --header-h: 4.5rem;
  --max: 1400px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  display: block;
}

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

a:hover {
  color: var(--yellow);
}

/* ——— Header ——— */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem var(--pad-x);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-link img {
  height: clamp(36px, 4.2vw, 48px);
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive);
}

.nav-links a {
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

.nav-links a[aria-current="page"] {
  color: var(--cream);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--cream);
}

.nav-links a:hover {
  color: var(--cream);
}

/* ——— Main / Hero (slide 2) ——— */

main {
  flex: 1;
  width: 100%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vh, 3rem) var(--pad-x) 1.5rem;
  min-height: calc(100vh - var(--header-h) - 5rem);
}

.hero-copy {
  padding-top: clamp(0.5rem, 2vh, 1.5rem);
  max-width: 28rem;
  animation: fade-up 0.7s ease both;
}

.hero-title {
  margin: 0 0 1.75rem;
  font-size: clamp(2.15rem, 4.6vw, 3.65rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--olive);
}

.hero-title .accent {
  color: var(--yellow);
}

.hero-lede {
  margin: 0;
  font-size: clamp(0.95rem, 1.35vw, 1.08rem);
  line-height: 1.65;
  color: var(--cream);
  max-width: 22rem;
}

.hero-chart {
  position: relative;
  min-height: 320px;
  animation: fade-in 0.9s 0.15s ease both;
}

.chart-frame {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  max-height: min(62vh, 560px);
}

.source-note {
  margin: 0.25rem auto 2.25rem;
  max-width: var(--max);
  padding-inline: var(--pad-x);
  font-family: var(--font-mono);
  font-size: clamp(0.58rem, 0.85vw, 0.68rem);
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--muted);
  animation: fade-in 0.8s 0.35s ease both;
}

/* ——— About ——— */

.about-page {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5rem) var(--pad-x) 4rem;
  animation: fade-up 0.65s ease both;
}

.about-page--manifesto {
  max-width: min(52rem, 100%);
  min-height: calc(100vh - var(--header-h) - 5.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(3rem, 10vh, 6.5rem);
}

.about-kicker {
  margin: 0 0 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--olive);
}

.about-lead {
  margin: 0 0 clamp(2rem, 5vh, 3.25rem);
  max-width: 28rem;
  font-size: clamp(1.85rem, 4.2vw, 3.15rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--olive);
}

.about-accent {
  color: var(--yellow);
}

.about-body {
  margin: 0 0 clamp(2.5rem, 6vh, 4rem);
  max-width: 36rem;
  font-size: clamp(1.05rem, 1.55vw, 1.28rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--cream);
}

.about-accent-soft {
  color: var(--yellow);
  font-weight: 500;
}

.about-punch {
  margin: 0;
  max-width: 14rem;
  font-size: clamp(2.4rem, 5.5vw, 4.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--cream);
}

.about-punch-accent {
  color: var(--yellow);
}

.about-page h1 {
  margin: 0 0 2.25rem;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--cream);
}

.about-page p {
  margin: 0 0 1.35rem;
}

@media (max-width: 700px) {
  .about-lead {
    max-width: none;
  }

  .about-punch {
    max-width: none;
  }
}

/* ——— Footer ——— */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.35rem var(--pad-x) 1.6rem;
  border-top: 1px solid #1a1a1a;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--olive);
}

.site-footer a {
  color: var(--olive);
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--yellow);
}

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

/* ——— Motion ——— */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy,
  .hero-chart,
  .source-note,
  .about-page {
    animation: none;
  }

  .chart-line-hist,
  .chart-line-proj,
  .chart-line-ext {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
    animation: none !important;
  }
}

/* ——— Responsive ——— */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 2rem;
    padding-top: 1.5rem;
  }

  .hero-copy {
    max-width: none;
    padding-top: 0;
  }

  .hero-lede {
    max-width: 36rem;
  }

  .chart-frame {
    max-height: none;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-block: 0.9rem;
  }

  .logo-link img {
    height: 32px;
  }

  .nav-links {
    gap: 1rem;
    font-size: 0.65rem;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
