:root {
  --ground: #EAF0E6;
  --surface: #F7FAF4;
  --well: #E2EADC;
  --line: #CBD8C2;
  --ink: #1B2A1E;
  --muted: #5B6B55;
  --primary: #1F6E3C;
  --accent: #D94F8C;
  --shadow: 0 2px 4px rgba(31,60,34,.06), 0 14px 28px -18px rgba(31,60,34,.22);
}

* { box-sizing: border-box; }
html { background: var(--ground); scroll-behavior: smooth; }
body, h1, h2, h3, p, span, div, td, th, li, button, input, a, code, pre { font-family: inherit; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.5 'Noto Sans', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input { font-size: 15px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(31,110,60,.25); outline-offset: 2px; }
.custom-gradient-accent { background: linear-gradient(120deg, #1F6E3C 0%, #D94F8C 100%); }

.topbar { background: rgba(247,250,244,.98); }
.topbar-inner { min-height: 62px; display: flex; align-items: center; gap: 12px; padding: 10px 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font: 800 18px/1 'Hanken Grotesk', sans-serif; letter-spacing: -.03em; text-decoration: none; }
.brand img { width: 34px; height: 34px; object-fit: contain; transform: scale(1.8); }
.copy-pill, .status-pill, .menu-button { border: 1px solid var(--line); border-radius: 20px; background: var(--well); color: var(--ink); }
.copy-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; cursor: pointer; font: 600 13px/1 'Source Code Pro', monospace; }
.copy-pill .material-symbols-outlined { color: var(--muted); font-size: 15px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; background: var(--surface); white-space: nowrap; font: 700 12px/1 'Hanken Grotesk', sans-serif; letter-spacing: .08em; }
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: #00C805; }
#primary-nav { display: flex; align-items: stretch; gap: 2px; margin-left: auto; }
.nav-link { position: relative; padding: 10px 9px; color: var(--muted); text-decoration: none; text-transform: uppercase; white-space: nowrap; font: 700 12px/1 'Hanken Grotesk', sans-serif; letter-spacing: .065em; }
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link.active::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 3px; border-radius: 9px; background: linear-gradient(120deg, #1F6E3C 0%, #D94F8C 100%); }
.social-links { display: flex; gap: 4px; font: 700 12px/1 'Hanken Grotesk', sans-serif; }
.social-links a { padding: 8px 6px; color: var(--primary); text-decoration: none; }
.menu-button { display: none; padding: 5px 8px; }
.mobile-nav { display: none; border-top: 1px solid var(--line); padding: 8px 14px 12px; background: var(--surface); }
.mobile-nav.open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.manifest-line { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 2px 14px; color: var(--muted); text-transform: uppercase; font: 700 12px/1.4 'Hanken Grotesk', sans-serif; letter-spacing: .08em; }
.manifest-live { display: inline-flex; align-items: center; gap: 8px; }
.manifest-live::before { content: '●'; color: var(--accent); animation: breathe 2s ease-in-out infinite; }
.manifest-source { text-align: right; text-transform: none; font: 500 13px/1.4 'Source Code Pro', monospace; letter-spacing: 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 18px; }
.data-card { position: relative; display: flex; min-width: 0; flex-direction: column; justify-content: space-between; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.data-card > div:first-child { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.data-card:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(31,60,34,.08), 0 18px 32px -16px rgba(31,60,34,.26); }
.data-card.featured { grid-column: span 2; }
.data-card.featured::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(120deg, #1F6E3C 0%, #D94F8C 100%); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.eyebrow { color: var(--muted); text-transform: uppercase; font: 700 12px/1.3 'Hanken Grotesk', sans-serif; letter-spacing: .08em; }
.badge { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--well); color: var(--primary); white-space: nowrap; font: 600 12px/1 'Source Code Pro', monospace; }
.signature { margin-bottom: 13px; color: var(--muted); overflow-wrap: anywhere; font: 600 14px/1.55 'Source Code Pro', monospace; }
.signature strong { color: var(--primary); font-weight: 700; }
.hook { max-width: 13ch; margin: 7px 0 13px; color: var(--ink); font: 800 clamp(34px, 4.4vw, 70px)/.95 'Hanken Grotesk', sans-serif; letter-spacing: -.055em; }
.lede { max-width: 66ch; margin: 0 0 16px; color: var(--muted); font: 500 16px/1.6 'Noto Sans', sans-serif; }
.split-well { display: grid; grid-template-columns: 4fr 8fr; gap: 12px; }
.inner-well { min-width: 0; padding: 14px; overflow-x: auto; border: 1px solid rgba(203,216,194,.75); border-radius: 14px; background: var(--well); }
.tech-art { position: relative; display: flex; min-height: 150px; flex: 1; flex-direction: column; margin: 13px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--well); }
.tech-art.large { min-height: 230px; }
.art-image { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; flex: 0 0 auto; object-fit: contain; object-position: center; background: var(--ground); }
.tech-art.large .art-image { height: 300px; }
.diagram-ledger { display: grid; min-height: 82px; flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.diagram-ledger > div { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: 9px 11px; border-right: 1px solid var(--line); }
.diagram-ledger > div:last-child { border-right: 0; }
.diagram-ledger strong, .diagram-ledger span { display: block; overflow-wrap: anywhere; }
.diagram-ledger strong { color: var(--primary); text-transform: uppercase; font: 700 12px/1.3 'Hanken Grotesk', sans-serif; letter-spacing: .05em; }
.diagram-ledger span { margin-top: 3px; color: var(--muted); font: 500 12px/1.35 'Source Code Pro', monospace; }
.art-caption { display: flex; justify-content: space-between; gap: 10px; padding: 8px 11px; border-top: 1px solid var(--line); color: var(--muted); text-transform: uppercase; font: 700 12px/1.3 'Hanken Grotesk', sans-serif; letter-spacing: .06em; }
.well-title { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 7px; margin-bottom: 8px; border-bottom: 1px solid rgba(203,216,194,.8); color: var(--muted); text-transform: uppercase; font: 700 12px/1.3 'Hanken Grotesk', sans-serif; letter-spacing: .07em; }
pre, code, .mono { font-family: 'Source Code Pro', monospace; }
pre { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.code-green { color: var(--primary); font-weight: 700; }
.code-pink { color: var(--accent); font-weight: 600; }
.copy-action { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--primary); cursor: pointer; font: 600 13px/1 'Source Code Pro', monospace; }
.data-table { width: 100%; border-collapse: collapse; font: 500 13px/1.45 'Source Code Pro', monospace; }
.data-table th { padding: 6px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; text-transform: uppercase; white-space: nowrap; font-size: 12px; letter-spacing: .04em; }
.data-table td { padding: 7px 6px; border-bottom: 1px solid rgba(203,216,194,.55); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .value { color: var(--primary); font-weight: 700; }
.kv { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(0, 1.4fr); gap: 0; font: 500 13px/1.45 'Source Code Pro', monospace; }
.kv > div { padding: 7px 0; border-bottom: 1px solid rgba(203,216,194,.7); overflow-wrap: anywhere; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .key { color: var(--muted); }
.kv .val { color: var(--ink); text-align: right; font-weight: 600; }
.meter-wrap { margin-top: 14px; }
.meter-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; text-transform: uppercase; font: 700 12px/1.35 'Hanken Grotesk', sans-serif; letter-spacing: .05em; }
.meter-label span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.fresh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: breathe 2s ease-in-out infinite; }
.meter-track { height: 6px; overflow: hidden; border-radius: 999px; background: var(--well); }
.meter-fill { width: 92%; height: 100%; border-radius: inherit; background: linear-gradient(120deg, #1F6E3C 0%, #D94F8C 100%); transform-origin: left; animation: meter 4s ease-in-out infinite; }
.source-rail { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; margin-top: 14px; border-top: 1px solid var(--line); color: var(--muted); overflow-wrap: anywhere; font: 500 12px/1.45 'Source Code Pro', monospace; }
.source-rail a { color: var(--primary); text-decoration: none; }
.source-rail a:hover { text-decoration: underline; }
.action-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 14px; border: 1px solid var(--primary); border-radius: 20px; background: var(--primary); color: white; cursor: pointer; text-decoration: none; font: 700 13px/1 'Hanken Grotesk', sans-serif; letter-spacing: .02em; }
.button.secondary { background: var(--surface); color: var(--primary); }
.button.disabled { border-color: var(--line); background: var(--well); color: var(--muted); cursor: default; }
.rule-list, .log-list, .flow-list { margin: 0; padding: 0; list-style: none; }
.rule-list li, .log-list li, .flow-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-bottom: 1px solid rgba(203,216,194,.72); }
.rule-list li:last-child, .log-list li:last-child, .flow-list li:last-child { border-bottom: 0; }
.list-index { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--primary); font: 700 12px/1 'Source Code Pro', monospace; }
.list-copy strong { display: block; margin-bottom: 2px; font: 700 14px/1.35 'Hanken Grotesk', sans-serif; }
.list-copy span { color: var(--muted); font-size: 14px; }
.notice { max-width: 72ch; padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--well); color: var(--muted); font-size: 14px; }
.notice strong { color: var(--primary); font-family: 'Hanken Grotesk', sans-serif; }
.stage-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 11px; }
.stage-strip > div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--well); }
.stage-strip strong, .stage-strip span { display: block; overflow-wrap: anywhere; }
.stage-strip strong { color: var(--primary); text-transform: uppercase; font: 700 12px/1.3 'Hanken Grotesk', sans-serif; letter-spacing: .06em; }
.stage-strip span { margin-top: 4px; color: var(--muted); font: 500 12px/1.4 'Source Code Pro', monospace; }
.ca-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--well); font: 600 13px/1.4 'Source Code Pro', monospace; }
.form-stack { display: grid; gap: 10px; }
.form-stack label { color: var(--muted); text-transform: uppercase; font: 700 12px/1.3 'Hanken Grotesk', sans-serif; letter-spacing: .08em; }
.form-stack input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 20px; background: var(--well); color: var(--ink); font-family: 'Source Code Pro', monospace; }
.site-footer { margin-top: auto; padding: 18px 24px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; }
.footer-top, .footer-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.footer-brand { display: flex; align-items: center; gap: 7px; color: var(--ink); font: 800 14px/1 'Hanken Grotesk', sans-serif; }
.footer-brand img { object-fit: contain; transform: scale(1.7); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; font: 700 12px/1.4 'Hanken Grotesk', sans-serif; }
.footer-links a { color: var(--primary); text-decoration: none; }
.footer-meta { padding-top: 8px; border-top: 1px solid rgba(203,216,194,.7); font: 500 12px/1.4 'Source Code Pro', monospace; }
#toast { position: fixed; right: 18px; bottom: 18px; z-index: 80; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--ink); color: white; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; font: 600 13px/1.3 'Source Code Pro', monospace; }
#toast.show { opacity: 1; transform: translateY(0); }
.loading-bar { height: 3px; width: 100%; overflow: hidden; border-radius: 10px; background: var(--well); }
.loading-bar::after { content: ''; display: block; width: 35%; height: 100%; background: var(--primary); animation: loading 1.1s ease-in-out infinite; }

