/* ============================================================
   Bedrock Claim Science - Design System V1
   Blueprint §14 Visual Brand + §16 UI/UX Design System
   Tokens, components, responsive, WCAG 2.2 AA, reduced motion
   ============================================================ */

:root {
  --black: #0B0F0D;
  --deep-green: #003B2B;
  --emerald: #009E58;
  --emerald-ink: #007A45;
  --bedrock-green: #42C85A;
  --lime: #A8F45D;
  --off-white: #F7F9F7;
  --slate: #66716C;
  --white: #FFFFFF;
  --ink: #0B0F0D;
  --border: rgba(11, 15, 13, 0.12);
  --border-soft: rgba(11, 15, 13, 0.08);
  --shadow-sm: 0 1px 2px rgba(11, 15, 13, 0.05);
  --shadow-md: 0 8px 28px rgba(11, 15, 13, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --font-display: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --container: 1240px;
  --section-pad: clamp(64px, 9vw, 132px);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(42px, 5.6vw, 76px); font-weight: 800; }
h2 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 750; }
h3 { font-size: clamp(21px, 2.4vw, 27px); font-weight: 700; }
p { margin: 0 0 1.1em; }
a { color: var(--deep-green); text-underline-offset: 3px; }
a:hover { color: var(--emerald-ink); }
img, svg { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 3px solid var(--emerald);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--lime); color: var(--black); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}
@media (max-width: 640px) {
  .container { padding-left: 24px; padding-right: 24px; }
}

.section { padding-top: var(--section-pad); padding-bottom: var(--section-pad); }
.section--tight { padding-top: clamp(48px, 6vw, 88px); padding-bottom: clamp(48px, 6vw, 88px); }

.eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--emerald-ink);
  margin: 0 0 18px;
}
.lede { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.6; color: #2c3431; max-width: 62ch; }
.muted { color: var(--slate); }
.small { font-size: 14px; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--black); color: #fff; padding: 12px 18px;
  border-radius: 8px; text-decoration: none; font-weight: 700;
  transition: top 150ms ease;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 249, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 76px; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img {
  height: 44px; width: auto; display: block; flex: none;
}
.footer-brand { display: inline-block; margin-bottom: 22px; }
.footer-brand img { height: 56px; width: auto; display: block; }

.site-nav ul {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
}
.site-nav a {
  display: block; padding: 10px 13px; border-radius: 9px;
  text-decoration: none; color: var(--ink);
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}
.site-nav a:hover { background: rgba(0, 158, 88, 0.09); color: var(--deep-green); }
.site-nav a[aria-current="page"] { color: var(--deep-green); background: rgba(0, 158, 88, 0.12); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: 10px;
  width: 46px; height: 46px; cursor: pointer; padding: 0;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: var(--ink);
  margin: 0 auto; position: relative; transition: transform 200ms ease, opacity 200ms ease;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1020px) {
  .nav-toggle { display: block; }
  .site-nav ul {
    display: none;
    position: absolute; top: 76px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--white); border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px; box-shadow: var(--shadow-md);
  }
  .site-nav ul.open { display: flex; }
  .site-nav a { padding: 13px 12px; font-size: 16px; }
}

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(64px, 8vw, 110px);
  padding-bottom: clamp(64px, 8vw, 110px);
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(66, 200, 90, 0.10), transparent 60%),
    radial-gradient(800px 420px at 100% 30%, rgba(0, 158, 88, 0.08), transparent 60%),
    var(--off-white);
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero-copy p.lede { margin-bottom: 32px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-visual { position: relative; min-height: 320px; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 240px; order: 2; }
}

