/* رفيق · marketing site — the app's own visual language.
   Canvas and blocks, no shadows (depth comes from colour), one inverse block per screen,
   bracket labels, big numbers, and the brand orange only on the buttons that matter.
   Light by default, dark follows the OS or the toggle. Radii: buttons 12, blocks 24, chips pill. */

@import url("/assets/fonts/plex.css?v=0.5");

:root {
  --bg: #e9e9e6;
  --bg-2: #e2e2de;
  --surface: #ffffff;
  --surface-2: #f3f2ee;
  --ink: #121212;
  --ink-2: #3a3a36;
  --muted: #66665f;
  --line: #dadad5;
  --line-2: #cfcfc9;
  --inverse: #141414;
  --on-inverse: #f4f4f1;
  --on-inverse-muted: #96968e;
  --accent: #e68835;
  --accent-ink: #1f1306;
  --ok: #2e7d4f;
  --peep-fill: #ffffff;
  --block: 24px;
  --btn: 12px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --display: "Alexandria", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --num: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Code", Consolas, ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --measure: 62ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e; --bg-2: #141413; --surface: #1a1a1a; --surface-2: #232321;
    --ink: #f2f2ef; --ink-2: #c8c8c2; --muted: #96968e; --line: #2c2c2b; --line-2: #3a3a38;
    --inverse: #f2f2ef; --on-inverse: #121212; --on-inverse-muted: #66665f;
    --ok: #6fcf97; --peep-fill: #232321;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e0e; --bg-2: #141413; --surface: #1a1a1a; --surface-2: #232321;
  --ink: #f2f2ef; --ink-2: #c8c8c2; --muted: #96968e; --line: #2c2c2b; --line-2: #3a3a38;
  --inverse: #f2f2ef; --on-inverse: #121212; --on-inverse-muted: #66665f;
  --ok: #6fcf97; --peep-fill: #232321;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: 0; line-height: 1.2; text-wrap: balance; }
h2 { font-size: clamp(30px, 3.8vw, 48px); }
h3 { font-size: 21px; font-weight: 700; }
.muted { color: var(--muted); }
.lead { color: var(--ink-2); font-size: 18px; max-width: var(--measure); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ( Label ) — the app's bracket labels above a block's content. */
.eyebrow { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 12px; font-family: var(--font); font-weight: 500; }
.eyebrow::before { content: "( "; }
.eyebrow::after { content: " )"; }

.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }
@media (max-width: 640px) { .wrap { width: min(1200px, 100% - 32px); } }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: var(--btn); font-weight: 600; font-size: 16px;
  border: 0; white-space: nowrap; cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.18s, filter 0.18s;
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-lg { padding: 16px 28px; font-size: 17px; }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 20; height: 70px;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 20px; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.nav-links { display: flex; align-items: center; gap: 4px; font-size: 15px; color: var(--muted); padding: 5px; border-radius: 999px; background: var(--surface); }
.nav-links a { padding: 6px 14px; border-radius: 999px; transition: color 0.2s, background-color 0.2s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--on-inverse); background: var(--inverse); font-weight: 500; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang, .theme-btn { font-size: 14px; color: var(--muted); height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; font-family: inherit; }
.theme-btn { width: 40px; padding: 0; }
.theme-btn svg { width: 18px; height: 18px; }
.lang:hover, .theme-btn:hover { color: var(--ink); }
@media (max-width: 960px) { .nav-links { display: none; } }
@media (max-width: 480px) { .nav .btn { padding: 10px 14px; font-size: 14px; } .lang { display: none; } }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { padding: 48px 0 24px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5vw, 68px); line-height: 1.2; }
.hero h1 em { font-style: normal; color: var(--muted); }
.hero .lead { margin-top: 20px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-art { position: relative; }
.hero-art .peep { position: absolute; width: clamp(130px, 13vw, 190px); bottom: -30px; inset-inline-end: clamp(-64px, -4vw, -16px); z-index: 2; }
.hero-shot { position: relative; }
@media (max-width: 960px) {
  .hero { padding-top: 32px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .hero-art .peep { inset-inline-start: auto; inset-inline-end: -10px; bottom: -20px; width: 120px; }
}

/* A real screenshot or clip, in a rounded block with a hairline. */
.frame { border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.frame img, .frame video { width: 100%; }
.clip { aspect-ratio: 16 / 9; background: #e9e9e6; }
.clip video { width: 100%; height: 100%; object-fit: cover; }

/* ── Provider strip ──────────────────────────────────────────────────────── */
.providers { padding: 40px 0 8px; }
.providers p { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 30px; padding: 22px 26px; border-radius: var(--block); background: var(--surface); }
.logos img { height: 24px; width: auto; opacity: 0.55; transition: opacity 0.2s; }
.logos img:hover { opacity: 1; }
:root[data-theme="dark"] .logos img, :root[data-theme="dark"] .mini-logos img, :root[data-theme="dark"] .logo-grid img { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logos img, :root:not([data-theme="light"]) .mini-logos img, :root:not([data-theme="light"]) .logo-grid img { filter: invert(1); }
}

/* ── Sections ────────────────────────────────────────────────────────────── */
.section { padding: 96px 0; }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head .lead { margin-top: 14px; }
@media (max-width: 640px) { .section { padding: 64px 0; } }

/* ── Walkthrough tabs ────────────────────────────────────────────────────── */
.tabs { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 32px; align-items: start; }
.tablist { display: flex; flex-direction: column; gap: 8px; counter-reset: tab; }
.tab {
  text-align: start; padding: 18px 20px; border-radius: 18px; border: 0;
  background: transparent; color: var(--ink-2); cursor: pointer; font: inherit;
  transition: background-color 0.2s, color 0.2s;
}
.tab strong { display: flex; gap: 12px; align-items: baseline; color: var(--ink); font-weight: 600; font-size: 17px; }
.tab strong::before { counter-increment: tab; content: "0" counter(tab); font-family: var(--num); font-size: 13px; color: var(--muted); font-weight: 500; }
.tab span { display: block; font-size: 14.5px; color: var(--muted); margin-top: 4px; line-height: 1.55; }
.tab:hover { background: color-mix(in oklab, var(--surface) 60%, transparent); }
.tab[aria-selected="true"] { background: var(--surface); }
.tabpanels { position: relative; }
.tabpanel { display: none; }
.tabpanel[data-active] { display: block; animation: fade 0.45s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 960px) {
  .tabs { grid-template-columns: 1fr; gap: 20px; }
  .tablist { flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
  .tab { flex: 0 0 78%; scroll-snap-align: start; }
}

/* ── Bento ───────────────────────────────────────────────────────────────── */
.bento { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(200px, auto); }
.tile {
  position: relative; overflow: hidden; border-radius: var(--block);
  background: var(--surface); display: flex; flex-direction: column; padding: 28px;
  transition: background-color 0.2s;
}
.tile h3 { margin-bottom: 8px; }
.tile p { color: var(--ink-2); font-size: 15.5px; max-width: 46ch; }
.tile .art { margin-top: auto; padding-top: 22px; }
.tile .art img, .tile .art video { width: 100%; border-radius: 16px; }
.tile .art.bleed { margin-inline: -28px; margin-bottom: -28px; }
.tile .art.bleed img, .tile .art.bleed video { border-radius: 0; }
.tile .peep { position: absolute; width: 130px; bottom: -6px; inset-inline-end: 14px; }
.tile.has-peep p, .tile.has-peep ul { max-width: calc(100% - 130px); }
.tile .peep.inline { position: static; width: 150px; margin: 12px auto 0; }
.tile.wide { grid-column: span 4; }
.tile.half { grid-column: span 3; }
.tile.third { grid-column: span 2; }
.tile.full { grid-column: span 6; }
.tile.tinted { background: var(--inverse); color: var(--on-inverse); }
.tile.tinted p, .tile.tinted li { color: var(--on-inverse-muted); }
.tile.alt { background: var(--surface-2); }
.tile ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; color: var(--ink-2); }
.tile ul li { display: flex; gap: 10px; align-items: baseline; }
.tile ul li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; flex: none; transform: translateY(-3px); }
.mini-logos { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.mini-logos img { height: 18px; opacity: 0.6; }
.tile.tinted .mini-logos img { filter: invert(1); opacity: 0.75; }
:root[data-theme="dark"] .tile.tinted .mini-logos img { filter: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile.tinted .mini-logos img { filter: none; } }
a.tile:hover { background: color-mix(in oklab, var(--surface) 92%, var(--ink)); }
a.tile.tinted:hover { background: color-mix(in oklab, var(--inverse) 92%, var(--on-inverse)); }
@media (max-width: 960px) { .tile.wide, .tile.half, .tile.third, .tile.full { grid-column: span 3; } }
@media (max-width: 640px) { .bento { grid-template-columns: 1fr; } .tile.wide, .tile.half, .tile.third, .tile.full { grid-column: auto; } .tile .peep { width: 96px; } .tile.has-peep p, .tile.has-peep ul { max-width: calc(100% - 90px); } }

/* Big numbers, as in the app. */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b { font-family: var(--num); font-size: clamp(40px, 5vw, 64px); line-height: 1; font-weight: 700; letter-spacing: -0.02em; }
.stat span { font-size: 14px; color: var(--muted); }
.tile.tinted .stat span { color: var(--on-inverse-muted); }
.stats { display: flex; flex-wrap: wrap; gap: 28px 44px; margin-top: 18px; }

/* ── Tool chips ──────────────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.chip { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14.5px; color: var(--ink-2); background: transparent; }
.chip code { font-family: var(--mono); font-size: 13px; color: var(--ink); background: none; padding: 0; }

/* ── Principles: blocks ──────────────────────────────────────────────────── */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.principle { position: relative; border-radius: var(--block); background: var(--surface); padding: 28px; min-height: 220px; overflow: hidden; }
.principle h3 { font-size: 21px; margin-bottom: 10px; }
.principle p { color: var(--ink-2); font-size: 15.5px; }
.principle .peep { position: absolute; width: 110px; bottom: -6px; inset-inline-end: 12px; }
.principle.has-peep p { max-width: calc(100% - 110px); }
@media (max-width: 860px) { .principles { grid-template-columns: 1fr; } }

/* ── Two-up: light + dark ───────────────────────────────────────────────── */
.twoup { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.twoup figure { margin: 0; }
.twoup figcaption { font-size: 14px; color: var(--muted); margin-top: 12px; }
@media (max-width: 800px) { .twoup { grid-template-columns: 1fr; } }

/* ── Download band: the screen's one inverse block ───────────────────────── */
.download {
  position: relative; overflow: hidden;
  border-radius: 32px; padding: 64px; background: var(--inverse); color: var(--on-inverse);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: center;
}
.download h2 { font-size: clamp(30px, 4vw, 52px); }
.download .lead { color: var(--on-inverse-muted); }
.download .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; align-items: center; }
.download .btn-ghost { background: color-mix(in oklab, var(--on-inverse) 10%, transparent); color: var(--on-inverse); }
.download .meta { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; font-size: 15px; color: var(--on-inverse); position: relative; z-index: 1; }
.download .meta li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; border-top: 1px solid color-mix(in oklab, var(--on-inverse) 14%, transparent); padding-top: 12px; }
.download .meta li:first-child { border-top: 0; padding-top: 0; }
.download .meta b { color: var(--on-inverse-muted); font-weight: 500; }
.download .meta code { font-family: var(--mono); font-size: 13px; overflow-wrap: break-word; direction: ltr; text-align: start; background: none; color: inherit; padding: 0; }
/* The figure stands in its own column between the pitch and the details, feet on the band's edge. */
.download:has(.peep) { grid-template-columns: minmax(0, 1.2fr) 140px minmax(0, 1fr); gap: 28px; }
.download .peep { width: 140px; align-self: end; margin-bottom: -68px; }
.download [data-version] { font-family: var(--num); }
.note { font-size: 14px; color: var(--muted); margin-top: 16px; max-width: 52ch; }
@media (max-width: 900px) { .download, .download:has(.peep) { grid-template-columns: 1fr; padding: 40px 28px; } .download .peep { display: none; } }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer { padding: 40px 0 56px; font-size: 14.5px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 28px; }
footer a:hover { color: var(--ink); }
footer nav { display: flex; flex-wrap: wrap; gap: 22px; }

/* ── The app's hand-drawn people, moving a little ─────────────────────────── */
.peep { pointer-events: none; user-select: none; color: var(--ink); }
.peep svg { width: 100%; height: auto; display: block; overflow: visible; }
.peep .pi { fill: currentColor; }
.peep .pf { fill: var(--peep-fill); }
.tile.tinted .peep, .download .peep { color: var(--on-inverse); --peep-fill: var(--inverse); }
.peep svg { animation: peep-float 5.6s ease-in-out infinite; transform-origin: 50% 100%; }
.peep .pb { animation: peep-breathe 4.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.peep .ph { animation: peep-nod 6.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 90%; }
.peep:nth-of-type(2n) svg { animation-delay: -1.7s; }
.peep:nth-of-type(2n) .ph { animation-delay: -2.9s; }
.peep:nth-of-type(3n) .ph { animation-duration: 7.3s; }
@keyframes peep-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes peep-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.022); } }
@keyframes peep-nod { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-3deg); } 60% { transform: rotate(2.2deg); } }
@media (prefers-reduced-motion: reduce) { .peep svg, .peep .pb, .peep .ph { animation: none; } }

