/* Kiln marketing site — shared design system.
   Mirrors crates/kiln-server/src/ui.html and desktop/ui/_kiln-tokens.css. */

:root {
  color-scheme: dark;

  /* Brand amber */
  --kiln-50: #fff7ed;
  --kiln-100: #ffedd5;
  --kiln-200: #fed7aa;
  --kiln-300: #fdba74;
  --kiln-400: #fb923c;
  --kiln-500: #f97316;
  --kiln-600: #ea580c;
  --kiln-700: #c2410c;
  --kiln-800: #9a3412;
  --kiln-900: #7c2d12;

  /* Warm-charcoal ink ramp */
  --ink-950: #08090c;
  --ink-900: #0d0e12;
  --ink-850: #11131a;
  --ink-800: #14161e;
  --ink-750: #181b24;
  --ink-700: #1c1f29;
  --ink-650: #232732;
  --ink-600: #2a2f3b;
  --ink-500: #353a48;
  --ink-400: #6b7280;
  --ink-300: #9aa3ae;
  --ink-200: #b6bcc4;
  --ink-100: #d1d5db;
  --ink-50:  #f4f5f7;

  /* Semantic */
  --success-fg: #4ade80; --success-bg: #0f2c1c; --success-bd: #1a4d2e;
  --warning-fg: #fbbf24; --warning-bg: #2c220a; --warning-bd: #4a3a14;
  --danger-fg:  #f87171; --danger-bg:  #2a1414; --danger-bd:  #4a1f1f;
  --info-fg:    #60a5fa; --info-bg:    #0f1c2c; --info-bd:    #1a3050;

  /* Surfaces / borders / text */
  --bg:          var(--ink-950);
  --surface:     var(--ink-800);
  --surface-2:   var(--ink-750);
  --surface-3:   var(--ink-700);
  --canvas:      var(--ink-900);
  --border:      var(--ink-650);
  --border-strong: var(--ink-500);
  --text:        var(--ink-50);
  --text-2:      var(--ink-100);
  --text-3:      var(--ink-200);
  --text-muted:  var(--ink-300);
  --text-quiet:  var(--ink-400);

  /* Accent */
  --accent:        var(--kiln-500);
  --accent-hover:  var(--kiln-400);
  --accent-press:  var(--kiln-600);
  --accent-soft:   rgba(249, 115, 22, 0.12);
  --accent-ring:   rgba(249, 115, 22, 0.42);

  /* Effects */
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 4px 16px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.4);
  --shadow-3: 0 16px 40px rgba(0,0,0,.55), 0 4px 12px rgba(0,0,0,.4);
  --glow-brand: 0 0 0 1px rgba(249,115,22,0.18), 0 12px 28px rgba(249,115,22,0.18);

  /* Type */
  --font-sans: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-mono: 'JetBrains Mono', 'JetBrains Mono Fallback', 'SF Mono', 'Berkeley Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;

  --text-2xs: 11px;
  --text-xs:  12px;
  --text-sm:  13px;
  --text-md:  14px;
  --text-lg:  16px;
  --text-xl:  18px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 36px;
  --text-5xl: 48px;
  --text-6xl: 64px;

  /* Spacing — 4px grid */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-10: 48px;
  --space-12: 64px;
  --space-16: 96px;

  /* Radius */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-instant: 80ms;
  --t-fast: 140ms;
  --t-base: 220ms;
  --t-slow: 380ms;

  /* Layout */
  --page-max: 1180px;
  --topbar-h: 64px;
}

/* ─── Reset / base ─── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -120px, rgba(249,115,22,0.08), transparent 60%),
    radial-gradient(800px 400px at 100% 0%, rgba(96,165,250,0.04), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.55;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); color: var(--text); }

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--text-2); text-decoration: none; transition: color var(--t-fast) var(--ease-out); }
a:hover { color: var(--text); }
a.amber, a.amber:hover { color: var(--accent); }
a.amber:hover { color: var(--accent-hover); }

p { margin: 0 0 var(--space-4); color: var(--text-3); }
p:last-child { margin-bottom: 0; }

ul { margin: 0 0 var(--space-4); padding-left: var(--space-5); color: var(--text-3); }
li { margin-bottom: var(--space-1); }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--text-5xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.015em; }
h3 { font-size: var(--text-xl); letter-spacing: -0.01em; }
h4 { font-size: var(--text-md); }

@media (max-width: 760px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-2xl); }
}

hr { border: 0; height: 1px; background: var(--border); margin: var(--space-8) 0; }

/* Focus (signature amber halo) */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: 0; left: var(--space-4);
  transform: translateY(-120%);
  z-index: 100;
  background: var(--accent);
  color: #1a0c00;
  padding: 10px 14px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600;
  transition: transform var(--t-fast) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); color: #1a0c00; }

