/* amrothabet.com — one stylesheet for the portfolio, product pages and documentation.
   System fonts only (nothing loaded from other origins). Colours are tokens; dark and light share every rule. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #fafaf9;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f3f5;
  --surface-3: #e9ebee;
  --line: rgba(15, 18, 24, .09);
  --line-strong: rgba(15, 18, 24, .17);
  --text: #101317;
  --text-2: #3a4048;
  --muted: #5f6670;
  --accent: #0b62c9;
  --accent-soft: rgba(11, 98, 201, .09);
  --accent-line: rgba(11, 98, 201, .35);
  --btn-bg: #101317;
  --btn-ink: #ffffff;
  --code-bg: #f3f4f6;
  --code-ink: #1d2630;
  --tok-key: #8a3ffc;
  --tok-str: #0f7b4f;
  --tok-com: #6b7480;
  --tok-num: #b4570b;
  --ok: #1e7f4f;
  --warn: #8a5a00;
  --danger: #b42318;
  --note-bg: rgba(11, 98, 201, .06);
  --warn-bg: rgba(190, 120, 0, .08);
  --danger-bg: rgba(180, 35, 24, .07);
  --tip-bg: rgba(30, 127, 79, .07);
  --grid-line: rgba(15, 18, 24, .055);
  --shadow: 0 1px 2px rgba(16, 19, 23, .06), 0 8px 30px rgba(16, 19, 23, .07);
  --shadow-lg: 0 2px 4px rgba(16, 19, 23, .06), 0 24px 60px rgba(16, 19, 23, .12);

  --font-sans: "Segoe UI Variable Text", "Segoe UI Variable", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Cascadia Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.375rem, 1.2rem + .7vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.35rem + 1.6vw, 2.625rem);
  --step-4: clamp(2.25rem, 1.5rem + 3.2vw, 4rem);
  --step-5: clamp(3rem, 1.6rem + 6vw, 7rem);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --wrap: 75rem;
  --wrap-wide: 85rem;
  --measure: 70ch;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0c0f;
    --bg-elev: #111317;
    --surface: #14171c;
    --surface-2: #1a1e24;
    --surface-3: #222730;
    --line: rgba(255, 255, 255, .075);
    --line-strong: rgba(255, 255, 255, .14);
    --text: #eceef1;
    --text-2: #bcc2ca;
    --muted: #8d949e;
    --accent: #7ab8ff;
    --accent-soft: rgba(122, 184, 255, .1);
    --accent-line: rgba(122, 184, 255, .4);
    --btn-bg: #eceef1;
    --btn-ink: #0b0c0f;
    --code-bg: #0f1115;
    --code-ink: #d9dee5;
    --tok-key: #c4a5ff;
    --tok-str: #8fd6a8;
    --tok-com: #7a828d;
    --tok-num: #f2b179;
    --ok: #5fcf95;
    --warn: #e9be6b;
    --danger: #ff8b80;
    --note-bg: rgba(122, 184, 255, .07);
    --warn-bg: rgba(233, 190, 107, .08);
    --danger-bg: rgba(255, 139, 128, .08);
    --tip-bg: rgba(95, 207, 149, .07);
    --grid-line: rgba(255, 255, 255, .045);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 30px rgba(0, 0, 0, .35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 30px 80px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c0f;
  --bg-elev: #111317;
  --surface: #14171c;
  --surface-2: #1a1e24;
  --surface-3: #222730;
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #eceef1;
  --text-2: #bcc2ca;
  --muted: #8d949e;
  --accent: #7ab8ff;
  --accent-soft: rgba(122, 184, 255, .1);
  --accent-line: rgba(122, 184, 255, .4);
  --btn-bg: #eceef1;
  --btn-ink: #0b0c0f;
  --code-bg: #0f1115;
  --code-ink: #d9dee5;
  --tok-key: #c4a5ff;
  --tok-str: #8fd6a8;
  --tok-com: #7a828d;
  --tok-num: #f2b179;
  --ok: #5fcf95;
  --warn: #e9be6b;
  --danger: #ff8b80;
  --note-bg: rgba(122, 184, 255, .07);
  --warn-bg: rgba(233, 190, 107, .08);
  --danger-bg: rgba(255, 139, 128, .08);
  --tip-bg: rgba(95, 207, 149, .07);
  --grid-line: rgba(255, 255, 255, .045);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 30px 80px rgba(0, 0, 0, .5);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (min-width: 2200px) { html { font-size: 112.5%; } }
@media (min-width: 3000px) { html { font-size: 125%; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.6 var(--font-sans);
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg, video, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: var(--accent-line); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 650; line-height: 1.12; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
code, kbd, samp, pre { font-family: var(--font-mono); font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--btn-bg); color: var(--btn-ink); padding: 10px 14px; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 600; transition: top .15s var(--ease);
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: calc(var(--wrap-wide) + 2 * var(--gutter)); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.site-header.is-scrolled, .site-header.is-docs { border-bottom-color: var(--line); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand small { font-weight: 450; color: var(--muted); }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.site-nav a {
  color: var(--text-2); text-decoration: none; font-size: var(--step--1); font-weight: 500;
  padding: 8px 12px; border-radius: 999px; transition: color .15s var(--ease), background-color .15s var(--ease);
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"], .site-nav a.is-current { color: var(--text); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
  transition: color .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.theme-toggle { display: none; }
.js .theme-toggle { display: inline-grid; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .18s var(--ease), transform .18s var(--ease), visibility 0s linear .18s;
  }
  .site-nav a { font-size: var(--step-0); padding: 12px 4px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .site-nav a:hover { background: transparent; }
  .nav-open .site-nav { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .js .nav-toggle { display: inline-grid; }
  .js .site-nav + * { margin-left: auto; }
  .site-header .wrap { gap: 6px; }
  html:not(.js) .site-nav { position: static; flex-direction: row; opacity: 1; visibility: visible; transform: none; border: 0; padding: 0; background: transparent; overflow-x: auto; }
  html:not(.js) .site-nav a { padding: 8px; border: 0; font-size: var(--step--1); }
}

/* ---------- Buttons, chips ---------- */
.btn {
  --b-bg: var(--surface-2); --b-ink: var(--text); --b-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--b-line);
  background: var(--b-bg); color: var(--b-ink); text-decoration: none; font-weight: 600; font-size: .9375rem; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { border-color: var(--text-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { --b-bg: var(--btn-bg); --b-ink: var(--btn-ink); --b-line: var(--btn-bg); }
.btn-primary:hover { box-shadow: 0 6px 24px color-mix(in srgb, var(--btn-bg) 22%, transparent); border-color: var(--btn-bg); }
.btn-ghost { --b-bg: transparent; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text-2); font-size: .8125rem; font-weight: 500; line-height: 1.4; white-space: nowrap;
}
.chip-accent { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 .78rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: .6; }
.eyebrow-plain::before { display: none; }
.muted { color: var(--muted); }
.lede { font-size: var(--step-1); line-height: 1.55; color: var(--text-2); max-width: 46ch; }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 140px) 0; position: relative; }
.section + .section { border-top: 1px solid var(--line); }
.section-tight { padding: clamp(56px, 7vw, 96px) 0; }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 5vw, 56px); max-width: 760px; }
.section-head h2 { font-size: var(--step-4); }
.section-head p:not(.eyebrow) { color: var(--text-2); font-size: var(--step-1); max-width: 60ch; }
.section-head.flush { margin-bottom: 0; }
.page-title { font-size: var(--step-5) !important; letter-spacing: -.045em; line-height: 1; font-weight: 680; }
.section-index { font: 500 .8125rem/1 var(--font-mono); color: var(--muted); letter-spacing: .04em; }

