/* ===== Archiva — Design tokens ===== */

:root {
  /* Type */
  --font-sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  /* Paper palette (default) — warm neutrals + deep legal blue */
  --bg: oklch(0.985 0.004 85);
  --bg-elev: oklch(1 0 0);
  --bg-sunken: oklch(0.965 0.006 85);
  --ink: oklch(0.185 0.012 70);
  --ink-soft: oklch(0.38 0.012 75);
  --ink-mute: oklch(0.56 0.010 80);
  --line: oklch(0.905 0.008 80);
  --line-soft: oklch(0.945 0.006 82);
  --accent: oklch(0.38 0.12 258);
  --accent-ink: oklch(0.98 0.004 258);
  --accent-soft: oklch(0.95 0.02 258);
  --accent-hue: 258;
  --hi: oklch(0.92 0.05 95); /* subtle highlight/cite */
  --ok: oklch(0.55 0.12 155);
  --warn: oklch(0.62 0.14 55);

  /* Radii & shadows — minimal */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --shadow-1: 0 1px 0 oklch(0.88 0.01 80);
  --shadow-soft: 0 1px 2px oklch(0.85 0.01 80 / 0.25), 0 8px 24px -12px oklch(0.35 0.02 80 / 0.12);
  --shadow-lift: 0 1px 2px oklch(0.85 0.01 80 / 0.3), 0 20px 40px -20px oklch(0.25 0.04 258 / 0.18);

  /* Spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px; --s10: 72px;
  --s11: 96px; --s12: 128px;

  /* Density */
  --section-y: clamp(72px, 9vw, 128px);
  --container: 1200px;
  --container-narrow: 960px;
}

/* ---- Accent variants (independent of mode) ---- */
[data-accent="blue"] {
  --accent: oklch(0.38 0.12 258);
  --accent-ink: oklch(0.98 0.004 258);
  --accent-soft: oklch(0.95 0.02 258);
  --accent-hue: 258;
}
[data-accent="emerald"] {
  --accent: oklch(0.42 0.10 160);
  --accent-ink: oklch(0.98 0.005 160);
  --accent-soft: oklch(0.94 0.025 160);
  --accent-hue: 160;
}
[data-accent="plum"] {
  --accent: oklch(0.38 0.11 330);
  --accent-ink: oklch(0.98 0.004 330);
  --accent-soft: oklch(0.95 0.022 330);
  --accent-hue: 330;
}
[data-accent="amber"] {
  --accent: oklch(0.55 0.13 55);
  --accent-ink: oklch(0.99 0.004 55);
  --accent-soft: oklch(0.95 0.04 75);
  --accent-hue: 55;
}
[data-accent="graphite"] {
  --accent: oklch(0.26 0.01 260);
  --accent-ink: oklch(0.98 0.004 260);
  --accent-soft: oklch(0.93 0.005 260);
  --accent-hue: 260;
}
[data-accent="ink"] {
  --accent: oklch(0.42 0.08 230);
  --accent-ink: oklch(0.98 0.004 230);
  --accent-soft: oklch(0.94 0.015 230);
  --accent-hue: 230;
}

