/*
 * Site stylesheet -- shared by index.html and the /products/* pages.
 *
 * Tokens (light/dark), base, the top nav (with the Products dropdown), buttons,
 * the landing page's sections, and the footer. The theme is applied before
 * first paint by a small inline script in each page's <head>; behavior for the
 * nav/theme toggle lives in /assets/js/site.js.
 */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-soft-2: #f0f1f4;
  --surface: #ffffff;
  --fg: #16181d;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --brand: #b45309;
  --brand-fg: #ffffff;
  --link: #2563eb;
  --header-bg: rgba(255,255,255,0.86);
  --inverse-bg: #16181d;
  --inverse-fg: #ffffff;
  /* Code panels: also set in the explicit [data-theme] blocks below, but they
     must exist here too -- with no data-theme (a first visit, nothing stored)
     an undefined --codebg leaves .codepanel transparent, i.e. near-invisible
     light code text on a light page. Values match the explicit light theme. */
  --code: #2b5820;
  --codebg: #eeeeee;
  /* Code panel chrome and syntax colors (light: Rosé Pine Dawn). */
  --code-fg: #575279;
  --code-ln: rgba(121,117,147,0.5);
  --code-c: #797593;
  --code-s: #ea9d34;
  --code-k: #286983;
  --code-p: #d7827e;
  --code-border: #e5e7eb;
  --code-bar-border: rgba(229,231,235,0.6);
  --code-dot: #dfdad9;
  --code-tab: #6b7280;
  --code-tab-active: #16181d;
  --code-tab-active-bg: #ffffff;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,0.04), 0 12px 32px rgba(16,24,40,0.06);
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161c2b;
    --bg-soft: #12151b;
    --bg-soft-2: #171a21;
    --surface: #12151b;
    --fg: #e7e9ee;
    --muted: #8b93a3;
    --border: rgba(255,255,255,0.09);
    --border-strong: rgba(255,255,255,0.18);
    --brand: #f2b544;
    --brand-fg: #2b1a02;
    --link: #60a5fa;
    --header-bg: rgba(11,13,18,0.86);
    --inverse-bg: #ffffff;
    --inverse-fg: #16181d;
    --code: #51aa3b;
    --codebg: #0f1115;
    --code-fg: #e2e4e9;
    --code-ln: rgba(255,255,255,0.25);
    --code-c: rgba(255,255,255,0.38);
    --code-s: #86efac;
    --code-k: #7dd3fc;
    --code-p: #fbbf24;
    --code-border: transparent;
    --code-bar-border: rgba(255,255,255,0.08);
    --code-dot: rgba(255,255,255,0.15);
    --code-tab: rgba(255,255,255,0.4);
    --code-tab-active: #ffffff;
    --code-tab-active-bg: rgba(255,255,255,0.08);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.45);
  }
}
:root[data-theme="light"] {
  /* --bg: #e7e7d4; */
  --bg: #f6f6fa;
  --bg-soft: #f7f8fa;
  --bg-soft-2: #f0f1f4;
  --surface: #ffffff;
  --fg: #16181d;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --brand: #b45309;
  --brand-fg: #ffffff;
  --link: #2563eb;
  --code: #2b5820;
  --header-bg: rgba(255,255,255,0.86);
  --inverse-bg: #16181d;
  --inverse-fg: #ffffff;
  --codebg: #eeeeee;
  --code-fg: #575279;
  --code-ln: rgba(121,117,147,0.5);
  --code-c: #797593;
  --code-s: #ea9d34;
  --code-k: #286983;
  --code-p: #d7827e;
  --code-border: #e5e7eb;
  --code-bar-border: rgba(229,231,235,0.6);
  --code-dot: #dfdad9;
  --code-tab: #6b7280;
  --code-tab-active: #16181d;
  --code-tab-active-bg: #ffffff;
  --shadow: 0 1px 2px rgba(16,24,40,0.04), 0 12px 32px rgba(16,24,40,0.06);
}
:root[data-theme="dark"] {
  --bg: #161c2b;
  --bg-soft: #12151b;
  --bg-soft-2: #171a21;
  --surface: #12151b;
  --fg: #e7e9ee;
  --muted: #8b93a3;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.18);
  --brand: #f2b544;
  --brand-fg: #2b1a02;
  --link: #60a5fa;
  --code: #51aa3b;
  --header-bg: rgba(11,13,18,0.86);
  --inverse-bg: #ffffff;
  --inverse-fg: #16181d;
  --codebg: #0f1115;
  --code-fg: #e2e4e9;
  --code-ln: rgba(255,255,255,0.25);
  --code-c: rgba(255,255,255,0.38);
  --code-s: #86efac;
  --code-k: #7dd3fc;
  --code-p: #fbbf24;
  --code-border: transparent;
  --code-bar-border: rgba(255,255,255,0.08);
  --code-dot: rgba(255,255,255,0.15);
  --code-tab: rgba(255,255,255,0.4);
  --code-tab-active: #ffffff;
  --code-tab-active-bg: rgba(255,255,255,0.08);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.45);
}
* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 150ms ease, color 150ms ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
code, .mono { font-family: var(--font-mono); }
h1, h2, h3 { font-weight: 600; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
::selection { background: #fde68a; color: #1c1917; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 3px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.02em;
  color: var(--brand); font-weight: 600; display: inline-flex; align-items: baseline; gap: 8px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }

/* ---------- Nav ---------- */
header.site {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-weight: 700; font-size: 1.02rem; text-decoration: none; color: var(--fg); }
.brand .mark {
  width: 24px; height: 24px; border-radius: 6px; background: var(--inverse-bg); color: var(--inverse-fg);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem;
}
nav.links { display: flex; align-items: center; gap: 26px; }
nav.links a { font-size: 0.92rem; color: var(--muted); text-decoration: none; }
nav.links a:hover { color: var(--fg); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* Hamburger: hidden on desktop. Below 900px it appears in place of the
   header's "Quick start" button (which moves into the menu as
   .nav-cta-mobile) and opens nav.links as a full-width panel. */
.nav-toggle {
  display: none; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--fg); cursor: pointer; padding: 0;
  transition: border-color 120ms ease;
}
.nav-toggle:hover { border-color: var(--fg); }
.nav-toggle svg { width: 16px; height: 16px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
nav.links .nav-cta-mobile { display: none; }

/* Products dropdown -- a disclosure (button + list of links), not an ARIA
   menu: plain links, so Tab moves through them and no arrow-key handling
   is promised. On phones (<=900px) it becomes an accordion inside the
   hamburger menu -- see the responsive block at the bottom. */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 0.92rem; color: var(--muted);
}
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle[aria-expanded="true"],
.nav-dropdown-toggle.is-current { color: var(--fg); }
.nav-dropdown-toggle svg { width: 12px; height: 12px; transition: transform 150ms ease; }
.nav-dropdown-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
/* padding-top (not margin) bridges the gap to the button, so a mouse
   moving down to the menu never leaves the hover area. */
