:root {
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --ink: #14181f;
  --ink-soft: #4a5260;
  --ink-faint: #828b9a;
  --line: #e4e7ec;
  --brand: #1f6f54;       /* deep grove green */
  --brand-soft: #e8f2ee;
  --accent: #1d4ed8;
  --good: #1f6f54;
  --warn: #b45309;
  --bad: #b42318;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
code { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: .88em; }
a { color: var(--accent); text-decoration: none; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand-mark { height: 22px; width: 22px; margin-right: 9px; display: block; }
.brand-dot { color: var(--brand); }
.brand-sub { color: var(--ink-faint); font-weight: 500; font-size: 14px; margin-left: 7px; }
.nav a { color: var(--ink-soft); font-size: 14px; font-weight: 500; margin-left: 24px; }
.nav a:hover { color: var(--ink); }
.nav a.nav-ext { color: var(--brand); font-weight: 600; }
.nav a.nav-ext:hover { color: var(--brand-dark, var(--brand)); text-decoration: underline; }
/* Inline links into grove.enginyyr.com woven through the prose */
.ilink { color: var(--brand); font-weight: 600; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.ilink:hover { border-bottom-color: var(--brand); }

/* Hero */
.hero { padding: 80px 0 56px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--brand); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 16px; }
.hero h1 { font-size: 44px; margin: 0 0 20px; max-width: 820px; }
.lede { font-size: 19px; color: var(--ink-soft); max-width: 760px; margin: 0 0 40px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 720px; }
.hstat-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.hstat-label { color: var(--ink-faint); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }

/* Sources -> lakehouse strip */
.stack-band { background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.stack-strip { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; padding: 22px 24px; }
.stack-group { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.wm-row { display: flex; align-items: center; gap: 18px; }
.stack-label { color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stack-arrow { color: var(--ink-faint); margin-bottom: 22px; }
.wm { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.wm.sf { color: #00a1e0; }
.wm.hs { color: #ff7a59; }
.wm.db { color: #ff3621; }
.wm.gv { color: var(--brand); }
.wm { display: inline-flex; align-items: center; }
.brand-ico { height: 19px; width: 19px; margin-right: 8px; display: inline-block; }
@media (max-width: 700px) { .wm { font-size: 16px; } .stack-strip { gap: 12px; } }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { font-size: 30px; margin: 0 0 16px; }
.section-intro { color: var(--ink-soft); font-size: 17px; margin: 0 0 36px; }
#problem p { font-size: 17px; color: var(--ink-soft); }

/* Pipeline */
.pipeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pstep { display: flex; gap: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.pstep.grove { border-color: var(--brand); background: var(--brand-soft); }
.pnum { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.pstep.grove .pnum { background: var(--brand); }
.pstep h3 { margin: 2px 0 6px; font-size: 16px; }
.pstep p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.tag { background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 20px; vertical-align: middle; letter-spacing: .02em; }

/* Results */
.results-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: start; }
.scorecard { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.score-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.score-table th, .score-table td { text-align: right; padding: 10px 12px; font-variant-numeric: tabular-nums; }
.score-table thead th { color: var(--ink-faint); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; border-bottom: 1px solid var(--line); }
.score-table tbody th { text-align: left; font-weight: 600; }
.score-table tbody tr.highlight { background: var(--brand-soft); }
.score-table tbody tr.highlight td, .score-table tbody tr.highlight th { color: var(--brand); font-weight: 700; }
.recall-bars { border-top: 1px solid var(--line); padding-top: 20px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 52px; align-items: center; gap: 12px; margin-bottom: 12px; }
.bar-label { font-size: 13px; color: var(--ink-soft); }
.bar { height: 10px; background: var(--bg-alt); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 6px; transition: width .9s cubic-bezier(.2,.7,.2,1); }
.bar-fill.rules { background: var(--ink-faint); }
.bar-fill.full { background: var(--brand); }
.bar-val { text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-caption { color: var(--ink-faint); font-size: 12px; margin: 4px 0 0; }
.metrics-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mcard { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.mcard .v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mcard .l { color: var(--ink-faint); font-size: 12.5px; margin-top: 2px; }

/* Nav highlight for Try It */
.nav a.cta { color: var(--brand); border: 1px solid var(--brand); border-radius: 20px; padding: 6px 14px; margin-left: 20px; transition: background .15s, color .15s; }
.nav a.cta:hover { background: var(--brand); color: #fff; }

/* Ingest — live flow diagram */
.flow { display: flex; align-items: center; gap: 0; margin: 8px 0 28px; flex-wrap: wrap; }
.flow-node { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); box-shadow: var(--shadow); flex: 1; min-width: 180px; transition: border-color .3s, box-shadow .3s, transform .3s; }
.fn-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--line); transition: background .3s, box-shadow .3s; }
.fn-label { font-weight: 600; font-size: 14px; }
.fn-sub { color: var(--ink-faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.flow-link { flex: 0 0 36px; height: 2px; background: var(--line); position: relative; overflow: hidden; }
.flow-pulse { position: absolute; top: 0; left: -30%; width: 30%; height: 100%; background: var(--brand); opacity: 0; }
.flow-node.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); transform: translateY(-2px); }
.flow-node.active .fn-dot { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); animation: dotpulse 1s ease-in-out infinite; }
.flow-node.done { border-color: var(--brand); }
.flow-node.done .fn-dot { background: var(--brand); }
.flow-node.grove.active { box-shadow: 0 0 0 3px rgba(31,111,84,.18); }
.flow-link.active .flow-pulse { opacity: 1; animation: flowdash 1.1s linear infinite; }
.flow-link.done { background: var(--brand); }
@keyframes dotpulse { 0%,100% { box-shadow: 0 0 0 3px var(--brand-soft); } 50% { box-shadow: 0 0 0 7px rgba(31,111,84,.10); } }
@keyframes flowdash { from { left: -30%; } to { left: 100%; } }

.ingest-btn { background: var(--brand); color: #fff; border: none; padding: 12px 26px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s; }
.ingest-btn:hover { background: #1a5e47; }
.ingest-btn:disabled { opacity: .65; cursor: default; }

.ingest-summary { display: flex; gap: 36px; flex-wrap: wrap; margin: 28px 0 8px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.ingest-summary .is { font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .03em; }
.ingest-summary .is b { display: block; font-size: 30px; color: var(--ink); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.ingest-summary .is.grove b { color: var(--brand); }

/* Ingest — batch table */
.ingest-table-wrap { margin-top: 24px; overflow-x: auto; }
.ingest-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ingest-table th { text-align: left; color: var(--ink-faint); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ingest-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ingest-table .outcome-col { width: 42%; }
.ingest-table tbody tr { animation: fadeup .4s ease both; }
.ingest-table .lead-name { font-weight: 600; }
.ingest-table .muted { color: var(--ink-faint); }
.ingest-table .src { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .03em; }
.outcome-pending { color: var(--ink-faint); font-size: 13px; }
.outcome { animation: fadeup .45s ease both; }
.outcome .obadge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 3px 10px; border-radius: 20px; margin-bottom: 5px; }
.obadge.auto { background: var(--brand-soft); color: var(--brand); }
.obadge.grove { background: var(--brand); color: #fff; }
.obadge.unsure { background: #fef3c7; color: var(--warn); }
.obadge.new { background: var(--bg-alt); color: var(--ink-soft); }
.outcome .otarget { font-size: 13.5px; color: var(--ink-soft); }
.outcome .oreason { font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; border-left: 3px solid var(--brand); padding-left: 10px; }
@keyframes fadeup { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Review */
.review-controls { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.filters { display: flex; gap: 8px; }
.filter { border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft); padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; cursor: pointer; }
.filter.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.truth-toggle { color: var(--ink-soft); font-size: 13px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.review-list { display: grid; gap: 14px; }
.loading { color: var(--ink-faint); }
.pair { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.pair-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.verdict .dot { width: 9px; height: 9px; border-radius: 50%; }
.verdict.yes .dot { background: var(--good); } .verdict.yes { color: var(--good); }
.verdict.no .dot { background: var(--ink-faint); } .verdict.no { color: var(--ink-soft); }
.verdict.unsure .dot { background: var(--warn); } .verdict.unsure { color: var(--warn); }
.conf { color: var(--ink-faint); font-size: 12.5px; font-weight: 500; }
.records { display: grid; grid-template-columns: 1fr 36px 1fr; gap: 0; align-items: stretch; }
.rec { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-alt); }
.rec .name { font-weight: 600; }
.rec .field { color: var(--ink-soft); font-size: 13.5px; }
.rec .src { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .03em; }
.vs { display: grid; place-items: center; color: var(--ink-faint); font-size: 12px; font-weight: 600; }
.reason { margin: 14px 0 0; color: var(--ink-soft); font-size: 14px; border-left: 3px solid var(--brand); padding-left: 12px; }
.truth { display: none; margin-top: 10px; font-size: 12.5px; font-weight: 600; }
.truth.same { color: var(--good); } .truth.diff { color: var(--bad); }
.show-truth .truth { display: block; }
.actions { display: flex; gap: 8px; margin-top: 16px; }
.btn { border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--ink-faint); }
.btn.confirm:hover { border-color: var(--good); color: var(--good); }
.btn.flag:hover { border-color: var(--bad); color: var(--bad); }
.pair.flagged { opacity: .62; }
.flagged-note { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--brand); }

/* Closing CTA band — hand the reader back to grove.enginyyr.com */
.closing-cta { background: var(--navy-dark, #0f1729); color: #e7ecf3; padding: 64px 0; }
.closing-inner { display: flex; align-items: center; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.closing-copy { max-width: 560px; }
.closing-copy h2 { color: #fff; font-size: 28px; margin: 0 0 12px; }
.closing-copy p { color: #aeb9c9; font-size: 15px; line-height: 1.6; margin: 0; }
.closing-actions { display: flex; flex-direction: column; gap: 12px; min-width: 220px; }
.cta-btn { display: inline-block; text-align: center; padding: 12px 22px; border-radius: 8px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid rgba(255,255,255,.22); color: #e7ecf3; transition: background .15s, border-color .15s; }
.cta-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }
.cta-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.cta-btn.primary:hover { background: var(--brand-dark, #185a44); border-color: var(--brand-dark, #185a44); }

/* Footer */
.site-footer { background: var(--ink); color: #c9cfd8; padding: 48px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.site-footer .brand { color: #fff; }
.footer-note { max-width: 460px; font-size: 14px; color: #9aa3b2; margin: 12px 0 0; }
.footer-note a { color: #c9cfd8; text-decoration: underline; text-underline-offset: 2px; }
.footer-note a:hover { color: #fff; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 0; max-width: 460px; }
.footer-nav a { color: #9aa3b2; font-size: 13px; font-weight: 500; text-decoration: none; }
.footer-nav a:hover { color: #fff; }
.footer-stack { display: flex; gap: 28px; }
.footer-stack .fs { font-size: 13px; }
.footer-stack .fs .v { color: #fff; font-weight: 700; font-size: 18px; }
.footer-stack .fs .l { color: #9aa3b2; }

@media (max-width: 860px) {
  .hero h1 { font-size: 34px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .nav { display: none; }
}
