@import url("https://fonts.googleapis.com/css2?family=Funnel+Display:wght@300..800&family=Atkinson+Hyperlegible+Next:ital,wght@0,200..800;1,200..800&family=Atkinson+Hyperlegible+Mono:wght@400;600&display=swap");

/* Agave: generated from tokens.json by build_css.py. Edit tokens.json or components.css, never this file. */

:root, [data-theme="light"] {
  --paper: #f2f4f1;
  --paper-sunk: #e4e8e3;
  --ink: #18201d;
  --ink-soft: #46504b;
  --rule: #c7cec8;
  --edge: #717d77;
  --agave: #2d5a4c;
  --agave-press: #24493e;
  --on-agave: #f2f4f1;
  --agave-ink: #2d5a4c;
  --marigold: #f2b53a;
  --on-marigold: #18201d;
  --marigold-ink: #845400;
  --sky: #2a6489;
  --clay: #a53f2a;
  --chart-focus: var(--agave-ink);
  --chart-context: var(--edge);
  --focus: var(--agave-ink);
}
[data-theme="dark"] {
  --paper: #121816;
  --paper-sunk: #1b2320;
  --ink: #e9ede8;
  --ink-soft: #a6b1ab;
  --rule: #2c3631;
  --edge: #6f7c75;
  --agave: #2e6656;
  --agave-press: #285a4b;
  --on-agave: #f0f4f1;
  --agave-ink: #86c9b1;
  --marigold: #f4be52;
  --on-marigold: #121816;
  --marigold-ink: #f4be52;
  --sky: #7db8dc;
  --clay: #ee8a70;
  --chart-focus: var(--agave-ink);
  --chart-context: var(--edge);
  --focus: var(--marigold);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #121816;
    --paper-sunk: #1b2320;
    --ink: #e9ede8;
    --ink-soft: #a6b1ab;
    --rule: #2c3631;
    --edge: #6f7c75;
    --agave: #2e6656;
    --agave-press: #285a4b;
    --on-agave: #f0f4f1;
    --agave-ink: #86c9b1;
    --marigold: #f4be52;
    --on-marigold: #121816;
    --marigold-ink: #f4be52;
    --sky: #7db8dc;
    --clay: #ee8a70;
    --chart-focus: var(--agave-ink);
    --chart-context: var(--edge);
    --focus: var(--marigold);
  }
}
:root {
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 104px;
  --radius-0: 0px;
  --radius-1: 4px;
  --radius-2: 12px;
  --slide-width: 1920px;
  --slide-height: 1080px;
  --measure: 64ch;
  --measure-tight: 40ch;
  --page-max: 1240px;
  --font-display: "Funnel Display", "Avenir Next", system-ui, sans-serif;
  --font-text: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, monospace;
}

/* Agave components. Every color, size and gap comes from tokens.css. */

.ag-slide, .ag-page { box-sizing: border-box; }
.ag-slide *, .ag-page * { box-sizing: border-box; }

/* Slides: a 1920 x 1080 canvas */
.ag-slide {
  width: var(--slide-width);
  height: var(--slide-height);
  padding: var(--space-6);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ag-headline {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1.08;
  font-weight: 650;
  margin: 0;
  max-width: 1560px;
  text-wrap: balance;
}
.ag-display {
  font-family: var(--font-display);
  font-size: 128px;
  line-height: 0.95;
  font-weight: 700;
  margin: 0;
}
.ag-figure {
  font-family: var(--font-display);
  font-size: 288px;
  line-height: 0.9;
  font-weight: 700;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.ag-figure-row {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--space-5);
  align-items: end;
  margin: auto 0;
}
.ag-figure-mark {
  display: inline-block;
  padding-bottom: var(--space-2);
  border-bottom: 24px solid var(--marigold);
}
.ag-body {
  font-size: 36px;
  line-height: 1.35;
  max-width: var(--measure-tight);
  margin: 0;
}
.ag-label { font-size: 28px; line-height: 1.3; font-weight: 600; }
.ag-source {
  font-size: 24px;
  line-height: 1.3;
  color: var(--ink-soft);
  margin: auto 0 0;
}

/* Evidence: a bar chart with labels next to the bars, no legend, no gridlines */
.ag-bars {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
  max-width: 1440px;
}
.ag-bar {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: center;
  gap: var(--space-3);
  font-size: 28px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink-soft);
}
.ag-bar-track { display: flex; align-items: center; gap: var(--space-2); }
.ag-bar-fill { height: 72px; background: var(--chart-context); }
.ag-bar-value { font-variant-numeric: tabular-nums; }
.ag-bar.is-focus { color: var(--agave-ink); }
.ag-bar.is-focus .ag-bar-fill { background: var(--chart-focus); }

/* Steps: big numbers and hairlines instead of boxes */
.ag-steps {
  list-style: none;
  counter-reset: ag-step;
  margin: var(--space-5) 0 0;
  padding: 0;
  max-width: 1500px;
}
.ag-steps li {
  counter-increment: ag-step;
  display: grid;
  grid-template-columns: 128px 1fr;
  align-items: baseline;
  padding: var(--space-3) 0;
  border-top: 2px solid var(--rule);
  font-size: 36px;
  line-height: 1.35;
}
.ag-steps li:last-child { border-bottom: 2px solid var(--rule); }
.ag-steps li::before {
  content: counter(ag-step);
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1;
  font-weight: 700;
  color: var(--agave-ink);
}