/* Abstract data visual: claim-data lines + range bars */
.data-viz {
  position: relative; width: 100%; min-height: 340px;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow-sm); overflow: hidden;
  padding: 52px 24px 52px;
}
.data-viz .grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(11,15,13,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,15,13,0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}
.data-viz .viz-label {
  position: absolute; left: 24px; top: 18px; z-index: 2;
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  color: var(--slate); text-transform: uppercase;
}
.data-viz .viz-foot {
  position: absolute; left: 24px; bottom: 16px; right: 24px; z-index: 2;
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px; color: var(--slate); font-weight: 600;
}
.range-bar { display: flex; align-items: center; gap: 10px; margin: 14px 0; position: relative; z-index: 1; }
.range-bar .rb-label { font-size: 13px; font-weight: 700; width: 132px; flex: none; color: var(--ink); }
.range-bar .rb-track { position: relative; flex: 1; height: 10px; border-radius: 6px; background: rgba(11,15,13,0.08); }
.range-bar .rb-fill {
  position: absolute; top: 0; bottom: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--emerald), var(--bedrock-green));
}
.range-bar .rb-fill.uncertain {
  background: linear-gradient(90deg, rgba(0,158,88,0.30), rgba(66,200,90,0.55));
  border: 1px dashed var(--emerald);
}
.range-bar .rb-val { font-size: 12.5px; color: var(--slate); font-weight: 600; width: 118px; flex: none; text-align: right; }
.viz-card { position: relative; z-index: 1; }
.viz-card h4 { font-size: 15px; margin: 0 0 4px; letter-spacing: 0.02em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 13px 26px; border-radius: 12px;
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}
.btn-primary { background: var(--emerald); color: var(--black); }
.btn-primary:hover { background: #00b365; color: var(--black); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--deep-green); border-color: var(--deep-green); }
.btn-secondary:hover { background: rgba(0, 59, 43, 0.06); color: var(--deep-green); }
.btn-light { background: var(--white); color: var(--deep-green); }
.btn-light:hover { background: var(--off-white); color: var(--deep-green); box-shadow: var(--shadow-md); }

/* ---------- Cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: clamp(24px, 3vw, 36px);
  box-shadow: var(--shadow-sm);
}
.card-grid { display: grid; gap: 22px; }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .card-grid--3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .card-grid--2 { grid-template-columns: 1fr; } }
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }
.card .kicker { font-size: 12.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--emerald-ink); margin-bottom: 10px; }
.card--green {
  background: linear-gradient(135deg, var(--deep-green) 0%, #005741 100%);
  border-color: rgba(255, 255, 255, 0.12);
}
.card--green h3 { color: #fff; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-soft); background: var(--white); color: var(--ink); }
table.data { width: 100%; border-collapse: collapse; font-size: 15.5px; }
table.data caption { text-align: left; padding: 18px 22px 6px; font-weight: 700; font-family: var(--font-display); font-size: 17px; }
table.data th, table.data td { text-align: left; padding: 15px 22px; vertical-align: top; border-top: 1px solid var(--border-soft); }
table.data thead th { border-top: none; background: rgba(0, 59, 43, 0.05); font-family: var(--font-display); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--deep-green); }
table.data tbody th { font-weight: 700; }
table.data td { color: #333b37; }
table.data tr:hover td, table.data tr:hover th[scope="row"] { background: rgba(66, 200, 90, 0.05); }

/* ---------- Engine diagram ---------- */
.engine { display: grid; grid-template-columns: 1fr auto 1.1fr auto 1fr; gap: 14px; align-items: stretch; margin-top: 36px; }
.engine-col { display: flex; flex-direction: column; gap: 10px; }
.engine-node {
  background: var(--white); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 13px 16px; font-size: 14.5px; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.engine-node small { display: block; font-weight: 400; color: var(--slate); font-size: 12.5px; margin-top: 2px; }
.engine-core {
  background: linear-gradient(135deg, var(--deep-green), #005741);
  color: #fff; border-radius: var(--radius); padding: 26px 22px;
  display: flex; flex-direction: column; justify-content: center; text-align: center;
  font-family: var(--font-display); font-weight: 800; font-size: 17px; line-height: 1.35;
}
.engine-core small { font-family: var(--font-body); font-weight: 400; font-size: 13px; margin-top: 8px; }
.engine-arrow { display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--emerald); font-weight: 800; }
.engine-label { font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--slate); margin-bottom: 4px; }
@media (max-width: 900px) {
  .engine { grid-template-columns: 1fr; }
  .engine-arrow { transform: rotate(90deg); padding: 2px 0; }
}

/* ---------- Split / feature rows ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.checklist { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 14px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; font-size: 16.5px; }
.checklist .tick {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0, 158, 88, 0.12); color: var(--deep-green);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
  margin-top: 2px;
}

/* ---------- Dark / green bands ---------- */
.band-dark { background: var(--black); color: #e9eeeb; }
.band-dark h1, .band-dark h2, .band-dark h3 { color: #fff; }
.band-dark .lede { color: #c6d0c9; }
.band-dark .eyebrow { color: var(--bedrock-green); }
.band-dark a { color: var(--bedrock-green); }
.band-dark a:hover { color: var(--lime); }
.band-dark .card { background: #141a16; border-color: rgba(255,255,255,0.1); }
.band-dark .card h3 { color: #fff; }
.band-dark .card p { color: #c9d2cc; }
.band-dark .card .kicker { color: var(--bedrock-green); }
.band-green { background: linear-gradient(135deg, var(--deep-green) 0%, #005741 100%); color: #eef5f0; }
.band-green h1, .band-green h2, .band-green h3 { color: #fff; }
.band-green .eyebrow { color: var(--lime); }
.band-green .lede { color: #d3e2d8; }
.band-green .card { color: var(--ink); }
.band-green .card p, .band-green .card li { color: #333b37; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 7px; }
.field .req { color: var(--emerald-ink); font-weight: 800; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; font-size: 16px; font-family: var(--font-body);
  border: 1.5px solid var(--border); border-radius: 10px; background: var(--white); color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(0, 158, 88, 0.18); outline: none;
}
.field .hint { font-size: 13.5px; color: var(--slate); margin-top: 6px; }
.field--check { display: flex; gap: 12px; align-items: flex-start; }
.field--check input { width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--emerald); }
.form-note { font-size: 14px; color: var(--slate); }

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: #c9d2cc; padding: 64px 0 36px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-bottom: 18px; }
.footer-nav a { color: #e8edea; text-decoration: none; font-size: 15px; font-weight: 600; }
.footer-nav a:hover { color: var(--bedrock-green); }
.footer-nav--legal a, .footer-nav--eco a { font-size: 14px; font-weight: 500; color: #aeb8b1; }
.footer-hr { border: none; border-top: 1px solid rgba(255,255,255,0.12); margin: 22px 0; }
.footer-microcopy { font-size: 13.5px; color: #9aa5a0; max-width: 80ch; }
.footer-copy { font-size: 13px; color: #7d8781; margin: 18px 0 0; }

/* ---------- Article ---------- */
.article-body { max-width: 72ch; }
.article-body h2 { margin-top: 1.8em; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--slate); font-size: 14.5px; margin: 18px 0 30px; }
.article-meta strong { color: var(--ink); }
.pull { border-left: 4px solid var(--emerald); padding: 6px 0 6px 22px; font-size: 20px; font-family: var(--font-display); font-weight: 600; color: var(--deep-green); margin: 32px 0; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li { margin-bottom: 0.6em; }

/* ---------- Page head (interior) ---------- */
.page-head { padding-top: clamp(56px, 7vw, 96px); padding-bottom: clamp(36px, 5vw, 64px); }
.page-head .lede { margin-bottom: 0; }

/* ---------- Reveal on scroll (restrained) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.page-404 { text-align: center; padding: clamp(80px, 12vw, 150px) 0; }
.page-404 .code { font-family: var(--font-display); font-weight: 800; font-size: clamp(80px, 14vw, 160px); color: var(--deep-green); line-height: 1; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
