/* Bruno landing site - main stylesheet
 * Tokens and component recipes mirror /style.md.
 * Mobile-first; widen via @media (min-width: ...).
 */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd,
ol,
ul {
  margin: 0;
}
ol[role='list'],
ul[role='list'],
.unstyled-list {
  list-style: none;
  padding: 0;
}
img,
picture,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}

/* ---------- 2. Tokens ---------- */
:root {
  color-scheme: light;

  /* Brand */
  --brand-50: #eef1ff;
  --brand-100: #dde3ff;
  --brand-200: #bcc8ff;
  --brand-500: #5875fe;
  --brand-600: #4762e8;
  --brand-700: #3a52cc;
  --brand-contrast: #ffffff;

  /* Ink */
  --ink: #161d31;
  --ink-soft: #3a4763;
  --ink-muted: #67738c;
  --ink-faint: #94a0b5;

  /* Surfaces */
  --surface: #ffffff;
  --surface-1: #f8fafc;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;

  /* Borders */
  --border: #e5e9f0;
  --border-soft: #eef2f7;
  --border-strong: #cbd2dd;

  /* Semantic */
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #0ea5e9;
  --info-soft: #e0f2fe;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;
  --fs-5xl: 3.75rem;
  --fs-6xl: 4.5rem;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;
  --sp-32: 128px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-pill: 9999px;

  /* Shadows */
  --sh-xs: 0 1px 2px rgb(15 20 36 / 0.05);
  --sh-sm: 0 1px 3px rgb(15 20 36 / 0.08), 0 1px 2px rgb(15 20 36 / 0.04);
  --sh-md: 0 8px 24px -8px rgb(15 20 36 / 0.16);
  --sh-lg: 0 24px 48px -16px rgb(15 20 36 / 0.2);
  --sh-xl: 0 40px 80px -24px rgb(15 20 36 / 0.28);
  --sh-ring: 0 0 0 4px rgb(88 117 254 / 0.2);

  /* Motion */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container: 1200px;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --brand-50: #1b2046;
    --brand-100: #232a57;
    --brand-200: #3242a0;
    --brand-500: #7a91ff;
    --brand-600: #6a82f5;
    --brand-700: #5872e0;

    --ink: #f2f4f8;
    --ink-soft: #c8cfdd;
    --ink-muted: #9aa3b4;
    --ink-faint: #6e7889;

    --surface: #0f1424;
    --surface-1: #151b30;
    --surface-2: #1b2238;
    --surface-3: #222a45;

    --border: #2a3450;
    --border-soft: #222a45;
    --border-strong: #3a4763;

    --success: #34d399;
    --success-soft: #0f2a22;
    --warning: #fbbf24;
    --warning-soft: #2a2014;
    --danger: #f87171;
    --danger-soft: #2a1414;
    --info: #38bdf8;
    --info-soft: #0f2436;

    --sh-xs: 0 1px 2px rgb(0 0 0 / 0.3);
    --sh-sm: 0 1px 3px rgb(0 0 0 / 0.4), 0 1px 2px rgb(0 0 0 / 0.3);
    --sh-md: 0 8px 24px -8px rgb(0 0 0 / 0.5);
    --sh-lg: 0 24px 48px -16px rgb(0 0 0 / 0.55);
    --sh-xl: 0 40px 80px -24px rgb(0 0 0 / 0.6);
  }
}

[data-theme='dark'] {
  color-scheme: dark;
  --brand-50: #1b2046;
  --brand-100: #232a57;
  --brand-200: #3242a0;
  --brand-500: #7a91ff;
  --brand-600: #6a82f5;
  --brand-700: #5872e0;
  --ink: #f2f4f8;
  --ink-soft: #c8cfdd;
  --ink-muted: #9aa3b4;
  --ink-faint: #6e7889;
  --surface: #0f1424;
  --surface-1: #151b30;
  --surface-2: #1b2238;
  --surface-3: #222a45;
  --border: #2a3450;
  --border-soft: #222a45;
  --border-strong: #3a4763;
  --success: #34d399;
  --success-soft: #0f2a22;
  --warning: #fbbf24;
  --warning-soft: #2a2014;
  --danger: #f87171;
  --danger-soft: #2a1414;
  --info: #38bdf8;
  --info-soft: #0f2436;
  --sh-xs: 0 1px 2px rgb(0 0 0 / 0.3);
  --sh-sm: 0 1px 3px rgb(0 0 0 / 0.4), 0 1px 2px rgb(0 0 0 / 0.3);
  --sh-md: 0 8px 24px -8px rgb(0 0 0 / 0.5);
  --sh-lg: 0 24px 48px -16px rgb(0 0 0 / 0.55);
  --sh-xl: 0 40px 80px -24px rgb(0 0 0 / 0.6);
}

