:root {
  --paper: #F3EEE3;
  --paper-warm: #EDE6D6;
  --ink: #14201A;
  --ink-soft: #2B3A30;
  --peat: #6B3A1F;
  --peat-light: #8C5232;
  --sphagnum: #7A8E6F;
  --bog-water: #3C5249;
  --amber: #C4751A;
  --amber-deep: #A35C0E;
  --rule: rgba(20, 32, 26, 0.15);
  --rule-strong: rgba(20, 32, 26, 0.35);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Paper grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.13 0 0 0 0 0.1 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Topographic line motif */
.topo {
  position: absolute;
  pointer-events: none;
  opacity: 0.18;
  color: var(--ink);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

/* ── Navigation ──────────────────────────────────────────── */
nav {
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
  z-index: 10;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 50, "opsz" 32;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-mark {
  width: 14px;
  height: 14px;
  background: var(--peat);
  border-radius: 50%;
  display: inline-block;
  align-self: center;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--peat);
}

.brand-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  opacity: 0.7;
  padding-left: 14px;
  border-left: 1px solid var(--rule-strong);
}

.nav-links {
  display: flex;
  gap: 36px;
  font-size: 13px;
  font-weight: 400;
}

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}

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

.nav-cta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--paper);
  background: var(--ink);
  padding: 10px 18px;
  text-decoration: none;
  transition: background 0.2s;
}

.nav-cta:hover { background: var(--peat); color: var(--paper); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  padding: 120px 0 100px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: end;
}

.hero-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--peat);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-eyebrow::before {
  content: '';
  width: 30px;
  height: 1px;
  background: var(--peat);
}

.hero h1 {
  font-family: 'Fraunces', serif;
  font-weight: 350;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--ink);
  font-variation-settings: "SOFT" 30, "opsz" 144;
  margin-bottom: 0;
}

.hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--peat);
  font-variation-settings: "SOFT" 100, "opsz" 144;
}

.hero-slogan {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 24px;
  color: var(--peat);
  margin-top: 28px;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 100;
}

.hero-body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 460px;
  margin-bottom: 40px;
}

.hero-body strong {
  color: var(--ink);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  padding: 16px 28px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: all 0.25s;
}

.btn-primary:hover {
  background: var(--peat);
  transform: translateY(-1px);
}

.btn-primary::after {
  content: '→';
  font-family: 'IBM Plex Sans', sans-serif;
  transition: transform 0.25s;
}

.btn-primary:hover::after { transform: translateX(3px); }

.btn-ghost {
  color: var(--ink);
  padding: 16px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

.btn-ghost:hover { color: var(--peat); border-color: var(--peat); }

/* Topographic decoration in hero */
.hero-topo {
  position: absolute;
  right: -120px;
  top: 40px;
  width: 540px;
  opacity: 0.12;
  pointer-events: none;
}

/* ── Section divider with meta ─────────────────────────── */
.section-meta {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  padding: 32px 0 24px;
  border-top: 1px solid var(--rule-strong);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.section-meta .number {
  color: var(--peat);
}

/* ── The Problem ─────────────────────────────────────────── */
.problem {
  padding: 60px 0 120px;
}

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  margin-top: 40px;
}

.problem h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variation-settings: "SOFT" 50, "opsz" 96;
}

.problem h2 em {
  font-style: italic;
  color: var(--peat);
}

.problem-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px 32px;
}

.problem-point {
  border-top: 1px solid var(--rule-strong);
  padding-top: 20px;
}

.problem-point-number {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--peat);
  letter-spacing: 0.15em;
  margin-bottom: 10px;
}

.problem-point h3 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 450;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 30;
}

.problem-point p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ── How it works ────────────────────────────────────────── */
.approach {
  background: var(--paper-warm);
  padding: 120px 0;
  margin: 0 -32px;
  padding-left: 32px;
  padding-right: 32px;
  position: relative;
  overflow: hidden;
}