/* ── Motion ──────────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal:nth-child(1) { transition-delay: 0.05s; }
.hero .hero-art.reveal { transition-delay: 0.18s; transform: translateY(28px); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .tabpanel[data-active] { animation: none; }
  .btn:active { transform: none; }
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }

/* ── Multi-page additions ─────────────────────────────────────────────────── */
.textlink { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 5px; }
.textlink:hover { text-decoration-color: var(--ink); }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--surface); color: var(--ink); align-items: center; justify-content: center; cursor: pointer; }
.menu-btn svg { width: 20px; height: 20px; }
.mobile-nav { display: flex; flex-direction: column; padding: 8px 24px 16px; gap: 4px; background: var(--bg); }
.mobile-nav[hidden] { display: none; }
.mobile-nav a { padding: 10px 4px; font-size: 16px; color: var(--ink-2); }
.mobile-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
@media (max-width: 960px) { .menu-btn { display: inline-flex; } }
@media (min-width: 961px) { .mobile-nav { display: none !important; } }

.page-head { padding: 64px 0 24px; position: relative; }
.page-head h1 { font-size: clamp(36px, 4.6vw, 60px); }
.page-head .lead { margin-top: 16px; }
.page-head .meta.inline { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 22px 0 0; padding: 0; list-style: none; font-size: 15px; color: var(--ink-2); }
.page-head .meta.inline li { display: flex; gap: 8px; }
.page-head .meta.inline b { color: var(--muted); font-weight: 500; }
.page-head .wrap { position: relative; }
.page-head .peep { position: absolute; inset-inline-end: 24px; bottom: -24px; width: 140px; }
.page-head:has(.peep) .lead { max-width: min(640px, calc(100% - 180px)); }
@media (max-width: 900px) { .page-head .peep { display: none; } }