/* ---------- 3. Base ---------- */
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

::selection {
  background: var(--brand-200);
  color: var(--ink);
}

a {
  color: var(--brand-500);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: none;
  box-shadow: var(--sh-ring);
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-4);
  background: var(--ink);
  color: var(--surface);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--dur-base) var(--ease-out);
  z-index: 1000;
}
.skip-link:focus {
  transform: translateY(0);
}

/* ---------- 4. Headings & prose ---------- */
h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h1 {
  font-size: var(--fs-4xl);
}
h2 {
  font-size: var(--fs-2xl);
}
h3 {
  font-size: var(--fs-xl);
}
h4 {
  font-size: var(--fs-lg);
}

@media (min-width: 768px) {
  h1 {
    font-size: var(--fs-5xl);
  }
  h2 {
    font-size: var(--fs-3xl);
  }
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: var(--fs-xs);
  color: var(--brand-500);
  margin-bottom: var(--sp-3);
}

.lead {
  font-size: var(--fs-md);
  color: var(--ink-soft);
  line-height: 1.6;
}

.muted {
  color: var(--ink-muted);
}

.prose {
  max-width: 65ch;
  color: var(--ink);
  font-size: var(--fs-base);
  line-height: 1.75;
}
.prose p,
.prose ul,
.prose ol,
.prose figure,
.prose pre {
  margin-bottom: 1.25em;
}
.prose img,
.prose .illustration {
  margin-block: 1em 1.5em;
}
.prose h2 {
  font-size: var(--fs-2xl);
  margin-top: 2em;
  margin-bottom: 0.5em;
}
.prose h3 {
  font-size: var(--fs-lg);
  margin-top: 1.75em;
  margin-bottom: 0.4em;
}
.prose ul,
.prose ol {
  padding-left: 1.5em;
}
.prose li {
  margin-bottom: 0.5em;
}
.prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.prose strong {
  color: var(--ink);
  font-weight: 600;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-2);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}
