/* ==========================================================================
   TSGPUI website
   Warm charcoal and ivory, one brass accent. Serif display type over a
   quiet sans body. Depth comes from hairlines and spacing, not glows.
   Animations use transform and opacity only.
   ========================================================================== */

:root {
  --bg: #0b0a09;
  --bg-raised: #100f0d;
  --surface: #141311;
  --surface-2: #1b1a17;
  --line: rgba(244, 239, 230, 0.08);
  --line-strong: rgba(244, 239, 230, 0.16);
  --ink: #f4efe6;
  --ink-2: #cdc6b8;
  --muted: #8d877a;
  --accent: #d6b77f;
  --accent-ink: #1a1408;
  --code-bg: #080807;
  --code-ink: #d9d2c4;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --content: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --nav-h: 68px;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--ink-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

code,
pre,
.mono {
  font-family: var(--mono);
}

code {
  font-size: 0.86em;
  padding: 0.1em 0.38em;
  border-radius: 4px;
  background: rgba(244, 239, 230, 0.06);
  color: var(--ink-2);
}

pre {
  margin: 0;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--code-ink);
  tab-size: 2;
}

pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ==========================================================================
   Background: a faint warm grid, fading out below the hero
   ========================================================================== */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(244, 239, 230, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 239, 230, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 60%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 60%);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(11, 10, 9, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-links a {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="true"] {
  color: var(--ink);
}

.nav-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nav-github svg {
  display: block;
  width: 18px;
  height: 18px;
}

.nav-github:hover {
  border-color: var(--accent);
  background: rgba(214, 183, 127, 0.08);
  color: var(--ink);
}

/* ==========================================================================
   Buttons: one solid primary, everything else hairline
   ========================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    transform 0.25s var(--ease),
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  color: var(--accent-ink);
  background: var(--ink);
}

.btn-primary:hover {
  color: var(--accent-ink);
  background: var(--accent);
}

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--ink-2);
}

.btn .arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.btn-primary:hover .arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   Shared section pieces
   ========================================================================== */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}

/* Serif italic in the accent colour, used once per headline */
.accent {
  font-style: italic;
  color: var(--accent);
}

.section {
  position: relative;
  max-width: var(--content);
  margin: 0 auto;
  padding: clamp(88px, 11vw, 144px) var(--gutter) 0;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.section-head {
  max-width: 780px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.section-head h2 {
  font-size: clamp(2.3rem, 4.8vw, 3.6rem);
}

.section-lede {
  margin-top: 22px;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-lede code,
.pillar p code,
.fact p code,
.step p code,
.status-col code,
.notice code,
.docs-links code {
  font-size: 0.84em;
}

/* Cursor-following light, driven by --mx / --my set in script.js.
   Warm and very faint, so it reads as a sheen rather than a glow. */
[data-spot] {
  --mx: 50%;
  --my: 0%;
  position: relative;
  isolation: isolate;
}

[data-spot]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    360px circle at var(--mx) var(--my),
    rgba(214, 183, 127, 0.07),
    transparent 60%
  );
  transition: opacity 0.4s ease;
}

[data-spot]:hover::before {
  opacity: 1;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  max-width: var(--content);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 128px) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(56px, 7vw, 96px);
  align-items: center;
}

.hero-copy,
.hero-visual {
  min-width: 0;
}