/* ---------- Home hero ---------- */
.hero { position: relative; padding: clamp(88px, 14vw, 200px) 0 clamp(64px, 9vw, 120px); overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--grid-line) 50%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--grid-line) 50%, transparent) 1px, transparent 1px);
  background-size: 128px 128px, 128px 128px, 16px 16px, 16px 16px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
}
.hero { padding-top: clamp(72px, 10vw, 150px); padding-bottom: clamp(32px, 4vw, 56px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.hero-grid .hero-meta { grid-column: 1 / -1; }
.hero h1 { font-size: var(--step-5); letter-spacing: -.045em; line-height: .98; margin: 22px 0 28px; font-weight: 680; }
.hero .lede { max-width: 40ch; margin-bottom: 36px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 28px 40px; margin-top: clamp(40px, 6vw, 72px); padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--step--1); }
.hero-meta strong { display: block; color: var(--text); font-weight: 600; font-size: .9375rem; }
.not-found.hero { padding-bottom: clamp(96px, 16vw, 200px); }

.hero-art { margin: 0; justify-self: end; width: 100%; max-width: 460px; }
.hero-art svg { width: 100%; height: auto; overflow: visible; }
.hero-art .ha-grid path { stroke: var(--grid-line); stroke-width: 1; fill: none; }
.hero-art .ha-outer { fill: color-mix(in srgb, var(--text) 5%, transparent); stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 5 6; stroke-linejoin: round; opacity: .9; }
.hero-art .ha-hull { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.hero-art .ha-pts circle { fill: var(--text); }
.hero-art figcaption { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: center; margin-top: 18px; font: 500 .75rem/1.2 var(--font-mono); letter-spacing: .04em; color: var(--muted); }
.ha-key { display: inline-block; width: 22px; height: 0; border-top: 1.5px dashed var(--muted); margin-left: 10px; }
.ha-key:first-child { margin-left: 0; }
.ha-key-hull { border-top: 2px solid var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .js .hero-art .ha-outer { animation: ha-fade .9s var(--ease) .15s both; }
  .js .hero-art .ha-pts { animation: ha-fade .6s var(--ease) both; }
  .js .hero-art .ha-hull { stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0; animation: ha-draw 1.1s var(--ease) forwards, ha-fill .6s var(--ease) forwards; }
  .js .hero-art .ha-cup { animation-delay: .7s, 1.6s; }
  .js .hero-art .ha-p1 { animation-delay: 1.2s, 2s; }
  .js .hero-art .ha-p2 { animation-delay: 1.35s, 2.1s; }
  .js .hero-art .ha-p3 { animation-delay: 1.5s, 2.2s; }
  .js .hero-art .ha-p4 { animation-delay: 1.65s, 2.3s; }
}
@keyframes ha-fade { from { opacity: 0; } }
@keyframes ha-draw { to { stroke-dashoffset: 0; } }
@keyframes ha-fill { to { fill-opacity: 1; } }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { justify-self: start; max-width: 320px; }
}
@media (max-width: 520px) { .hero-art { display: none; } }

/* Products strip (home) */
.product-strip { list-style: none; display: grid; gap: 12px; }
.product-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 20px; align-items: center;
  padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  color: var(--text); text-decoration: none; transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.product-row:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.product-row img { width: 48px; height: 48px; border-radius: 11px; }
.pr-main { display: grid; gap: 2px; }
.pr-name { font-family: var(--font-display); font-weight: 650; font-size: var(--step-1); letter-spacing: -.01em; }
.pr-tag { color: var(--text-2); font-size: .9375rem; }
.pr-meta { color: var(--muted); font-size: .8125rem; text-align: right; line-height: 1.5; }
.pr-arrow { color: var(--muted); font-size: 1.25rem; transition: transform .2s var(--ease), color .2s var(--ease); }
.product-row:hover .pr-arrow { color: var(--accent); transform: translateX(3px); }
@media (max-width: 640px) { .product-row { grid-template-columns: auto minmax(0, 1fr); } .pr-meta, .pr-arrow { display: none; } }

/* One product on /products/: a wide card */
.product-grid:has(> .product-card:only-child) { grid-template-columns: 1fr; }
@media (min-width: 820px) {
  .product-grid > .product-card:only-child { flex-direction: row; }
  .product-grid > .product-card:only-child .thumb { flex: 0 0 58%; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--line); }
  .product-grid > .product-card:only-child .body { padding: clamp(24px, 3vw, 40px); align-content: center; }
  .product-grid > .product-card:only-child h2, .product-grid > .product-card:only-child h3 { font-size: var(--step-2); }
}