/* ─── Eyebrow ─── */
.eyebrow {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

/* ─── Brand mark (matches favicon) ─── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand-mark {
  width: 30px; height: 30px; flex: none;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--kiln-700), var(--kiln-500) 55%, var(--kiln-300));
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 4px 10px rgba(249,115,22,0.25);
}
.brand-mark::before {
  content: "";
  position: absolute; inset: 6px;
  background: var(--ink-950);
  clip-path: polygon(50% 12%, 88% 88%, 12% 88%);
  opacity: 0.78;
}
.brand-version {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

/* ─── Topbar / nav ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 14, 18, 0.78);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: var(--topbar-h);
}
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--t-fast) var(--ease-out);
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
  position: relative;
}
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  bottom: -7px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-ext {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
}
.nav-ext svg { width: 14px; height: 14px; }
@media (max-width: 760px) {
  .topbar-inner { gap: var(--space-3); padding: var(--space-3) var(--space-4); }
  .nav { gap: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 6px 10px; }
}

/* ─── Layout ─── */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.section {
  padding: var(--space-16) 0;
}
.section--tight {
  padding: var(--space-12) 0;
}
@media (max-width: 760px) {
  .section { padding: var(--space-12) 0; }
  .section--tight { padding: var(--space-10) 0; }
  .page { padding: 0 var(--space-4); }
}

/* ─── Pill / chip ─── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--ink-850);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.pill-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success-fg);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.16);
}
.pill-dot--accent { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pill--accent {
  border-color: rgba(249,115,22,0.32);
  color: var(--kiln-200);
  background: var(--accent-soft);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--kiln-500), var(--kiln-600));
  border-color: var(--kiln-700);
  color: #1a0c00;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 4px 14px rgba(249,115,22,0.28);
  font-weight: 600;
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--kiln-400), var(--kiln-500));
  border-color: var(--kiln-600);
  color: #1a0c00;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 6px 18px rgba(249,115,22,0.36);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: rgba(255,255,255,0.04); color: var(--text); border-color: transparent; }
.btn-lg { padding: 13px 22px; font-size: var(--text-lg); }

/* ─── Card ─── */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--t-fast) var(--ease-out);
}
.card:hover { border-color: var(--ink-600); }
.card-pad { padding: var(--space-6); }
.card-pad-lg { padding: var(--space-7); }

/* ─── Code ─── */
code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-feature-settings: 'liga' 0, 'calt' 0, 'tnum' 1;
}
:not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-size: 0.85em;
  color: var(--kiln-200);
}
pre {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-2);
  margin: 0;
}
pre code { background: transparent; border: 0; padding: 0; color: inherit; font-size: inherit; }

.code-shell {
  position: relative;
}
.code-shell .copy-btn {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  transition: all var(--t-fast) var(--ease-out);
}
.code-shell:hover .copy-btn,
.code-shell .copy-btn:focus-visible { opacity: 1; }
.code-shell .copy-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.code-shell .copy-btn[data-copied="1"] { color: var(--success-fg); border-color: var(--success-bd); background: var(--success-bg); }

/* Token highlighting */
.tok-co { color: var(--ink-300); font-style: italic; }
.tok-st { color: #d1c0a3; }
.tok-kw { color: var(--kiln-300); }
.tok-fn { color: #93c5fd; }
.tok-nu { color: #c4b5fd; }
.tok-pn { color: var(--ink-200); }

/* ─── Hero ─── */
.hero {
  padding: var(--space-12) 0 var(--space-10);
  position: relative;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.hero h1 {
  max-width: 22ch;
  margin-bottom: var(--space-5);
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--kiln-300), var(--kiln-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: var(--text-xl);
  line-height: 1.5;
  color: var(--text-3);
  max-width: 56ch;
  margin: 0 0 var(--space-7);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
.hero-meta {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}
.hero-meta-item {
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.hero-meta-item strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Hero split layout */
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-10);
  align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-8); }
}

/* Hero terminal preview */
.hero-terminal {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  position: relative;
}
.hero-terminal::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(249,115,22,0.18), transparent 30%);
  pointer-events: none;
  -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
          mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  padding: 1px;
}
.hero-terminal-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
}
.hero-terminal-dots {
  display: flex; gap: 6px;
}
.hero-terminal-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-600);
}
.hero-terminal-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.hero-terminal-pulse {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.hero-terminal-pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: kiln-pulse 1.6s ease-in-out infinite;
}
.hero-terminal pre {
  border: 0;
  border-radius: 0;
  margin: 0;
  background: transparent;
  font-size: var(--text-sm);
  line-height: 1.7;
  padding: var(--space-6);
}

