/* رفيق · the site, built the way the app is: a top bar, a slim rail, blocks on a canvas with
   the globe turning behind them. Tokens and motion are the app's own
   (apps/desktop/src/styles/index.css, lib/motion.ts): no borders or shadows between blocks,
   one inverse block per screen, bracket labels, orange only on the action that matters. */

@import url("/assets/fonts/plex.css?v=0.5");

:root {
  --bg: #e9e9e6;
  --surface: #ffffff;
  --surface-2: #f3f2ee;
  --border: #dadad5;
  --ink: #121212;
  --ink-muted: #66665f;
  --inverse: #141414;
  --on-inverse: #f4f4f1;
  --on-inverse-muted: color-mix(in oklab, var(--on-inverse) 62%, transparent);
  --accent: #e68835;
  --accent-ink: #1f1306;
  --danger: #c2412d;
  --success: #256b43;
  --pending: #a95a17;
  --peep-fill: #ffffff;
  --logo-filter: none;
  --logo-filter-inverse: invert(1);

  --font: "IBM Plex Sans Arabic", "Segoe UI Variable", "Segoe UI", Tahoma, system-ui, sans-serif;
  --display: "Alexandria", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --num: "Space Grotesk", "Segoe UI Variable", system-ui, sans-serif;
  --mono: "Cascadia Code", Consolas, ui-monospace, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
  --block: 16px;
  --btn: 10px;
  --gap: 12px;
  --topbar: 52px;
  --rail: 76px;
  --measure: 66ch;
  --z-globe: 0;
  --z-page: 1;
  --z-rail: 20;
  --z-top: 30;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e; --surface: #1a1a1a; --surface-2: #232321; --border: #2c2c2b;
    --ink: #f2f2ef; --ink-muted: #96968e; --inverse: #f2f2ef; --on-inverse: #121212;
    --danger: #f07a66; --success: #6fcf97; --pending: #e68835; --peep-fill: #232321;
    --logo-filter: invert(1); --logo-filter-inverse: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e0e; --surface: #1a1a1a; --surface-2: #232321; --border: #2c2c2b;
  --ink: #f2f2ef; --ink-muted: #96968e; --inverse: #f2f2ef; --on-inverse: #121212;
  --danger: #f07a66; --success: #6fcf97; --pending: #e68835; --peep-fill: #232321;
  --logo-filter: invert(1); --logo-filter-inverse: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; overflow-x: hidden;
  font: 16px/1.75 var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in oklch, var(--accent) 35%, transparent); }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: 0; text-wrap: balance; }