.prose hr {
  border: 0;
  height: 1px;
  background: var(--border-soft);
  margin: 2.5em 0;
}
.prose mark {
  background: var(--warning-soft);
  color: var(--ink);
  padding: 0.05em 0.3em;
  border-radius: 4px;
}
.prose .todo {
  background: var(--warning-soft);
  border: 1px dashed var(--warning);
  color: var(--ink);
  padding: 0.05em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  margin-bottom: 1.5em;
}
.prose th,
.prose td {
  text-align: left;
  padding: var(--sp-3) var(--sp-3);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose th {
  background: var(--surface-1);
  font-weight: 600;
  color: var(--ink);
}

/* ---------- 5. Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.section {
  padding-block: var(--sp-12);
}
@media (min-width: 768px) {
  .section {
    padding-block: var(--sp-16);
  }
}
.section--tinted {
  background: var(--surface-1);
}
.section--brand {
  background: linear-gradient(180deg, var(--brand-50) 0%, var(--surface) 100%);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}
.stack--lg {
  gap: var(--sp-10);
}
.stack--sm {
  gap: var(--sp-3);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

.grid {
  display: grid;
  gap: var(--sp-6);
}
.grid-2 {
  grid-template-columns: 1fr;
}
.grid-3 {
  grid-template-columns: 1fr;
}
.grid-4 {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.text-center {
  text-align: center;
}
.mx-auto {
  margin-inline: auto;
}
.max-w-prose {
  max-width: 65ch;
}
.max-w-readable {
  max-width: 720px;
}

/* ---------- 6. Header / nav ---------- */
/* The translucent background + backdrop-filter live on a ::before layer rather
 * than on .site-header itself. backdrop-filter on the header would make it a
 * containing block for position:fixed descendants (per CSS spec), which would
 * trap the fixed mobile menu inside the 64px-tall header and collapse it to a
 * sliver. Keeping the filter on a pseudo-element preserves the visual effect
 * without breaking the mobile menu's viewport-relative positioning.
 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid var(--border-soft);
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  z-index: -1;
  pointer-events: none;
}
.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  color: var(--ink);
  font-size: var(--fs-md);
  letter-spacing: -0.02em;
}
.brand:hover {
  text-decoration: none;
}
.brand__mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-block;
  object-fit: contain;
}

.site-nav {
  display: none;
  gap: var(--sp-1);
  margin-inline-start: var(--sp-4);
  flex: 1;
}
@media (min-width: 1024px) {
  .site-nav {
    display: flex;
  }
}
.site-nav a {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--ink-soft);
  font-weight: 500;
  font-size: var(--fs-sm);
  transition: color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}
.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
  text-decoration: none;
}
.site-nav a[aria-current='page'] {
  color: var(--brand-500);
  background: var(--brand-50);
}

.site-header__cta {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  margin-inline-start: auto;
}
@media (min-width: 1024px) {
  .site-header__cta {
    display: flex;
  }
}

.menu-toggle {
  display: inline-flex;
  margin-inline-start: auto;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }
}
.menu-toggle:hover {
  background: var(--surface-2);
}
.menu-toggle svg {
  width: 20px;
  height: 20px;
}
.menu-toggle .icon-close {
  display: none;
}
.menu-toggle[aria-expanded='true'] .icon-open {
  display: none;
}
.menu-toggle[aria-expanded='true'] .icon-close {
  display: block;
}

/* Mobile menu: full-height drop-down panel anchored below the sticky header.
 * Uses position:fixed with viewport-relative inset so the panel always fills
 * the visible area below the header on every device (100dvh handles iOS/Android
 * URL-bar collapse). The panel is always in the DOM so we can transition it.
 */
.mobile-menu {
  position: fixed;
  top: var(--header-h);
  inset-inline: 0;
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
  z-index: 49;
  padding: var(--sp-5) var(--sp-6) calc(var(--sp-8) + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    visibility 0s linear var(--dur-base);
}
.mobile-menu[data-open='true'] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    visibility 0s linear 0s;
}
@media (min-width: 1024px) {
  .mobile-menu {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-menu {
    transition: opacity var(--dur-fast) linear,
      visibility 0s linear var(--dur-fast);
    transform: none;
  }
  .mobile-menu[data-open='true'] {
    transition: opacity var(--dur-fast) linear, visibility 0s linear 0s;
    transform: none;
  }
}
.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.mobile-menu a {
  display: block;
  padding: var(--sp-4) var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--ink);
  min-height: 44px;
}
.mobile-menu a:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.mobile-menu a[aria-current='page'] {
  background: var(--brand-50);
  color: var(--brand-500);
}
.mobile-menu__cta {
  margin-top: auto;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* ---------- 7. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.btn:hover {
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--sm {
  height: 32px;
  padding: 0 var(--sp-3);
  font-size: var(--fs-sm);
}
.btn--md {
  height: 40px;
  padding: 0 var(--sp-4);
  font-size: var(--fs-sm);
}
.btn--lg {
  height: 48px;
  padding: 0 var(--sp-6);
  font-size: var(--fs-base);
}

.btn--primary {
  background: var(--brand-500);
  color: var(--brand-contrast);
}
.btn--primary:hover {
  background: var(--brand-600);
}
.btn--primary:active {
  background: var(--brand-700);
}

.btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn--secondary:hover {
  background: var(--surface-2);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
}
.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--danger:hover {
  filter: brightness(0.95);
}

/* ---------- 8. Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: var(--border-strong);
}
.card--brand {
  background: var(--brand-50);
  border-color: var(--brand-100);
}
.card__icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--brand-50);
  color: var(--brand-500);
  margin-bottom: var(--sp-2);
}
.card--brand .card__icon {
  background: var(--surface);
}
.card__icon svg {
  width: 20px;
  height: 20px;
}
.card__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.card__body {
  color: var(--ink-soft);
  font-size: var(--fs-base);
  line-height: 1.6;
  flex: 1;
}
.card__cta {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-500);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin-top: var(--sp-2);
}
.card__cta:hover {
  color: var(--brand-600);
  text-decoration: none;
}

/* ---------- 9. Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--neutral {
  background: var(--surface-2);
  color: var(--ink-soft);
  border-color: var(--border);
}
.badge--brand {
  background: var(--brand-50);
  color: var(--brand-500);
  border-color: var(--brand-100);
}
.badge--success {
  background: var(--success-soft);
  color: var(--success);
}
.badge--warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge--info {
  background: var(--info-soft);
  color: var(--info);
}

/* ---------- 10. Inputs ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
}
.field__input,
.field__textarea,
.field__select {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 0 var(--sp-3);
  height: 40px;
  font-size: var(--fs-base);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field__textarea {
  height: auto;
  padding: var(--sp-3);
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}
.field__input::placeholder,
.field__textarea::placeholder {
  color: var(--ink-faint);
}
.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: var(--sh-ring);
}
.field__hint {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
}

/* ---------- 11. Callout ---------- */
.callout {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.callout strong {
  color: var(--ink);
}
.callout--info {
  background: var(--info-soft);
  border-color: var(--info);
  color: var(--ink);
}
.callout--success {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--ink);
}
.callout--warning {
  background: var(--warning-soft);
  border-color: var(--warning);
  color: var(--ink);
}
.callout--danger {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--ink);
}

/* ---------- 12. Code block ---------- */
.code {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 0;
}
.code__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.code__copy {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 2px var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
}
.code__copy:hover {
  background: var(--surface);
}
.code__copy[data-state='copied'] {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}
.code__pre {
  margin: 0;
  padding: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre;
}

/* ---------- 13. FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--dur-base);
}
.faq[open] {
  border-color: var(--brand-200);
  box-shadow: var(--sh-xs);
}
.faq__q {
  cursor: pointer;
  list-style: none;
  padding: var(--sp-4) var(--sp-5);
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.faq__q::-webkit-details-marker {
  display: none;
}
.faq__q::after {
  content: '+';
  font-size: 1.5em;
  font-weight: 400;
  line-height: 1;
  color: var(--ink-muted);
  transition: transform var(--dur-base);
}
.faq[open] .faq__q::after {
  content: '−';
  color: var(--brand-500);
}
.faq__a {
  padding: 0 var(--sp-5) var(--sp-5);
  color: var(--ink-soft);
  line-height: 1.65;
}
.faq__a > p:not(:last-child) {
  margin-bottom: 0.75em;
}

/* ---------- 14. Hero ---------- */
.hero {
  padding-block: var(--sp-16) var(--sp-12);
  background: radial-gradient(
      ellipse 60% 60% at 70% 0%,
      color-mix(in srgb, var(--brand-500) 10%, transparent) 0%,
      transparent 80%
    ),
    var(--surface);
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) {
  .hero {
    padding-block: var(--sp-24) var(--sp-16);
  }
}
.hero__grid {
  display: grid;
  gap: var(--sp-10);
  align-items: center;
}
@media (min-width: 1024px) {
  .hero__grid {
    grid-template-columns: 1.05fr 1fr;
  }
}
.hero__title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.hero__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--brand-500) 0%, #8a9bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead {
  margin-top: var(--sp-5);
  font-size: var(--fs-md);
  color: var(--ink-soft);
  max-width: 56ch;
  line-height: 1.6;
}
.hero__cta {
  margin-top: var(--sp-8);
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.hero__meta {
  margin-top: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}
.hero__meta strong {
  color: var(--ink);
  font-weight: 600;
}

/* Hero visual: stylised browser frame with chat bubble */
.hero__visual {
  position: relative;
  border-radius: var(--r-2xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  min-height: 360px;
}
.hero__visual::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 36px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.hero__visual::after {
  content: '';
  position: absolute;
  top: 13px;
  left: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 18px 0 0 0 #febc2e, 36px 0 0 0 #28c840;
}
.hero__viz-content {
  position: absolute;
  inset: 36px 0 0 0;
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.hero__bubble {
  align-self: flex-end;
  background: var(--brand-500);
  color: var(--brand-contrast);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-xl) var(--r-xl) var(--r-sm) var(--r-xl);
  font-size: var(--fs-sm);
  max-width: 85%;
  box-shadow: var(--sh-md);
}
.hero__bubble--bot {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--r-xl) var(--r-xl) var(--r-xl) var(--r-sm);
  border: 1px solid var(--border-soft);
}
.hero__highlight {
  position: absolute;
  border: 2px dashed var(--brand-500);
  border-radius: var(--r-md);
  background: rgb(88 117 254 / 0.08);
  pointer-events: none;
  bottom: 22%;
  left: 14%;
  right: 14%;
  height: 38px;
  animation: heroPulse 2.4s var(--ease-in-out) infinite;
}
@keyframes heroPulse {
  0%, 100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.015);
  }
}

