:root {
  --bg: #090505;
  --bg-2: #120809;
  --ink: #f6efe8;
  --muted: #b5a39c;
  --red: #ff2a3a;
  --red-2: #c81b2c;
  --line: rgba(255, 42, 58, 0.18);
  --card: rgba(255, 246, 240, 0.03);
  --serif: "Instrument Serif", "Songti SC", "Noto Serif SC", serif;
  --sans: "Outfit", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.grain, .orb { pointer-events: none; position: fixed; inset: 0; }
.grain {
  z-index: 0;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.orb {
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 45% at 80% -10%, rgba(255, 42, 58, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 20%, rgba(255, 80, 60, 0.08), transparent 50%);
}

a { color: var(--ink); }
button { font: inherit; color: inherit; }

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 7vw;
  backdrop-filter: blur(16px);
  background: rgba(9, 5, 5, 0.62);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-family: var(--serif);
  font-size: 18px;
  border-radius: 7px;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}
.nav-links a:hover { color: var(--ink); }
.lang {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.lang button {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.lang button.is-on { background: var(--red); color: #fff; }

.hero, .split, .primitives, .era, .stack, .compare, .start, .foot, .stats, .cases, .repos, .how, .field {
  position: relative;
  z-index: 1;
  padding: 88px 7vw;
}
.hero { padding-top: 72px; padding-bottom: 40px; max-width: 1400px; }
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--red);
  margin: 0 0 18px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  max-width: 14ch;
}
.hero h1 em { font-style: italic; color: #fff; }
.lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: 18px;
  margin: 0 0 32px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 48px; }
.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-2); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: rgba(255, 42, 58, 0.5); }

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,42,58,0.06), var(--card));
  border-radius: 20px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}
.rerun {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--ink);
}
.rerun:hover { border-color: var(--red); }
.state {
  margin: 0;
  padding: 16px 18px 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: #e8d4ce;
  white-space: pre-wrap;
}
.answers { padding: 8px 18px 18px; display: grid; gap: 14px; }
.answer {
  display: grid;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  animation: rise 0.55s ease forwards;
}
.answer:nth-child(2) { animation-delay: 0.12s; }
.answer:nth-child(3) { animation-delay: 0.24s; }
.answer-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.answer-top span { color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; }
.answer-top strong { font-weight: 500; }
.bar {
  height: 6px;
  background: rgba(255, 246, 240, 0.08);
  border-radius: 99px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--red-2), var(--red));
  animation: fill 0.8s ease forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fill { to { width: var(--w); } }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  padding: 0 7vw 24px;
  background: transparent;
}
.stats article {
  padding: 28px 24px;
  background: var(--card);
  border: 1px solid var(--line);
}
.stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.03em;
}
.stats span { color: var(--muted); font-size: 13px; }

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: start;
}
.split h2, .primitives h2, .era h2, .stack h2, .compare h2, .start h2, .cases h2, .repos h2, .how h2, .field h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.prose p { color: var(--muted); font-size: 17px; margin: 0 0 16px; }
.section-lead { color: var(--muted); max-width: 70ch; font-size: 17px; }

.cards { display: grid; gap: 16px; }
.cards.three { grid-template-columns: repeat(3, 1fr); margin-top: 36px; }
.stack-grid, .cases-grid, .repo-grid, .field-grid { grid-template-columns: repeat(2, 1fr); margin-top: 36px; }
.diagram {
  margin: 32px 0 8px;
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  overflow-x: auto;
}
.diagram svg { width: 100%; min-width: 640px; height: auto; display: block; }
.howto {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.howto li {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.howto strong { display: block; margin-bottom: 8px; }
.howto span { color: var(--muted); font-size: 15px; }
.voices { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  min-height: 180px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(255, 42, 58, 0.45); }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--red);
}
.card h3 { margin: 10px 0 8px; font-size: 20px; font-weight: 500; }
.card p { margin: 0; color: var(--muted); }
a.card.repo { text-decoration: none; color: inherit; display: block; }
.repo-path {
  display: block;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--red);
  letter-spacing: 0.02em;
}
.section-lead a { color: var(--ink); }
.card code, .snippet code, .paths code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: #ffd0d3;
}

.voices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 36px;
}
blockquote {
  margin: 0;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 0 18px 18px 0;
}
blockquote p { margin: 0 0 16px; font-family: var(--serif); font-size: 22px; line-height: 1.35; }
cite { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--muted); }
cite a { color: var(--muted); }

.table-wrap { overflow-x: auto; margin-top: 28px; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 16px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); font-weight: 500; font-size: 13px; letter-spacing: 0.06em; }
tbody th { color: var(--muted); font-weight: 400; width: 18%; }
.fine { color: var(--muted); font-size: 13px; }

.paths { list-style: none; padding: 0; margin: 32px 0; display: grid; gap: 16px; }
.paths li {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.paths strong { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; color: var(--red); }
.paths p { margin: 8px 0 0; color: var(--muted); }
.snippet {
  margin: 0;
  padding: 22px;
  overflow-x: auto;
  background: #0e0708;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: #f0d9d6;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.foot-links { display: flex; gap: 18px; }
.foot-links a { color: var(--muted); text-underline-offset: 3px; }

@media (max-width: 980px) {
  .nav-links { display: none; }
  .stats, .cards.three, .voices, .split, .stack-grid, .cases-grid, .repo-grid, .field-grid { grid-template-columns: 1fr; }
  .hero, .split, .primitives, .era, .stack, .compare, .start, .foot, .cases, .repos, .how, .field { padding: 56px 6vw; }
  .howto { grid-template-columns: 1fr; }
  .stats { padding: 0 6vw 8px; }
  blockquote p { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .answer, .bar i { animation: none; opacity: 1; transform: none; }
  .bar i { width: var(--w); }
  .card { transition: none; }
}
