:root {
  --bg: #0a0e14;
  --surface: rgba(17, 24, 38, 0.84);
  --surface-strong: #151d2c;
  --surface-alt: #0f1521;
  --text: #edf2ff;
  --muted: #98a6c4;
  --line: rgba(255, 255, 255, 0.09);
  --blue: #6fa8ff;
  --red: #ff7a59;
  --yellow: #f0c24f;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.3);
  --radius: 22px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  background: #0a0e14;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(111, 168, 255, 0.14), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(255, 122, 89, 0.12), transparent 22%),
    linear-gradient(180deg, #0a0e14 0%, #0c1118 100%);
  font-family: "Manrope", sans-serif;
  line-height: 1.6;
}

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

code,
pre {
  font-family: "IBM Plex Mono", monospace;
}

.site-shell {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
  padding-bottom: 3rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(15, 21, 33, 0.9);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.brand {
  font-family: "Instrument Serif", serif;
  font-size: 1.8rem;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
}

.section {
  padding: 4.4rem 0 1rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 8rem);
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-family: "Instrument Serif", serif;
  font-size: clamp(4rem, 8vw, 6.3rem);
  font-weight: 400;
}

h2 {
  font-family: "Instrument Serif", serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 400;
}

h3 {
  font-size: 1.05rem;
  margin-bottom: 0.7rem;
}

.hero-subhead {
  margin: 1rem 0 0;
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  font-weight: 700;
  max-width: 24ch;
}

.hero-body,
.section-lead,
.panel p,
.demo-card p,
.link-card span,
.pipeline-step p,
.diagram-node p {
  color: var(--muted);
}

.hero-body,
.section-lead {
  max-width: 62ch;
  font-size: 1rem;
}

.section-lead {
  margin: 0.8rem 0 0;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
}

.button-primary {
  background: linear-gradient(135deg, var(--blue), #8f71ff);
  color: #08111f;
}

.button-secondary {
  background: transparent;
  border-color: var(--line);
}

.hero-grid,
.diagram,
.hero-card,
.panel,
.demo-card,
.link-card,
.stack-card,
.pipeline-step,
.code-panel {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(17, 24, 38, 0.7);
  border-radius: 32px;
}

.hero-card,
.panel,
.code-panel,
.demo-card,
.link-card,
.stack-card,
.pipeline-step,
.diagram-node {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--surface-strong);
  border-radius: var(--radius);
}

.hero-card,
.panel,
.code-panel,
.demo-card,
.link-card,
.stack-card,
.pipeline-step {
  padding: 1.3rem;
}

.hero-card strong,
.demo-card strong,
.diagram-node strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.hero-accent {
  background:
    linear-gradient(135deg, rgba(111, 168, 255, 0.12), rgba(240, 194, 79, 0.1)),
    var(--surface-strong);
}

.card-label {
  display: inline-block;
  margin-bottom: 0.6rem;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  font-weight: 800;
}

.stat-band,
.three-up,
.architecture-grid,
.model-grid,
.demo-grid,
.links-grid {
  display: grid;
  gap: 1rem;
}

.stat-band,
.three-up,
.architecture-grid {
  grid-template-columns: repeat(3, 1fr);
}

.demo-grid,
.links-grid {
  grid-template-columns: repeat(3, 1fr);
}

.demo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-chip {
  padding: 1.1rem 1.2rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(21, 29, 44, 0.72);
}

.stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
}

.stat-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.section-heading {
  margin-bottom: 1.4rem;
}

.split-layout,
.oracle-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1rem;
  align-items: start;
}

.stack-compare {
  display: grid;
  gap: 1rem;
}

.stack-card ol,
.flat-list {
  margin: 0.7rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.flat-list li + li {
  margin-top: 0.45rem;
}

.diagram {
  display: grid;
  grid-template-columns: 1fr auto 1.2fr auto 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, rgba(111, 168, 255, 0.06), rgba(255, 255, 255, 0)),
    var(--surface-alt);
  border-radius: 28px;
}

.diagram-node {
  padding: 1rem;
  border: 1px solid var(--line);
}

.diagram-node-parent {
  position: relative;
}

.diagram-arrow {
  color: var(--blue);
  font-size: 1.8rem;
  text-align: center;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.step-number {
  display: inline-block;
  margin-bottom: 0.7rem;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 500;
}

.code-panel {
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(111, 168, 255, 0.08), rgba(255, 255, 255, 0)),
    var(--surface-alt);
}

pre {
  margin: 0;
  white-space: pre-wrap;
  color: #d5e4ff;
  font-size: 0.9rem;
}

.feature-band {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.feature-band span {
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(21, 29, 44, 0.76);
  font-size: 0.84rem;
}

/* ── Thread Graph ── */
.thread-graph {
  --thread-more-width: 2rem;

  position: relative;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);

  display: grid;
  grid-template-columns: 1fr 1fr var(--thread-more-width) 1fr;
  column-gap: 0.4rem;
  row-gap: 1rem;
  align-items: center;
}

.thread-root {
  grid-column: 2;
  justify-self: center;

  position: relative;
  z-index: 1;
  display: inline-flex;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(111, 168, 255, 0.08);
  font-size: 0.84rem;
}

.thread-branches {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr var(--thread-more-width) 1fr;
  gap: 0.4rem;
  width: 100%;
}

.thread-branches .thread-more {
  width: var(--thread-more-width);
}

.thread-branches span {
  display: block;
  padding: 0.65rem 0.7rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  background: rgba(21, 29, 44, 0.72);
  font-size: 0.82rem;
}


.thread-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

/* ── Table ── */
.table-panel {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

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

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ── Demo ── */
.demo-card {
  min-height: 100%;
  padding: 1.3rem;
}

.demo-note {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.demo-player-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
}

.demo-player-frame twisty-player {
  width: 100% !important;
  max-width: 320px;
  height: 220px !important;
}

/* ── Links ── */
.link-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.65rem;
  transition: transform 100ms ease, border-color 100ms ease;
}

.link-card strong {
  font-size: 1.1rem;
  line-height: 1.1;
}

.link-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.link-card em {
  margin-top: auto;
  color: var(--blue);
  font-style: normal;
  font-size: 0.88rem;
  font-weight: 700;
}

.link-eyebrow {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Footer ── */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding: 1.5rem 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ── Responsive ── */
@media (max-width: 980px) {
  .hero,
  .split-layout,
  .oracle-layout,
  .pipeline,
  .three-up,
  .stat-band,
  .demo-grid,
  .links-grid,
  .architecture-grid,
  .diagram {
    grid-template-columns: 1fr;
  }

  .diagram-arrow {
    transform: rotate(90deg);
  }

  .thread-branches {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 3rem;
  }
}

@media (max-width: 760px) {
  .site-shell {
    width: min(calc(100% - 1rem), var(--max));
  }

  .topbar {
    flex-wrap: wrap;
    border-radius: 28px;
    padding: 0.9rem 1rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 0.5rem;
  }

  .site-nav.is-open {
    display: flex;
  }

  h1 {
    font-size: clamp(3.2rem, 17vw, 5rem);
  }

  .section {
    padding-top: 3.8rem;
  }

  .footer {
    flex-direction: column;
  }
}

.move-count-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(111, 168, 255, 0.08);
  color: var(--muted);
  font-size: 0.85rem;
}

.move-count-value {
  color: var(--text);
  font-weight: 800;
}