@keyframes kiln-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

/* ─── Stat blocks ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.stat-grid::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 60%; height: 100%;
  background: radial-gradient(40% 80% at 0% 0%, rgba(249,115,22,0.10), transparent 60%);
  pointer-events: none;
}
.stat-cell {
  padding: var(--space-6);
  border-right: 1px solid var(--border);
  position: relative;
}
.stat-cell:last-child { border-right: 0; }
.stat-label {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
.stat-unit {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
  letter-spacing: 0;
}
.stat-foot {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cell:nth-child(2) { border-right: 0; }
  .stat-cell:nth-child(1), .stat-cell:nth-child(2) { border-bottom: 1px solid var(--border); }
}

/* ─── Section title ─── */
.section-title {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  max-width: 56ch;
}
.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}
.section-title-row .section-title { margin-bottom: 0; }
.section-sub {
  color: var(--text-3);
  font-size: var(--text-lg);
  line-height: 1.55;
}

/* ─── Feature grid (3-up) ─── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
@media (max-width: 980px) { .feature-grid { grid-template-columns: 1fr; } }

.feature {
  padding: var(--space-7);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--t-fast) var(--ease-out);
}
.feature:hover { border-color: var(--ink-600); }
.feature-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid rgba(249,115,22,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: var(--space-4);
}
.feature h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}
.feature p {
  color: var(--text-3);
  font-size: var(--text-md);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ─── 4-up small features ─── */
.feature-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
@media (max-width: 980px) { .feature-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .feature-grid-4 { grid-template-columns: 1fr; } }

/* ─── Code-side layout (split with explanation + code) ─── */
.split {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 980px) { .split { grid-template-columns: 1fr; gap: var(--space-6); } }

/* ─── Loop diagram ─── */
.loop {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: var(--space-3);
  align-items: stretch;
  margin: var(--space-7) 0;
}
.loop-step {
  background: var(--ink-850);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.loop-step-label {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--space-2);
}
.loop-step h4 { font-size: var(--text-md); margin-bottom: var(--space-2); }
.loop-step p { font-size: var(--text-sm); color: var(--text-muted); margin: 0; }
.loop-arrow {
  display: flex;
  align-items: center;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-lg);
}
@media (max-width: 980px) {
  .loop { grid-template-columns: 1fr; }
  .loop-arrow { transform: rotate(90deg); justify-content: center; }
}

/* ─── Install tab UI ─── */
.tabs {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  overflow: hidden;
}
.tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.16);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 14px 20px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t-fast) var(--ease-out);
}
.tab-btn:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.tab-btn[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: var(--accent-soft);
}
.tab-panel { display: none; }
.tab-panel[aria-hidden="false"] { display: block; }
.tab-panel pre { border: 0; border-radius: 0; margin: 0; }

/* ─── Screenshot frame ─── */
.screenshot {
  position: relative;
  background: var(--ink-900);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-3);
}
.screenshot img { display: block; width: 100%; height: auto; }
.screenshot-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.screenshot-bar .dots { display: flex; gap: 6px; }
.screenshot-bar .dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-600); }
.screenshot-bar .url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--ink-850);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  text-align: center;
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-12);
  padding: var(--space-10) 0 var(--space-12);
  background: rgba(8,9,12,0.6);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-7);
}
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-inner { grid-template-columns: 1fr; } }
.footer h4 {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin-bottom: var(--space-2); }
.footer ul a { color: var(--text-3); font-size: var(--text-sm); }
.footer ul a:hover { color: var(--text); }
.footer-meta {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  color: var(--text-quiet);
  font-size: var(--text-xs);
}

.footer-blurb {
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: 1.6;
  max-width: 36ch;
  margin: var(--space-3) 0 0;
}

/* ─── Reduced-motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Subpage layout ─── */
.docs-hero {
  padding: var(--space-10) 0 var(--space-7);
}
.docs-hero h1 { font-size: var(--text-4xl); margin-bottom: var(--space-4); max-width: 26ch; }
.docs-hero .hero-sub { font-size: var(--text-lg); margin: 0; max-width: 64ch; }

.docs-prose {
  max-width: 760px;
}
.docs-prose h2 { margin-top: var(--space-10); margin-bottom: var(--space-4); }
.docs-prose h2:first-child { margin-top: 0; }
.docs-prose h3 { margin-top: var(--space-6); margin-bottom: var(--space-3); font-size: var(--text-md); }
.docs-prose p { color: var(--text-3); }
.docs-prose ul li { color: var(--text-3); }
.docs-prose pre { margin: var(--space-4) 0; }

