/* ────────────────────────────────────────────────────────────
   openpasture — shared design system
   brutalist-terminal: JetBrains Mono + Libre Baskerville,
   olive/cream/dark, hard offset shadows, square corners.
   ──────────────────────────────────────────────────────────── */

:root {
  --olive: #4a6a2e;
  --olive-bright: #5a7a38;
  --olive-muted: #c0d0a8;
  --olive-light: #f2f6ee;
  --terracotta: #a83a32;
  --terracotta-muted: #c06a62;
  --cobalt: #0047AB;
  --cobalt-muted: #4a7abf;
  --dark: #1a1e18;
  --charcoal: #2a3028;
  --cream: #f6f8f4;
  --panel: #ffffff;
  --border: #c4d0c0;
  --text-muted-olive: #647060;
  font-size: 13px;
}

@media (min-width: 1024px) { :root { font-size: 14px; } }
@media (min-width: 1280px) { :root { font-size: 15px; } }

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

html { scroll-behavior: smooth; }

body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--cream);
  color: var(--dark);
  line-height: 1.7;
  font-weight: 400;
}

.serif { font-family: 'Libre Baskerville', serif; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-divider {
  height: 4px;
  background: var(--olive);
  width: 100%;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 2px solid var(--dark);
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-olive {
  background: var(--olive);
  color: var(--cream);
  border-color: var(--olive);
  box-shadow: 3px 3px 0 var(--dark);
}
.btn-olive:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--dark);
}

.btn-outline {
  background: transparent;
  color: var(--dark);
  border-color: var(--dark);
  box-shadow: 3px 3px 0 var(--dark);
}
.btn-outline:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--dark);
}

.btn-white {
  background: var(--cream);
  color: var(--dark);
  border-color: var(--cream);
  box-shadow: 3px 3px 0 var(--olive);
}
.btn-white:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--olive);
}

.btn-outline-light {
  background: transparent;
  color: var(--cream);
  border-color: var(--cream);
  box-shadow: 3px 3px 0 rgba(255,255,255,0.15);
}
.btn-outline-light:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(255,255,255,0.15);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.7rem; }

/* ─── Header ─── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--panel);
  border-bottom: 2px solid var(--border);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.header-logo {
  width: 32px;
  height: 32px;
  background: var(--olive);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
}
.header-logo i { width: 18px; height: 18px; }
.header-brand {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.header-tag {
  font-size: 0.65rem;
  color: var(--text-muted-olive);
  background: var(--olive-light);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  font-weight: 500;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.header-nav a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted-olive);
  transition: color 0.15s;
}
.header-nav a:hover { color: var(--dark); }
.header-nav .github-link { display: flex; align-items: center; }
.header-nav .github-link i { width: 18px; height: 18px; }
.header-cta .btn { padding: 0.5rem 1rem; font-size: 0.7rem; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark);
}
.mobile-toggle i { width: 24px; height: 24px; }

.mobile-menu {
  display: none;
  background: var(--panel);
  border-bottom: 2px solid var(--border);
  padding: 1rem 1.5rem;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted-olive);
}
.mobile-menu a:hover { color: var(--dark); }
.mobile-menu .btn { margin-top: 0.75rem; }

/* ─── Section labels ─── */
.section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--text-muted-olive);
  margin-bottom: 1rem;
}

/* ─── Dark hero ─── */
.hero {
  background: var(--dark);
  padding: 7rem 0 5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  line-height: 1.6;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--olive);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--olive-muted);
  margin-bottom: 2rem;
  text-transform: lowercase;
}

.hero h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--olive-muted);
  max-width: 640px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.hero-note {
  font-size: 0.65rem;
  color: #6a7a60;
  margin-top: 0.75rem;
}

