/* ── TurboLLM design system (spec 11 §1) ──────────────────────────────────────
   Warm, calm, editorial. One accent. No gradients, no glow. Tokens are the only
   source of color — components must never hardcode hex; use var(--token).        */

/* ── Light theme ────────────────────────────────────────────────────────────── */

:root,
html:not(.dark) {
  --bg: #faf9f7;
  --panel: #ffffff;
  --panel-2: #f4f2ee;
  --ink: #1a1a18;
  --muted: #6b6a66;
  --faint: #9c9a94;
  --border: #e7e4de;
  --border-strong: #d6d2c8;
  --accent: #c96442;
  --accent-hover: #b85837;
  --on-accent: #ffffff;
  --ok: #3a9d6b;
  --warn: #c9913f;
  --err: #c4453c;
  --info: #5a7d9a;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-2: 0 4px 16px rgb(0 0 0 / 0.07);
  --log-bg: #0b0b0c;
  --log-ink: #d6d3cd;
  --log-faint: #7a7872;
  --log-err-ink: #e0b3ad;
  --nav-bg: #ffffff;
  --nav-border: #e7e4de;
  --hero-gradient: linear-gradient(180deg, var(--bg) 0%, var(--panel-2) 100%);
  --code-bg: #f4f2ee;
}

/* ── Dark theme ─────────────────────────────────────────────────────────────── */

html.dark {
  --bg: #0e0e10;
  --panel: #17171a;
  --panel-2: #1d1d21;
  --ink: #ededec;
  --muted: #9a9a96;
  --faint: #6e6e6a;
  --border: #2a2a2e;
  --border-strong: #3a3a40;
  --accent: #e08a5f;
  --accent-hover: #e89a73;
  --on-accent: #1a1a18;
  --ok: #4cc38a;
  --warn: #d8a45a;
  --err: #e06c5f;
  --info: #7da3c4;
  --nav-bg: #17171a;
  --nav-border: #2a2a2e;
  --hero-gradient: linear-gradient(180deg, var(--bg) 0%, var(--panel-2) 100%);
  --code-bg: #1d1d21;
}

/* ── Reset & base ───────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  border-radius: 9999px;
  background-color: var(--border-strong);
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }

/* ── Focus ──────────────────────────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 1px;
}

/* ── Typography ─────────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--ink);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--accent-hover);
}

/* ── Code ───────────────────────────────────────────────────────────────────── */

code,
pre {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.875rem;
}

code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background: var(--log-bg);
  color: var(--log-ink);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

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

th {
  font-weight: 600;
  color: var(--ink);
  background: var(--panel-2);
}

td {
  color: var(--ink);
}

tr:hover td {
  background: var(--panel-2);
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: 800px;
}

/* ── Navigation ─────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.nav__brand:hover {
  color: var(--ink);
}

.nav__brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.nav__brand-text {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav__link {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav__link:hover {
  color: var(--ink);
}

.nav__link--active {
  color: var(--accent);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Theme toggle ───────────────────────────────────────────────────────────── */

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ── Mobile nav toggle ──────────────────────────────────────────────────────── */

.nav__mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav__mobile-toggle svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .nav__links {
    display: none;
  }
  .nav__mobile-toggle {
    display: flex;
  }
}

/* ── Hero ───────────────────────────────────────────────────────────────────── */

.hero {
  padding: 6rem 0 4rem;
  text-align: center;
  background: var(--hero-gradient);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
}

.hero__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.hero__title-accent {
  color: var(--accent);
}

.hero__subtitle {
  font-size: 1.25rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: inherit;
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn--secondary {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
}

.btn--ghost:hover {
  color: var(--ink);
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.2s;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--accent);
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

.card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.card__desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Section ────────────────────────────────────────────────────────────────── */

.section {
  padding: 5rem 0;
}

.section__header {
  text-align: center;
  margin-bottom: 3rem;
}

.section__title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.section__desc {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Grid ───────────────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

/* ── Divider ────────────────────────────────────────────────────────────────── */

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */

.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__copy {
  font-size: 0.85rem;
  color: var(--muted);
}

.footer__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.footer__link {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

.footer__link:hover {
  color: var(--ink);
}

/* ── Badge ──────────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--ok {
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  color: var(--ok);
}

.badge--accent {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

/* ── Content page ───────────────────────────────────────────────────────────── */

.content {
  padding: 3rem 0 5rem;
}

.content__header {
  margin-bottom: 2rem;
}

.content__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.content__subtitle {
  font-size: 1.1rem;
  color: var(--muted);
}

.content__body {
  max-width: 800px;
}

.content__body h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.content__body h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.content__body h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.content__body p {
  margin-bottom: 1rem;
}

.content__body ul,
.content__body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.content__body li {
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.content__body details {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--panel);
}

.content__body summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}

.content__body details[open] summary {
  margin-bottom: 0.75rem;
}

/* ── Feature row ────────────────────────────────────────────────────────────── */

.feature-row {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.feature-row--reverse {
  flex-direction: row-reverse;
}

.feature-row__media {
  flex: 1;
  min-width: 0;
}

.feature-row__media img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.feature-row__text {
  flex: 1;
  min-width: 0;
}

.feature-row__text h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

.feature-row__text p {
  color: var(--muted);
}

@media (max-width: 768px) {
  .feature-row,
  .feature-row--reverse {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* ── Stats ──────────────────────────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat {
  text-align: center;
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.stat__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.stat__label {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── CTA ────────────────────────────────────────────────────────────────────── */

.cta {
  text-align: center;
  padding: 4rem 0;
}

.cta__title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.cta__desc {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 2rem;
}

/* ── Code block with copy ───────────────────────────────────────────────────── */

.code-block {
  position: relative;
  margin-bottom: 1.5rem;
}

.code-block__copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.code-block__copy:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

/* ── Comparison table ───────────────────────────────────────────────────────── */

.comparison {
  overflow-x: auto;
  margin-bottom: 2rem;
}

.comparison table {
  min-width: 600px;
}

.comparison .check {
  color: var(--ok);
  font-weight: 700;
}

.comparison .cross {
  color: var(--err);
  font-weight: 700;
}

.comparison .partial {
  color: var(--warn);
}

/* ── Mobile nav overlay ─────────────────────────────────────────────────────── */

.nav__mobile-menu {
  display: none;
  position: fixed;
  inset: 56px 0 0 0;
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  padding: 1.5rem;
  z-index: 99;
}

.nav__mobile-menu.open {
  display: block;
}

.nav__mobile-menu ul {
  list-style: none;
}

.nav__mobile-menu li {
  margin-bottom: 0.5rem;
}

.nav__mobile-menu a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s;
}

.nav__mobile-menu a:hover,
.nav__mobile-menu a.active {
  background: var(--panel-2);
  color: var(--ink);
}

/* ── Animations ─────────────────────────────────────────────────────────────── */

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fade-in-up 0.5s ease-out forwards;
}

.animate-in--delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-in--delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-in--delay-3 { animation-delay: 0.3s; opacity: 0; }
.animate-in--delay-4 { animation-delay: 0.4s; opacity: 0; }