.approach::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%236B3A1F' stroke-width='0.6' opacity='0.25'%3E%3Cpath d='M 0,300 Q 150,250 300,280 T 600,260'/%3E%3Cpath d='M 0,320 Q 150,280 300,310 T 600,290'/%3E%3Cpath d='M 0,340 Q 150,310 300,340 T 600,320'/%3E%3Cpath d='M 0,360 Q 150,340 300,370 T 600,350'/%3E%3Cpath d='M 0,380 Q 150,370 300,400 T 600,380'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 800px 800px;
  background-position: right center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.approach .container { position: relative; z-index: 2; }

.approach-header {
  max-width: 720px;
  margin-bottom: 80px;
}

.approach-header h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-top: 24px;
  font-variation-settings: "SOFT" 50, "opsz" 96;
}

.approach-header h2 em {
  font-style: italic;
  color: var(--peat);
}

.approach-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule-strong);
}

.step {
  padding: 40px 32px 40px 0;
  border-right: 1px solid var(--rule);
  position: relative;
}

.step:last-child { border-right: none; }
.step:not(:first-child) { padding-left: 32px; }

.step-number {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 56px;
  color: var(--peat);
  line-height: 1;
  margin-bottom: 24px;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-weight: 300;
}

.step h3 {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 450;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  font-variation-settings: "SOFT" 30;
}

.step p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
}

.step-tag {
  display: inline-block;
  margin-top: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--peat);
  border: 1px solid var(--peat);
  padding: 4px 10px;
}

/* ── Live Demo Section ───────────────────────────────────── */
.demo {
  padding: 120px 0;
}

.demo-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: end;
  margin-bottom: 60px;
}

.demo h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-top: 24px;
  font-variation-settings: "SOFT" 50, "opsz" 96;
}

.demo h2 em {
  font-style: italic;
  color: var(--peat);
}

.demo-intro {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 460px;
}

.demo-panel {
  background: var(--ink);
  color: var(--paper);
  padding: 0;
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 620px;
  position: relative;
  overflow: hidden;
}

.demo-sidebar {
  background: var(--ink-soft);
  padding: 32px 28px;
  border-right: 1px solid rgba(243, 238, 227, 0.1);
}

.demo-sidebar-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(243, 238, 227, 0.5);
  margin-bottom: 24px;
}

.site-option {
  padding: 18px 0;
  border-top: 1px solid rgba(243, 238, 227, 0.12);
  cursor: pointer;
  transition: all 0.2s;
}

.site-option:last-child {
  border-bottom: 1px solid rgba(243, 238, 227, 0.12);
}

.site-option:hover {
  padding-left: 8px;
}

.site-option.active {
  padding-left: 12px;
  border-left: 2px solid var(--amber);
}

.site-option-name {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 450;
  line-height: 1.2;
  margin-bottom: 4px;
  font-variation-settings: "SOFT" 30;
}

.site-option-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(243, 238, 227, 0.55);
}

.demo-main {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.demo-main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(243, 238, 227, 0.15);
}

.demo-site-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-site-name {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 30, "opsz" 96;
}

.demo-site-type {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(243, 238, 227, 0.6);
}

.demo-coords {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: rgba(243, 238, 227, 0.5);
  text-align: right;
  line-height: 1.5;
}

/* Provenance strip (v0.14) — observed vs illustrative honesty banner. */
.demo-provenance {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 24px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid rgba(243, 238, 227, 0.12);
  background: rgba(243, 238, 227, 0.03);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
}

