/* ==========================================================================
   Baselyra — marketing site
   One stylesheet. Tokens first, then primitives, then page sections.
   The palette is the Studio's own palette (studio/src/styles.css), so the
   drawings of the product and the site around them are the same colours.
   ========================================================================== */

/* --- design tokens -------------------------------------------------------
   Dark is the default. Light is applied when the visitor asks for it, or
   when their system does and they have not chosen otherwise. */
:root {
  --bg:            #0a0b0d;
  --bg-subtle:     #0f1114;
  --panel:         #131619;
  --panel-2:       #181c20;
  --panel-hover:   #1d2226;
  --border:        #23282e;
  --border-strong: #333b43;
  --text:          #e6e9ec;
  --text-muted:    #98a1a9;
  --text-faint:    #6a737c;
  --accent:        #4fd1c5;
  --accent-soft:   #10312f;
  --accent-line:   #2b6f68;
  --primary-bg:    #f0f2f4;
  --primary-fg:    #0a0b0d;
  --danger:        #f36d6d;
  --warn:          #e3a008;
  --ok:            #4ade80;
  --shadow-pop:    0 10px 30px -10px rgb(0 0 0 / .7), 0 2px 8px -2px rgb(0 0 0 / .5);
  --shadow-deck:   0 2px 4px rgb(0 0 0 / .5), 0 12px 24px -8px rgb(0 0 0 / .55),
                   0 48px 80px -32px rgb(0 0 0 / .75);
  --grid-line:     rgb(255 255 255 / .035);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text",
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Cascadia Mono",
               "Roboto Mono", Consolas, monospace;

  --wrap: 1180px;
  --radius: 6px;
  --radius-sm: 5px;
  --gap: 20px;
  --section-y: clamp(56px, 8vw, 104px);
  --header-h: 56px;
}

:root[data-theme="light"] {
  --bg:            #ffffff;
  --bg-subtle:     #f7f8f9;
  --panel:         #ffffff;
  --panel-2:       #f2f4f5;
  --panel-hover:   #edf0f2;
  --border:        #e3e6e9;
  --border-strong: #cdd3d9;
  --text:          #14171a;
  --text-muted:    #5c656e;
  --text-faint:    #8b949c;
  --accent:        #0d9488;
  --accent-soft:   #d6f2ee;
  --accent-line:   #7fcfc6;
  --primary-bg:    #14171a;
  --primary-fg:    #ffffff;
  --danger:        #d13d3d;
  --warn:          #a86200;
  --ok:            #197a4b;
  --shadow-pop:    0 8px 24px -8px rgb(20 23 26 / .18), 0 2px 6px -2px rgb(20 23 26 / .1);
  --shadow-deck:   0 1px 2px rgb(20 23 26 / .09), 0 12px 24px -10px rgb(20 23 26 / .18),
                   0 40px 72px -32px rgb(20 23 26 / .22);
  --grid-line:     rgb(20 23 26 / .05);

}


/* --- product drawings ----------------------------------------------------
   Each .svg in assets/img carries its own copy of these tokens so it still
   reads correctly when loaded through <img>. Inlined into a page, this rule
   is more specific, so the drawings follow the site's theme toggle. */
.figure svg, .deck-window svg, .fig svg {
  --sv-bg: var(--bg); --sv-subtle: var(--bg-subtle); --sv-panel: var(--panel);
  --sv-panel-2: var(--panel-2); --sv-border: var(--border);
  --sv-border-strong: var(--border-strong); --sv-text: var(--text);
  --sv-muted: var(--text-muted); --sv-faint: var(--text-faint);
  --sv-accent: var(--accent); --sv-accent-soft: var(--accent-soft);
  --sv-ok: var(--ok); --sv-warn: var(--warn); --sv-danger: var(--danger);
}