/* ─── Window chrome (figures) ─── */
.window-chrome {
  border: 2px solid var(--charcoal);
  background: var(--panel);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
  text-align: left;
}
.window-bar {
  background: var(--charcoal);
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.window-dot { width: 10px; height: 10px; border-radius: 50%; }
.window-dot-red { background: #d45a5a; }
.window-dot-yellow { background: #d4a84a; }
.window-dot-green { background: #5aaa5a; }
.window-title {
  margin-left: 0.5rem;
  font-size: 0.7rem;
  color: #8a9080;
  font-weight: 500;
}
.window-body { padding: 1.5rem; }

/* ─── Long-form prose (manifesto) ─── */
.prose-wrap {
  display: grid;
  grid-template-columns: 200px minmax(0, 68ch);
  gap: 4rem;
  justify-content: center;
  padding: 4rem 1.5rem 6rem;
  max-width: 1120px;
  margin: 0 auto;
}

.toc {
  position: sticky;
  top: 5.5rem;
  align-self: start;
  font-size: 0.7rem;
}
.toc-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--text-muted-olive);
  margin-bottom: 0.75rem;
}
.toc a {
  display: block;
  padding: 0.25rem 0 0.25rem 0.75rem;
  color: var(--text-muted-olive);
  border-left: 2px solid var(--border);
  transition: color 0.15s, border-color 0.15s;
  line-height: 1.5;
}
.toc a:hover { color: var(--dark); }
.toc a.active {
  color: var(--olive);
  border-left-color: var(--olive);
  font-weight: 700;
}

.prose { min-width: 0; }

.prose .doc-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--olive);
  margin-bottom: 1rem;
}

.prose h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.prose .doc-meta {
  font-size: 0.7rem;
  color: var(--text-muted-olive);
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 3rem;
}

.prose h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 3.5rem 0 1.25rem;
  padding-top: 1rem;
  scroll-margin-top: 5.5rem;
}
.prose h2 .sec-num {
  color: var(--olive);
  margin-right: 0.75rem;
}

.prose p {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.98rem;
  line-height: 1.95;
  margin-bottom: 1.4rem;
}

.prose p.mono-aside {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted-olive);
  line-height: 1.8;
}

.prose a {
  color: var(--olive);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--olive-bright); }

.prose strong { font-weight: 700; }

.prose ul, .prose ol {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.98rem;
  line-height: 1.9;
  margin: 0 0 1.4rem 1.4rem;
}
.prose li { margin-bottom: 0.5rem; }

.prose .pull {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.6;
  border-left: 4px solid var(--olive);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2.5rem 0;
  color: var(--charcoal);
}

.prose sup a, .prose .fnref {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65em;
  color: var(--olive);
  text-decoration: none;
  font-weight: 700;
}

.prose .figure {
  margin: 2.5rem 0;
}
.prose .figure figcaption {
  font-size: 0.7rem;
  color: var(--text-muted-olive);
  margin-top: 0.6rem;
  line-height: 1.6;
}

/* stat blocks */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.stat-card {
  background: var(--panel);
  border: 2px solid var(--dark);
  box-shadow: 3px 3px 0 var(--dark);
  padding: 1.25rem 1rem 1rem;
}
.stat-card .stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}
.stat-card .stat-desc {
  font-size: 0.65rem;
  color: var(--text-muted-olive);
  line-height: 1.6;
}

/* footnotes */
.footnotes {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
}
.footnotes h2 { margin-top: 0; }
.footnotes ol {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted-olive);
  line-height: 1.8;
  margin-left: 1.4rem;
}
.footnotes li { margin-bottom: 0.6rem; scroll-margin-top: 5.5rem; }
.footnotes a { color: var(--olive); text-decoration: underline; text-underline-offset: 2px; }

/* ─── Honesty ledger ─── */
.ledger {
  background: var(--panel);
  border: 2px solid var(--dark);
  box-shadow: 4px 4px 0 var(--dark);
  font-family: 'JetBrains Mono', monospace;
}
.ledger-head {
  background: var(--charcoal);
  color: var(--cream);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.6rem 1rem;
}
.ledger ul { list-style: none; margin: 0; padding: 0.75rem 0; }
.ledger li {
  display: flex;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  font-size: 0.75rem;
  line-height: 1.7;
  font-family: 'JetBrains Mono', monospace;
}
.ledger li + li { border-top: 1px solid var(--olive-light); }
.ledger .mark { font-weight: 700; flex-shrink: 0; }
.ledger .mark-yes { color: var(--olive); }
.ledger .mark-part { color: var(--cobalt); }
.ledger .mark-no { color: var(--terracotta); }
.ledger .ledger-note {
  font-size: 0.65rem;
  color: var(--text-muted-olive);
  padding: 0.6rem 1rem 0.9rem;
  border-top: 1px solid var(--border);
  line-height: 1.7;
}