.hero h1 {
  margin-top: 4px;
  font-size: clamp(3.2rem, 8.4vw, 6.6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.lede {
  margin-top: 32px;
  max-width: 44ch;
  color: var(--ink-2);
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  line-height: 1.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  margin-top: 56px;
  max-width: 520px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.compare > div {
  padding: 16px 20px;
  background: var(--bg-raised);
}

.compare dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.compare dd {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: var(--ink-2);
}

.compare > div:last-child dt {
  color: var(--accent);
}

.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
}

.source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-chips li {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.beam {
  position: relative;
  height: 40px;
  margin-left: 22px;
  width: 1px;
  background: var(--line-strong);
  overflow: hidden;
}

.beam span {
  position: absolute;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  transform: translateY(-100%);
  animation: beam-run 2.4s var(--ease) infinite;
}

@keyframes beam-run {
  to {
    transform: translateY(260%);
  }
}

.visual-caption {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ==========================================================================
   Native app preview (warm palette, same structure as examples/counter)
   ========================================================================== */

.app {
  --mx: 50%;
  --my: 0%;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--code-bg);
  border: 1px solid var(--line-strong);
  box-shadow: 0 32px 64px -32px rgba(0, 0, 0, 0.8);
  transform: translateZ(0);
}

.app-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  font-family: var(--sans);
}

.app-dots {
  display: inline-flex;
  gap: 6px;
}

.app-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
}

.app-body {
  display: grid;
  place-items: center;
  padding: 4cqi;
  background: var(--code-bg);
  aspect-ratio: 3 / 2;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 2.1cqi;
  width: 100%;
  padding: 3.6cqi;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2.4cqi;
  font-family: var(--sans);
}

.app-badge {
  font-family: var(--mono);
  font-size: max(9px, 1.2cqi);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
}

.app-title {
  font-family: var(--display);
  font-size: max(26px, 6cqi);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.app-sub {
  font-size: max(11px, 1.7cqi);
  color: var(--muted);
}

.app-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1cqi;
  padding: 2.6cqi;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 1.6cqi;
}

.app-eyebrow {
  font-family: var(--mono);
  font-size: max(9px, 1.2cqi);
  color: var(--muted);
  letter-spacing: 0.1em;
}

.app-count {
  font-family: var(--display);
  font-size: max(44px, 8.4cqi);
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  transition: transform 0.2s var(--ease), color 0.2s ease;
}

.app-count.bump {
  transform: scale(1.06);
  color: var(--accent);
}

.app-hint {
  font-size: max(9px, 1.4cqi);
  color: var(--muted);
}

.app-buttons {
  display: flex;
  gap: 1.3cqi;
}

.app-btn {
  flex: 1;
  padding: 1.4cqi 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: max(11px, 1.5cqi);
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 0.2s ease, color 0.2s ease;
}

.app-btn:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}

.app-btn:active {
  transform: scale(0.96);
}

.app-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.app-btn-primary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent-ink);
}

.app-foot {
  font-size: max(9px, 1.2cqi);
  color: var(--muted);
}

/* ==========================================================================
   Interactive demo
   ========================================================================== */

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.editor {
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
}

.editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
}

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button {
  position: relative;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.tabs button:hover {
  color: var(--ink);
}

.tabs button[aria-selected="true"] {
  color: var(--ink);
  background: var(--surface-2);
}

.tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -9px;
  height: 1px;
  background: var(--accent);
}

.panel {
  padding: 24px 26px 28px;
  overflow-x: auto;
  max-height: 560px;
  overflow-y: auto;
}

.panel[hidden] {
  display: none;
}

/* Syntax colours produced by script.js: warm, low-saturation tones */
.tk-tag {
  color: #c9b08a;
}

.tk-attr {
  color: #b9b1a3;
}

.tk-str {
  color: #a7b88c;
}

.tk-com {
  color: #6b6459;
  font-style: italic;
}

.tk-meta {
  color: #6b6459;
}

.tk-prop {
  color: #c9b08a;
}

.tk-sel {
  color: #e2d5bd;
}

.tk-num {
  color: #d6b77f;
}

.tk-kw {
  color: #d6b77f;
}

.tk-fn {
  color: #e2d5bd;
}

.tk-type {
  color: #c9b08a;
}

.copy {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.copy:hover {
  color: var(--ink);
  border-color: var(--ink-2);
}

.copy.is-done {
  color: var(--accent);
  border-color: var(--accent);
}

.demo-preview {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==========================================================================
   Pillars
   ========================================================================== */

.pillars {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pillar {
  padding: 36px 32px;
  background: var(--bg);
  transition: background-color 0.3s ease;
}

.pillar:hover {
  background: var(--surface);
}

.pillar h3 {
  margin-bottom: 16px;
  font-size: 1.7rem;
}

.pillar p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.pillar p code {
  color: var(--ink-2);
}

/* ==========================================================================
   Pipeline
   ========================================================================== */

.pipeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1.3fr) 48px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  position: relative;
  transition: border-color 0.5s ease;
}

.stage-index-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.stage h3 {
  font-size: 1.6rem;
}

.stage h3 code {
  padding: 0;
  background: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.92rem;
}

.stage > p {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.7;
}

.file-list {
  display: grid;
  gap: 6px;
}

.file-list li {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(244, 239, 230, 0.03);
  border: 1px solid var(--line);
}

.file-list code {
  background: none;
  padding: 0;
  color: var(--ink-2);
  font-size: 0.8rem;
}

.tgp {
  overflow-x: auto;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--code-bg);
  border: 1px solid var(--line);
  font-size: 0.76rem;
  line-height: 1.65;
  color: var(--muted);
  white-space: pre;
}