.provenance-badge {
  flex: none;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.demo-provenance.is-observed {
  border-color: rgba(127, 184, 160, 0.35);
  background: rgba(127, 184, 160, 0.07);
}
.demo-provenance.is-observed .provenance-badge {
  color: #0E1A14;
  background: #7FB8A0;
}

.demo-provenance.is-illustrative {
  border-color: rgba(196, 117, 26, 0.30);
  background: rgba(196, 117, 26, 0.06);
}
.demo-provenance.is-illustrative .provenance-badge {
  color: #0E1A14;
  background: #C4751A;
}

.provenance-detail {
  color: rgba(243, 238, 227, 0.7);
}

.demo-metrics {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.metric {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(243, 238, 227, 0.55);
  margin-bottom: 12px;
}

.metric-value {
  font-family: 'Fraunces', serif;
  font-size: 44px;
  font-weight: 350;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--paper);
  font-variation-settings: "SOFT" 30, "opsz" 144;
}

.metric-value.primary {
  color: var(--amber);
}

.metric-unit {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: rgba(243, 238, 227, 0.6);
  margin-top: 6px;
  letter-spacing: 0.05em;
}

.metric-ci {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: rgba(243, 238, 227, 0.7);
  margin-top: 6px;
}

.chart-container {
  /* flex-basis auto so the rule's min/max actually take effect; without
   * this, Chart.js's canvas computes a height from its aspect ratio and
   * overflows the container during prediction (v0.6.2 fix). */
  flex: 1 1 auto;
  background: rgba(243, 238, 227, 0.04);
  padding: 20px;
  border: 1px solid rgba(243, 238, 227, 0.08);
  position: relative;
  min-height: 220px;
  max-height: 280px;
  overflow: hidden;
}

.chart-container canvas {
  /* Chart.js + maintainAspectRatio:false is necessary but not sufficient —
   * belt-and-braces caps the canvas to the parent. */
  max-height: 100% !important;
  max-width: 100% !important;
}

.chart-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(243, 238, 227, 0.55);
  margin-bottom: 12px;
}

/* ── Comparison ─────────────────────────────────────────── */
.comparison {
  padding: 120px 0;
}

.comparison-header {
  max-width: 720px;
  margin-bottom: 60px;
}

.comparison h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-top: 24px;
  font-variation-settings: "SOFT" 50, "opsz" 96;
}

.comparison h2 em {
  font-style: italic;
  color: var(--peat);
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.compare-card {
  border: 1px solid var(--rule-strong);
  padding: 36px;
  background: var(--paper-warm);
  position: relative;
}

.compare-card.highlight {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.compare-card-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--peat);
  margin-bottom: 16px;
}

.compare-card.highlight .compare-card-label {
  color: var(--amber);
}

.compare-card h3 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 24px;
  font-variation-settings: "SOFT" 30, "opsz" 96;
}

.compare-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}

.compare-card.highlight .compare-row {
  border-color: rgba(243, 238, 227, 0.15);
}

.compare-row-label {
  color: var(--ink-soft);
  font-weight: 400;
  flex: 1;
}

.compare-card.highlight .compare-row-label {
  color: rgba(243, 238, 227, 0.65);
}

.compare-row-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  text-align: right;
  flex-shrink: 0;
}

.compare-result {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--rule-strong);
}

.compare-card.highlight .compare-result {
  border-color: rgba(243, 238, 227, 0.25);
}

.compare-result-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--peat);
  margin-bottom: 12px;
}

.compare-card.highlight .compare-result-label {
  color: var(--amber);
}

.compare-result-value {
  font-family: 'Fraunces', serif;
  font-size: 36px;
  font-weight: 350;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 30, "opsz" 144;
}

.compare-result-ci {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.compare-card.highlight .compare-result-ci {
  color: rgba(243, 238, 227, 0.7);
}

/* ── Trust / About ───────────────────────────────────────── */
.trust {
  padding: 100px 0;
  border-top: 1px solid var(--rule-strong);
}

.trust-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
}

.trust h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 50, "opsz" 96;
}

.trust h2 em {
  font-style: italic;
  color: var(--peat);
}

.trust-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.trust-item {
  padding-top: 20px;
  border-top: 1px solid var(--rule-strong);
}

.trust-item-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--peat);
  margin-bottom: 10px;
}