.nav-dropdown-menu {
  position: absolute; top: 100%; left: -14px; min-width: 220px; padding-top: 12px;
  visibility: hidden; opacity: 0; transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 0s linear 120ms;
}
.nav-dropdown.is-open .nav-dropdown-menu {
  visibility: visible; opacity: 1; transform: none; transition-delay: 0s;
}
.nav-dropdown-menu ul {
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
nav.links .nav-dropdown-menu a {
  display: block; padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 0.92rem; color: var(--fg);
}
nav.links .nav-dropdown-menu a:hover,
nav.links .nav-dropdown-menu a:focus-visible { background: var(--bg-soft-2); }
nav.links .nav-dropdown-menu a[aria-current="page"] { color: var(--brand); }
@media (prefers-reduced-motion: reduce) {
  .nav-dropdown-menu, .nav-dropdown-toggle svg { transition: none; }
}

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--fg); cursor: pointer; padding: 0;
  transition: border-color 120ms ease, transform 120ms ease;
}
.theme-toggle:hover { border-color: var(--fg); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { 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; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.9rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease, filter 120ms ease;
}
.btn--dark { background: var(--inverse-bg); color: var(--inverse-fg); }
.btn--dark:hover { filter: brightness(0.88); }
.btn--ghost { border-color: var(--border-strong); color: var(--fg); background: var(--surface); }
.btn--ghost:hover { border-color: var(--fg); }
.btn--sm { padding: 7px 14px; font-size: 0.82rem; }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 80px;
  background:
    radial-gradient(700px 320px at 15% -10%, rgba(180,83,9,0.08), transparent 60%),
    radial-gradient(700px 320px at 90% 0%, rgba(37,99,235,0.07), transparent 60%);
}
.hero-inner { max-width: 898px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: clamp(2.3rem, 3vw, 3.6rem); line-height: 1.06; margin: 28px 0 42px; }
.hero p.lede { font-size: 1.16rem; color: var(--muted); max-width: 78ch; margin: 0 auto 42px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.hero-note { font-size: 0.85rem; color: var(--muted); }
.hero-note .mono { color: var(--fg); }
.code { color: var(--code); }

/* ---------- Code panel with line numbers ---------- */
.codepanel {
  margin: 56px auto 0;
  background: var(--codebg); border: 1px solid var(--code-border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; text-align: left;
}
.codepanel-bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--code-bar-border);
}
.codepanel-bar .dots { display: flex; gap: 6px; }
.codepanel-bar .dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--code-dot); }
/* min-width:0 + overflow lets the tab strip scroll inside the bar when there
   are more tabs than fit (4 tabs need ~355px; a phone panel has ~260px). */