/* Dark mode accents need to be brighter to stand out on dark bg */
[data-accent="sky"] {
  --accent: #0ea5e9;
  --accent-ink: #f0f9ff;
  --accent-soft: #e0f2fe;
  --accent-hue: 235;
}
[data-palette="dark"][data-accent="sky"] { --accent: #38bdf8; --accent-soft: #0c4a6e; }
[data-palette="dark"][data-accent="blue"] { --accent: oklch(0.74 0.14 258); --accent-soft: oklch(0.28 0.06 258); }
[data-palette="dark"][data-accent="emerald"] { --accent: oklch(0.78 0.13 160); --accent-soft: oklch(0.28 0.05 160); }
[data-palette="dark"][data-accent="plum"] { --accent: oklch(0.75 0.14 330); --accent-soft: oklch(0.28 0.06 330); }
[data-palette="dark"][data-accent="amber"] { --accent: oklch(0.82 0.14 75); --accent-soft: oklch(0.30 0.06 60); }
[data-palette="dark"][data-accent="graphite"] { --accent: oklch(0.85 0.01 260); --accent-soft: oklch(0.28 0.005 260); }
[data-palette="dark"][data-accent="ink"] { --accent: oklch(0.80 0.10 230); --accent-soft: oklch(0.28 0.05 230); }

/* New accent variants */
[data-accent="crimson"] {
  --accent: oklch(0.42 0.16 15);
  --accent-ink: oklch(0.98 0.004 15);
  --accent-soft: oklch(0.95 0.04 15);
  --accent-hue: 15;
}
[data-accent="rust"] {
  --accent: oklch(0.48 0.13 35);
  --accent-ink: oklch(0.98 0.004 35);
  --accent-soft: oklch(0.95 0.04 35);
  --accent-hue: 35;
}
[data-accent="teal"] {
  --accent: oklch(0.42 0.10 195);
  --accent-ink: oklch(0.98 0.004 195);
  --accent-soft: oklch(0.94 0.04 195);
  --accent-hue: 195;
}
[data-accent="violet"] {
  --accent: oklch(0.40 0.14 295);
  --accent-ink: oklch(0.98 0.004 295);
  --accent-soft: oklch(0.94 0.05 295);
  --accent-hue: 295;
}
[data-accent="gold"] {
  --accent: oklch(0.50 0.12 80);
  --accent-ink: oklch(0.15 0.02 80);
  --accent-soft: oklch(0.95 0.05 80);
  --accent-hue: 80;
}
[data-palette="dark"][data-accent="crimson"] { --accent: oklch(0.74 0.16 15); --accent-soft: oklch(0.28 0.07 15); }
[data-palette="dark"][data-accent="rust"]    { --accent: oklch(0.78 0.13 35); --accent-soft: oklch(0.28 0.06 35); }
[data-palette="dark"][data-accent="teal"]    { --accent: oklch(0.78 0.12 195); --accent-soft: oklch(0.28 0.05 195); }
[data-palette="dark"][data-accent="violet"]  { --accent: oklch(0.76 0.15 295); --accent-soft: oklch(0.28 0.07 295); }
[data-palette="dark"][data-accent="gold"]    { --accent: oklch(0.82 0.13 80); --accent-soft: oklch(0.30 0.06 80); }

/* ---- Palette variants ---- */
[data-palette="light"] {
  --bg: oklch(1 0 0);
  --bg-elev: oklch(1 0 0);
  --bg-sunken: oklch(0.975 0.002 260);
  --ink: oklch(0.16 0.01 260);
  --ink-soft: oklch(0.38 0.01 260);
  --ink-mute: oklch(0.56 0.008 260);
  --line: oklch(0.915 0.004 260);
  --line-soft: oklch(0.955 0.003 260);
  --hi: oklch(0.92 0.04 258);
}
[data-palette="dark"] {
  --bg: oklch(0.165 0.008 260);
  --bg-elev: oklch(0.21 0.01 260);
  --bg-sunken: oklch(0.14 0.008 260);
  --ink: oklch(0.97 0.004 85);
  --ink-soft: oklch(0.78 0.008 80);
  --ink-mute: oklch(0.6 0.008 80);
  --line: oklch(0.28 0.01 260);
  --line-soft: oklch(0.23 0.008 260);
  --accent-ink: oklch(0.16 0.01 260);
  --hi: oklch(0.35 0.08 258);
  --shadow-1: 0 1px 0 oklch(0.3 0.01 260);
  --shadow-soft: 0 1px 2px oklch(0.1 0 0 / 0.4), 0 10px 30px -10px oklch(0.05 0 0 / 0.5);
  --shadow-lift: 0 1px 2px oklch(0.08 0 0 / 0.5), 0 24px 48px -24px oklch(0.05 0 0 / 0.6);
}

/* ---- Density variants ---- */
[data-density="compact"] {
  --section-y: clamp(56px, 6vw, 88px);
  --container: 1140px;
}
[data-density="spacious"] {
  --section-y: clamp(96px, 12vw, 176px);
}

/* ---- Type style variants ---- */
[data-type-style="serif"] {
  --font-sans: "Instrument Serif", "Iowan Old Style", Georgia, serif;
}
[data-type-style="serif"] h1,
[data-type-style="serif"] h2,
[data-type-style="serif"] h3 {
  letter-spacing: -0.01em;
  font-weight: 400;
}
[data-type-style="serif"] .eyebrow,
[data-type-style="serif"] .btn,
[data-type-style="serif"] .nav-link,
[data-type-style="serif"] .tag,
[data-type-style="serif"] .meta {
  font-family: "Inter Tight", sans-serif;
}

/* ===== Reset-ish ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* ===== Typography ===== */
h1, h2, h3, h4 {
  margin: 0;
  letter-spacing: -0.022em;
  line-height: 1.05;
  font-weight: 500;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 6vw, 68px); letter-spacing: -0.03em; font-weight: 500; }