.trust-item h4 {
  font-family: 'Fraunces', serif;
  font-size: 19px;
  font-weight: 450;
  margin-bottom: 10px;
  letter-spacing: -0.005em;
  font-variation-settings: "SOFT" 30;
}

.trust-item p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ── CTA ─────────────────────────────────────────────────── */
.cta {
  background: var(--ink);
  color: var(--paper);
  padding: 100px 0;
  margin: 0 -32px;
  padding-left: 32px;
  padding-right: 32px;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400'%3E%3Cg fill='none' stroke='%23F3EEE3' stroke-width='0.5' opacity='0.15'%3E%3Cpath d='M 0,200 Q 200,150 400,180 T 800,160'/%3E%3Cpath d='M 0,220 Q 200,180 400,210 T 800,190'/%3E%3Cpath d='M 0,240 Q 200,210 400,240 T 800,220'/%3E%3Cpath d='M 0,260 Q 200,240 400,270 T 800,250'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.cta .container { position: relative; z-index: 2; }

.cta-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 80px;
  align-items: center;
}

.cta h2 {
  font-family: 'Fraunces', serif;
  font-weight: 350;
  font-size: 72px;
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-variation-settings: "SOFT" 50, "opsz" 144;
}

.cta h2 em {
  font-style: italic;
  color: var(--amber);
}

.cta-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cta-form-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(243, 238, 227, 0.65);
  margin-bottom: 6px;
}

.cta-form input {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(243, 238, 227, 0.3);
  padding: 14px 0;
  color: var(--paper);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.cta-form input::placeholder {
  color: rgba(243, 238, 227, 0.35);
}

.cta-form input:focus { border-color: var(--amber); }

.cta-form button {
  background: var(--amber);
  color: var(--ink);
  border: none;
  padding: 16px 24px;
  margin-top: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: all 0.2s;
}

.cta-form button:hover {
  background: var(--paper);
  transform: translateY(-1px);
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  padding: 48px 0 32px;
  border-top: 1px solid var(--rule);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 60px;
}

.footer-col h5 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--peat);
  margin-bottom: 20px;
  font-weight: 500;
}

.footer-col a, .footer-col p {
  display: block;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 8px;
  line-height: 1.5;
}

.footer-col a:hover { color: var(--peat); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-grid, .demo-header, .approach-steps, .problem-points, .trust-grid, .comparison-grid, .cta-grid, .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .step { border-right: none; border-bottom: 1px solid var(--rule); padding: 32px 0 !important; }
  .step:last-child { border-bottom: none; }
  .demo-panel { grid-template-columns: 1fr; }
  .demo-sidebar { border-right: none; border-bottom: 1px solid rgba(243, 238, 227, 0.1); }
  .hero h1 { font-size: 56px; }
  .cta h2 { font-size: 44px; }
  .demo-metrics { grid-template-columns: 1fr; gap: 20px; }
  .nav-links { display: none; }
}

.metric-value .unit-suffix { font-size: 24px; }
.section-meta.bare { grid-template-columns: 1fr; padding-top: 0; border: none; }
.brand.footer-brand { margin-bottom: 16px; }
.footer-tagline { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }

/* ── Live-demo loading / error / live-indicator states ────────────────── */

/* Sidebar skeleton — same ink/paper palette as the dark demo panel */
.site-skeleton {
  padding: 18px 0;
  border-top: 1px solid rgba(243, 238, 227, 0.12);
}

.site-skeleton:last-child {
  border-bottom: 1px solid rgba(243, 238, 227, 0.12);
}

.site-skeleton .bar {
  height: 12px;
  background: rgba(243, 238, 227, 0.08);
  animation: maze-pulse 1.4s ease-in-out infinite;
}

.site-skeleton .bar.title {
  width: 70%;
  margin-bottom: 8px;
}

.site-skeleton .bar.meta {
  width: 90%;
  height: 8px;
  background: rgba(243, 238, 227, 0.06);
}

@keyframes maze-pulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1.0; }
}