.callout {
  border-left: 3px solid var(--accent);
  padding: var(--space-4) var(--space-5);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-5) 0;
}
.callout strong { color: var(--text); }
.callout p { color: var(--text-2); margin: 0; }

/* Endpoint table for api page */
.endpoint {
  background: var(--ink-850);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
.endpoint-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}
.endpoint-method {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid;
}
.endpoint-method[data-m="GET"]    { color: var(--info-fg);    border-color: var(--info-bd);    background: var(--info-bg); }
.endpoint-method[data-m="POST"]   { color: var(--success-fg); border-color: var(--success-bd); background: var(--success-bg); }
.endpoint-method[data-m="DELETE"] { color: var(--danger-fg);  border-color: var(--danger-bd);  background: var(--danger-bg); }
.endpoint-method[data-m="WS"]     { color: var(--warning-fg); border-color: var(--warning-bd); background: var(--warning-bg); }
.endpoint-path {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text);
  font-weight: 500;
}
.endpoint-desc { color: var(--text-3); font-size: var(--text-sm); margin: 0; }

/* Inline link list */
.link-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: var(--space-5) 0 0;
}
.link-list li { margin: 0; }
.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--ink-850);
  color: var(--text);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: all var(--t-fast) var(--ease-out);
}
.link-list a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.link-list a::after { content: "→"; color: var(--accent); font-family: var(--font-mono); }

/* Accent gradient text utility */
.txt-accent {
  background: linear-gradient(120deg, var(--kiln-300), var(--kiln-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Util */
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.center { text-align: center; }

/* ============================================================
   Marketing site v1 — additional components
   ============================================================ */

/* Hero typography */
.hero-title {
  font-size: clamp(40px, 5.5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.024em;
  line-height: 1.04;
  margin: 0 0 var(--space-5);
  max-width: 18ch;
}
.hero-lede {
  font-size: var(--text-xl);
  line-height: 1.55;
  color: var(--text-3);
  max-width: 56ch;
  margin: 0 0 var(--space-7);
}
.hero-lede strong { color: var(--text); font-weight: 600; }
@media (max-width: 760px) {
  .hero-title { font-size: clamp(32px, 8vw, 44px); }
  .hero-lede { font-size: var(--text-lg); }
}

.hero-meta {
  margin-top: var(--space-7);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-meta svg { color: var(--accent); flex: none; }

/* Hero terminal body + traffic-light dots */
.hero-terminal-bar { padding: 10px 14px; }
.hero-terminal-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: var(--space-2);
}
.hero-terminal-body {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  padding: var(--space-6);
  color: var(--text-2);
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-600) transparent;
}
.hero-terminal-body::-webkit-scrollbar { height: 6px; }
.hero-terminal-body::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: 4px; }

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink-600);
  flex: none;
  display: inline-block;
}
.dot--r { background: #ff5f57; }
.dot--y { background: #ffbd2e; }
.dot--g { background: #28c840; }

/* Terminal text colors */
.t-c   { color: var(--ink-300); font-style: italic; }    /* comment */
.t-p   { color: var(--accent); font-weight: 600; }       /* prompt */
.t-cmd { color: var(--text); font-weight: 500; }         /* command */
.t-d   { color: var(--text-muted); }                     /* dim/diagnostic */
.t-a   { color: var(--kiln-200); font-weight: 600; }     /* accent token */
.t-ok  { color: var(--success-fg); font-weight: 600; }   /* success */
.kiln-pulse {
  display: inline-block;
  color: var(--accent);
  animation: kiln-pulse 1.6s ease-in-out infinite;
}

/* Section heading helper (centered) */
.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0 auto var(--space-8);
  max-width: 60ch;
  text-align: center;
  align-items: center;
}
.section-head .eyebrow { margin-bottom: 0; }
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 22ch;
}
.section-lede {
  color: var(--text-3);
  font-size: var(--text-lg);
  line-height: 1.6;
  margin: 0;
  max-width: 60ch;
}
.eyebrow--accent { color: var(--accent); }

/* Accent section background */
.section--accent {
  background:
    radial-gradient(900px 320px at 50% 0%, rgba(249,115,22,0.10), transparent 60%),
    radial-gradient(700px 240px at 50% 100%, rgba(249,115,22,0.05), transparent 60%);
  position: relative;
}

/* Compact feature card (used in 4-up grid) */
.feature--compact {
  padding: var(--space-5);
}
.feature--compact h3 {
  font-size: var(--text-md);
  margin-bottom: var(--space-2);
}
.feature--compact p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.55;
}