h2 { font-size: clamp(30px, 3.6vw, 46px); letter-spacing: -0.025em; }
h3 { font-size: clamp(20px, 1.6vw, 24px); letter-spacing: -0.015em; font-weight: 500; }
p { margin: 0; color: var(--ink-soft); text-wrap: pretty; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 999px;
  display: inline-block;
}

.mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: -0.01em; }
.meta { font-family: var(--font-sans); font-size: 11.5px; color: var(--ink-mute); letter-spacing: 0.04em; text-transform: uppercase; }

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
}
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }

section {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--line);
  position: relative;
}
section:first-of-type { border-top: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, color 0.15s;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--bg-sunken); border-color: var(--ink-mute); }
.btn-link {
  background: transparent;
  padding: 0;
  color: var(--ink);
  border: none;
  font-weight: 500;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-link:hover { color: var(--accent); }
.btn-link .arrow { transition: transform 0.2s; }
.btn-link:hover .arrow { transform: translateX(3px); }

.btn-lg { padding: 14px 20px; font-size: 15px; border-radius: var(--r-md); }

/* ===== Tag / Chip ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--ink-soft);
  background: var(--bg-elev);
}
.tag .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
.tag.ok .dot { background: var(--ok); }

/* ===== Card ===== */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

/* ===== Grid utilities ===== */
.grid { display: grid; gap: var(--s6); }

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--s6);
}
.nav-left { display: flex; align-items: center; }
.nav-center { display: flex; align-items: center; justify-content: center; }
.nav-links { display: flex; align-items: center; gap: var(--s6); line-height: 1; }
.nav-link {
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.15s;
  position: relative;
}
.nav-link:hover { color: var(--ink); }
.nav-right { display: flex; align-items: center; align-self: center; gap: var(--s3); }

.logo {
  display: inline-flex;
  align-items: flex-end;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 28px;
  line-height: 1;
}
.logo-mark {
  width: 22px; height: 22px;
  display: block;
}

.lang-switch {
  display: inline-flex;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: 14px;
}
.lang-switch a {
  background: transparent;
  border-radius: var(--r-sm);
  padding: 4px 6px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  cursor: pointer;
  font-weight: 400;
  transition: color 0.15s;
  text-decoration: none;
}
.lang-switch a.active { color: var(--ink); font-weight: 700; }
.lang-switch a:not(.active):hover { color: var(--ink); }

/* ===== Hero ===== */
.hero {
  padding-top: clamp(48px, 6vw, 96px);
  padding-bottom: var(--section-y);
  border-top: none;
  position: relative;
  isolation: isolate;
}
/* Gradient layer: pinned to top of document, spans ~nav + hero intro, fades out before next content */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 820px;
  background:
    radial-gradient(ellipse 130% 100% at 50% 0%,
      color-mix(in oklab, var(--accent) 22%, transparent) 0%,
      color-mix(in oklab, var(--accent) 12%, transparent) 30%,
      color-mix(in oklab, var(--accent) 6%, transparent) 55%,
      transparent 80%);
  z-index: -1;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
}
[data-palette="dark"] body::before {
  background:
    radial-gradient(ellipse 130% 100% at 50% 0%,
      color-mix(in oklab, var(--accent) 18%, transparent) 0%,
      color-mix(in oklab, var(--accent) 8%, transparent) 40%,
      transparent 80%);
}
body { position: relative; }