/* --- reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.022em; line-height: 1.15; }
p { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--panel); border: 1px solid var(--border-strong);
  padding: 8px 14px; border-radius: var(--radius-sm); transition: top .15s;
}
.skip:focus { top: 8px; }

/* --- type helpers -------------------------------------------------------- */
.mono { font-family: var(--font-mono); font-variant-ligatures: none; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.accent { color: var(--accent); }
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-faint);
}
.lead { font-size: clamp(16px, 1.6vw, 18px); color: var(--text-muted); max-width: 62ch; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

h1 { font-size: clamp(33px, 5.4vw, 58px); letter-spacing: -.035em; line-height: 1.04; }
h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em; }
h3 { font-size: 17px; }
h4 { font-size: 14px; }

/* --- layout -------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.wrap-wide { max-width: 1400px; }
.section { padding-block: var(--section-y); }
.section-tight { padding-block: clamp(40px, 5vw, 68px); }
.section + .section { border-top: 1px solid var(--border); }
.section-head { max-width: 68ch; margin-bottom: 36px; }
.section-head h2 { margin-top: 10px; }
.section-head p { margin-top: 12px; }

.grid { display: grid; gap: var(--gap); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: clamp(24px, 4vw, 56px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.stack-8 > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

@media (max-width: 900px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
}

/* --- header -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header { background: var(--bg); }
}
.site-header.is-stuck { border-bottom-color: var(--border); background: var(--bg); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: -.02em; }
.brand .mark { color: var(--accent); flex: none; }
.brand-name { font-size: 15px; }
.brand-tag {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; margin-left: 2px;
}
.nav-main { flex: 1; min-width: 0; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  font-size: 13.5px; color: var(--text-muted); padding: 6px 10px;
  border-radius: var(--radius-sm); transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--panel-2); }
.nav-links a[aria-current="page"] { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; }

@media (max-width: 940px) {
  .nav-main { display: none; }
  .nav-toggle { display: inline-flex; }
  .hide-sm { display: none; }
}

/* --- drawer -------------------------------------------------------------- */
.drawer { position: fixed; inset: 0; z-index: 90; background: rgb(0 0 0 / .5); }
.drawer[hidden] { display: none; }
.drawer-panel {
  position: absolute; inset: 0 0 auto auto; width: min(320px, 88vw); height: 100%;
  background: var(--bg); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px;
  animation: slide-in .18s ease-out;
}
@keyframes slide-in { from { transform: translateX(14px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.drawer-nav { display: flex; flex-direction: column; padding-block: 8px; flex: 1; }
.drawer-nav a { padding: 11px 8px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 15px; }
.drawer-nav a[aria-current="page"] { color: var(--accent); }
.drawer-foot { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; padding-top: 12px; }

/* --- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); background: var(--panel);
  transition: background .15s, border-color .15s, color .15s, transform .12s;
}
.btn:hover { background: var(--panel-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--primary-bg); color: var(--primary-fg); border-color: var(--primary-bg); }
.btn-primary:hover { background: var(--primary-bg); border-color: var(--primary-bg); opacity: .9; }
.btn-quiet { background: transparent; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14.5px; }
.btn svg { flex: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--panel); color: var(--text-muted);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--panel-hover); color: var(--text); border-color: var(--border-strong); }
.i-sun { display: none; }
:root[data-theme="light"] .i-sun { display: block; }
:root[data-theme="light"] .i-moon { display: none; }

.arrow-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: 13.5px; }
.arrow-link::after { content: "→"; transition: transform .15s; }
.arrow-link:hover::after { transform: translateX(2px); }

/* --- surfaces ------------------------------------------------------------ */
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 20px;
  transition: border-color .15s, background .15s;
}
a.card:hover { border-color: var(--border-strong); background: var(--panel-2); }
.card h3 { margin-bottom: 6px; }
.card p { font-size: 13.5px; color: var(--text-muted); }
.card-ico { color: var(--accent); margin-bottom: 14px; }
.card-foot { margin-top: 14px; font-size: 12.5px; }

.panel {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--panel-2);
}
.panel-body { padding: 16px; }

.note {
  border: 1px solid var(--border); border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm); background: var(--bg-subtle);
  padding: 14px 16px; font-size: 13.5px; color: var(--text-muted);
}
.note strong { color: var(--text); font-weight: 600; }
.note-warn { border-left-color: var(--warn); }
.note-danger { border-left-color: var(--danger); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px;
  border-radius: 4px; border: 1px solid var(--border); background: var(--panel-2);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
}
.badge-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.badge-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.badge-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.badge-accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* --- code ---------------------------------------------------------------- */
.code {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-subtle); overflow: hidden;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 8px 7px 12px; border-bottom: 1px solid var(--border); background: var(--panel-2);
}
.code-head .eyebrow { letter-spacing: .1em; }
.code pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65;
  color: var(--text); tab-size: 2;
}
.code pre code { font: inherit; }
code { font-family: var(--font-mono); font-size: .92em; }
p code, li code, td code {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 4px; padding: .5px 4px;
}