/* Web */
.ag-page {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 19px;
  line-height: 1.6;
}
.ag-page p { max-width: var(--measure); }
.ag-h1, .ag-h2, .ag-h3 { font-family: var(--font-display); margin: 0 0 var(--space-3); text-wrap: balance; }
.ag-h1 { font-size: 48px; line-height: 1.08; font-weight: 650; }
.ag-h2 { font-size: 32px; line-height: 1.15; font-weight: 600; }
.ag-h3 { font-size: 24px; line-height: 1.25; font-weight: 600; }
.ag-small { font-size: 16px; line-height: 1.5; color: var(--ink-soft); }
.ag-page p + .ag-h2, .ag-page p + .ag-h3 { margin-top: var(--space-4); }
.ag-page figcaption { margin-top: var(--space-1); }

.ag-hero {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--space-5);
  align-items: end;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}
.ag-hero-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1;
  font-weight: 700;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}
.ag-hero p { max-width: var(--measure-tight); margin: 0 0 var(--space-4); }

/* Stage hero (Nov 28): one real subject on a ledge, far/mid/close depth, one light source.
   Put data-theme="dark" on .ag-stage so it uses the dark tokens. JS may set --mx, --my (-0.5 to 0.5). */
.ag-stage {
  --mx: 0; --my: 0;
  position: relative;
  min-height: 760px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  isolation: isolate;
}
.ag-stage, .ag-stage * { box-sizing: border-box; }
.ag-stage-light {
  position: absolute; inset: 0; z-index: -4;
  background: radial-gradient(circle at 84% 8%, color-mix(in srgb, var(--marigold) 40%, transparent) 0%, color-mix(in srgb, var(--marigold) 10%, transparent) 22%, transparent 48%);
}
.ag-stage-layer {
  position: absolute; left: -48px; width: calc(100% + 96px); bottom: -24px;
  transition: transform 0.4s ease-out;
}
.ag-stage-far { z-index: -3; height: 62%; fill: var(--rule); filter: blur(2px); transform: translate(calc(var(--mx) * -8px), calc(var(--my) * -4px)); }
.ag-stage-mid { z-index: -2; height: 42%; fill: var(--paper-sunk); transform: translate(calc(var(--mx) * -20px), calc(var(--my) * -10px)); }
.ag-stage-close { z-index: -1; height: 24%; fill: var(--paper); transform: translate(calc(var(--mx) * -40px), calc(var(--my) * -20px)); }
.ag-stage-rim { fill: none; stroke: var(--marigold); stroke-opacity: 0.55; stroke-width: 2; }
.ag-stage-inner {
  position: relative;
  max-width: var(--page-max);
  min-height: 760px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5) var(--space-5);
  display: grid;
  grid-template-columns: 7fr 5fr;
  grid-template-rows: auto 1fr auto;
  column-gap: var(--space-5);
}
.ag-stage-nav { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.ag-stage-brand { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.ag-stage-copy { grid-column: 1; grid-row: 3; align-self: end; }
.ag-stage-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7.8vw, 112px);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}
.ag-stage-copy p { max-width: var(--measure-tight); margin: 0 0 var(--space-4); color: var(--ink-soft); }
.ag-stage-subject {
  position: absolute; right: var(--space-5); bottom: 22%;
  margin: 0;
  width: min(26%, 280px);
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-2);
  overflow: hidden;
  transform: translate(calc(var(--mx) * -40px), calc(var(--my) * -20px));
  transition: transform 0.4s ease-out;
}
.ag-stage-subject img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ag-stage-slot {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4); text-align: center;
  border: 2px dashed var(--edge); border-radius: var(--radius-2);
  color: var(--ink-soft);
}
.ag-stage-detail {
  grid-column: 2; grid-row: 2; align-self: start; justify-self: start;
  width: 280px;
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-3);
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  border-radius: var(--radius-1);
  transform: translate(calc(var(--mx) * -20px), calc(var(--my) * -10px));
  transition: transform 0.4s ease-out;
}
.ag-stage-detail-key { display: block; font-family: var(--font-mono); font-size: 16px; color: var(--agave-ink); }
.ag-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ag-media {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-2);
  background: var(--paper-sunk);
  overflow: hidden;
}
.ag-section { border-top: 1px solid var(--rule); padding: var(--space-6) 0; }

.ag-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 48px;
  padding: 0 var(--space-3);
  border: 2px solid transparent;
  border-radius: var(--radius-1);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.ag-btn-primary { background: var(--agave); color: var(--on-agave); }
.ag-btn-primary:hover { background: var(--agave-press); }
.ag-btn-secondary { background: transparent; color: var(--ink); border-color: var(--edge); }
.ag-btn-secondary:hover { border-color: var(--ink); }
.ag-link {
  color: var(--agave-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.ag-btn:focus-visible, .ag-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

@media (max-width: 760px) {
  .ag-hero { grid-template-columns: 1fr; padding: var(--space-5) var(--space-3); }
  .ag-h1 { font-size: 34px; }
  .ag-stage-inner { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; padding: var(--space-3); row-gap: var(--space-4); }
  .ag-stage-detail, .ag-stage-subject, .ag-stage-copy { grid-column: 1; grid-row: auto; justify-self: start; margin: 0; }
  .ag-stage-subject { position: relative; right: auto; bottom: auto; width: min(100%, 260px); }
  .ag-stage-layer, .ag-stage-subject, .ag-stage-detail { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ag-slide *, .ag-page * { animation: none !important; transition: none !important; }
}