.layout-bar {
  display: flex;
  align-items: stretch;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.seg {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  border-right: 1px solid var(--bg);
}

.seg:last-child {
  border-right: 0;
}

.seg-host {
  flex: 2.2;
  background: rgba(244, 239, 230, 0.1);
}

.seg-bundle {
  flex: 3;
  background: rgba(214, 183, 127, 0.22);
}

.seg-len {
  flex: 0.9;
  background: rgba(244, 239, 230, 0.06);
}

.seg-magic {
  flex: 1.9;
  background: rgba(214, 183, 127, 0.38);
  color: var(--accent-ink);
}

.layout-caption {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.stage-result {
  margin-top: auto;
  color: var(--ink-2);
  font-size: 0.9rem;
}

.link {
  position: relative;
  align-self: center;
  height: 1px;
  margin: 0 4px;
  background: var(--line-strong);
  overflow: hidden;
}

.link span {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-100%);
}

/* Sequenced highlight: runs once the pipeline scrolls into view (script.js) */
.pipeline.is-running .stage {
  animation: stage-glow 1.6s var(--ease) both;
  animation-delay: calc(var(--s) * 1.2s);
}

.pipeline.is-running .link span {
  animation: link-run 1.2s var(--ease) both;
}

.pipeline.is-running .link:nth-of-type(2) span {
  animation-delay: 1.1s;
}

.pipeline.is-running .link:nth-of-type(4) span {
  animation-delay: 2.3s;
}

@keyframes stage-glow {
  0% {
    border-color: var(--line);
  }
  40% {
    border-color: var(--accent);
  }
  100% {
    border-color: var(--line);
  }
}

@keyframes link-run {
  to {
    transform: translateX(100%);
  }
}

.pipeline .stage:hover {
  border-color: var(--line-strong);
}

/* ==========================================================================
   Architecture
   ========================================================================== */

.layers {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.layers li {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  align-items: baseline;
  padding: 24px 30px;
  background: var(--bg);
  transition: background-color 0.25s ease;
}

.layers li + li {
  border-top: 1px solid var(--line);
}

.layers li:hover {
  background: var(--surface);
}

.layer-name {
  font-family: var(--display);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--accent);
}

.layers p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 48px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.fact {
  padding: 32px;
  background: var(--bg);
  transition: background-color 0.3s ease;
}

.fact:hover {
  background: var(--surface);
}

.fact h3 {
  font-size: 1.45rem;
  margin-bottom: 12px;
}

.fact p {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.7;
}

/* ==========================================================================
   Quick start
   ========================================================================== */

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  background: var(--bg);
}

.step h3 {
  font-size: 1.5rem;
}

.step > p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

.codeblock {
  position: relative;
  padding: 18px 20px;
  padding-right: 88px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.codeblock .copy {
  position: absolute;
  top: 10px;
  right: 10px;
}

.codeblock pre {
  color: var(--code-ink);
}

.docs-links {
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   Docs: Markdown from docs/ rendered in place
   ========================================================================== */

.doc-body {
  max-width: 820px;
  margin-top: 28px;
  color: var(--ink-2);
  font-size: 0.97rem;
  line-height: 1.7;
}

.doc-body h1,
.doc-body h2,
.doc-body h3 {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.2;
  margin: 40px 0 14px;
}

.doc-body h1 {
  font-size: 2rem;
  margin-top: 0;
}

.doc-body h2 {
  font-size: 1.6rem;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.doc-body h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
}

.doc-body p,
.doc-body ul,
.doc-body ol {
  margin: 0 0 16px;
}

.doc-body li + li {
  margin-top: 6px;
}

.doc-body a {
  color: var(--accent);
}

.doc-body code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 0.88em;
}

.doc-body pre {
  margin: 0 0 20px;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--code-bg);
}