/* When .hero__visual is used as a frame for a generated illustration we
   hide the synthetic browser-chrome dots and let the picture fill the frame. */
.hero__visual--image {
  background: transparent;
  border: none;
  box-shadow: var(--sh-lg);
  aspect-ratio: 16 / 9;
  min-height: 0;
}
.hero__visual--image::before,
.hero__visual--image::after { content: none; }
.hero__visual--image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Generic illustration utility used across pages.
   Keeps a consistent rounded card look in both light and dark mode. */
.illustration {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-soft);
  box-shadow: var(--sh-md);
  background: var(--surface);
  overflow: hidden;
}
.illustration--bare {
  border: none;
  box-shadow: none;
  background: transparent;
}
.illustration--ratio-16-9 { aspect-ratio: 16 / 9; object-fit: cover; }
.illustration--ratio-4-3  { aspect-ratio: 4  / 3; object-fit: cover; }
/* Slightly desaturate the image edges in dark mode so they don't punch out
   against the navy background. */
[data-theme='dark'] .illustration,
@media (prefers-color-scheme: dark) {
  .illustration {
    border-color: var(--border);
  }
}

/* ---------- 15. Feature grid ---------- */
.feature {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-6);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  height: 100%;
}
.feature__icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--brand-50);
  color: var(--brand-500);
}
.feature__icon svg {
  width: 22px;
  height: 22px;
}
.feature__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink);
}
.feature__body {
  color: var(--ink-soft);
  line-height: 1.6;
}
.feature__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.feature__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}
.feature__list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-500);
  margin-top: 0.55em;
  flex: 0 0 6px;
}