/* token colours — hand-applied in the markup, no highlighter runs at runtime */
.t-key { color: var(--accent); }
.t-str { color: var(--ok); }
.t-num { color: var(--warn); }
.t-com { color: var(--text-faint); font-style: normal; }
.t-fn  { color: var(--text); }
.t-pun { color: var(--text-muted); }

.copy {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 4px; background: var(--panel);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  transition: background .15s, color .15s;
}
.copy:hover { background: var(--panel-hover); color: var(--text); }
.copy[data-copied="1"] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }

/* --- tabs ---------------------------------------------------------------- */
.tabs { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.tablist { display: flex; overflow-x: auto; border-bottom: 1px solid var(--border); background: var(--panel-2); scrollbar-width: none; }
.tablist::-webkit-scrollbar { display: none; }
.tablist button {
  padding: 9px 14px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color .15s, border-color .15s;
}
.tablist button:hover { color: var(--text); }
.tablist button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabpanel { padding: 0; }
.tabpanel[hidden] { display: none; }
.tabpanel pre { padding: 18px 18px 20px; margin: 0; overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; }
.tab-foot { border-top: 1px solid var(--border); padding: 10px 16px; font-size: 12.5px; color: var(--text-faint); background: var(--panel-2); }

/* --- tables -------------------------------------------------------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.t th, table.t td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t thead th {
  position: sticky; top: 0; background: var(--panel-2); z-index: 1;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 500; white-space: nowrap;
}
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--panel-2); }
table.t td:first-child, table.t th:first-child { position: sticky; left: 0; background: var(--panel); }
table.t thead th:first-child { background: var(--panel-2); z-index: 2; }
table.t tbody tr:hover td:first-child { background: var(--panel-2); }
table.t .col-us { color: var(--text); }
table.t td.mono, table.t th.mono { font-family: var(--font-mono); font-size: 12px; }
.y { color: var(--ok); }
.n { color: var(--text-faint); }
.p { color: var(--warn); }
.scroll-hint { font-size: 12px; color: var(--text-faint); margin-top: 8px; }

/* --- stat rail ----------------------------------------------------------- */
.rail { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rail div { padding: 16px 18px; border-right: 1px solid var(--border); background: var(--panel); }
.rail div:last-child { border-right: 0; }
.rail .n-big { font-family: var(--font-mono); font-size: clamp(20px, 2.6vw, 26px); letter-spacing: -.02em; color: var(--text); }
.rail .n-lab { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
@media (max-width: 720px) {
  .rail { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .rail div:nth-child(2) { border-right: 0; }
  .rail div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

/* --- hero ---------------------------------------------------------------- */
.hero { position: relative; padding-top: clamp(44px, 6vw, 84px); padding-bottom: 0; overflow: hidden; }
.hero-bg {
  position: absolute; inset: -20% -10% auto -10%; height: 900px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(58% 42% at 22% 8%, color-mix(in srgb, var(--accent) 13%, transparent) 0%, transparent 62%),
    radial-gradient(46% 38% at 82% 0%, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 60%);
  filter: blur(2px);
}
.hero-grid {
  position: absolute; inset: 0 0 auto 0; height: 720px; 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: 56px 56px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}
.grain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 1040px) { .hero-inner { grid-template-columns: minmax(0,1fr); } }
.hero h1 { margin-top: 14px; }
.hero h1 .h1-2 { display: block; color: var(--text-muted); }
.hero .lead { margin-top: 18px; font-size: clamp(15.5px, 1.5vw, 17.5px); }
.hero-cta { margin-top: 26px; }
.hero-install { margin-top: 26px; max-width: 560px; }
.hero-install .code pre { font-size: 12.5px; padding: 12px 14px; }
.hero-note { margin-top: 10px; font-size: 12.5px; color: var(--text-faint); }

/* --- the tilted studio deck (CSS 3D) ------------------------------------- */
.stage { perspective: 1800px; perspective-origin: 60% 30%; padding-block: 10px 40px; }
.deck {
  position: relative;
  transform-style: preserve-3d;
  transform:
    rotateX(calc(11deg + var(--py, 0) * -4deg))
    rotateY(calc(-15deg + var(--px, 0) * 5deg))
    rotateZ(1.2deg);
  transition: transform .35s cubic-bezier(.2,.7,.3,1);
  will-change: transform;
}
.deck-window {
  border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden;
  background: var(--panel); box-shadow: var(--shadow-deck);
}
.deck-window svg { width: 100%; height: auto; }
.deck-back {
  position: absolute; inset: 0; border-radius: 8px; z-index: -1;
  border: 1px solid var(--border); background: var(--panel-2);
  transform: translateZ(-70px) translate(38px, 34px) scale(.985);
  opacity: .55;
}
.deck-back2 {
  position: absolute; inset: 0; border-radius: 8px; z-index: -2;
  border: 1px solid var(--border); background: var(--bg-subtle);
  transform: translateZ(-140px) translate(76px, 68px) scale(.97);
  opacity: .32;
}
.deck-chip {
  position: absolute; z-index: 2; transform: translateZ(60px);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--panel);
  box-shadow: var(--shadow-pop); font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
}
.deck-chip.c1 { left: -14px; top: 22%; }
.deck-chip.c2 { right: -10px; bottom: 16%; }
@media (max-width: 1040px) {
  .stage { perspective: none; padding-top: 34px; }
  .deck { transform: none; }
  .deck-back, .deck-back2, .deck-chip { display: none; }
}

/* --- architecture diagram ------------------------------------------------ */
.arch { display: grid; grid-template-columns: minmax(0,1fr) 64px minmax(0,1fr); gap: 0; align-items: stretch; }
@media (max-width: 860px) { .arch { grid-template-columns: minmax(0,1fr); } .arch-vs { padding-block: 18px; } }
.arch-side { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 18px; }
.arch-side h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.arch-side h3 span { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); font-weight: 400; }
.arch-side > p { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.arch-vs { display: flex; align-items: center; justify-content: center; }
.arch-vs span { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); letter-spacing: .1em; }
.boxes { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.boxes b {
  display: block; font-family: var(--font-mono); font-size: 10.5px; font-weight: 400;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px;
  background: var(--panel-2); padding: 8px 6px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  animation: box-in .5s both;
}
.reveal .boxes b { animation-play-state: paused; }
.reveal.is-in .boxes b { animation-play-state: running; }
@keyframes box-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.two-up { display: grid; gap: 8px; }
.two-box {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--panel-2); padding: 12px 14px;
}
.two-box .tb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.two-box b { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }
.two-box ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.two-box li { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 3px; padding: 2px 5px; background: var(--panel); }

/* --- feature grid -------------------------------------------------------- */
.feat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.feat-grid > a { background: var(--panel); padding: 22px 20px 20px; transition: background .15s; }
.feat-grid > a:hover { background: var(--panel-2); }
@media (max-width: 900px) { .feat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 600px) { .feat-grid { grid-template-columns: minmax(0,1fr); } }

/* --- figures ------------------------------------------------------------- */
.figure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.figure img, .figure svg { width: 100%; height: auto; display: block; background: var(--sv-bg); }
.figure figcaption { border-top: 1px solid var(--border); padding: 10px 14px; font-size: 12.5px; color: var(--text-faint); background: var(--panel-2); }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--gap); }
@media (max-width: 760px) { .shots { grid-template-columns: minmax(0,1fr); } }