/* ─── Phase timeline ─── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.phase {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.25rem;
  position: relative;
  padding-bottom: 2rem;
}
.phase::before {
  content: '';
  position: absolute;
  left: 1.7rem;
  top: 2.6rem;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.phase:last-child::before { display: none; }
.phase-num {
  width: 3.5rem;
  height: 2.4rem;
  background: var(--panel);
  border: 2px solid var(--dark);
  box-shadow: 2px 2px 0 var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}
.phase-num.phase-now { background: var(--olive); color: var(--cream); border-color: var(--olive); }
.phase-body h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: lowercase;
  margin-bottom: 0.35rem;
  padding-top: 0.35rem;
}
.phase-body p {
  font-size: 0.78rem;
  color: var(--text-muted-olive);
  line-height: 1.8;
  max-width: 58ch;
}
.phase-status {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.1rem 0.5rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.phase-status-now { background: var(--olive-light); border: 1px solid var(--olive-muted); color: var(--olive); }
.phase-status-future { background: var(--cream); border: 1px solid var(--border); color: var(--text-muted-olive); }

/* ─── System flow diagram ─── */
.flow {
  display: grid;
  gap: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
}
.flow-tier {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}
.flow-node {
  background: var(--panel);
  border: 2px solid var(--dark);
  box-shadow: 2px 2px 0 var(--dark);
  padding: 0.7rem 0.8rem;
}
.flow-node .fn-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted-olive);
  margin-bottom: 0.15rem;
}
.flow-node .fn-title { font-size: 0.72rem; font-weight: 700; line-height: 1.5; }
.flow-node .fn-desc { font-size: 0.62rem; color: var(--text-muted-olive); line-height: 1.6; }
.flow-node-wide { grid-column: 1 / -1; }
.flow-node-accent { border-color: var(--olive); box-shadow: 2px 2px 0 var(--olive); }
.flow-arrow {
  text-align: center;
  font-size: 0.8rem;
  color: var(--olive);
  font-weight: 700;
  line-height: 1;
}
.flow-loop {
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-muted-olive);
  border: 1px dashed var(--border);
  padding: 0.4rem;
}

/* ─── Early access form ─── */
.ea-section {
  background: var(--dark);
  color: var(--cream);
  padding: 5rem 0;
}
.ea-section h2 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
.ea-section > .container > p {
  font-size: 0.85rem;
  color: var(--olive-muted);
  max-width: 60ch;
  margin-bottom: 2rem;
  line-height: 1.8;
}
.ea-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 640px;
}
.ea-form input, .ea-form textarea {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: 0.75rem 0.9rem;
  background: var(--cream);
  color: var(--dark);
  border: 2px solid var(--cream);
  border-radius: 0;
  width: 100%;
}
.ea-form input:focus, .ea-form textarea:focus {
  outline: none;
  border-color: var(--olive-bright);
}
.ea-form textarea { grid-column: 1 / -1; resize: vertical; min-height: 5rem; }
.ea-form .ea-submit-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.ea-status { font-size: 0.72rem; color: var(--olive-muted); }
.ea-status.error { color: var(--terracotta-muted); }

/* ─── Footer ─── */
.footer {
  background: var(--dark);
  color: #8a9080;
  padding: 3.5rem 0 2rem;
  border-top: 1px solid var(--charcoal);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-col h4 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cream);
  margin-bottom: 1rem;
}
.footer-col a {
  display: block;
  font-size: 0.75rem;
  color: #8a9080;
  margin-bottom: 0.5rem;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--cream); }
.footer-bottom {
  border-top: 1px solid var(--charcoal);
  padding-top: 1.5rem;
  font-size: 0.7rem;
  text-align: center;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .prose-wrap { grid-template-columns: minmax(0, 68ch); }
  .toc { display: none; }
}

@media (max-width: 768px) {
  .header-nav, .header-cta { display: none; }
  .mobile-toggle { display: block; }

  .hero { padding: 4.5rem 0 3.5rem; }

  .stat-row { grid-template-columns: 1fr; }
  .flow-tier { grid-template-columns: 1fr 1fr; }

  .ea-form { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