/* GRPO killer-feature split */
.grpo-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 980px) {
  .grpo-grid { grid-template-columns: 1fr; gap: var(--space-6); }
}
.grpo-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.grpo-side .callout {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  margin: 0;
}
.grpo-side .callout > div { flex: 1; }
.grpo-side .callout h4 {
  margin: 0 0 var(--space-1);
  color: var(--text);
  font-size: var(--text-md);
}
.grpo-side .callout p {
  margin: 0;
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: 1.55;
}
.callout-step {
  width: 32px; height: 32px; flex: none;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--kiln-500), var(--kiln-600));
  color: #1a0c00;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 4px 10px rgba(249,115,22,0.22);
  font-variant-numeric: tabular-nums;
}
.link-arrow {
  align-self: flex-start;
  color: var(--accent);
  font-weight: 600;
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}
.link-arrow:hover { color: var(--accent-hover); }

/* Code-shell bar (persistent header on code blocks) */
.code-shell {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.code-shell-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  background: rgba(0,0,0,0.22);
  border-bottom: 1px solid var(--border);
}
.code-tag {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(249,115,22,0.20);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.code-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.code-shell .code-shell-bar .copy-btn {
  margin-left: auto;
  position: static;
  opacity: 1;
  top: auto; right: auto;
}
.code-shell .code-shell-bar + pre {
  border: 0;
  border-radius: 0;
  margin: 0;
}

/* Python syntax (used in GRPO sample) */
.hl-c { color: var(--ink-300); font-style: italic; }
.hl-k { color: var(--kiln-300); font-weight: 500; }
.hl-s { color: #d1c0a3; }
.hl-n { color: #c4b5fd; }
.hl-b { color: #93c5fd; font-style: italic; }

/* Screenshot showcase grid */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
@media (max-width: 760px) { .screenshot-grid { grid-template-columns: 1fr; } }
.screenshot {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
}
.screenshot-frame {
  position: relative;
  background: var(--ink-900);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-3);
  aspect-ratio: 16 / 10;
}
.screenshot-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.screenshot figcaption {
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.55;
  margin: 0;
}
.screenshot figcaption strong { color: var(--text); font-weight: 600; }
.screenshot figcaption code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  color: var(--kiln-200);
  font-size: 0.85em;
}

/* Endpoint list (table-like) */
.endpoint-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.endpoint-table .endpoint {
  display: grid;
  grid-template-columns: 64px 220px 1fr;
  gap: var(--space-4);
  align-items: center;
  padding: 14px 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin: 0;
  transition: background var(--t-fast) var(--ease-out);
}
.endpoint-table .endpoint:last-child { border-bottom: 0; }
.endpoint-table .endpoint:hover { background: rgba(255,255,255,0.02); }
.endpoint-table .endpoint-method {
  justify-self: start;
  text-align: center;
  min-width: 56px;
}
.endpoint-table .endpoint-path {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text);
  font-weight: 500;
  background: transparent;
  border: 0;
  padding: 0;
}
.endpoint-table .endpoint-desc {
  color: var(--text-3);
  font-size: var(--text-sm);
  margin: 0;
}
.endpoint-table .endpoint-desc code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0 5px;
  border-radius: var(--radius-xs);
  color: var(--kiln-200);
  font-size: 0.9em;
}
@media (max-width: 760px) {
  .endpoint-table .endpoint {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px;
  }
  .endpoint-table .endpoint-method { justify-self: start; }
}

.install-foot {
  margin: var(--space-6) 0 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
}
.install-foot a { color: var(--accent); font-weight: 500; }
.install-foot a:hover { color: var(--accent-hover); }

/* CTA card */
.cta-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-7);
  padding: var(--space-10);
  border: 1px solid rgba(249,115,22,0.32);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(700px 240px at 80% 0%, rgba(249,115,22,0.18), transparent 60%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--glow-brand);
}
.cta-title {
  font-size: clamp(24px, 3.4vw, 36px);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-2);
}
.cta-lede {
  margin: 0;
  color: var(--text-3);
  font-size: var(--text-lg);
  line-height: 1.55;
  max-width: 50ch;
}
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  flex: none;
}
@media (max-width: 760px) {
  .cta-card {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-7);
  }
}

/* Footer brand block */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* `.stat-cell` is the canonical class for stat-grid cells (alias for older `.stat`).
   The .stat-foot rule already exists; nothing to add. */