/* ---------- 16. Steps ---------- */
.steps {
  counter-reset: step;
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}
.step {
  position: relative;
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -16px;
  left: var(--sp-5);
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--brand-500);
  color: var(--brand-contrast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  box-shadow: var(--sh-sm);
}
/* Step card image - kept inside the card padding so it doesn't collide
   with the floating step-number badge (.step::before). */
.step__media {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  margin-top: var(--sp-2);
}
.step__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-top: var(--sp-3);
}
.step__body {
  color: var(--ink-soft);
  line-height: 1.6;
  margin-top: var(--sp-2);
}

/* Use-case card image - sits above the badge inside .card--interactive and
 * bleeds to the card's left/right edges via negative horizontal margins.
 *
 * IMPORTANT: the global reset sets `img { max-width: 100%; }`, which would
 * clamp the bleed-out width back to 100% of the card's content box (leaving
 * a ~48px gap on the right). We override max-width here so the negative
 * margins can actually do their job and the image fills the card edge-to-edge.
 *
 * The aspect ratio is intentionally tighter than the source illustrations
 * (which are 4:3 with built-in decorative padding); 16:10 with object-fit:
 * cover crops a sliver off the top and bottom so the actual subject fills
 * the card width, instead of looking small inside a padded frame.
 */
.usecase__media {
  display: block;
  width: calc(100% + 2 * var(--sp-6));
  max-width: none;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  background: var(--surface-2);
  margin: calc(-1 * var(--sp-6)) calc(-1 * var(--sp-6)) var(--sp-2);
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  border-top-left-radius: var(--r-lg);
  border-top-right-radius: var(--r-lg);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* ---------- 17. Pricing ---------- */
.pricing-grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1200px) {
  .pricing-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-8) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.plan--featured {
  border-color: var(--brand-500);
  box-shadow: var(--sh-md);
  position: relative;
}
.plan--featured::after {
  content: 'Most popular';
  position: absolute;
  top: 0;
  right: var(--sp-6);
  transform: translateY(-50%);
  background: var(--brand-500);
  color: var(--brand-contrast);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px var(--sp-3);
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
}
.plan__name {
  font-size: var(--fs-xl);
  font-weight: 700;
}
.plan__tag {
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}
.plan__price {
  display: flex;
  align-items: baseline;
  gap: var(--sp-1);
  margin-block: var(--sp-2);
}
.plan__price-amount {
  font-size: var(--fs-4xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.plan__price-period {
  color: var(--ink-muted);
  font-size: var(--fs-sm);
}
.plan__features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.plan__features li {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}
.plan__features li::before {
  content: '';
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 2px;
  background-color: var(--brand-500);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>")
    center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>")
    center / contain no-repeat;
}
.plan__cta {
  margin-top: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  margin-top: var(--sp-8);
}
.compare-table th,
.compare-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.compare-table thead th {
  background: var(--surface-1);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.compare-table tbody th {
  font-weight: 500;
  color: var(--ink-soft);
}
.compare-table td {
  color: var(--ink);
  text-align: center;
}
.compare-table td:first-child {
  text-align: left;
  color: var(--ink-soft);
}
.compare-table td.yes {
  color: var(--success);
  font-weight: 600;
}
.compare-table td.no {
  color: var(--ink-faint);
}

/* ---------- 18. Footer ---------- */
.site-footer {
  margin-top: auto;
  background: var(--surface-1);
  border-top: 1px solid var(--border-soft);
  padding-block: var(--sp-12) var(--sp-6);
}
.site-footer__grid {
  display: grid;
  gap: var(--sp-8);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: 1.3fr repeat(3, 1fr);
  }
}
.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.site-footer__brand p {
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  max-width: 36ch;
  line-height: 1.55;
}
.site-footer__col h4 {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: var(--sp-3);
}
.site-footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.site-footer__col a {
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}
.site-footer__col a:hover {
  color: var(--ink);
  text-decoration: none;
}
.site-footer__bottom {
  margin-top: var(--sp-10);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--ink-muted);
}
.site-footer__bottom a {
  color: var(--ink-soft);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 4px var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  cursor: pointer;
}
.theme-toggle:hover {
  background: var(--surface);
  color: var(--ink);
}
.theme-toggle svg {
  width: 14px;
  height: 14px;
}
.theme-toggle .icon-moon {
  display: none;
}
.theme-toggle .icon-sun {
  display: block;
}
[data-theme='dark'] .theme-toggle .icon-sun {
  display: none;
}
[data-theme='dark'] .theme-toggle .icon-moon {
  display: block;
}

/* ---------- 19. Misc ---------- */
.kbd {
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  padding: 1px 6px;
  font-size: 0.85em;
  color: var(--ink);
}

.divider {
  height: 1px;
  background: var(--border-soft);
  margin-block: var(--sp-12);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.split {
  display: grid;
  gap: var(--sp-10);
  align-items: center;
}
@media (min-width: 1024px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}
.split--reverse > :first-child {
  order: 2;
}
@media (min-width: 1024px) {
  .split--reverse > :first-child {
    order: 1;
  }
  .split--reverse > :last-child {
    order: 0;
  }
}

.cta-band {
  background: linear-gradient(135deg, var(--brand-500), #4255d6);
  color: var(--brand-contrast);
  border-radius: var(--r-2xl);
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
}
.cta-band h2 {
  color: var(--brand-contrast);
  font-size: var(--fs-3xl);
  letter-spacing: -0.02em;
}
.cta-band p {
  color: rgb(255 255 255 / 0.85);
  margin-top: var(--sp-3);
  font-size: var(--fs-md);
  max-width: 56ch;
  margin-inline: auto;
}
.cta-band .btn--primary {
  background: var(--surface);
  color: var(--brand-700);
}
.cta-band .btn--primary:hover {
  background: var(--surface-1);
}
.cta-band .btn--secondary {
  background: transparent;
  color: var(--brand-contrast);
  border-color: rgb(255 255 255 / 0.5);
}
.cta-band .btn--secondary:hover {
  background: rgb(255 255 255 / 0.1);
}
.cta-band__row {
  margin-top: var(--sp-6);
  display: inline-flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  justify-content: center;
}

.section-head {
  text-align: center;
  max-width: 64ch;
  margin: 0 auto var(--sp-10);
}
.section-head h2 {
  margin-top: var(--sp-2);
}
.section-head p {
  margin-top: var(--sp-4);
  color: var(--ink-soft);
  font-size: var(--fs-md);
  line-height: 1.6;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
  align-self: start;
  font-size: var(--fs-sm);
}
.toc h2 {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: var(--sp-3);
}
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  border-left: 1px solid var(--border);
  padding-left: var(--sp-3);
}
.toc a {
  color: var(--ink-soft);
}
.toc a:hover {
  color: var(--ink);
  text-decoration: none;
}

.layout-doc {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
}
@media (min-width: 1024px) {
  .layout-doc {
    grid-template-columns: 220px 1fr;
  }
}

.breadcrumbs {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  margin-bottom: var(--sp-3);
}
.breadcrumbs a {
  color: var(--ink-soft);
}
.breadcrumbs span {
  margin-inline: var(--sp-2);
  color: var(--ink-faint);
}

/* Stat group */
.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
}
@media (min-width: 640px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
}
.stat__num {
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.stat__label {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  margin-top: var(--sp-1);
}

/* Logos row (placeholder customer logos) */
.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  opacity: 0.7;
}
.logo-row span {
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--ink-muted);
  letter-spacing: -0.01em;
}

/* ---------- 20. Reduced motion (always last) ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
