/* =========================
   THEME + RESETS
   ========================= */
   :root {
    --bg: #0c0c0f;
    --panel: #15161a;
    --text: #e9e9ef;
    --muted: #a9a9b7;
    --accent: #ffb84d;
    --green: #10a37f;
    --blue: #4b84ff;
    --orange: #ff7a1a;
    --red: #e5534b;
  }
  
  * { box-sizing: border-box; }
  html, body { height: 100%; }
  html { scroll-behavior: smooth; }
  
  body {
    margin: 0;
    background: #000; /* true black hero background */
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
  a { color: inherit; text-decoration: none; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  
  @media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  }
  
  /* =========================
     CONTAINER + LEDE
     ========================= */
  .wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: clamp(16px, 4vw, 28px);
  }
  .lede {
    font-size: clamp(16px, 2.2vw, 18px);
    line-height: 1.6;
    margin: 6px 0 22px;
    color: var(--text);
  }

  /* Dropcap for the first paragraph */
.dropcap {
  position: relative;
  max-width: 70ch;            /* comfy reading width */
  margin-inline: auto;        /* center on wide screens */
}

.dropcap::first-letter {
  float: left;
  font-weight: 800;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  font-size: clamp(44px, 10vw, 120px);     /* big on desktop, sane on mobile */
  line-height: 0.85;                        /* tighten letter box */
  margin-right: 0.18em;                     /* space between W and copy */
  margin-top: 0.08em;                       /* drop a touch */
  letter-spacing: -0.02em;

  /* gradient ink like your H1 */
  color: transparent;
  background: linear-gradient(180deg, #fff, #f5c48e 55%, #e9ae73);
  -webkit-background-clip: text;
  background-clip: text;

  /* subtle glow so it “sits” on black */
  text-shadow: 0 6px 28px rgba(255, 184, 77, 0.08);
}

/* Tweak paragraph body to balance around the drop cap */
.dropcap {
  text-wrap: pretty;
}

/* On very small phones, shrink the cap a touch more */
@media (max-width: 420px) {
  .dropcap::first-letter { font-size: clamp(38px, 12vw, 64px); margin-right: 0.16em; }
}

  
  /* =========================
     HERO (desktop split / mobile stacked)
     ========================= */
/* Full-bleed wrapper */
.hero-outer {
  width: 100vw;
  margin-left: calc(50% - 50vw); /* make it span edge-to-edge even inside a centered layout */
  background: #000;
  /* optional divider:
  border-bottom: 2px solid #f5c48e;
  */
}

/* Inner grid: image ~32%, text ~68% on wide screens */
.hero {
  display: grid;
  grid-template-columns: minmax(280px, 32vw) 1fr;
  grid-template-areas: "media text";
  align-items: center;
  gap: clamp(16px, 4vw, 48px);
  padding: clamp(24px, 6vw, 96px) clamp(20px, 5vw, 80px);
  max-width: min(1600px, 100%);
  margin: 0 auto;
}

.cover-image {
  grid-area: media;
  width: 100%;
  height: auto;
  max-height: min(70vh, 760px);
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}

.hero-text {
  grid-area: text;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(12px, 2vw, 18px);
  max-width: none; /* let text breathe */
}

.hero-text h1 {
  margin: 0;
  line-height: 0.95;
  font-weight: 800;
  font-size: clamp(44px, 9vw, 120px);
  letter-spacing: -0.02em;
  color: transparent;
  background: linear-gradient(180deg, #ffffff, #f5c48e 55%, #e9ae73);
  -webkit-background-clip: text;
  background-clip: text;
  text-wrap: balance; /* nicer breaks (supported in modern browsers) */
}

.subtitle {
  margin: 0;
  font-size: clamp(18px, 2.8vw, 32px);
  line-height: 1.25;
  color: #f5c48e;
}

.arrow {
  display: inline-block;
  font-size: clamp(20px, 4.5vw, 28px);
  margin-top: 8px;
  color: #f5c48e;
}

.hero-outer {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: #000;
  border-bottom: 4px solid #f5c48e; /* underline */
}


/* Mobile */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "text"
      "media"; /* put text first on mobile */
    gap: 18px;
    padding: clamp(24px, 8vw, 40px) 6vw;
  }

  .cover-image {
    display: none;
    aspect-ratio: 16 / 10;
  }

  .hero-text h1 {
    font-size: clamp(34px, 10vw, 64px);
    text-wrap: balance;
  }

  .subtitle {
    font-size: clamp(16px, 4.2vw, 22px);
  }
}

  /* =========================
     SECTIONS / CARDS
     ========================= */
  .section {
    background: var(--panel);
    border: 1px solid #1e2026;
    border-radius: 16px;
    padding: clamp(14px, 3.5vw, 20px);
    margin: clamp(14px, 3.5vw, 26px) 0;
    box-shadow: 0 8px 28px rgba(0,0,0,.25);
  }
  .section h2 {
    font-size: clamp(18px, 2.6vw, 22px);
    margin: 4px 2px 12px;
    color: var(--accent);
  }
  
  /* =========================
     CONTROLS
     ========================= */
  .controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 6px 2px 12px;
  }
  .pill {
    background: #0f1014;
    border: 1px solid #24262d;
    border-radius: 999px;
    padding: 8px 10px;
    color: var(--muted);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  select, input[type="checkbox"] { accent-color: var(--accent); }
  select {
    background: transparent;
    color: var(--text);
    border: 1px solid #2a2d35;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 14px;
  }
  @media (max-width: 560px) {
    .controls { flex-direction: column; align-items: stretch; }
    .pill { justify-content: space-between; }
    select { width: 100%; }
  }
  
  /* =========================
     CHARTS (reliable sizing)
     ========================= */
  .chart-wrap {
    position: relative;
    background: #121217;
    border: 1px solid #1c1d22;
    border-radius: 12px;
    padding: 8px;
    /* desktop defaults restored below; mobile overrides later */
  }
  .chart-wrap canvas {
    width: 100% !important;
    height: auto !important;   /* desktop default */
    max-height: 440px;         /* your original cap */
    display: block;
    border-radius: 8px;
  }
  
  /* Mobile: tall enough to read labels, prevents 0px canvases */
  @media (max-width: 820px) {
    .chart-wrap { min-height: 56vh; }
    .chart-wrap canvas {
      height: 100% !important;
      max-height: none;
    }
  }
  
  /* Optional: medium screens get a gentle bump */
  @media (min-width: 821px) and (max-width: 1080px) {
    .chart-wrap canvas { max-height: 500px; }
  }
  
  /* =========================
     CAPTIONS + TAKEAWAYS
     ========================= */
  .caption {
    color: var(--muted);
    font-size: clamp(12px, 2.6vw, 14px);
    line-height: 1.5;
    margin: 10px 4px 2px;
  }
  .takeaways {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 10px 4px 6px;
  }
  .takeaways div {
    background: #0f1014;
    border: 1px dashed #262833;
    color: var(--muted);
    border-radius: 10px;
    padding: 10px;
  }
  @media (min-width: 720px) {
    .takeaways { grid-template-columns: repeat(2, 1fr); }
  }
  
  /* =========================
     CREDITS / FOOTER
     ========================= */
  .credits {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    margin: 22px 0 calc(40px + env(safe-area-inset-bottom));
    opacity: .9;
  }
  
  /* =========================
     MISC POLISH
     ========================= */
  .section + .section { scroll-margin-top: 16px; }
  hr { border: 0; height: 1px; background: #23242a; margin: 24px 0; }

  /* Mobile: slightly shorter height for Sections 2–4 only */
@media (max-width: 820px) {
  #stanford-numbers .chart-wrap { min-height: 46vh; }
  #pre-post         .chart-wrap { min-height: 42vh; }
  #future           .chart-wrap { min-height: 42vh; }

  /* keep canvases filling their wrappers */
  #stanford-numbers .chart-wrap canvas,
  #pre-post         .chart-wrap canvas,
  #future           .chart-wrap canvas {
    height: 100% !important;
    max-height: none;
  }
}

/* Optional: extra-small phones */
@media (max-width: 380px) {
  #stanford-numbers .chart-wrap { min-height: 42vh; }
  #pre-post         .chart-wrap { min-height: 38vh; }
  #future           .chart-wrap { min-height: 38vh; }
}

/* =========================
   Consistent reading width
   ========================= */
   :root { --measure: 85ch; } /* sweet spot for readability */

   /* Apply the measure to text blocks */
   .lede,
   .section h2,
   .caption {
     max-width: var(--measure);
     margin-left: auto;
     margin-right: auto;
     padding-inline: clamp(8px, 2vw, 12px); /* tiny side padding so it never kisses edges */
   }
   
   /* Dropcap paragraph uses same measure */
   .lede.dropcap { max-width: var(--measure); }
   
   /* Optional: make charts align visually by centering captions/titles,
      but keep chart canvases full width inside the wrap */
   .section .chart-wrap { margin-inline: auto; }
   
   /* On small screens, just use the viewport width (measure is handled naturally) */
   @media (max-width: 820px) {
     .lede, .section h2, .caption { max-width: 100%; }
   }

   
   
   