/* ---------- Media frame ---------- */
.frame {
  position: relative; border-radius: var(--radius); overflow: hidden; background: #15171b;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
}
.frame picture, .frame img, .frame video { width: 100%; }
.frame-chrome {
  display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; background: #1d2026; border-bottom: 1px solid rgba(255,255,255,.06);
}
.frame-chrome i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.16); }
.frame-chrome span { margin-left: 8px; font: 500 .75rem/1 var(--font-sans); color: rgba(255,255,255,.5); }
figure { margin: 0; }
figcaption { margin-top: 12px; font-size: var(--step--1); color: var(--muted); line-height: 1.5; }
.figure-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.figure-pair .frame { box-shadow: var(--shadow); }
.figure-pair figcaption { margin-top: 10px; }
@media (max-width: 640px) { .figure-pair { grid-template-columns: 1fr; } }
.tag-before, .tag-after {
  position: absolute; left: 12px; top: 12px; z-index: 2; padding: 4px 9px; border-radius: 999px;
  font: 600 .72rem/1.2 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: #fff;
  background: rgba(11, 12, 15, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.tag-after { background: rgba(14, 90, 180, .82); }

/* ---------- Work (portfolio project) ---------- */
.work {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: center;
}
.work-copy h3 { font-size: var(--step-3); margin: 14px 0 16px; }
.work-copy h3 a { color: inherit; text-decoration: none; }
.work-copy h3 a:hover { color: var(--accent); }
.work-copy > p { color: var(--text-2); margin-bottom: 24px; max-width: 48ch; }
.facts { list-style: none; display: grid; gap: 0; margin: 0 0 28px; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .9375rem; color: var(--text-2); }
.facts li b { font: 600 .8125rem/1.6 var(--font-mono); color: var(--text); letter-spacing: .01em; }
.work .chips { margin-bottom: 28px; }
.work-media { position: relative; }
@media (max-width: 960px) { .work { grid-template-columns: 1fr; } .work-media { order: -1; } }
@media (max-width: 420px) { .facts li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Product cards (data-driven) ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.product-card {
  position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden; transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.product-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.product-card .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: #15171b; border-bottom: 1px solid var(--line); }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.product-card:hover .thumb img { transform: scale(1.025); }
.product-card .body { padding: 22px 22px 24px; display: grid; gap: 10px; flex: 1; align-content: start; }
.product-card .title-row { display: flex; align-items: center; gap: 12px; }
.product-card .title-row img { width: 36px; height: 36px; border-radius: 8px; }
.product-card h3 { font-size: var(--step-1); letter-spacing: -.01em; }
.product-card h3 a { color: inherit; text-decoration: none; }
.product-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.product-card p { color: var(--text-2); font-size: .9375rem; }
.product-card .meta { font-size: .8125rem; color: var(--muted); }
.product-card .links { display: flex; gap: 16px; margin-top: 6px; position: relative; z-index: 2; font-size: .9rem; font-weight: 600; }
.product-card .links a { text-decoration: none; }
.product-card .links a:hover { text-decoration: underline; }

/* ---------- About / areas / contact ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 5vw, 80px); }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.two-col h2 { font-size: var(--step-3); }
.statement { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.4; letter-spacing: -.012em; color: var(--text); max-width: 34ch; margin-bottom: 36px; font-weight: 500; }
.areas-label { font: 600 .78rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.areas { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.areas li { background: var(--bg); padding: 22px; display: grid; gap: 6px; }
.areas b { font-weight: 600; font-size: 1rem; }
.areas span { color: var(--muted); font-size: .9rem; line-height: 1.5; }
@media (max-width: 600px) { .areas { grid-template-columns: 1fr; } }
.contact-line { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.contact-line p { color: var(--text-2); max-width: 52ch; }
.copy-email[data-copied="true"]::after { content: "Copied"; font-weight: 500; color: var(--ok); margin-left: 4px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: grid; gap: 28px; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-start; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; }
.footer-nav a { color: var(--text-2); text-decoration: none; }
.footer-nav a:hover { color: var(--text); text-decoration: underline; }
.footer-legal { display: grid; gap: 6px; max-width: 80ch; line-height: 1.55; }

/* ---------- Product page ---------- */
.p-hero { padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 6vw, 72px); position: relative; overflow: hidden; isolation: isolate; }
.p-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 10%, transparent 70%);
}
.p-hero-head { display: grid; justify-items: center; text-align: center; gap: 20px; }
.p-hero-icon { width: 72px; height: 72px; border-radius: 16px; box-shadow: var(--shadow); }
.p-hero h1 { font-size: var(--step-5); letter-spacing: -.045em; line-height: 1; font-weight: 680; }
.p-hero .lede { margin: 0 auto; text-align: center; max-width: 44ch; }
.p-hero .actions { justify-content: center; margin-top: 8px; }
.p-hero .chips { justify-content: center; }
.trailer { margin-top: clamp(40px, 6vw, 72px); }
.trailer .frame { max-width: 1120px; margin: 0 auto; }
.trailer video { aspect-ratio: 16 / 9; background: #0c0d10; object-fit: cover; }
.trailer figcaption { text-align: center; }

.benefits { display: grid; gap: clamp(64px, 9vw, 120px); }
.benefit { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.benefit:nth-child(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.benefit:nth-child(even) .benefit-copy { order: 2; }
.benefit-copy h3 { font-size: var(--step-3); margin: 14px 0 16px; }
.benefit-copy p { color: var(--text-2); }
.benefit-copy p + p { margin-top: 12px; }
.benefit-copy .proof { margin-top: 20px; padding-left: 14px; border-left: 2px solid var(--accent-line); font-size: .9375rem; color: var(--text-2); }
@media (max-width: 900px) {
  .benefit, .benefit:nth-child(even) { grid-template-columns: 1fr; }
  .benefit:nth-child(even) .benefit-copy { order: 0; }
}

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.feature { background: var(--bg); padding: clamp(22px, 2.6vw, 32px); display: grid; gap: 10px; align-content: start; transition: background-color .2s var(--ease); }
.feature:hover { background: var(--surface); }
.feature svg { width: 22px; height: 22px; color: var(--accent); }
.feature h3 { font-size: 1.0625rem; letter-spacing: -.01em; font-weight: 620; }
.feature p { color: var(--muted); font-size: .9375rem; line-height: 1.55; }
@media (max-width: 960px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }

.steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.steps li { position: relative; padding: 26px 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; gap: 8px; align-content: start; }
.steps li::before { counter-increment: step; content: "0" counter(step); font: 600 .8125rem/1 var(--font-mono); color: var(--accent); }
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 34px; right: -13px; width: 10px; height: 10px; border-top: 1.5px solid var(--line-strong); border-right: 1.5px solid var(--line-strong); transform: rotate(45deg); z-index: 1;
}
.steps h3 { font-size: var(--step-1); }
.steps p { color: var(--muted); font-size: .9375rem; line-height: 1.55; }
.steps kbd { font-size: .78rem; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps li::after { display: none; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

.dives { display: grid; gap: clamp(56px, 8vw, 96px); }
.dive { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.dive-copy { position: sticky; top: calc(var(--header-h) + 32px); }
.dive-copy h3 { font-size: var(--step-3); margin: 12px 0 16px; }
.dive-copy p { color: var(--text-2); }
.dive-copy p + p, .dive-copy ul { margin-top: 12px; }
.dive-copy ul { padding-left: 1.1em; color: var(--text-2); display: grid; gap: 6px; }
.dive-copy .more { display: inline-block; margin-top: 18px; font-weight: 600; text-decoration: none; }
.dive-copy .more:hover { text-decoration: underline; }
.dive-media { display: grid; gap: 16px; }
@media (max-width: 900px) { .dive { grid-template-columns: 1fr; } .dive-copy { position: static; } }

.mini-table-wrap { overflow-x: auto; border-radius: var(--radius); }
.mini-table { width: 100%; border-collapse: collapse; font-size: .875rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mini-table th, .mini-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.mini-table th { font-weight: 600; color: var(--text); background: var(--surface-2); font-size: .8125rem; }
.mini-table td { color: var(--text-2); }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table td:not(:first-child) { font-family: var(--font-mono); font-size: .8125rem; white-space: nowrap; }

.compat { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 960px) { .compat { grid-template-columns: 1fr; } }
.spec { width: 100%; border-collapse: collapse; }
.spec th, .spec td { text-align: left; padding: 16px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .9375rem; }
.spec th { width: 34%; font-weight: 600; color: var(--text); padding-right: 20px; }
.spec td { color: var(--text-2); }
.spec tr:first-child th, .spec tr:first-child td { border-top: 1px solid var(--line); }

.get-it {
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: clamp(24px, 3vw, 36px);
  background: linear-gradient(180deg, var(--surface), var(--bg)); display: grid; gap: 18px; position: sticky; top: calc(var(--header-h) + 24px);
}
.get-it .title-row { display: flex; gap: 14px; align-items: center; }
.get-it .title-row img { width: 48px; height: 48px; border-radius: 11px; }
.get-it h3 { font-size: var(--step-2); }
.get-it ul { list-style: none; display: grid; gap: 10px; font-size: .9375rem; color: var(--text-2); }
.get-it li { display: flex; gap: 10px; align-items: baseline; }
.get-it li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transform: translateY(-2px); }
.get-it .actions .btn { flex: 1 1 auto; }
.get-it .fine { font-size: .8125rem; color: var(--muted); }

.changelog { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line); }
.changelog > li { display: grid; grid-template-columns: 10rem 1fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.changelog .ver { font: 600 1rem/1.3 var(--font-mono); }
.changelog .ver small { display: block; font: 400 .8125rem/1.5 var(--font-sans); color: var(--muted); margin-top: 4px; }
.changelog ul { padding-left: 1.1em; display: grid; gap: 6px; color: var(--text-2); }
@media (max-width: 640px) { .changelog > li { grid-template-columns: 1fr; gap: 10px; } }

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; align-items: center;
  padding: 22px 0; font-weight: 600; font-size: var(--step-1); letter-spacing: -.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq .answer { padding: 0 0 24px; color: var(--text-2); max-width: 72ch; display: grid; gap: 10px; }

.after-link { margin-top: 28px; font-weight: 600; }
.after-link a { text-decoration: none; }
.after-link a:hover { text-decoration: underline; }
.cta-band { text-align: center; display: grid; justify-items: center; gap: 20px; }
.cta-band h2 { font-size: var(--step-4); max-width: 18ch; }
.cta-band p { color: var(--text-2); max-width: 52ch; }

.blueprint-embed { border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: #262626; box-shadow: var(--shadow); }
.blueprint-embed iframe { width: 100%; height: clamp(380px, 60vh, 600px); border: 0; display: block; background: #262626; }
.blueprint-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--surface); border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.blueprint-bar .actions { gap: 8px; }
.blueprint-bar .btn { min-height: 36px; padding: 6px 14px; font-size: .875rem; }

/* ---------- Docs layout ---------- */
.docs-shell { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr) 14.5rem; gap: 0; max-width: 90rem; margin: 0 auto; width: 100%; }
.docs-sidebar {
  position: sticky; top: var(--header-h); align-self: start; height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 28px 20px 48px var(--gutter); border-right: 1px solid var(--line); font-size: .9rem; overscroll-behavior: contain;
}
.docs-sidebar .product-switch { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; color: var(--text); text-decoration: none; font-weight: 650; }
.docs-sidebar .product-switch img { width: 28px; height: 28px; border-radius: 7px; }
.docs-sidebar .product-switch small { display: block; font-weight: 450; color: var(--muted); font-size: .78rem; }
.docs-nav-group { margin-bottom: 22px; }
.docs-nav-group h2 { font: 600 .72rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 10px; }
.docs-nav-group ul { list-style: none; display: grid; gap: 1px; }
.docs-nav-group a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--text-2); text-decoration: none; line-height: 1.35; }
.docs-nav-group a:hover { color: var(--text); background: var(--surface-2); }
.docs-nav-group a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.docs-main { min-width: 0; padding: 36px clamp(20px, 4vw, 64px) 80px; }
.docs-article { max-width: 76ch; margin: 0 auto; }
.docs-toc { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 36px var(--gutter) 40px 8px; font-size: .84rem; }
.docs-toc h2 { font: 600 .72rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.docs-toc ul { list-style: none; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.docs-toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.is-active { color: var(--accent); border-left-color: var(--accent); }
.docs-toc .toc-h3 a { padding-left: 24px; }
.docs-toggle { display: none; }
.docs-scrim { display: none; }

@media (max-width: 1240px) { .docs-shell { grid-template-columns: 15.75rem minmax(0, 1fr); } .docs-toc { display: none; } }
@media (max-width: 900px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .docs-sidebar {
    position: fixed; z-index: 35; inset: var(--header-h) auto 0 0; width: min(320px, 86vw); height: auto; background: var(--bg);
    border-right: 1px solid var(--line); transform: translateX(-102%); transition: transform .22s var(--ease); box-shadow: var(--shadow-lg);
    padding-left: 20px;
  }
  .docs-open .docs-sidebar { transform: none; }
  .docs-scrim { display: block; position: fixed; inset: var(--header-h) 0 0 0; z-index: 34; background: rgba(0,0,0,.35); opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility 0s linear .2s; }
  .docs-open .docs-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
  .js .docs-toggle { display: inline-flex; }
  html:not(.js) .docs-sidebar { position: static; transform: none; width: auto; box-shadow: none; border-right: 0; border-bottom: 1px solid var(--line); height: auto; }
  .docs-main { padding-top: 20px; }
}
.docs-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 76ch; margin: 0 auto 26px; font-size: 1rem; }
.docs-toggle { align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 600 .875rem/1 var(--font-sans); cursor: pointer; }
.docs-toggle svg { width: 16px; height: 16px; }
.breadcrumbs { font-size: .8125rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; opacity: .6; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); text-decoration: underline; }

.search-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px 0 12px; min-width: 220px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); cursor: pointer;
  font: 500 .875rem/1 var(--font-sans); transition: border-color .15s var(--ease), color .15s var(--ease);
}
.search-btn:hover { border-color: var(--text-2); color: var(--text); }
.search-btn svg { width: 16px; height: 16px; flex: none; }
.search-btn kbd { margin-left: auto; }
.search-btn { display: none; }
.js .search-btn { display: inline-flex; }
@media (max-width: 1100px) { .search-btn { min-width: 0; width: 38px; height: 38px; padding: 0; justify-content: center; } .search-btn .label, .search-btn kbd { display: none; } }

/* ---------- Prose (docs content) ---------- */
.prose { font-size: 1rem; line-height: 1.7; color: var(--text-2); }
.prose > * + * { margin-top: 1.05em; }
.prose h1 { font-size: var(--step-4); color: var(--text); letter-spacing: -.035em; line-height: 1.05; margin-bottom: .45em; }
.prose .lead { font-size: var(--step-1); line-height: 1.55; color: var(--text-2); }
.prose h2 { font-size: var(--step-2); color: var(--text); margin-top: 2.2em; padding-top: .3em; letter-spacing: -.02em; }
.prose h3 { font-size: 1.1875rem; color: var(--text); margin-top: 1.8em; letter-spacing: -.012em; }
.prose h4 { font-size: 1rem; color: var(--text); margin-top: 1.5em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .7em; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose li > ul, .prose li > ol { margin-top: .4em; }
.prose :not(pre) > code { padding: .12em .38em; border-radius: 5px; background: var(--code-bg); border: 1px solid var(--line); color: var(--code-ink); font-size: .86em; overflow-wrap: anywhere; }
.prose a code { color: inherit; }
.prose img { border-radius: var(--radius-sm); }
.prose figure { margin-top: 1.6em; margin-bottom: 1.6em; }
.prose figure .frame { box-shadow: var(--shadow); }
.prose dl { display: grid; gap: 12px; }
.prose dt { color: var(--text); font-weight: 600; }
.prose dd { margin: 2px 0 0; }
.heading-anchor {
  margin-left: .35em; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; transition: opacity .15s var(--ease);
}
h2:hover .heading-anchor, h3:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }

kbd {
  display: inline-block; min-width: 1.6em; padding: .08em .45em; border-radius: 6px; text-align: center;
  font: 600 .78em/1.5 var(--font-mono); color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); box-shadow: inset 0 -1px 0 var(--line-strong); white-space: nowrap;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.5; }
.prose th, .prose td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 600; font-size: .84rem; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }
.prose td.wrap-code code { white-space: normal; }
.prose th.num { white-space: normal; }
.prose .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: .84rem; white-space: nowrap; }