/* Make nav blend with the tint instead of fighting it */
.nav { background: transparent; }
.nav.scrolled { background: color-mix(in oklab, var(--bg) 80%, transparent); }

.hero-eyebrow-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s6);
  flex-wrap: wrap;
}
.hero-eyebrow-row .meta {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero h1 { margin-bottom: var(--s5); max-width: 18ch; }
.hero .lede {
  font-size: clamp(16px, 1.35vw, 19px);
  color: var(--ink-soft);
  max-width: 72ch;
  line-height: 1.5;
  margin-bottom: var(--s7);
}
.hero-ctas { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
/* Hero bottom: two-column grid — metas left, demo right */
.hero-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s8);
  margin-top: var(--s9);
  align-items: center;
}
.hero-meta-col {
  display: flex;
  flex-direction: column;
  gap: var(--s7);
  padding: var(--s8) 0 var(--s8) 0;
  border-top: 1px solid var(--line);
  justify-content: space-around;
  align-self: stretch;
}
.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-meta-item .k {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--s2);
}
.hero-meta-item .v {
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0;
}
.hero-demo-col {
  /* demo fills full width of right column */
}

/* Remove old hero-meta row and hero-meta standalone rules — replaced by hero-meta-col */
.hero-meta {
  display: flex;
  gap: var(--s6);
  padding-top: var(--s6);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.hero-meta-item { display: flex; flex-direction: column; gap: 4px; }
.hero-meta-item .k { font-family: var(--font-sans); font-size: 11px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.06em; }
.hero-meta-item .v { font-size: 16px; color: var(--ink); font-weight: 500; display: flex; align-items: center; gap: 4px; }

@media (max-width: 960px) {
  .hero-bottom-grid { grid-template-columns: 1fr; }
  .hero-meta-col { flex-direction: row; flex-wrap: wrap; gap: var(--s5); border-top: 1px solid var(--line); border-bottom: none; }
}


.hero-demo {
  margin-top: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  position: relative;
}
.hero-demo-side {
  padding: clamp(20px, 2.2vw, 32px);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  min-height: 340px;
  position: relative;
}
.hero-demo-side + .hero-demo-side { border-left: 1px solid var(--line); }
.hero-demo-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--s2);
}
.hero-demo-label::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 999px; }

.question-bubble {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s4) var(--s5);
  font-size: 15px;
  color: var(--ink);
  line-height: 1.5;
}
.question-bubble .q-prefix { color: var(--accent); font-family: var(--font-mono); font-size: 12px; margin-right: 6px; }

.answer-stream {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
}
.answer-stream .cite {
  background: var(--hi);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}

.doc-preview {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  padding: var(--s5);
  font-family: var(--font-serif);
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.65;
  position: relative;
  overflow: hidden;
  flex: 1;
}
.doc-preview::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.doc-preview .highlight {
  background: var(--hi);
  padding: 2px 0;
  box-shadow: 4px 0 0 var(--hi), -4px 0 0 var(--hi);
  border-radius: 1px;
  color: var(--ink);
}
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s4);
  font-family: var(--font-sans);
  font-size: 13px;
}
.doc-header .doc-title { color: var(--ink); font-weight: 500; }
.doc-header .doc-ref { color: var(--ink-mute); font-family: var(--font-mono); font-size: 11.5px; }

/* ===== How it works ===== */
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin-top: var(--s9);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  overflow: hidden;
}
.how-step {
  padding: clamp(24px, 2.5vw, 36px);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  border-left: 1px solid var(--line);
  min-height: 420px;
  position: relative;
}
.how-step:first-child { border-left: none; }
.how-step .num {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
}
.how-step h3 { font-size: 22px; }
.how-step p { font-size: 14.5px; line-height: 1.55; }
.how-visual {
  margin-top: auto;
  padding-top: var(--s5);
  height: 180px;
  position: relative;
}