.doc-body pre code {
  padding: 0;
  background: none;
}

.doc-body table {
  display: block;
  width: 100%;
  margin: 0 0 20px;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.doc-body th,
.doc-body td {
  padding: 8px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc-body th {
  color: var(--ink);
  background: var(--surface);
}

/* ==========================================================================
   Status
   ========================================================================== */

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.status-col {
  padding: 36px;
  background: var(--bg);
}

.status-col h3 {
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.status-col li {
  position: relative;
  padding: 12px 0 12px 26px;
  color: var(--ink-2);
  font-size: 0.94rem;
  line-height: 1.6;
  border-top: 1px solid var(--line);
}

.status-col li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 21px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-col:first-child li::before {
  background: var(--accent);
}

.status-col + .status-col li::before {
  background: var(--muted);
}

.status-col li:first-child {
  border-top: 0;
}

.notice {
  margin-top: 24px;
  padding: 24px 28px;
  border-left: 1px solid var(--accent);
}

.notice p {
  color: var(--ink-2);
  font-family: var(--display);
  font-size: 1.4rem;
  line-height: 1.4;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: clamp(104px, 13vw, 160px);
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: var(--content);
  margin: 0 auto;
  padding: 52px var(--gutter) 64px;
}

.footer-brand p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

/* ==========================================================================
   Entrance motion: only when script.js confirms motion is allowed.
   Content is visible by default, so a script failure never hides it.
   ========================================================================== */

/* Uses the independent `translate` property so hover transforms still work */
.js .reveal {
  opacity: 0;
  translate: 0 20px;
  transition:
    opacity 0.9s var(--ease) calc(var(--d, 0) * 90ms),
    translate 0.9s var(--ease) calc(var(--d, 0) * 90ms);
}

.js .reveal.is-in {
  opacity: 1;
  translate: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  }

  .demo-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }

  .demo-preview {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
  }
}

@media (max-width: 1080px) {
  .nav-links a:nth-child(n + 4) {
    display: none;
  }
}

@media (max-width: 900px) {
  .pillars,
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pipeline {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .link {
    width: 1px;
    height: 36px;
    margin: 0 auto;
    background: var(--line-strong);
  }

  .link span {
    transform: translateY(-100%);
    background: linear-gradient(180deg, transparent, var(--accent), transparent);
  }

  .pipeline.is-running .link span {
    animation-name: link-run-y;
  }

  .steps,
  .status-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@keyframes link-run-y {
  to {
    transform: translateY(100%);
  }
}

@media (max-width: 720px) {
  .site-nav {
    height: auto;
  }

  .nav-inner {
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 12px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .nav-links a:nth-child(n + 4) {
    display: inline-flex;
  }

  .nav-links a {
    flex-shrink: 0;
  }

  .nav-github {
    margin-left: auto;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 14vw, 4rem);
    white-space: normal;
  }

  .hero-visual {
    margin-top: 8px;
  }

  .pillars,
  .facts,
  .steps,
  .status-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .layers li {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .stage {
    padding: 24px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .actions .btn {
    width: 100%;
    justify-content: center;
  }

  .codeblock {
    padding-right: 20px;
    padding-top: 48px;
  }

  .codeblock .copy {
    top: 10px;
    right: 10px;
  }

  .layout-bar {
    flex-wrap: wrap;
    height: auto;
  }

  .seg {
    flex: 1 1 45%;
    min-height: 34px;
  }
}

/* ==========================================================================
   Reduced motion: keep every element visible, remove travel and loops.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .beam span,
  .link span,
  .pipeline.is-running .stage,
  .pipeline.is-running .link span {
    animation: none;
  }

  .js .reveal,
  .js .reveal.is-in {
    opacity: 1;
    translate: none;
    transition: none;
  }

  .btn,
  .pillar,
  .fact,
  .app-btn,
  .btn-primary:hover .arrow {
    transition: none;
    transform: none;
  }
}