.code-block { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.code-block .code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); font: 500 .75rem/1.2 var(--font-mono); color: var(--muted); }
.code-block pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: .84rem; line-height: 1.65; color: var(--code-ink); tab-size: 4; }
.code-block pre code { font-size: inherit; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text-2); font: 600 .75rem/1 var(--font-sans); cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--text-2); }
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn[data-copied="true"] { color: var(--ok); border-color: currentColor; }
.tok-k { color: var(--tok-key); }
.tok-s { color: var(--tok-str); }
.tok-c { color: var(--tok-com); font-style: italic; }
.tok-n { color: var(--tok-num); }

.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--note-bg); font-size: .9375rem; line-height: 1.6; }
.callout > * + * { margin-top: .5em; }
.callout-title { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 650; font-size: .875rem; }
.callout-title svg { width: 16px; height: 16px; flex: none; }
.callout.tip { border-left-color: var(--ok); background: var(--tip-bg); }
.callout.tip .callout-title svg { color: var(--ok); }
.callout.warning { border-left-color: var(--warn); background: var(--warn-bg); }
.callout.warning .callout-title svg { color: var(--warn); }
.callout.danger { border-left-color: var(--danger); background: var(--danger-bg); }
.callout.note .callout-title svg { color: var(--accent); }
.prose .callout ul { margin-top: .5em; }