.codepanel-bar .tabs { display: flex; gap: 4px; margin-left: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.codepanel-bar .tabs::-webkit-scrollbar { display: none; }
.codepanel-bar .tab {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--code-tab);
  background: none; border: 0; padding: 5px 10px; border-radius: 6px; cursor: pointer;
  flex: none; white-space: nowrap;
}
.codepanel-bar .tab.is-active { color: var(--code-tab-active); background: var(--code-tab-active-bg); }
.codelines { padding: 18px 0; overflow-x: auto; }
.codelines table { border-collapse: collapse; width: 100%; }
.codelines td { padding: 1px 0; font-family: var(--font-mono); font-size: 0.86rem; white-space: pre; vertical-align: top; }
.codelines td.ln { width: 44px; text-align: right; padding-right: 16px; color: var(--code-ln); user-select: none; }
.codelines td.src { padding-right: 24px; color: var(--code-fg); }
.codelines .c { color: var(--code-c); }
.codelines .s { color: var(--code-s); }
.codelines .k { color: var(--code-k); }
.codelines .p { color: var(--code-p); }
.codepanel-tabpanel { display: none;  padding:12px; }
.codepanel-tabpanel.is-active { display: block;}

.product-codepanel {
  min-width: 486px;
  min-height: 426px;
}
.align-items-start {
  align-items: flex-start;
}

#front-codepanel { 
  /* margin: 92px 0 0 16%;  */
  /* width:72%;  */
}
/* ---------- Keyword strip ---------- */
.kw-strip { padding: 28px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.kw-strip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; }
.kw-strip li { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); }
.kw-strip li b { color: var(--fg); font-weight: 600; }

/* ---------- Section shells ---------- */
section { padding: 88px 0; }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 2.5vw, 2.3rem); margin-top: 12px; }
.section-head p { color: var(--muted); font-size: 1.04rem; margin: 14px 0 0; }
section.alt { background: var(--bg-soft); }

/* ---------- Built-to-disappear cards ---------- */
.quad { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.quad-card { background: var(--surface); padding: 32px; }
.quad-card .num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--brand); font-weight: 700; }
.quad-card h3 { font-size: 1.28rem; margin: 12px 0 10px; }
.quad-card p { color: var(--muted); margin: 0; font-size: 0.96rem; }

