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

:root {
  --bg: oklch(98% 0.002 95);
  --fg: oklch(16% 0.004 95);
  --muted: oklch(46% 0.006 95);
  --border: oklch(85% 0.006 95);
  --grid-fill: oklch(93% 0.004 95);
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

body:has(#dark-mode:checked) {
  --bg: oklch(14% 0.004 95);
  --fg: oklch(96% 0.002 95);
  --muted: oklch(62% 0.006 95);
  --border: oklch(30% 0.006 95);
  --grid-fill: oklch(20% 0.004 95);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.container-wide { max-width: 940px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.page-main { padding-top: 90px; padding-bottom: 100px; }

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.site-nav .brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 28px; height: auto; }
.brand-text { display: flex; flex-direction: column; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; line-height: 1.4; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 400; }
.nav-links a.active { font-weight: 700; text-decoration: underline; }

/* Dark/light toggle — pure CSS, no JS */
.mode-toggle { display: flex; align-items: center; }
.mode-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-label { cursor: pointer; display: flex; align-items: center; }
.toggle-track { display: block; width: 36px; height: 18px; border: 1px solid var(--fg); border-radius: 9px; position: relative; }
.toggle-thumb { position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border-radius: 50%; background: var(--fg); transition: transform 0.15s ease; }
#dark-mode:checked ~ .toggle-label .toggle-thumb { transform: translateX(18px); }

/* Footer */
.site-footer {
  padding: 28px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* Headings / eyebrow */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.page-title {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 34px;
  margin: 0 0 12px;
}
h2.page-title { font-size: 26px; margin-top: 8px; }
.page-sub { font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 560px; margin: 0 0 56px; }

/* Prose (about story, blog posts, project/idea detail copy) */
.prose p { font-size: 16px; line-height: 1.7; margin: 0 0 22px; }
.prose p:last-child { margin-bottom: 0; }

/* Buttons */
.btn {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--fg);
  padding: 14px 28px;
  display: inline-block;
}
.btn-disabled { border-color: var(--border); color: var(--muted); cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; }

/* Hero (home) */
.hero { padding-top: 90px; padding-bottom: 100px; display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 60px; align-items: center; }
.hero h1 { font-family: var(--font-mono); font-size: 46px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.hero-graphic { display: flex; justify-content: center; }
.hero-graphic svg { width: 100%; max-width: 230px; height: auto; display: block; }
.hero-graphic img { width: 100%; height: auto; display: block; }
body:has(#dark-mode:checked) .hero-graphic img { filter: invert(1); }
body:has(#dark-mode:checked) .brand-mark { filter: invert(1); }

/* Mission (home) */
.mission { padding-top: 60px; padding-bottom: 100px; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.mission .num { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.mission p { font-size: 15px; line-height: 1.65; margin: 0; }

/* CTA (home) */
.cta { padding-top: 56px; padding-bottom: 100px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-label { font-family: var(--font-mono); font-size: 19px; }

/* About page section dividers */
.about-divider { border-top: 1px solid var(--border); margin: 48px 0; }
.vision-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.prose .vision-list { padding-left: 18px; }
.principle-table { border-top: 1px solid var(--border); margin-top: 32px; }
.principle-row { display: grid; grid-template-columns: 32px 176px 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.principle-row:last-child { border-bottom: none; }
.principle-num { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.principle-name { font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.principle-desc { font-size: 15px; line-height: 1.6; }
@media (max-width: 640px) {
  .principle-row { grid-template-columns: 1fr; gap: 6px; padding: 18px 0; }
  .principle-num { display: none; }
}
.prose .vision-list li { font-size: 16px; line-height: 1.5; padding-left: 16px; position: relative; margin-bottom: 14px; }
.vision-list li::before { content: "•"; position: absolute; left: 0; }

/* Projects grid */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; background: var(--grid-fill); border: 1px solid var(--border); margin-bottom: 90px; }
.project-card { background: var(--bg); padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.project-icon { width: 52px; height: 52px; border: 1px solid var(--fg); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; }
.project-name { font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.project-desc { font-size: 13px; line-height: 1.55; color: var(--muted); }

/* Ideas list */
.idea-list { border-top: 1px solid var(--border); margin-bottom: 100px; }
.idea-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.idea-title { font-family: var(--font-mono); font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.idea-desc { font-size: 13px; color: var(--muted); }
.idea-cta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Blog list */
.post-list { border-top: 1px solid var(--border); }
.post-row { display: block; padding: 32px 0; border-bottom: 1px solid var(--border); }
.post-date { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.post-title { font-family: var(--font-mono); font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.post-excerpt { font-size: 14px; line-height: 1.6; color: var(--muted); }

/* Detail pages (project / idea / blog post) */
.back-link { font-family: var(--font-mono); font-size: 12px; color: var(--muted); display: inline-block; margin-bottom: 48px; }
.detail-icon { width: 64px; height: 64px; border: 1px solid var(--fg); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 13px; margin-bottom: 28px; }
.detail-title { font-family: var(--font-mono); font-size: 32px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 28px; }
.post-date-lg { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-bottom: 18px; }
.post-author { font-family: var(--font-mono); font-size: 13px; color: var(--muted); margin: 0 0 32px; }
.prose p.post-lede { font-size: 19px; line-height: 1.5; color: var(--muted); margin: 0 0 32px; }

/* Placeholder image block (blog posts) */
.placeholder-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(45deg, var(--border), var(--border) 10px, transparent 10px, transparent 20px);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  margin: 40px 0;
}
.placeholder-image span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* Funding (about) */
.funding { border-top: 1px solid var(--border); }
.funder-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--grid-fill); border: 1px solid var(--border); margin-bottom: 64px; }
.funder-row { padding: 14px 16px; background: var(--bg); font-family: var(--font-mono); font-size: 14px; }

.donate-block { padding-top: 0; }
.donate-heading { font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 40px; }
.donate-heading .ens-link { text-decoration: none; }
.donate-heading .ens-link:hover { text-decoration: underline; }
.ext-arrow { display: inline-block; }

.address-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.address-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.address-hint { font-size: 12px; color: var(--muted); text-align: right; }

.address-row { display: flex; align-items: stretch; border: 1px solid var(--fg); margin-bottom: 16px; }
.address-text { flex: 1 1 auto; font-family: var(--font-mono); font-size: 13px; padding: 16px 20px; word-break: break-all; user-select: all; cursor: pointer; }
.address-text:hover { background: var(--grid-fill); }

.qr-reveal summary { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.qr-reveal summary::-webkit-details-marker { display: none; }
.qr-reveal summary::before { content: "+"; }
.qr-reveal[open] summary::before { content: "–"; }
.qr-reveal summary:hover { text-decoration: underline; }
.qr-reveal[open] summary { margin-bottom: 24px; }
.qr-placeholder { width: 220px; aspect-ratio: 1 / 1; margin: 0; }
.qr-frame { width: 220px; padding: 16px; background: #fff; border: 1px solid var(--border); }
.qr-frame img { width: 100%; height: auto; display: block; }

/* Prose extras (headings, lists, inline code — used by longer blog posts) */
.prose h2 { font-family: var(--font-mono); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 48px 0 18px; }
.prose h3 { font-family: var(--font-mono); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 36px 0 16px; }
.prose ul { margin: 0 0 22px; padding-left: 22px; }
.prose li { font-size: 16px; line-height: 1.7; margin-bottom: 10px; }
.prose li:last-child { margin-bottom: 0; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; background: var(--grid-fill); padding: 2px 5px; }
.prose p a, .prose li a, .prose figcaption a { text-decoration: underline; }

.post-figure { margin: 40px 0; }
.post-figure img { width: 100%; height: auto; display: block; border: 1px solid var(--border); }
.post-figure figcaption { font-size: 13px; line-height: 1.6; color: var(--muted); font-style: italic; margin-top: 12px; text-align: center; }

.code-block { font-family: var(--font-mono); font-size: 13px; line-height: 1.6; background: var(--grid-fill); border: 1px solid var(--border); padding: 16px 20px; margin: 0 0 22px; overflow-x: auto; }
.code-block code { background: none; padding: 0; }

/* Spaces two-ends diagram (blog) */
.prose .ends-wrap { margin: 40px 0; }
.prose .end-card { border: 1px solid var(--border); padding: 32px; }
.prose h2.end-heading { font-family: var(--font-mono); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 6px; }
.prose .end-card.end-b .end-heading { font-style: italic; font-weight: 500; }
.prose .end-gloss { font-style: italic; font-size: 13px; color: var(--muted); margin: 0 0 20px; }
.prose p.end-lede { font-size: 16px; line-height: 1.7; margin: 0 0 20px; }
.prose h3.end-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 28px 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.prose p.def-block { font-size: 15px; line-height: 1.65; margin: 0 0 14px; padding: 16px 20px; border: 1px solid var(--border); }
.prose .end-card ul { column-count: 2; column-gap: 32px; }
.prose .end-card ul li { break-inside: avoid; }
.prose ul.feature-list { list-style: none; margin: 0 0 8px; padding: 0; }
.prose ul.feature-list li { font-size: 14px; line-height: 1.6; padding-left: 18px; position: relative; margin-bottom: 12px; color: var(--muted); }
.prose ul.feature-list li strong { color: var(--fg); font-weight: 600; }
.prose ul.feature-list li::before { position: absolute; left: 0; top: 0; font-family: var(--font-mono); color: var(--fg); content: ""; }
.prose ul.feature-list.plus li::before { content: "+"; }
.prose ul.feature-list.minus li::before { content: "\2212"; }
.prose ul.feature-list.keep li::before { content: "\00B7"; font-size: 18px; top: -3px; }
.prose p.end-note { font-style: italic; font-size: 14px; color: var(--muted); margin: 16px 0 0; }
.prose .end-char { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 16px; font-size: 15px; font-style: italic; color: var(--muted); }
.end-connector { display: flex; flex-direction: column; align-items: center; padding: 20px 0; gap: 6px; }
.end-connector .stem { width: 1px; height: 22px; background: var(--border); }
.end-connector .arrow { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--fg); }
.end-connector .label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) {
  .prose .end-card { padding: 24px 20px; }
  .prose .end-card ul { column-count: 1; }
}

/* Mobile */
@media (max-width: 640px) {
  .mission { grid-template-columns: 1fr; gap: 40px; }
  .address-text { font-size: 11px; }
  .funder-list { grid-template-columns: 1fr; }
}