/* ===== Features ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-top: var(--s9);
}
.feature {
  background: var(--bg-elev);
  padding: clamp(24px, 2.4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  min-height: 260px;
}
.feature-icon {
  width: 32px; height: 32px;
  color: var(--accent);
  margin-bottom: var(--s3);
}
.feature h3 { font-size: 18px; }
.feature p { font-size: 14px; line-height: 1.55; }
.feature .tag { align-self: flex-start; margin-top: auto; }

/* ===== Demo chat ===== */
.demo-wrap {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  margin-top: var(--s9);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  min-height: 560px;
}
.demo-sidebar {
  border-right: 1px solid var(--line);
  background: var(--bg-sunken);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.demo-sidebar h4 {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--s2);
  font-weight: 500;
}
.doc-item {
  display: flex;
  gap: var(--s3);
  padding: var(--s3);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  align-items: flex-start;
}
.doc-item:hover { background: var(--bg-elev); }
.doc-item.active { background: var(--bg-elev); border-color: var(--line); }
.doc-item .ic { color: var(--ink-mute); margin-top: 1px; flex-shrink: 0; }
.doc-item .doc-name { font-weight: 500; color: var(--ink); margin-bottom: 2px; line-height: 1.35; }
.doc-item .doc-sub { font-family: var(--font-sans); font-size: 10.5px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.05em; }

.demo-main {
  display: flex;
  flex-direction: column;
  min-height: 560px;
}
.demo-header {
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.demo-messages {
  flex: 1;
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  overflow: auto;
}
.msg { display: flex; gap: var(--s3); max-width: 100%; }
.msg.user { justify-content: flex-end; }
.msg .bubble {
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 1.55;
  max-width: 80%;
  border: 1px solid var(--line);
}
.msg.user .bubble { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.msg.ai .bubble { background: var(--bg-elev); }
.msg.ai .bubble .sources {
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.src-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-soft);
}
.src-chip .dot { width: 5px; height: 5px; background: var(--accent); border-radius: 999px; }

.demo-input {
  border-top: 1px solid var(--line);
  padding: var(--s4) var(--s5);
  display: flex;
  gap: var(--s3);
  background: var(--bg-elev);
  align-items: center;
}
.demo-input input {
  flex: 1;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.demo-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 15%, transparent); }

.demo-suggestions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 var(--s5) var(--s4) var(--s5);
}
.sug {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink-soft);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sug:hover { background: var(--bg-sunken); color: var(--ink); }

.typing { display: inline-flex; gap: 3px; align-items: center; }
.typing span { width: 5px; height: 5px; background: var(--ink-mute); border-radius: 999px; animation: tp 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tp { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; transform: translateY(-2px); } }

/* ===== Trust ===== */
.trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: var(--s8);
}
@media (max-width: 720px) {
  .trust-grid { grid-template-columns: 1fr; }
}
.trust-block {
  padding: var(--s8) 0;
}
.trust-block--left {
  position: relative;
  padding-right: var(--s8);
}
.trust-block--left::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 65%;
  width: 1px;
  background: var(--line);
}
.trust-block--right {
  padding-left: var(--s10);
}
.trust-block-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: var(--s6);
}
.trust-backing-list {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.trust-backing-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s4) 0;
}
.trust-backing-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.trust-backing-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.trust-backing-logo {
  height: 40px;
  width: auto;
  opacity: 0.75;
  margin-right: var(--s9);
}
.trust-backing-desc {
  font-size: 13px;
  color: var(--ink-mute);
}
.trust-caps-list {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.trust-cap-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s4) 0;
}
.trust-cap-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.trust-cap-desc {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.55;
}