@keyframes meter { 0%,100% { transform: scaleX(.68); } 50% { transform: scaleX(1); } }
@keyframes breathe { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

@media (max-width: 1180px) {
  #primary-nav { display: none; }
  .menu-button { display: inline-flex; margin-left: auto; }
  .social-links { display: none; }
}
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-card.featured { grid-column: span 2; }
  .split-well { grid-template-columns: 1fr; }
  .manifest-line { align-items: flex-start; flex-direction: column; gap: 5px; }
  .manifest-source { text-align: left; }
}
@media (max-width: 620px) {
  .topbar-inner { min-height: 58px; padding: 9px 14px; gap: 8px; }
  .brand span { display: none; }
  .status-pill { display: none; }
  .copy-pill { flex: 1; justify-content: center; }
  .card-grid { grid-template-columns: 1fr; gap: 14px; }
  .data-card, .data-card.featured { grid-column: span 1; padding: 16px; }
  .hook { font-size: 42px; }
  .card-head { align-items: flex-start; }
  .badge { white-space: normal; text-align: right; }
  .meter-label, .source-rail, .footer-top, .footer-meta { align-items: flex-start; flex-direction: column; }
  .stage-strip { grid-template-columns: 1fr; }
  .diagram-ledger { grid-template-columns: 1fr; }
  .diagram-ledger > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .diagram-ledger > div:last-child { border-bottom: 0; }
  .footer-links { justify-content: flex-start; }
  .site-footer { padding: 17px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