h1 { font-weight: 800; line-height: 1.15; }
/* Arabic marks sit above and below the line: tighter than this and lines collide. */
:root[lang="ar"] h1 { line-height: 1.42; }
:root[lang="ar"] h2 { line-height: 1.4; }
h2 { font-weight: 800; line-height: 1.22; font-size: clamp(25px, 2.6vw, 34px); }
h3 { font-weight: 700; line-height: 1.35; font-size: 18px; }
.muted { color: var(--ink-muted); }
.lead { color: var(--ink-muted); font-size: 16.5px; max-width: var(--measure); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid color-mix(in oklch, var(--ink) 70%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ( label ): a block's small heading, as in the app. */
.bracket, .eyebrow { display: block; font: 400 12px/1 var(--font); color: var(--ink-muted); margin-bottom: 12px; }
.bracket::before, .eyebrow::before { content: "( "; }
.bracket::after, .eyebrow::after { content: " )"; }

/* ── The globe behind the pages ──────────────────────────────────────────── */
.globe {
  position: fixed; z-index: var(--z-globe); pointer-events: none;
  bottom: calc(var(--globe-size) * -0.28); inset-inline-end: calc(var(--globe-size) * -0.22);
  width: var(--globe-size); height: var(--globe-size);
  --globe-size: clamp(320px, 38vw, 720px);
  opacity: 0.6;
  view-transition-name: globe;
}
.globe canvas { display: block; width: 100%; height: 100%; contain: strict; }
:root[data-theme="dark"] .globe { opacity: 0.75; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .globe { opacity: 0.75; } }

/* ── The shell ───────────────────────────────────────────────────────────── */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: var(--z-top); height: var(--topbar);
  display: flex; align-items: center; gap: 8px; padding-inline: 14px 10px;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font: 800 16px/1 var(--display); }
.brand img { width: 26px; height: 26px; border-radius: 7px; animation: logo-in 0.6s var(--ease) both; }
@keyframes logo-in { from { opacity: 0; transform: scale(0.6) rotate(-12deg); } }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.lang, .theme-btn {
  height: 34px; min-width: 34px; padding-inline: 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font: 13px var(--font); color: var(--ink-muted); transition: background-color 0.15s, color 0.15s;
}
.theme-btn { padding: 0; }
.theme-btn svg { width: 18px; height: 18px; animation: theme-swap 0.22s var(--ease); }
@keyframes theme-swap { from { opacity: 0; transform: rotate(-90deg) scale(0.6); } }
.lang:hover, .theme-btn:hover { background: var(--surface); color: var(--ink); }

.rail {
  position: fixed; z-index: var(--z-rail); inset-block: var(--topbar) 0; inset-inline-start: 0; width: var(--rail);
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding-block: 10px;
  background: var(--bg); border-inline-end: 1px solid var(--border);
}
.rail a {
  position: relative; width: 62px; padding-block: 8px 6px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10.5px; line-height: 1.3; color: var(--ink-muted); transition: color 0.15s, background-color 0.15s;
}
.rail a:hover { color: var(--ink); }
.rail a svg { position: relative; width: 20px; height: 20px; flex: none; }
.rail a span { position: relative; white-space: nowrap; }
.rail a[aria-current="page"] { color: var(--ink); font-weight: 500; background: var(--surface); view-transition-name: nav-pill; }
.rail-end { margin-top: auto; }
main { position: relative; z-index: var(--z-page); padding-top: var(--topbar); padding-inline-start: var(--rail); display: block; }
footer { position: relative; z-index: var(--z-page); padding-inline-start: var(--rail); }

@media (max-width: 800px) {
  :root { --rail: 0px; }
  .rail {
    inset: auto 0 0; width: auto; height: 62px; flex-direction: row; justify-content: space-around; padding: 4px 6px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    border-inline-end: 0; border-top: 1px solid var(--border);
  }
  .rail a { width: auto; flex: 1; min-width: 0; }
  .rail-end { display: none; }
  /* Headings run over it on a narrow screen: it has to stay well behind them. */
  .globe { opacity: 0.28 !important; }
  body { padding-bottom: 62px; }
}

.wrap { width: min(1152px, 100% - 40px); margin-inline: auto; }
.wrap.narrow { width: min(800px, 100% - 40px); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; cursor: pointer;
  padding: 9px 16px; border: 0; border-radius: var(--btn); font: 500 14.5px/1.4 var(--font);
  transition: transform 0.2s var(--ease), background-color 0.15s, filter 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.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: 17px; height: 17px; flex: none; }
.btn-lg { padding: 12px 20px; font-size: 15.5px; border-radius: 12px; }
.topbar .btn { padding-block: 6px; font-size: 13.5px; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.textlink { font-weight: 500; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 5px; transition: text-decoration-color 0.15s; }
.textlink:hover { text-decoration-color: currentColor; }

/* ── Home: the app's home screen, saying what Rafiq is ───────────────────── */
.hero { padding-block: clamp(24px, 5vh, 56px) 12px; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.hero-head { grid-column: span 2; position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 8px; }
.hero-head h1 { font-size: clamp(34px, 4vw, 54px); }
.hero-head h1 em { font-style: normal; color: var(--ink-muted); }
.hero-head .lead { margin-top: 14px; }
.hero-head .peep { width: 150px; flex: none; }
.block { position: relative; overflow: hidden; border-radius: var(--block); background: var(--surface); padding: 22px; }
.inverse { background: var(--inverse); color: var(--on-inverse); --peep-fill: var(--inverse); }
.inverse .bracket { color: var(--on-inverse-muted); }
.hero-stats { grid-row: span 2; display: flex; flex-direction: column; gap: 14px; min-height: 300px; }
.big { font: 700 72px/1 var(--num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; direction: ltr; display: inline-block; }
.hero-stats .big + p { margin-top: 8px; font-size: 14px; opacity: 0.72; }
.hero-stats .peep { width: 160px; margin: auto; color: var(--on-inverse); }
.hero-stats .row { margin-top: auto; display: flex; flex-wrap: wrap; gap: 14px 30px; }
.hero-stats .row b { display: block; font: 700 28px/1.1 var(--num); direction: ltr; text-align: start; }
.hero-stats .row b.dir { direction: inherit; }
.hero-stats .row span { font-size: 12px; opacity: 0.65; }
.led { display: flex; gap: 3px; }
.led i { flex: 1; height: 5px; border-radius: 2px; background: currentColor; animation: led-on 0.25s calc(var(--i) * 40ms + 400ms) both; }
@keyframes led-on { from { background: color-mix(in oklab, currentColor 18%, transparent); } }

.demo { grid-column: span 2; display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.demo-chat { display: flex; flex-direction: column; gap: 10px; min-height: 322px; }
.bubble { align-self: flex-end; max-width: 85%; padding: 8px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14.5px; line-height: 1.6; transform-origin: 0 100%; }
:root[dir="ltr"] .bubble { transform-origin: 100% 100%; }
.work { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.live { display: inline-block; }
.shimmer-text {
  background: linear-gradient(90deg, var(--ink-muted) 0 38%, var(--ink) 50%, var(--ink-muted) 62% 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer-ltr 2.2s linear infinite;
}
:root[dir="rtl"] .shimmer-text { animation-name: shimmer-rtl; }
@keyframes shimmer-ltr { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes shimmer-rtl { from { background-position: 0 0; } to { background-position: 100% 0; } }
.tool { border-radius: 12px; background: var(--surface-2); padding: 10px 14px; font-size: 13px; }
.tool header { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-muted); font-size: 12.5px; }
.tool header code { background: none; padding: 0; color: inherit; }
.tool > code { display: block; margin-top: 6px; background: none; padding: 0; font-size: 12.5px; direction: ltr; text-align: start; overflow-wrap: anywhere; }
.status { display: inline-flex; align-items: center; gap: 4px; }
.status.ok { color: var(--success); }
.status svg { width: 14px; height: 14px; }
.status path { stroke-dasharray: 24; }
.ask.pending { animation: pending-ring 1.6s ease-out infinite; }
.ask .actions { display: flex; gap: 6px; margin-top: 8px; }
.ask .fake-btn { padding: 4px 12px; border-radius: 8px; font-size: 12.5px; background: var(--inverse); color: var(--on-inverse); transition: transform 0.2s var(--ease); }
.ask .fake-btn.no { background: transparent; color: var(--ink-muted); }
.ask .fake-btn.press { transform: scale(0.94); }
@keyframes pending-ring {
  from { box-shadow: 0 0 0 0 color-mix(in oklch, var(--pending) 40%, transparent); }
  to { box-shadow: 0 0 0 10px color-mix(in oklch, var(--pending) 0%, transparent); }
}
.reply { font-size: 14.5px; line-height: 1.7; }
.composer { border-radius: 12px; background: var(--surface-2); padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.composer .field { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.75em; }
.composer .field.typed { color: var(--ink); }
.composer .chip-model { font-size: 11.5px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink-muted); white-space: nowrap; }
.composer .send { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); transition: transform 0.2s var(--ease); }
.composer .send.press { transform: scale(0.88) translateY(-2px); }
.composer .send svg { width: 15px; height: 15px; }
.caret { display: inline-block; width: 0.5em; height: 1.05em; margin-inline-start: 2px; vertical-align: -0.15em; border-radius: 1px; background: var(--accent); animation: caret 0.9s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* While the demo plays, its pieces wait out of sight in place, so nothing shifts. */
.demo[data-run] [data-step] { opacity: 0; visibility: hidden; }
.demo[data-run] [data-step].on { opacity: 1; visibility: visible; animation: arrive 0.42s var(--ease-spring) both; }
.demo[data-run] .bubble.on { animation: bubble-in 0.42s var(--ease-spring) both; }
.demo[data-run] .ask.pending.on { animation: arrive 0.42s var(--ease-spring) both, pending-ring 1.6s ease-out 0.4s infinite; }
.demo[data-fading] { --fade: 1; }
.demo[data-fading] .demo-chat { opacity: 0; transition: opacity 0.3s; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px) scale(0.97); filter: blur(3px); } }
@keyframes bubble-in { from { opacity: 0; transform: translateY(18px) scale(0.9); filter: blur(4px); } }
.swap { animation: live-swap 0.32s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes live-swap { from { opacity: 0; transform: translateY(70%); filter: blur(6px); } }
.draw { stroke-dasharray: 24; animation: draw 0.42s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 24; } }

/* The working orb. */
.orb { position: relative; display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 50%; isolation: isolate; }
.orb > span { position: absolute; inset: 0; border-radius: inherit; }
.orb-glow { inset: -45% !important; z-index: -1; background: radial-gradient(circle, color-mix(in oklch, var(--accent) 70%, transparent) 0%, color-mix(in oklch, var(--accent) 20%, transparent) 38%, transparent 64%); filter: blur(5px); animation: orb-breathe 2.4s ease-in-out infinite; }
.orb-core { background: radial-gradient(circle at 50% 54%, #fff4e2 0%, color-mix(in oklch, var(--accent) 45%, #ffe2b8) 16%, var(--accent) 42%, color-mix(in oklch, var(--accent) 50%, #3b1003) 76%, #160401 100%); animation: orb-pulse 2.4s ease-in-out infinite; }
.orb-swirl { inset: 8% !important; background: conic-gradient(transparent 0deg, rgba(255, 238, 205, 0.9) 50deg, transparent 120deg, rgba(255, 140, 60, 0.7) 200deg, transparent 260deg, rgba(255, 220, 160, 0.6) 320deg, transparent 360deg); mix-blend-mode: screen; filter: blur(2.5px); animation: orb-turn 2.6s linear infinite; }
@keyframes orb-turn { to { transform: rotate(360deg); } }
@keyframes orb-pulse { 50% { filter: brightness(1.15) saturate(1.15); } }
@keyframes orb-breathe { 0%, 100% { opacity: 0.55; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.06); } }

@media (max-width: 960px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-head, .demo { grid-column: auto; }
  .hero-stats { grid-row: auto; min-height: 0; order: 3; }
  .hero-stats .peep { display: none; }
  .hero-head .peep { display: none; }
  .big { font-size: 60px; }
}

/* The composer first on a phone, or the typing happens below the fold. */
@media (max-width: 800px) { .demo { flex-direction: column-reverse; } }

/* ── Providers ───────────────────────────────────────────────────────────── */
.providers { padding-block: 0 8px; }
.providers p { font-size: 12px; color: var(--ink-muted); margin-bottom: 12px; padding-inline: 8px; }
.providers p::before { content: "( "; }
.providers p::after { content: " )"; }
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; padding: 20px 22px; border-radius: var(--block); background: var(--surface); }
.logos img { height: 21px; width: auto; opacity: 0.6; filter: var(--logo-filter); transition: opacity 0.15s; }
.logos img:hover { 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: 19px; }

/* ── Sections ────────────────────────────────────────────────────────────── */
.section { padding-block: 56px 0; }
.section-head { max-width: 720px; margin-bottom: 22px; padding-inline: 8px; }
.section-head .lead { margin-top: 8px; }
#download-band { padding-block: 40px 16px; }

/* A real screenshot or clip. */
.frame { border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.frame img, .frame video { width: 100%; }
.clip { aspect-ratio: 16 / 9; }
.clip video { width: 100%; height: 100%; object-fit: cover; }

/* ── Walkthrough: the pill slides between steps, as in the app ───────────── */
.tabs { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.tablist { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: var(--block); background: var(--surface); counter-reset: tab; }
.tab-pill { position: absolute; inset-inline: 6px; top: 0; height: 0; border-radius: 12px; background: var(--surface-2); transition: transform 0.34s var(--ease), height 0.34s var(--ease); }
.tab { position: relative; text-align: start; padding: 14px 16px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-muted); cursor: pointer; font: inherit; }
.tab strong { display: flex; gap: 10px; align-items: baseline; color: var(--ink-muted); font-weight: 500; font-size: 15.5px; transition: color 0.15s; }
.tab strong::before { counter-increment: tab; content: "0" counter(tab); font: 500 12px var(--num); }
.tab[aria-selected="true"] strong { color: var(--ink); }
.tab span { display: block; font-size: 13.5px; margin-top: 4px; line-height: 1.6; }
.tabpanels { padding: 8px; border-radius: var(--block); background: var(--surface); }
.tabpanel { display: none; }
.tabpanel[data-active] { display: block; animation: arrive-small 0.3s var(--ease); }
@keyframes arrive-small { from { opacity: 0; transform: translateY(4px); } }
@media (max-width: 960px) { .tabs { grid-template-columns: minmax(0, 1fr); } }

/* ── Blocks on the home page ─────────────────────────────────────────────── */
.bento { display: grid; gap: var(--gap); grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tile { position: relative; overflow: hidden; border-radius: var(--block); background: var(--surface); color: inherit; display: flex; flex-direction: column; padding: 22px; transition: transform 0.22s var(--ease), background-color 0.15s; }
a.tile:hover { transform: translateY(-2px); }
a.tile:active { transform: scale(0.99); }
.tile h3 { margin-bottom: 6px; }
.tile p { color: var(--ink-muted); font-size: 14.5px; max-width: 48ch; }
.tile .art { margin-top: auto; padding-top: 18px; }
.tile .art img, .tile .art video { width: 100%; border-radius: 10px; }
.tile .frame { border-radius: 10px; }
.tile .peep { position: absolute; width: 120px; bottom: -6px; inset-inline-end: 12px; }
.tile .peep.inline { position: static; width: 130px; margin: 10px auto 0; }
.tile.has-peep p, .tile.has-peep ul { max-width: calc(100% - 124px); }
.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.alt { background: var(--surface-2); }
.tile.tinted { background: var(--inverse); color: var(--on-inverse); --peep-fill: var(--inverse); }
.tile.tinted p, .tile.tinted li { color: var(--on-inverse-muted); }
.tile ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--ink-muted); }
.tile ul li { display: flex; gap: 9px; align-items: baseline; }
.tile ul li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; transform: translateY(-3px); }
.mini-logos { display: flex; flex-wrap: wrap; gap: 13px; margin-top: auto; padding-top: 16px; }
.mini-logos img { height: 17px; opacity: 0.72; filter: var(--logo-filter-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: minmax(0, 1fr); }
  .tile.wide, .tile.half, .tile.third, .tile.full { grid-column: auto; }
  .tile .peep { width: 88px; }
  .tile.has-peep p, .tile.has-peep ul { max-width: calc(100% - 84px); }
}

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b { font: 700 clamp(36px, 4.4vw, 56px)/1 var(--num); letter-spacing: -0.02em; }
.stat span { font-size: 13px; color: var(--ink-muted); }
.tile.tinted .stat span { color: var(--on-inverse-muted); }
.stats { display: flex; flex-wrap: wrap; gap: 24px 40px; margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; color: var(--ink-muted); }
.chip code { background: none; padding: 0; font-size: 12.5px; color: var(--ink); }

.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.principle { position: relative; border-radius: var(--block); background: var(--surface); padding: 22px; min-height: 210px; overflow: hidden; }
.principle h3 { margin-bottom: 8px; }
.principle p { color: var(--ink-muted); font-size: 14.5px; }
.principle .peep { position: absolute; width: 100px; bottom: -6px; inset-inline-end: 10px; }
.principle.has-peep p { max-width: calc(100% - 92px); }
@media (max-width: 860px) { .principles { grid-template-columns: minmax(0, 1fr); } }

.twoup { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
.twoup figure { margin: 0; }
.twoup .frame { outline: 1px solid var(--border); outline-offset: -1px; }
.twoup figcaption { font-size: 13px; color: var(--ink-muted); margin-top: 10px; padding-inline: 8px; }
@media (max-width: 800px) { .twoup { grid-template-columns: minmax(0, 1fr); } }

/* The screen's closing inverse block. */
.download {
  position: relative; overflow: hidden; border-radius: 20px; padding: clamp(28px, 4vw, 48px);
  background: var(--inverse); color: var(--on-inverse); --peep-fill: var(--inverse);
  display: grid; grid-template-columns: minmax(0, 1.2fr) 130px minmax(0, 1fr); gap: 28px; align-items: center;
}
.download:not(:has(.peep)) { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.download h2 { font-size: clamp(27px, 3.4vw, 42px); }
.download .lead { color: var(--on-inverse-muted); }
.download .btn-ghost { background: color-mix(in oklab, var(--on-inverse) 12%, transparent); color: var(--on-inverse); }
.download .meta { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; }
.download .meta li { display: grid; grid-template-columns: 100px 1fr; gap: 12px; border-top: 1px solid color-mix(in oklab, var(--on-inverse) 14%, transparent); padding-top: 10px; }
.download .meta li:first-child { border-top: 0; padding-top: 0; }
.download .meta b { color: var(--on-inverse-muted); font-weight: 400; }
.download .meta code { background: none; color: inherit; padding: 0; font-size: 12.5px; direction: ltr; text-align: start; overflow-wrap: anywhere; }
.download [data-version], .meta [data-size] { font-family: var(--num); }
.download .peep { width: 130px; align-self: end; margin-bottom: calc(clamp(28px, 4vw, 48px) * -1 - 4px); }
.note { font-size: 13.5px; color: var(--ink-muted); margin-top: 14px; max-width: 56ch; }
@media (max-width: 900px) { .download, .download:not(:has(.peep)) { grid-template-columns: minmax(0, 1fr); } .download .peep { display: none; } }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer { padding-block: 28px 32px; font-size: 13.5px; color: var(--ink-muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; padding: 16px 20px; border-radius: var(--block); background: var(--surface); }
footer a { transition: color 0.15s; }
footer a:hover { color: var(--ink); }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ── The app's hand-drawn people ─────────────────────────────────────────── */
.peep { pointer-events: none; user-select: none; color: var(--ink); }
.peep svg { width: 100%; height: auto; display: block; overflow: visible; animation: peep-float 5.6s ease-in-out infinite; transform-origin: 50% 100%; }
.peep .pi { fill: currentColor; }
.peep .pf { fill: var(--peep-fill); }
.tile.tinted .peep, .download .peep { color: var(--on-inverse); }
.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; }
@keyframes peep-float { 50% { transform: translateY(-4px); } }
@keyframes peep-breathe { 50% { transform: scale(1.012, 1.022); } }
@keyframes peep-nod { 25% { transform: rotate(-3deg); } 60% { transform: rotate(2.2deg); } }

/* ── Inner pages: a title on the canvas, then blocks ─────────────────────── */
.page-head { padding-block: clamp(28px, 6vh, 60px) 20px; }
.page-head .wrap { position: relative; padding-inline: 8px; }
.page-head h1 { font-size: clamp(32px, 3.8vw, 48px); }
.page-head .lead { margin-top: 10px; }
.page-head .peep { position: absolute; inset-inline-end: 8px; bottom: -44px; width: 118px; }
.page-head:has(.peep) .lead { max-width: min(620px, calc(100% - 150px)); }
.page-head .meta.inline { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 14px; }
.page-head .meta.inline li { display: flex; gap: 8px; }
.page-head .meta.inline b { color: var(--ink-muted); font-weight: 400; }
@media (max-width: 900px) { .page-head .peep { display: none; } .page-head:has(.peep) .lead { max-width: none; } }

.chapter { position: relative; z-index: 1; padding-block: 6px; }
.chapter > .wrap { padding: clamp(20px, 2.6vw, 30px); border-radius: var(--block); background: var(--surface); }
.chapter.alt > .wrap { background: var(--surface-2); }
.chapter > .wrap.narrow { padding: 0; background: none; }
.chapter h2 { margin-bottom: 10px; font-size: clamp(23px, 2.3vw, 30px); }
.chapter p { color: var(--ink-muted); max-width: var(--measure); font-size: 15.5px; }
.chapter .stack { max-width: 760px; margin-bottom: 22px; }
.chapter .stack p { max-width: none; }
.chapter .section-head { padding-inline: 0; }
.chapter .frame { background: var(--surface-2); }
.chapter.alt .frame { background: var(--surface); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 3vw, 40px); 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) {
  .split, .split.flip { grid-template-columns: minmax(0, 1fr); }
  .split.flip > :first-child { order: 1; }
  .split.flip > :last-child { order: 2; }
}
.checks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; color: var(--ink-muted); font-size: 14.5px; }
.checks li { display: flex; gap: 10px; align-items: baseline; }
.checks li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); flex: none; transform: translateY(-2px); }
.checks.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }
@media (max-width: 720px) { .checks.two { grid-template-columns: minmax(0, 1fr); } }
code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 5px; color: var(--ink); unicode-bidi: isolate; }
.chapter.alt code { background: var(--surface); }
pre.code { margin: 14px 0 0; padding: 12px 16px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chapter.alt pre.code { background: var(--surface); }
pre.code code { background: none; padding: 0; }
.toolgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.toolgrid > div { border-radius: 12px; background: var(--surface-2); padding: 16px; }
.chapter.alt .toolgrid > div { background: var(--surface); }
.toolgrid h3 { font-size: 16px; margin-bottom: 4px; }
.toolgrid p { font-size: 14px; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 8px; }
.logo-grid span { display: grid; place-items: center; aspect-ratio: 1; padding: 18px; border-radius: 12px; background: var(--surface-2); }
.chapter.alt .logo-grid span { background: var(--surface); }
.logo-grid img { width: 100%; height: 100%; object-fit: contain; opacity: 0.75; filter: var(--logo-filter); transition: opacity 0.15s; }
.logo-grid span:hover img { opacity: 1; }
.chapter .principles { gap: 8px; }
.chapter .principle { background: var(--surface-2); min-height: 0; padding: 18px; }
.chapter.alt .principle { background: var(--surface); }
.chapter .principle p { max-width: none; font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: start; padding: 11px 14px; vertical-align: top; }
th { color: var(--ink-muted); font-weight: 400; font-size: 12.5px; border-bottom: 1px solid var(--border); }
tbody tr + tr td { border-top: 1px solid var(--border); }
td { color: var(--ink-muted); }
td:first-child { color: var(--ink); font-weight: 500; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; counter-reset: step; }
.steps > div { padding: 18px; border-radius: 12px; background: var(--surface-2); }
.chapter.alt .steps > div { background: var(--surface); }
.steps h3 { font-size: 16px; margin-bottom: 6px; display: flex; align-items: baseline; gap: 10px; }
.steps h3::before { counter-increment: step; content: "0" counter(step); font: 500 12px var(--num); color: var(--ink-muted); flex: none; }
.steps p { font-size: 14px; max-width: none; }
@media (max-width: 800px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.faq { border-radius: 14px; background: var(--surface); padding: 2px 20px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 500; font-size: 16px; 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: 400 22px/1 var(--num); color: var(--ink-muted); flex: none; transition: transform 0.25s var(--ease); }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { padding: 0 0 16px; max-width: none; font-size: 15px; }
.legal { max-width: 780px; margin-inline: auto; width: min(780px, 100% - 40px); padding: clamp(20px, 2.6vw, 30px); margin-bottom: 8px; border-radius: var(--block); background: var(--surface); }
.legal h2 { font-size: 20px; margin: 26px 0 8px; }
.legal p { line-height: 1.8; margin: 0 0 10px; color: var(--ink-muted); font-size: 15px; }
.legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.legal .updated { font-size: 13.5px; }

/* ── Motion: the app's, small and quick. The content is there without any of it. ── */
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.reveal { animation: rise 0.34s var(--ease) both; }
.home-grid > :nth-child(2) { animation-delay: 60ms; }
.home-grid > :nth-child(3) { animation-delay: 120ms; }
@supports (animation-timeline: view()) {
  .section .reveal, .chapter .reveal, .providers .reveal { animation: rise-far linear forwards; animation-timeline: view(); animation-range: entry 0% entry 22%; }
  @keyframes rise-far { from { opacity: 0; transform: translateY(10px); } }
}

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 0.12s linear both vt-out; }
::view-transition-new(root) { animation: 0.2s var(--ease) both rise; }
::view-transition-group(nav-pill) { animation-duration: 0.3s; animation-timing-function: var(--ease); z-index: 40; }
::view-transition-old(globe), ::view-transition-new(globe) { animation: none; mix-blend-mode: normal; }
::view-transition-old(globe) { display: none; }
@keyframes vt-out { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .shimmer-text { background: none; color: var(--ink-muted); }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Rafiq for Mac: the copy beside the app in a macOS window. */
.mac {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); gap: clamp(24px, 4vw, 52px); align-items: center;
  padding: clamp(24px, 3.4vw, 40px); border-radius: var(--block); background: var(--surface);
}
.mac h2 { font-size: clamp(27px, 3.4vw, 42px); margin-top: 8px; }
.mac .lead { margin-top: 12px; }
.mac .meta.inline { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 20px 0 0; padding: 0; list-style: none; font-size: 14px; }
.mac .meta.inline li { display: flex; gap: 8px; }
.mac .meta.inline b { color: var(--ink-muted); font-weight: 400; }
.mac-art { margin: 0; }
.mac-art img { width: 100%; height: auto; display: block; }
@media (max-width: 900px) { .mac { grid-template-columns: minmax(0, 1fr); } }

/* The language switch: the two other languages, side by side. */
.langs { display: inline-flex; align-items: center; gap: 2px; }

/* The top bar's two downloads: each system's mark, and only the marks on a narrow screen. */
.btn .os { width: 16px; height: 16px; }
.topbar .btn-os { padding-inline: 12px; }
@media (max-width: 640px) {
  .topbar .btn-os { padding: 0; width: 36px; height: 36px; }
  .topbar .btn-os span { display: none; }
}