/* ===== Security ===== */
.sec-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s9);
  align-items: start;
  margin-top: var(--s8);
}
.sec-copy h2 { margin-bottom: var(--s5); }
.sec-copy p { margin-bottom: var(--s5); font-size: 16px; line-height: 1.6; max-width: 52ch; }
.sec-list {
  display: grid;
  gap: var(--s4);
  list-style: none;
  padding: 0;
  margin: 0;
}
.sec-list li {
  display: flex;
  gap: var(--s3);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.sec-list li:last-child { border-bottom: none; }
.sec-list .ic { color: var(--accent); flex-shrink: 0; margin-top: 3px; }
.sec-list .label { font-weight: 500; color: var(--ink); margin-bottom: 2px; font-size: 15px; }
.sec-list .desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }

.sec-visual {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  padding: var(--s7);
  position: relative;
  overflow: hidden;
  min-height: 460px;
}

/* ===== FAQ ===== */
.faq-list {
  max-width: 780px;
  margin: var(--s8) auto 0;
  border-top: 1px solid var(--line);
}
.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: var(--s5) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  gap: var(--s4);
}
.faq-q .plus {
  width: 20px; height: 20px;
  position: relative;
  flex-shrink: 0;
  color: var(--ink-mute);
  transition: transform 0.25s;
}
.faq-item.open .faq-q .plus { transform: rotate(45deg); color: var(--accent); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
  padding: 0;
}
.faq-item.open .faq-a { max-height: 400px; padding: 0 0 var(--s6) 0; }
.faq-a p { max-width: 68ch; }

/* ===== CTA ===== */
.cta {
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
}
.cta-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--s10);
  align-items: start;
}
.cta h2 { margin-bottom: var(--s5); }
.cta p { font-size: 16px; line-height: 1.6; max-width: 48ch; margin-bottom: var(--s6); }
.cta-form {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s7);
  display: grid;
  gap: var(--s4);
  box-shadow: var(--shadow-soft);
}
.cta-form h3 { font-size: 18px; margin-bottom: var(--s2); }
.form-row { display: grid; gap: 6px; }
.form-row label {
  font-family: var(--font-sans);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
}
.form-row input, .form-row select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus, .form-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 15%, transparent);
}
.form-fine {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--line);
  padding: var(--s9) 0 var(--s7);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: var(--s8);
  margin-bottom: var(--s9);
}
.footer-col h5 {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 var(--s4) 0;
  font-weight: 500;
}
.footer-col a {
  display: block;
  padding: 5px 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s6);
  border-top: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}

/* ===== Scroll animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== Tweaks panel ===== */
.tweaks-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lift);
  width: 280px;
  overflow: hidden;
  font-family: var(--font-sans);
}
.tweaks-panel .th {
  padding: var(--s4);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}
.tweaks-panel .tb { padding: var(--s4); display: grid; gap: var(--s5); }
.tweak-row { display: grid; gap: 6px; }
.tweak-row > label {
  font-family: var(--font-sans);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
}
.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.seg button {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 7px 8px;
  font-size: 12px;
  color: var(--ink-soft);
  border-left: 1px solid var(--line);
}
.seg button:first-child { border-left: none; }
.seg button.active { background: var(--ink); color: var(--bg); }

.swatches {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.swatches .sw {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 6px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.swatches .sw:hover { border-color: var(--ink-mute); }
.swatches .sw.active { border-color: var(--ink); background: var(--bg-elev); }
.swatches .sw-dot {
  width: 18px; height: 18px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px oklch(0 0 0 / 0.1);
}
.swatches .sw-lbl {
  font-size: 10.5px;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}
.swatches .sw.active .sw-lbl { color: var(--ink); }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .hero-demo { grid-template-columns: 1fr; }
  .hero-demo-side + .hero-demo-side { border-left: none; border-top: 1px solid var(--line); }
  .how-grid { grid-template-columns: 1fr; }
  .how-step { border-left: none; border-top: 1px solid var(--line); }
  .how-step:first-child { border-top: none; }
  .features-grid { grid-template-columns: 1fr; }
  .demo-wrap { grid-template-columns: 1fr; min-height: auto; }
  .demo-sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  .sec-grid { grid-template-columns: 1fr; gap: var(--s8); }
  .cta-wrap { grid-template-columns: 1fr; gap: var(--s8); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s6); }
  .nav-center { display: none; }
}