/* --- security flow ------------------------------------------------------- */
.flow-legend { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0,1fr)); margin-top: 18px; }
@media (max-width: 760px) { .flow-legend { grid-template-columns: minmax(0,1fr); } }
.flow-legend div { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--panel); }
.flow-legend b { font-family: var(--font-mono); font-size: 12px; display: block; margin-bottom: 3px; }
.flow-legend p { font-size: 12.5px; color: var(--text-muted); }

/* --- logo marks ---------------------------------------------------------- */
.marks { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.marks > * { background: var(--panel); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.marks .m-ico { color: var(--text); opacity: .9; }
.marks b { font-size: 13.5px; font-weight: 600; }
.marks p { font-size: 12.5px; color: var(--text-muted); }
@media (max-width: 900px) { .marks { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .marks { grid-template-columns: minmax(0,1fr); } }

/* --- steps --------------------------------------------------------------- */
.steps { counter-reset: s; display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.steps > li { background: var(--panel); padding: 18px 20px 18px 58px; position: relative; list-style: none; }
.steps > li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 20px; top: 18px;
  width: 22px; height: 22px; border-radius: 4px;
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: 11px; display: grid; place-items: center;
}
.steps h3 { margin-bottom: 4px; }
.steps p { font-size: 13.5px; color: var(--text-muted); }

/* --- FAQ ----------------------------------------------------------------- */
.faq { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  padding: 15px 18px; cursor: pointer; font-weight: 500; font-size: 14.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--text-faint); flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { background: var(--panel-2); }
.faq .faq-body { padding: 0 18px 16px; font-size: 13.5px; color: var(--text-muted); }
.faq .faq-body > * + * { margin-top: 10px; }

/* --- CTA ----------------------------------------------------------------- */
.cta { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: clamp(26px, 4vw, 46px); text-align: left; position: relative; overflow: hidden; }
.cta::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 120% at 88% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%);
}
.cta > * { position: relative; }
.cta .row { margin-top: 22px; }

/* --- footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 48px 28px; background: var(--bg-subtle); }
.f-grid { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(0,1fr)); gap: 32px; }
@media (max-width: 900px) { .f-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .f-grid { grid-template-columns: minmax(0,1fr); } }
.f-blurb { font-size: 13px; color: var(--text-muted); margin-top: 12px; max-width: 44ch; }
.f-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 12px; }
.f-col { display: flex; flex-direction: column; gap: 7px; }
.f-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); font-weight: 500; margin-bottom: 3px; }
.f-col a { font-size: 13px; color: var(--text-muted); width: fit-content; }
.f-col a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.f-bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); }
.f-bottom p { font-size: 11.5px; color: var(--text-faint); }

/* --- scroll reveal ------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.3,1); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .06s; }
.reveal-d2 { transition-delay: .12s; }
.reveal-d3 { transition-delay: .18s; }

/* --- SVG animation hooks (CSS, so reduced-motion can stop them) ---------- */
.anim-dash { stroke-dasharray: 5 7; animation: dash 1.6s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -24; } }
.anim-pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.anim-blink { animation: pulse 1.6s steps(2, jump-none) infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .deck { transform: rotateX(11deg) rotateY(-15deg) rotateZ(1.2deg); }
  .anim-pulse, .anim-blink { opacity: 1; }
}

/* --- additions used by the pages ---------------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* A provider mark standing alone in a card, rather than inside the .marks grid. */
.card > .m-ico { color: var(--accent); margin-bottom: 2px; }
.card > .badge + h3 { margin-top: 12px; }
/* Anchor chips in the "on this page" row. */
a.badge { transition: color .15s, border-color .15s, background .15s; }
a.badge:hover { color: var(--text); border-color: var(--border-strong); background: var(--panel-hover); }
/* Inlined drawings carry width/height attributes; the container decides. */
.figure svg, .deck-window svg { width: 100%; height: auto; }
/* Two-up variant of the stat rail: the right-hand cell of each row owns no
   border, so it does not double up with the container's own. */
.rail-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rail-2 div:nth-child(2n) { border-right: 0; }
.rail-2 div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