/* ---------- Batteries-included bento ---------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.bento3 { display: grid; grid-template-columns: repeat(3, 3fr); gap: 18px; }
.bento2 { display: grid; grid-template-columns: repeat(2, 2fr); gap: 22px; }
.bento-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 20px; display: flex; flex-direction: column; gap: 14px;
  transition: border-color 150ms ease, transform 150ms ease;
}
.bento-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.bento-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff; flex: none;
}
.bento-card h3 { font-size: 1rem; }
.bento-card p { color: var(--muted); font-size: 0.88rem; margin: 0; }

/* Screenshot thumbnails (Data dashboards); site.js opens them full size. */
.shot {
  display: block; width: 100%; padding: 0; margin: 0;
  background: none; border: 0; border-radius: var(--radius-sm);
  cursor: zoom-in; overflow: hidden;
}
.shot img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.shot:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,0.82);
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: var(--radius-sm); box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute; top: 12px; right: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,0.15); color: #fff;
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.lightbox-close:hover, .lightbox-close:focus-visible { background: rgba(255,255,255,0.3); }
body.lightbox-open { overflow: hidden; }
.ic-blue { background: #2563eb; }
.ic-purple { background: #7c3aed; }
.ic-green { background: #16a34a; }
.ic-orange { background: #ea580c; }
.ic-pink { background: #db2777; }
.ic-teal { background: #0d9488; }
.ic-red { background: #dc2626; }
.ic-slate { background: #475569; }

/* ---------- Narrative + code split ---------- */
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.split h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin-bottom: 16px; }
.split p { color: var(--muted); font-size: 1.02rem; margin: 0 0 16px; }
.split ul { margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
/* Not display:flex: a flex item's automatic min-width is its content's
   min-content size, and Chromium/WebKit computes that wrong for an
   anonymous flex item mixing plain text with inline elements (e.g. a
   <code> term) -- it can come out as the full unwrapped line instead of
   the longest word, so a bullet with a code term refuses to wrap and
   overflows a narrow column. An absolutely-positioned ::before checkmark
   avoids creating that anonymous flex item at all. */
.split ul li { font-size: 0.95rem; position: relative; padding-left: 24px; }
.split ul li::before { content: "✓"; color: #16a34a; font-weight: 700; position: absolute; left: 0; top: 0.05em; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--inverse-bg); color: var(--inverse-fg); border-radius: var(--radius);
  padding: 56px 40px; text-align: center;
}
.cta-banner h2 { color: var(--inverse-fg); font-size: clamp(1.6rem, 3vw, 2.1rem); }
.cta-banner p { color: color-mix(in srgb, var(--inverse-fg) 65%, transparent); margin: 14px 0 28px; }
.cta-banner .btn--dark { background: var(--bg); color: var(--fg); }
.cta-banner .btn--dark:hover { filter: brightness(0.96); }
.cta-banner .btn--ghost { border-color: color-mix(in srgb, var(--inverse-fg) 30%, transparent); color: var(--inverse-fg); background: transparent; }
.cta-banner .btn--ghost:hover { border-color: var(--inverse-fg); }

/* ---------- Footer ---------- */
footer.site { padding: 56px 0 48px; border-top: 1px solid var(--border); }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 14px; }
.footer-col a { display: block; font-size: 0.92rem; text-decoration: none; color: var(--fg); margin-bottom: 10px; }
.footer-col a:hover { color: var(--link); }
.fineprint { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------- /products/* stub pages ---------- */
body.page-stub { min-height: 100vh; display: flex; flex-direction: column; }
body.page-stub main { flex: 1; }
.stub { padding: 112px 0 96px; }
.stub-inner { max-width: 640px; }
.stub h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.08; margin: 18px 0 18px; }
.stub p.lede { font-size: 1.12rem; color: var(--muted); margin: 0 0 28px; max-width: 54ch; }
.soon {
  display: inline-block; margin-bottom: 32px; padding: 4px 12px; border-radius: 999px;
  border: 1px dashed var(--border-strong); color: var(--muted);
  font-family: var(--font-mono); font-size: 0.78rem;
}
.stub-cta { display: flex; gap: 12px; flex-wrap: wrap; }
/* Long-form text pages (/terms/): readable line length, section spacing. */
.legal { padding: 96px 0 80px; }
.legal-inner { max-width: 72ch; }
.legal h1 { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.1; margin: 18px 0 10px; }
.legal .updated { color: var(--muted); font-size: 0.92rem; margin: 0 0 36px; }
.legal h2 { font-size: 1.22rem; margin: 40px 0 10px; }
.legal p, .legal li { line-height: 1.65; }
.legal ul { padding-left: 1.3em; }
.legal li { margin: 6px 0; }
.legal a { color: var(--link); }
/* Compact footer for the stubs. Its own class names on purpose: the landing
   footer above already owns .footer-links / .footer-col. */
footer.site.footer--compact { padding: 32px 0 40px; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-inline { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-inline a { font-size: 0.92rem; color: var(--muted); text-decoration: none; }
.footer-inline a:hover { color: var(--fg); }

.w1 {
  width:1.25rem;
}
.h1 {
  height:1.25rem;
}
.kw-strip a {
  text-decoration: none;
  color: var(--link);
}
/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 560ms ease, transform 560ms ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .quad { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento3, .bento2 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .footer-grid { flex-direction: column; }
  #front-codepanel { 
    /* margin: 62px 0 0 2%;  */
    /* width: initial;  */
  }
  /* A code panel in a stacked .split column on a product page fills the
     column. The base .codepanel's `margin: 56px auto 0` (auto sides) makes a
     grid item shrink-to-fit its widest code line -- ~460px, wider than a
     phone's ~340px column -- so the page scrolled sideways. Desktop keeps the
     centered fit-content look. */
  .page-stub .split > .codepanel { margin: 0; max-width: none; }
  /* The landing page's panels had the same problem (the page was ~680px
     wide on a phone, which also threw the screenshot popup off-centre): cap
     them at their column and let the code scroll inside, as on the product
     pages. */
  .split > .codepanel { margin-left: 0; margin-right: 0; }
  .codepanel { max-width: 100%; min-width: 0; }
  /* .product-codepanel's fixed desktop min-width/min-height (466x426, so
     every panel on a product page reads as the same size regardless of how
     much code is in it) reintroduces the same overflow the rule above just
     fixed -- 466px is still wider than a phone's ~340px column. */
  .page-stub .split > .product-codepanel { min-width: 0; min-height: 0; }
  /* --- Mobile nav: hamburger + full-width panel ---------------------------
     nav.links used to be display:none here, which left phones with no way to
     reach Docs/Examples/Dashboard (or Products). It's now the panel itself,
     revealed by the hamburger (header.menu-open). */
  /* .nav's `padding: 16px 0` (above) also zeroes .wrap's 24px side gutters,
     since both classes sit on the same element. Wide screens hide that via
     max-width centering; on a phone it pins the brand and hamburger to the
     screen edges while the panel below is inset. Restore the gutters here. */
  .nav { padding-left: 24px; padding-right: 24px; }
  .nav-toggle { display: inline-flex; }
  .nav-actions .nav-cta { display: none; }
  nav.links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 4px 24px 20px;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    max-height: calc(100vh - 70px); max-height: calc(100dvh - 70px); overflow-y: auto;
  }
  header.site.menu-open nav.links { display: flex; }
  nav.links > a:not(.nav-cta-mobile),
  nav.links .nav-dropdown-toggle {
    display: flex; width: 100%; align-items: center; justify-content: space-between;
    padding: 14px 0; font-size: 1rem; color: var(--fg);
    border-bottom: 1px solid var(--border);
  }
  nav.links .nav-dropdown-toggle svg { width: 14px; height: 14px; }
  /* Products becomes an accordion: the menu is in normal flow, shown only
     while .is-open, instead of a floating panel. */
  .nav-dropdown-menu {
    position: static; min-width: 0; padding-top: 0;
    display: none; visibility: visible; opacity: 1; transform: none; transition: none;
  }
  .nav-dropdown.is-open .nav-dropdown-menu { display: block; }
  .nav-dropdown-menu ul { border: 0; box-shadow: none; background: none; padding: 4px 0 8px 14px; }
  nav.links .nav-dropdown-menu a { padding: 11px 12px; font-size: 0.95rem; }
  nav.links .nav-cta-mobile {
    display: inline-flex; justify-content: center; margin-top: 18px;
    padding: 12px 18px; font-size: 0.95rem; color: var(--inverse-fg);
  }
  nav.links .nav-cta-mobile:hover { color: var(--inverse-fg); }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
}

/* "How anonymous keys work" flow chart (Mermaid, drawn by index.html). The
   raw chart text shows until the library loads, so keep the box from jumping. */
.flowchart { max-width: 760px; margin: 0 auto; min-height: 320px; display: flex; justify-content: center; }
.flowchart pre.mermaid { margin: 0; background: none; border: 0; color: var(--muted); font-size: .8rem; white-space: pre-wrap; text-align: left; }
.flowchart pre.mermaid[data-processed] { color: inherit; font-size: inherit; white-space: normal; }
.flowchart svg { max-width: 100%; height: auto; }
.flowchart-note { text-align: center; color: var(--muted); max-width: 54ch; margin: 24px auto 0; }