.chapter { padding: 64px 0; }
.chapter.alt .wrap { background: var(--surface); border-radius: 32px; padding: 48px; }
@media (max-width: 640px) { .chapter.alt .wrap { padding: 28px 22px; border-radius: 24px; } }
.chapter h2 { margin-bottom: 14px; }
.chapter p { color: var(--ink-2); max-width: var(--measure); }
.chapter .stack { max-width: 760px; margin-bottom: 32px; }
.chapter .stack p { max-width: none; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; }
.split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split.flip > :first-child { order: 2; }
.split.flip > :last-child { order: 1; }
@media (max-width: 900px) {
  .chapter { padding: 44px 0; }
  .split, .split.flip { grid-template-columns: 1fr; gap: 24px; }
  .split.flip > :first-child { order: 1; }
  .split.flip > :last-child { order: 2; }
}

.checks { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; color: var(--ink-2); font-size: 15.5px; }
.checks li { display: flex; gap: 12px; align-items: baseline; }
.checks li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); flex: none; transform: translateY(-2px); }
.checks.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; }
@media (max-width: 720px) { .checks.two { grid-template-columns: 1fr; } }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; color: var(--ink); }
pre.code { margin: 18px 0 0; padding: 16px 20px; border-radius: 16px; background: var(--surface); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chapter.alt pre.code { background: var(--surface-2); }
pre.code code { background: none; padding: 0; }

.toolgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.toolgrid > div { border-radius: 20px; background: var(--surface); padding: 22px; }
.chapter.alt .toolgrid > div { background: var(--surface-2); }
.toolgrid h3 { font-size: 18px; margin-bottom: 8px; }
.toolgrid p { font-size: 15px; }
@media (max-width: 900px) { .toolgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .toolgrid { grid-template-columns: 1fr; } }

.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.logo-grid span { display: grid; place-items: center; aspect-ratio: 1; padding: 20px; border-radius: 18px; background: var(--surface); }
.chapter.alt .logo-grid span { background: var(--surface-2); }
/* The tile is the span, so the dark-mode invert only touches the logo itself. */
.logo-grid img { width: 100%; height: 100%; object-fit: contain; opacity: 0.75; transition: opacity 0.2s; }
.logo-grid span:hover img { opacity: 1; }
.logos img[src$="azure.svg"], .logos img[src$="bedrock.svg"], .logos img[src$="cerebras.svg"], .logos img[src$="fireworks.svg"], .logos img[src$="together.svg"], .logos img[src$="zai.svg"] { height: 22px; }

.chapter .principles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chapter.alt .principle { background: var(--surface-2); }
.chapter .principle p { max-width: none; }
@media (max-width: 860px) { .chapter .principles { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; border-radius: 20px; background: var(--surface); }
.chapter.alt .table-wrap { background: var(--surface-2); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: start; padding: 14px 20px; vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13.5px; border-bottom: 1px solid var(--line); }
tbody tr + tr td { border-top: 1px solid var(--line); }
td:first-child { color: var(--ink); font-weight: 500; }
td { color: var(--ink-2); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.steps > div { padding: 26px; border-radius: var(--block); background: var(--surface); }
.chapter.alt .steps > div { background: var(--surface-2); }
.steps h3 { font-size: 18px; margin-bottom: 8px; display: flex; align-items: baseline; gap: 12px; }
.steps h3::before { counter-increment: step; content: "0" counter(step); font-family: var(--num); font-size: 15px; color: var(--muted); font-weight: 600; flex: none; }
.steps p { font-size: 15px; max-width: none; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

.wrap.narrow { width: min(840px, 100% - 48px); }
.faq { border-radius: 20px; background: var(--surface); padding: 4px 24px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 600; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--num); color: var(--muted); font-size: 24px; line-height: 1; flex: none; transition: transform 0.25s var(--ease); }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { padding: 0 0 20px; color: var(--ink-2); max-width: none; }

.tile { color: inherit; }