.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .8125rem; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--ok); }
.status.partial { color: var(--warn); }
.status.none { color: var(--muted); }

.card-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; list-style: none; padding: 0 !important; }
.card-links li { margin: 0 !important; }
.card-links a { display: grid; gap: 4px; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: border-color .15s var(--ease), transform .15s var(--ease); }
.card-links a:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.card-links b { color: var(--text); font-weight: 600; }
.card-links span { color: var(--muted); font-size: .875rem; line-height: 1.5; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 600; transition: border-color .15s var(--ease); }
.pager a:hover { border-color: var(--accent-line); }
.pager small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 520px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }
.docs-meta { margin-top: 28px; font-size: .8125rem; color: var(--muted); }

/* ---------- Search dialog ---------- */
.search-dialog {
  width: min(680px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 48px)); padding: 0; margin: 8vh auto auto;
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-dialog::backdrop { background: rgba(5, 7, 10, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.search-dialog form { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.search-dialog form svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-dialog input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 1.0625rem/1.4 var(--font-sans); padding: 6px 0; }
.search-dialog input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-results { list-style: none; overflow-y: auto; max-height: calc(min(640px, 100vh - 48px) - 110px); padding: 8px; }
.search-results a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 9px; text-decoration: none; color: var(--text); }
.search-results a .crumb { font-size: .75rem; color: var(--muted); font-family: var(--font-mono); }
.search-results a .title { font-weight: 600; }
.search-results a .snippet { font-size: .84rem; color: var(--text-2); line-height: 1.5; }
.search-results a mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; }
.search-results li[aria-selected="true"] a, .search-results a:hover { background: var(--surface-2); }
.search-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: .9rem; }
.search-foot { display: flex; gap: 16px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); }

/* ---------- Motion ---------- */
.reveal { opacity: 1; }
.reveal-ready .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-ready .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal-ready .reveal { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- 404 ---------- */
.not-found { padding: clamp(96px, 16vw, 200px) 0; }
.not-found h1 { font-size: var(--step-5); letter-spacing: -.045em; margin: 18px 0 20px; }
.not-found p:not(.eyebrow) { color: var(--text-2); max-width: 46ch; margin-bottom: 32px; font-size: var(--step-1); }

@media print {
  .reveal, .reveal-ready .reveal { opacity: 1 !important; transform: none !important; }
  .site-header, .site-footer, .docs-sidebar, .docs-toc, .pager, .copy-btn, .search-btn { display: none !important; }
  body { background: #fff; color: #000; }
  .docs-shell { display: block; }
}
