:root {
  --bg0: #05080f;
  --bg1: #0a101c;
  --bg2: #121a2c;
  --line: rgba(120, 160, 220, 0.14);
  --violet: #a78bfa;
  --violet-dim: #7c5cbf;
  --cyan: #5eead4;
  --cyan-dim: #2dd4bf;
  --amber: #fbbf24;
  --rose: #fb7185;
  --text: #e8eef8;
  --muted: #8b9bb4;
  --card: rgba(14, 20, 36, 0.78);
  --glow: 0 0 60px rgba(94, 234, 212, 0.08);
  --radius: 16px;
  --max: 1080px;
  --font: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg0);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(167, 139, 250, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 10%, rgba(94, 234, 212, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(59, 130, 246, 0.1), transparent 55%),
    var(--bg0);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
  pointer-events: none;
  opacity: 0.45;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: #99f6e4; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--cyan);
  background: rgba(94, 234, 212, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 15, 0.82);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--text); }

.brand-mark {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 6px;
  background:
    conic-gradient(from 210deg, var(--cyan), var(--violet), var(--cyan));
  box-shadow: 0 0 16px rgba(94, 234, 212, 0.35);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-left: auto;
  font-size: 0.9rem;
}
.nav a {
  color: var(--muted);
}
.nav a:hover { color: var(--text); }

.pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 820px) {
  .site-header { flex-wrap: wrap; }
  .nav { margin-left: 0; width: 100%; order: 3; }
  .status-pill { margin-left: auto; }
}

/* Hero */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 2.5rem;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 16ch;
  margin-bottom: 1.25rem;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 2rem;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 720px) {
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
}

.meta-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: var(--glow);
}

.meta-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.meta-value {
  font-weight: 600;
  font-size: 1rem;
}

.hero-note {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 60ch;
  border-left: 2px solid var(--violet-dim);
  padding-left: 1rem;
}

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 62ch;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-head p { color: var(--muted); }

/* Gates */
.gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.gate {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  position: relative;
  overflow: hidden;
}

.gate.done { border-color: rgba(94, 234, 212, 0.28); }
.gate.strong { border-color: rgba(167, 139, 250, 0.35); }

.gate-id {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--cyan);
  font-weight: 600;
}

.gate h3 {
  font-size: 1.05rem;
  margin: 0.35rem 0 0.45rem;
}

.gate p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Cards / lists */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.check-list li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.5);
}

.serial-panel {
  background: #070c16;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}

.serial-panel h3 {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.serial {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--cyan-dim);
  overflow-x: auto;
  white-space: pre;
}

/* Layers */
.layers {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.layer {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1rem;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.layer-n {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--violet);
  font-size: 0.95rem;
  padding-top: 0.15rem;
}

.layer h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.layer p {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 0.55rem;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.tag.live {
  color: var(--cyan);
  border-color: rgba(94, 234, 212, 0.35);
  background: rgba(94, 234, 212, 0.08);
}

.tag.design {
  color: var(--violet);
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.08);
}

.tag.deferred {
  color: var(--muted);
  border-color: var(--line);
}

/* Manifesto */
.principles .manifesto {
  list-style: none;
  counter-reset: m;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.manifesto li {
  counter-increment: m;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.15rem 1rem 3.25rem;
  position: relative;
  color: var(--muted);
}

.manifesto li::before {
  content: counter(m, decimal-leading-zero);
  position: absolute;
  left: 1rem;
  top: 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--violet);
}

.manifesto strong { color: var(--text); font-weight: 600; }

/* Roadmap */
.roadmap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.road-item {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}

.road-item.next { border-color: rgba(167, 139, 250, 0.3); }
.road-item.later { opacity: 0.85; }

.road-n {
  font-family: var(--mono);
  color: var(--cyan);
  font-weight: 600;
}

.road-item h3 { margin-bottom: 0.3rem; font-size: 1.05rem; }
.road-item p { color: var(--muted); font-size: 0.94rem; }

/* Table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.ladder {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.ladder th,
.ladder td {
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.ladder th {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.ladder tr:last-child td { border-bottom: none; }

.inception-card p + p { margin-top: 0.9rem; }
.muted { color: var(--muted); }

/* FAQ */
.faq {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq details[open] summary {
  margin-bottom: 0.5rem;
  color: var(--cyan);
}

.faq p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem 2.5rem;
  margin-top: 1rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.92rem;
}

.footer-fine {
  max-width: var(--max);
  margin: 0 auto;
  font-size: 0.8rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
