:root {
  --bg: #fbfaf7;
  --bg-alt: #f2efe8;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #5d5a53;
  --line: #e2ddd2;
  --accent: #c2410c;
  --accent-text: #ffffff;
  --built: #15803d;
  --proto: #a16207;
  --design: #6b7280;
  --warn-bg: #fff4e5;
  --warn-line: #f2c58a;
  --radius: 10px;
  --max: 1080px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --bg-alt: #1b1a17;
    --surface: #22211d;
    --text: #ece9e2;
    --muted: #a8a397;
    --line: #34322c;
    --accent: #fb923c;
    --accent-text: #1c1b19;
    --built: #4ade80;
    --proto: #facc15;
    --design: #9ca3af;
    --warn-bg: #2a2117;
    --warn-line: #6b4a1f;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 32px; } }

section { padding: 64px 0; }
section.alt { background: var(--bg-alt); }
.section-lead { color: var(--muted); max-width: 46em; }
.note { color: var(--muted); font-size: .95rem; margin-top: 1.5em; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-header .bar { min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; }
.site-header nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.site-header nav a:hover { color: var(--text); }
@media (max-width: 640px) { .site-header nav:not(.lang) { display: none; } }

/* Hero */
.hero { padding: 96px 0 80px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 5rem); letter-spacing: -0.03em; margin-bottom: .35em; }
.lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 36em; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2em; }
.button {
  display: inline-block; padding: 12px 20px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); text-decoration: none; font-weight: 600;
  border: 2px solid var(--accent);
}
.button.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.button.ghost:hover { border-color: var(--text); }

/* Cards */
.cards { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.cards li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.cards p { color: var(--muted); margin: 0; }

/* Principles */
.principles { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.principles li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.principles p { color: var(--muted); margin: 0; font-size: .95rem; }
.principles h3 { margin-bottom: .25em; }
.tag { flex: none; min-width: 3em; text-align: center; font-weight: 700; font-size: .8rem; padding: 3px 6px; border-radius: 6px; background: var(--bg-alt); border: 1px solid var(--line); color: var(--accent); }
.rules { margin-top: 32px; }
.rules ul { padding-left: 1.2em; margin: 0; }
.rules li { margin-bottom: .5em; }

/* Layer model */
.layers { display: grid; gap: 6px; margin: 28px 0 36px; max-width: 760px; }
.layer { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 14px; text-align: center; font-size: .95rem; }
.layer.muted { border-style: dashed; color: var(--muted); }
.layer.base { background: var(--bg-alt); font-weight: 600; }
.layer.row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; border: 0; background: none; }
.layer.row span { border: 1px solid var(--accent); border-radius: 8px; padding: 10px 6px; background: var(--surface); font-weight: 600; }
@media (max-width: 520px) { .layer.row { grid-template-columns: repeat(2, 1fr); } }

.modules { display: grid; gap: 20px 32px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin: 0; }
.modules dt { font-weight: 700; margin-bottom: .25em; }
.modules dd { margin: 0; color: var(--muted); font-size: .95rem; }

/* Status */
.date { font-size: .9rem; font-weight: 500; color: var(--muted); margin-left: .4em; }
.status { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.status th, .status td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.status th { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.status td:first-child { font-weight: 600; white-space: nowrap; }
.status tr:last-child td { border-bottom: 0; }
@media (max-width: 600px) {
  .status thead { display: none; }
  .status, .status tbody, .status tr, .status td { display: block; width: 100%; }
  .status td:first-child { border-bottom: 0; padding-bottom: 0; }
}
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; margin-right: 6px; }
.pill.built { color: var(--built); }
.pill.proto { color: var(--proto); }
.pill.design { color: var(--design); }
.warning { margin-top: 24px; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 18px 20px; }
.warning ul { margin: 0; padding-left: 1.2em; }
.warning li { margin-bottom: .4em; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 24px 0 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 24px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.timeline li:last-child::before { background: var(--accent); }
.when { display: block; font-weight: 700; font-size: .9rem; color: var(--accent); }
.timeline p { margin: 0; }

/* Links */
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.links li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.links a { font-weight: 700; display: block; }
.links span { color: var(--muted); font-size: .9rem; }

/* Contact */
.contact { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* Skip link */
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-text); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* Logo and language switch */
.logo { width: 36px; height: 36px; color: var(--text); flex: none; }
.lang { display: flex; gap: 2px; }
.lang a { color: var(--muted); text-decoration: none; font-size: .8rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; border: 1px solid transparent; }
.lang a:hover { color: var(--text); border-color: var(--line); }
.lang a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }

/* Hero with globe */
.hero-grid { display: grid; gap: 40px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; } }
.hero-text { min-width: 0; }
.no-token { font-weight: 800; font-size: clamp(1.2rem, 2.4vw, 1.5rem); letter-spacing: -0.01em; margin-top: .2em; }
.hero-globe { min-width: 0; }
.globe-wrap { position: relative; aspect-ratio: 1; width: min(100%, 560px); margin: 0 auto; }
#globe { width: 100%; height: 100%; display: block; touch-action: none; }
.globe-hint { margin: 6px 0 0; text-align: center; color: var(--muted); font-size: .8rem; }
html:not(.has-globe) .globe-wrap, html:not(.has-globe) .globe-hint { display: none; }
.module-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 520px) { .module-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.module-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left;
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; cursor: pointer;
}
.module-item:hover, .module-item.is-active { border-color: var(--accent); }
.module-item.is-active { box-shadow: inset 0 0 0 1px var(--accent); }
.module-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.module-tag { font-size: .7rem; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.module-name { font-weight: 600; font-size: .95rem; line-height: 1.25; }
html.has-globe .module-item .module-text, html.has-globe .module-item a { display: none; }
html:not(.has-globe) .module-list { grid-template-columns: 1fr; }
html:not(.has-globe) .module-item { cursor: default; }
html:not(.has-globe) .module-item .module-text { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.module-panel { margin-top: 16px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; }
.module-panel h3 { margin-bottom: .3em; }
.module-panel p { color: var(--muted); margin-bottom: .6em; }
.module-panel a { font-weight: 600; }

/* Money section */
.two-col { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .two-col { grid-template-columns: 1fr 1fr; } }
.two-col h3 { margin-top: .2em; }

/* Legal pages */
.legal { padding: 56px 0 72px; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.legal h2 { font-size: 1.25rem; margin-top: 1.8em; }
.draft { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 12px 16px; }
.placeholder { background: var(--warn-bg); border-bottom: 2px dashed var(--warn-line); padding: 0 4px; }

/* Inline logo: globe + net, colours swap in dark mode */
.logo .g { stroke: var(--text); }
.logo .n { stroke: var(--accent); }
.logo .nd { fill: var(--accent); stroke: var(--bg); }
@media (prefers-color-scheme: dark) {
  .logo .g { stroke: var(--accent); }
  .logo .n { stroke: var(--text); }
  .logo .nd { fill: var(--text); }
}