/* Main-panel computing state — dim the live values, surface the banner.
 * Frames the 30-60s prediction window as the model actually running,
 * rather than hiding it behind a spinner. */
.demo-main .metric-value,
.demo-main .metric-ci,
.demo-main .chart-container canvas {
  transition: opacity 0.35s ease;
}

.demo-main.is-loading .metric-value,
.demo-main.is-loading .metric-ci,
.demo-main.is-loading .chart-container canvas {
  opacity: 0.3;
}

.computing-banner {
  display: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--amber);
  margin-top: 16px;
  padding-bottom: 4px;
  position: relative;
}

.demo-main.is-loading .computing-banner { display: inline-block; }

/* Underline track + travelling sheen.
 * The sheen uses transform (Composite-only) instead of background-position
 * (Composite + Paint) so it doesn't fight the chart re-render for paint
 * budget during the prediction window. */
.computing-banner::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: rgba(196, 117, 26, 0.15);
  overflow: hidden;
}
.computing-banner::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 40%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--amber) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  will-change: transform;
  animation: maze-underline 1.8s linear infinite;
}

@keyframes maze-underline {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* Tiny "live · model · v0.3" indicator under the chart */
.live-indicator {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: lowercase;
  letter-spacing: 0.15em;
  color: var(--amber);
  margin-top: 14px;
  align-self: flex-end;
  opacity: 0.85;
}

.live-indicator::before {
  content: '●';
  margin-right: 6px;
  font-size: 8px;
  vertical-align: 1px;
}

/* Error fallback — em-dashes plus a quiet "model unavailable" line. */
.demo-main.is-error .metric-value span,
.demo-main.is-error .metric-ci {
  color: rgba(243, 238, 227, 0.4);
}

.error-banner {
  display: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(243, 238, 227, 0.55);
  margin-top: 16px;
}

.demo-main.is-error .error-banner { display: inline-block; }

/* ── v0.15 — ocean / off-land ad-hoc draw: no forecast ─────────────────── */
.unsupported-banner {
  display: none;
  margin-top: 4px;
  padding: 22px 24px;
  border-radius: 8px;
  border: 1px solid rgba(196, 117, 26, 0.30);
  background: rgba(196, 117, 26, 0.06);
}

.demo-main.is-unsupported .unsupported-banner { display: block; }

/* Suppress the curve, the metric cards and the provenance strip entirely —
   there is no forecast to show for a point off any landmass. */
.demo-main.is-unsupported .demo-metrics,
.demo-main.is-unsupported .chart-container,
.demo-main.is-unsupported .demo-provenance {
  display: none;
}

.unsupported-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--paper);
  margin-bottom: 8px;
}

.unsupported-detail {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(243, 238, 227, 0.7);
}

/* ── v0.6 — Map sidebar (replaces static site list) ────────────────────── */

/* When the sidebar hosts the map, switch to the warm cream palette so the
 * OSM tiles read naturally and the dark forecast panel on the right pops by
 * contrast. */
.demo-sidebar.map-sidebar {
  background: var(--paper-warm);
  padding: 24px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--rule);
}

.map-instruction {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.12em;
  color: var(--peat);
  padding: 0 24px;
}

#demo-map {
  flex: 1;
  min-height: 440px;
  width: 100%;
  background: var(--paper-warm);
  cursor: crosshair;
}

/* Desaturate + warm-shift OSM tiles so they sit in the MAZE palette rather
 * than shouting like a stock map view. */
.leaflet-tile {
  filter: saturate(0.4) hue-rotate(-10deg) brightness(0.97);
}

/* Strip Leaflet's bright defaults; lean on monospace + ink-soft like the
 * rest of the typographic surface. */
.leaflet-container {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--paper-warm);
}

.leaflet-control-attribution,
.leaflet-control-scale-line {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-soft);
  background: rgba(243, 238, 227, 0.7) !important;
  padding: 2px 6px;
}

.leaflet-control-attribution a {
  color: var(--peat);
}

.leaflet-bar a,
.leaflet-bar a:hover {
  color: var(--ink);
  background: var(--paper);
  border-bottom-color: var(--rule);
  font-family: 'IBM Plex Mono', monospace;
}

/* Leaflet-draw toolbar — match palette. */
.leaflet-draw-toolbar a {
  background-color: var(--paper) !important;
}
.leaflet-draw-toolbar a:hover {
  background-color: var(--paper-warm) !important;
}
.leaflet-draw-tooltip {
  background: var(--ink);
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  border: none;
  letter-spacing: 0.08em;
}
.leaflet-draw-tooltip:before { border-right-color: var(--ink); }

/* Preset-site dot markers. */
.maze-preset-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.maze-preset-marker.active {
  background: var(--amber);
  transform: scale(1.25);
  box-shadow: 0 0 0 1px var(--amber-deep);
}
.maze-preset-marker:hover { transform: scale(1.2); }

/* Loading state on the map while /predict is in flight. */
.demo-main.is-loading + .leaflet-interactive,
.demo-sidebar.map-sidebar.is-loading .leaflet-interactive {
  fill-opacity: 0.08 !important;
}

/* Peatland-type selector — three-button group below the map. */
.peatland-type-selector {
  display: flex;
  gap: 0;
  padding: 0 24px;
}

.type-btn {
  flex: 1;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  background: var(--paper);
  padding: 10px 8px;
  border: 1px solid var(--rule-strong);
  border-right-width: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.type-btn:last-child {
  border-right-width: 1px;
}

.type-btn:hover {
  background: var(--paper-warm);
  color: var(--ink);
}

.type-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* "custom override" indicator under the site name when a preset's
 * peatland_type has been manually overridden. */
.custom-override {
  font-family: 'IBM Plex Mono', monospace;
  font-style: italic;
  font-size: 10px;
  text-transform: lowercase;
  letter-spacing: 0.10em;
  color: var(--amber);
  margin-top: 4px;
}

/* ── v0.6.2 — Contact-form feedback line ───────────────────────────────── */

.cta-form-feedback {
  margin-top: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: var(--amber);
}
.cta-form-feedback.is-error { color: var(--amber-deep); }

/* ── v0.6.1 — JS-disabled + CDN-fallback notices ───────────────────────── */

.noscript-notice {
  background: var(--paper-warm);
  color: var(--ink);
  padding: 18px 24px;
  border-left: 3px solid var(--peat);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  margin: 24px 32px;
}

.cdn-fallback-notice {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.10em;
  color: var(--peat);
  padding: 0 24px 12px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 12px;
}

/* When the sidebar falls back to the static list, revert to the dark
 * theme so the existing .site-option styles read correctly. */
.demo-sidebar.fallback-list {
  background: var(--ink-soft);
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.demo-sidebar.fallback-list .cdn-fallback-notice {
  color: var(--amber);
  border-bottom-color: rgba(243, 238, 227, 0.15);
}
.demo-sidebar.fallback-list .demo-sidebar-label {
  padding: 0 28px;
}
.demo-sidebar.fallback-list #fallback-site-list {
  padding: 0 28px;
}
.demo-sidebar.fallback-list .site-option {
  /* Re-use the v0.5 .site-option visuals — same dark-theme palette. */
  padding: 18px 0;
  border-top: 1px solid rgba(243, 238, 227, 0.12);
  cursor: pointer;
  transition: padding 0.2s;
}
.demo-sidebar.fallback-list .site-option:last-child {
  border-bottom: 1px solid rgba(243, 238, 227, 0.12);
}
.demo-sidebar.fallback-list .site-option:hover { padding-left: 8px; }
.demo-sidebar.fallback-list .site-option.active {
  padding-left: 12px;
  border-left: 2px solid var(--amber);
}
.demo-sidebar.fallback-list .site-option-name {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 450;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--paper);
}
.demo-sidebar.fallback-list .site-option-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(243, 238, 227, 0.55);
}
