/* Hapimatic public site — shared layout for the design prototypes (issue #4542, epic #4539).
   Builds ONLY on the brand tokens in hapimatic-dark.css (load it first). Dark-only: no light-mode
   variant is defined anywhere in this file. Script-free and deployable under the gateway's
   LANDING_CSP (gateway/src/routes/landing.ts:13-14): no inline script, no external origin. The one
   webfont, Inter (SIL OFL 1.1, licence in Inter-OFL.txt), is self-hosted beside this file (#4768).

   Design v2 (#4768, from the operator's mockup review of 2026-10-05/06): deep purple #1e0a3e as a
   minor accent beside mint (keylines, icon tiles, the hero glow, the add-on band), the W11 wordmark
   as an image (the one-shot bridge in the header, the still in the footer), the device glyphs, and
   the CSS :target lightboxes.

   Contrast rules carried from the research fixtures (README has the full table):
   - text on a mint fill is --hb-mint-deep (#0c3327, 8.79:1); white on mint fails (1.57:1);
   - --hb-muted (#8e8e93) is used only on --hb-bg / --hb-deepest, never as normal-size text on
     --hb-surface (4.27:1 there), where the fine print uses --hb-text-secondary instead. */

/* Inter, self-hosted (#4768): Latin-subset variable fonts (wght 100-900, opsz 14-32) cut from the
   official Inter 4.1 release. The URLs are relative to this stylesheet, so the same file works at
   /site-assets/site.css and in docs/public-site/design/assets/. */
@font-face {
  font-family: "Inter";
  src: url("inter-latin-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("inter-latin-var-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  /* The second brand colour (#4768). Deep purple is the app's own theme colour (web/vite.config.ts
     theme_color); grape is the app icon's purple; violet is the existing --hb-violet. Mint keeps its
     one meaning (a live session, an action); purple means the platform: the mesh, the hosted service,
     the paid add-ons. */
  --hb-purple-deep: #1e0a3e;
  --hb-purple: #3b1578;
  --hb-purple-ink: #14062b;
  --hb-violet-line: rgba(167, 139, 250, 0.36);
  /* Safe-area insets (iPhone 16: 59px top / 34px bottom in standalone or viewport-fit=cover). */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --header-h: 60px;
  color-scheme: dark;
}

/* scroll-padding keeps a focused element or an anchor target clear of the sticky header on Tab and
   Shift+Tab (WCAG 2.2 SC 2.4.11, #4689). */
html { background: var(--hb-bg); scroll-padding-top: calc(var(--header-h) + var(--safe-top) + 12px); }

/* Reduced motion (erratum T5 + R5): the copied tokens set smooth scrolling unconditionally. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Motion layer (#4769). The rules are in docs/public-site/design/README.md ("The motion rules"):
   every page ships its still frames, and motion.js sets <html data-motion="on"> only when reduced
   motion is off and the visit is not paused, so with no script nothing moves (WCAG 2.2.2). */
#ambient { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main, .site-footer { position: relative; z-index: 1; }
.anim { display: none; }
[data-motion="on"] .anim { display: inline; }
[data-motion="on"] .still { display: none; }
@media (prefers-reduced-motion: reduce) {
  .anim { display: none !important; }
  .still { display: inline !important; }
}
/* The one pause control: fixed in the lower-right corner, so it never crowds the phone header
   (a header button overran it at 320 and 393 px); hidden until motion.js has motion to pause. */
.motion-toggle {
  position: fixed; z-index: 30; right: max(12px, calc(var(--safe-right) + 8px)); bottom: max(12px, calc(var(--safe-bottom) + 8px));
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
  color: var(--hb-text); background: rgba(16, 16, 20, 0.82); border: 1px solid var(--hb-line-strong); border-radius: 50%;
  cursor: pointer; transition: border-color 0.15s ease;
}
.motion-toggle[hidden] { display: none; }
.motion-toggle:hover { border-color: var(--hb-violet); }
.motion-toggle:focus-visible { border-radius: 50%; }
.motion-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.motion-toggle .i-play, .motion-toggle[aria-pressed="true"] .i-pause { display: none; }
.motion-toggle[aria-pressed="true"] .i-play { display: inline; }
html { scroll-padding-bottom: calc(40px + 24px + var(--safe-bottom)); }

body { font-size: 15.5px; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
h1, h2, h3 { text-wrap: balance; }
p, dd, li { text-wrap: pretty; }

/* Prose links are underlined (erratum T5): mint on body text is 1.07:1, so colour alone fails SC 1.4.1. */
p a, li a, dd a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

/* One visible focus ring for every interactive element (R5). */
:focus-visible { outline: 2px solid var(--hb-mint); outline-offset: 3px; border-radius: var(--hb-r-sm); }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--hb-mint); color: var(--hb-mint-deep); font-weight: 700;
  padding: 10px 14px; border-radius: var(--hb-r-md); text-decoration: none;
}
.skip-link:focus { top: calc(8px + var(--safe-top)); text-decoration: none; }

.wrap {
  max-width: var(--hb-maxw); margin: 0 auto;
  padding-left: max(var(--hb-gutter), var(--safe-left));
  padding-right: max(var(--hb-gutter), var(--safe-right));
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  padding-top: var(--safe-top);
  background: rgba(28, 28, 30, 0.88);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--hb-line);
}
.site-header .wrap { display: flex; align-items: center; gap: 22px; height: var(--header-h); }

/* Live-text wordmark, matching the #2751 sign-in landing (.logo: white fill, mint stroke, mint glow). */
.wordmark {
  font-weight: 800; font-size: 21px; letter-spacing: 1px; color: var(--hb-text);
  -webkit-text-stroke: 0.6px var(--hb-mint);
  text-shadow: 0 0 10px rgba(90, 230, 171, 0.45);
  text-decoration: none; line-height: 1;
}
.wordmark:hover { text-decoration: none; }
/* The W11 wordmark as an image (#4768): the one-shot bridge in the header (a <picture> whose
   reduced-motion source is the still T2 frame), the W14 still in the footer. */
.wordmark.wm-img { display: inline-flex; align-items: center; text-shadow: none; -webkit-text-stroke: 0; }
.wordmark.wm-img img { display: block; height: 38px; width: auto; }
.site-footer .wordmark.wm-img img { height: 30px; }

/* GitHub mark in the header (#4768): the mark alone, as on the reference sites. */
.gh {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  color: var(--hb-text); text-decoration: none; font-size: 14px; font-weight: 600;
  border: 1px solid var(--hb-line-strong); border-radius: var(--hb-r-md); padding: 7px 9px;
  transition: border-color 0.15s ease;
}
.gh:hover { border-color: var(--hb-violet); text-decoration: none; }
.gh svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
/* Home's star count in the GitHub mark (#4772): hidden until stars.js shows it, at 100 or more.
   The [hidden] rule is needed because the inline-flex rule above it would otherwise override hidden. */
.gh .stars {
  display: inline-flex; align-items: center; gap: 5px; padding-left: 9px;
  border-left: 1px solid var(--hb-line-strong); color: var(--hb-text-secondary); font-weight: 500;
}
.gh .stars[hidden] { display: none; }
.gh .stars b { font-weight: 600; }
.gh .stars svg { width: 13px; height: 13px; fill: var(--hb-violet); }
/* 481–540 px: no room for the count beside the menu (measured at 481 px it ran 5 px into the right
   gutter with Inter and 21 px with a fallback face), so the mark shows alone. At 480 px and below the
   whole mark moves to the menu (the phones block below). */
@media (max-width: 540px) { .gh .stars { display: none; } }

.nav-desktop { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-desktop a, .menu-panel a {
  color: var(--hb-text-secondary); text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--hb-r-sm);
}
.nav-desktop a:hover, .menu-panel a:hover { color: var(--hb-text); background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.nav-desktop a[aria-current="page"], .menu-panel a[aria-current="page"] { color: var(--hb-text); }
.nav-desktop a[aria-current="page"]::after {
  content: ""; display: block; height: 2px; margin-top: 4px; border-radius: 2px; background: var(--hb-mint);
}

.signin {
  color: var(--hb-text); text-decoration: none; font-size: 14px; font-weight: 600;
  border: 1px solid var(--hb-line-strong); border-radius: var(--hb-r-md);
  padding: 7px 14px; white-space: nowrap; transition: border-color 0.15s ease;
}
.signin:hover { border-color: var(--hb-mint); text-decoration: none; }

/* Mobile menu: a <details> disclosure — keyboard-operable with no script. */
.menu { display: none; position: relative; }
.menu > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  color: var(--hb-text); font-size: 14px; font-weight: 600;
  border: 1px solid var(--hb-line-strong); border-radius: var(--hb-r-md); padding: 7px 11px;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary svg { width: 16px; height: 16px; }
.menu[open] > summary { border-color: var(--hb-mint); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 2 * var(--hb-gutter)));
  background: var(--hb-surface); border: 1px solid var(--hb-line-strong); border-radius: var(--hb-r-lg);
  padding: 8px; display: grid; gap: 2px;
}
.menu-panel a { color: var(--hb-text); font-size: 16px; padding: 12px 12px; }

@media (max-width: 820px) {
  .nav-desktop { display: none; }
  .header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  .menu { display: block; }
}
@media (min-width: 821px) { .header-actions { display: contents; } .gh { margin-left: 6px; } }
/* Phones (#4768): a smaller wordmark, and GitHub lives in the menu and the footer. */
@media (max-width: 480px) {
  .wordmark.wm-img img { height: 32px; }
  .gh { display: none; }
}
/* 320 px reflow (WCAG 1.4.10, #4689): with a wide fallback face (DejaVu Sans) the header overran a
   320 px viewport by 23 px. Must follow the 820px block so these win by source order. */
@media (max-width: 360px) {
  .site-header .wrap { gap: 8px; }
  .header-actions { gap: 6px; }
  .signin { padding-left: 8px; padding-right: 8px; }
  .menu > summary { padding-left: 8px; padding-right: 8px; }
  /* #4768: the image wordmark is 118 px wide at 32 px; at 28 px (103 px) the header fits a 305 px
     layout (320 px less a classic 15 px scrollbar) with DejaVu Sans as the fallback face (#4713). */
  .wordmark.wm-img img { height: 28px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15.5px; font-weight: 700; line-height: 1.2; text-decoration: none;
  padding: 13px 20px; border-radius: var(--hb-r-md); border: 1px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--hb-mint); color: var(--hb-mint-deep); }   /* R3: dark text on mint */
.btn-primary:hover { box-shadow: 0 0 0 4px rgba(90, 230, 171, 0.22); }      /* mint ring (token at alpha); no new colour */
.btn-secondary { background: transparent; color: var(--hb-text); border-color: var(--hb-line-strong); }
.btn-secondary:hover { border-color: var(--hb-mint); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
/* The interest button (#4901): one look for every call to action that opens the interest form, the
   envelope glyph before the label (.btn is inline-flex with an 8 px gap). The form's own styles are
   the last section of this file. */
.btn-interest svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Type helpers ---------- */
.eyebrow { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--hb-mint); font-weight: 600; margin: 0 0 10px; }
.lead { font-size: 18px; line-height: 1.55; color: var(--hb-text-secondary); max-width: 62ch; }
.fine { font-size: 13px; line-height: 1.5; color: var(--hb-text-secondary); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 56px; border-bottom: 1px solid var(--hb-line); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 38px; align-items: center; }
.hero h1 { font-size: clamp(32px, 8.4vw, 40px); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 18px; }
.hero .subline { font-size: 17.5px; line-height: 1.6; color: var(--hb-text-secondary); margin-bottom: 26px; max-width: 54ch; }
.hero .subline span { display: block; }
.hero .subline span + span { margin-top: 4px; }
.hero .certified { margin-top: 18px; font-size: 13px; color: var(--hb-muted); }
.hero-figure { margin: 0; }
.hero-figure img { display: block; width: 100%; height: auto; }

/* Inner-page hero */
.page-hero.with-figure .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 38px; align-items: center; }
.page-hero figure { margin: 0; }
.page-hero figure img { display: block; width: 100%; max-width: 360px; height: auto; margin-left: auto; }
.page-hero { padding: 54px 0 34px; }
.page-hero h1 { font-size: clamp(30px, 7.6vw, 40px); line-height: 1.12; letter-spacing: -0.02em; margin-bottom: 14px; }

/* ---------- Sections ---------- */
.page-hero + .section, .page-hero + .doc-layout { padding-top: 14px; }
.section { padding: 64px 0; border-bottom: 1px solid var(--hb-line); }
main > .section:last-child { border-bottom: 0; }   /* main's last CHILD only: pages mix div.section and section.section, so a per-tag selector also hit "Who it is for" (#4689) */
.section-head { max-width: 760px; margin-bottom: 30px; }
.section-head h2 { font-size: 25px; letter-spacing: -0.01em; margin-bottom: 10px; }
.section-head p { margin: 0; }

.beat.beat-wide { max-width: 880px; margin: 0 auto; text-align: center; font-size: 23px; }
.beat { font-size: 21px; line-height: 1.55; color: var(--hb-text); font-weight: 500; letter-spacing: -0.005em; max-width: 34em; margin: 0; }

.two-col { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); gap: 38px; align-items: start; }
.two-col .section-head { margin-bottom: 0; }
.section-foot { margin-top: 22px; }
.h-sm { font-size: 20px; margin: 0 0 14px; }
.block { display: block; margin-top: 6px; }
.after-panel { margin: 14px 0 0; }

/* Lists rendered as card grids */
.plain { list-style: none; margin: 0; padding: 0; }
.plain > li > .card-link { height: 100%; }

/* Install page */
.install-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 38px; align-items: start; }

/* Card grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card {
  background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--hb-r-lg);
  padding: 22px; display: flex; flex-direction: column; gap: 8px;
}
.card h3 { font-size: 16px; font-weight: 700; margin: 0; }
.card p { margin: 0; }
.card .idx { font-family: var(--hb-mono); font-size: 12px; color: var(--hb-mint); letter-spacing: 0.04em; }
.card-head { display: flex; align-items: baseline; gap: 12px; }
.card .note { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--hb-line); }
.card .card-foot { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.card-link { text-decoration: none; color: inherit; transition: border-color 0.15s ease; }
.card-link:hover { text-decoration: none; border-color: var(--hb-mint); }
.card-link .go { color: var(--hb-mint); font-weight: 600; font-size: 14px; }

/* Tags and pills (brand helpers + the availability pill) */
.tag-paid { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; padding: 3px 9px;
  border-radius: var(--hb-r-pill); color: var(--hb-text); background: var(--hb-raised); border: 1px solid var(--hb-line-strong); }
.pill-pilot { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  padding: 4px 11px; border-radius: var(--hb-r-pill); color: var(--hb-mint); background: var(--hb-mint-deep); border: 1px solid var(--hb-mint-dim); }
.pill-pilot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--hb-mint); }

/* Quiet framing blocks */
.panel { background: var(--hb-deepest); border: 1px solid var(--hb-line); border-radius: var(--hb-r-lg); padding: 28px; }

/* CTA band */
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.cta-band h2 { font-size: 25px; margin: 0 0 6px; }
.cta-band p { margin: 0; }

/* Install command block */
.cmd { background: var(--hb-deepest); border: 1px solid var(--hb-line-strong); border-radius: var(--hb-r-lg); overflow: hidden; }
.cmd-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 16px;
  border-bottom: 1px solid var(--hb-line); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hb-muted); font-weight: 600; }
.cmd pre { margin: 0; border: 0; border-radius: 0; background: transparent; padding: 18px 16px; }
.cmd code { font-size: 14.5px; color: var(--hb-text); user-select: all; -webkit-user-select: all; white-space: pre-wrap; word-break: break-word; }
.cmd .prompt { color: var(--hb-mint); user-select: none; -webkit-user-select: none; }
.cmd .placeholder { color: var(--hb-muted); }

/* Install: copy button (needs a same-origin script under LANDING_CSP; the code is select-all without it) */
.copy-btn {
  font: inherit; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
  color: var(--hb-text); background: transparent; cursor: pointer;
  border: 1px solid var(--hb-line-strong); border-radius: var(--hb-r-sm); padding: 4px 10px;
  transition: border-color 0.15s ease;
}
.copy-btn:hover { border-color: var(--hb-mint); }

/* Install: harness status table (statuses from docs/support-matrix.md via #4541) */
.table-card { background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--hb-r-lg); padding: 4px 18px 8px; }
.status-table caption { caption-side: top; text-align: left; color: var(--hb-text); font-weight: 700; padding: 14px 0 4px; }
.status-table thead th { color: var(--hb-text-secondary); }   /* token th colour (muted) is 4.27:1 on --hb-surface */
.status-table th[scope="row"] { color: var(--hb-text); font-weight: 700; white-space: nowrap; vertical-align: top;
  font-size: 15px; letter-spacing: 0; text-transform: none; }   /* row headers are harness names, not column labels */
.status-table td { vertical-align: top; }
.status-table tbody tr:last-child th, .status-table tbody tr:last-child td { border-bottom: 0; }
.tag-pending { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: var(--hb-r-pill);
  color: var(--hb-text); background: var(--hb-raised); border: 1px solid var(--hb-line-strong); }
.after-facts { margin: 14px 0 0; }

/* Home: add-ons footer row + the unheaded honest-lines panel */
.addon-foot { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.honest-panel p { margin: 0; max-width: 76ch; }

/* Definition list for "what runs it" */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 12px 22px; margin: 0; }
.facts dt { color: var(--hb-text); font-weight: 700; }
.facts dd { margin: 0; }

/* ---------- Long-form documents (Legal) ---------- */
.doc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 38px; align-items: start; padding-bottom: 64px; }
.toc { position: sticky; top: calc(var(--header-h) + var(--safe-top) + 22px); font-size: 13.5px; }
.toc p { margin: 0 0 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; color: var(--hb-text-secondary); text-decoration: none; padding: 5px 10px; border-left: 2px solid var(--hb-line); }
.toc a:hover { color: var(--hb-text); border-left-color: var(--hb-mint); text-decoration: none; }
.doc { max-width: 70ch; }
.doc h2 { font-size: 20px; margin: 2em 0 0.6em; scroll-margin-top: 4px; }   /* html scroll-padding already clears the header; 12 + 4 keeps the landing (#4689) */
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { line-height: 1.7; }
.doc code { word-break: break-word; }
.doc-meta { font-size: 13px; color: var(--hb-muted); margin: 0; }
.card .doc-meta { color: var(--hb-text-secondary); }   /* muted on --hb-surface is 4.27:1 — fails AA at 13px */
.back-link { display: inline-block; font-size: 14px; font-weight: 600; margin-bottom: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--hb-deepest); border-top: 1px solid var(--hb-line);
  padding: 28px 0 calc(22px + var(--safe-bottom)); font-size: 14px;   /* #4895: a shorter footer */
}
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 38px; align-items: center; }   /* #5004: the nav drops under the brand when one row cannot hold both, so the brand never shrinks */
.footer-brand { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; }   /* #4895: the logo sits beside the wordmark */
.footer-brand .wordmark { font-size: 19px; }
.byline { display: flex; align-items: center; gap: 8px; color: var(--hb-muted); font-size: 13px; text-decoration: none; }
.byline img { height: 22px; width: auto; opacity: 0.85; }
a.byline:hover { color: var(--hb-text); text-decoration: underline; }   /* #4895: the logo links solidpd.com */
.footer-nav { flex: 0 1 auto; min-width: 0; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: flex-end; }
.footer-nav a { color: var(--hb-text-secondary); text-decoration: none; display: inline-block; padding: 6px 0; }
.footer-nav a:hover { color: var(--hb-text); text-decoration: underline; }
.footer-legal { flex: 1 1 100%; border-top: 1px solid var(--hb-line); padding-top: 14px; margin: 0; font-size: 13px; color: var(--hb-muted);
  padding-right: calc(40px + var(--safe-right)); }   /* #4895: clear the fixed pause button at the page's end (below 1180 px and in landscape it covered the line's last words) */
/* #5004: tighter spacing from 900 px, so the brand and the nav share one row there; narrower tablets keep the
   usual spacing, with the nav on its own row under the brand. The block reaches 1039 px because the nine-link
   nav (Tour, #4905) needs it to 1035 px; from 1040 px the usual spacing holds one row */
@media (min-width: 900px) and (max-width: 1039px) {
  .footer-grid { column-gap: 22px; }
  .footer-brand { column-gap: 18px; }
  .footer-nav ul { column-gap: 10px; }
}

/* ---------- Design v2 (#4768) ---------- */
/* Hero: a low purple glow behind the fleet, and the four M1 lines as keylines. */
.hero-v2 { position: relative; z-index: 0; }
.hero-v2::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(620px 400px at 76% 44%, rgba(59, 21, 120, 0.42), transparent 72%),
    radial-gradient(520px 320px at 4% 0%, rgba(30, 10, 62, 0.6), transparent 70%);
}
.hero-v2 h1 { margin-bottom: 22px; }
.hero .keylines { margin-bottom: 28px; }
.hero .keylines span {
  position: relative; display: block; padding: 0 0 0 24px; font-style: italic; color: var(--hb-text);
  font-size: 17px; line-height: 1.45;
}
.hero .keylines span + span { margin-top: 13px; }
.hero .keylines span::before {          /* the session tile from the fleet diagram, as the marker */
  content: ""; position: absolute; left: 2px; top: 0.5em; width: 9px; height: 9px;
  background: var(--hb-mint); transform: scaleY(0.58) rotate(45deg); box-shadow: 0 0 10px rgba(90, 230, 171, 0.55);
}
.hero .certified .block { margin-top: 3px; }

/* Second beat: two statements, each with an icon tile. */
.beat-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 46px; }
.beat-block { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 16px; align-items: start; padding-top: 20px; border-top: 1px solid transparent; border-image: linear-gradient(90deg, var(--hb-mint), rgba(167, 139, 250, 0.7) 45%, transparent) 1; }
.beat-block .beat { font-size: 19px; max-width: none; }

/* Icon tiles: line icons in a deep purple tile; mint strokes, violet for the second meaning. */
.beat-ico, .card-icon, .addon-icon {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: linear-gradient(160deg, #2c1560, var(--hb-purple-deep)); border: 1px solid var(--hb-violet-line);
}
.beat-ico { margin-top: 3px; }
.beat-ico svg, .card-icon svg, .addon-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--hb-mint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.beat-ico svg .v, .card-icon svg .v, .addon-icon svg .v { stroke: var(--hb-violet); }
.card-v2 .card-head { align-items: center; gap: 12px; }
.card-v2 .card-icon { width: 34px; height: 34px; border-radius: 9px; }
.card-v2 .card-icon svg { width: 19px; height: 19px; }
.card .fineprint { font-size: 11.6px; font-style: italic; line-height: 1.5; }
.punch { margin-top: 12px; font-weight: 700; }

/* "See it working": the interface in three frames; each opens full size in a lightbox. */
.ui-stage { position: relative; padding-bottom: 54px; }
.ui-stage a { display: block; color: inherit; text-decoration: none; }
.ui-stage a:hover { outline: 2px solid var(--hb-violet); outline-offset: 3px; }
.frame-desktop {
  width: min(100%, 760px); border: 1px solid var(--hb-line-strong); border-radius: 12px; overflow: hidden; background: #111113;
  box-shadow: 0 34px 90px -34px rgba(59, 21, 120, 0.95), 0 0 0 1px rgba(167, 139, 250, 0.1);
}
.frame-bar { height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-bottom: 1px solid var(--hb-line); }
.frame-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--hb-raised); }
.frame-tablet {
  position: absolute; right: 12%; bottom: 10px; width: 300px; border-radius: 22px; padding: 10px; background: #0b0b0c;
  border: 1px solid var(--hb-line-strong); box-shadow: 0 30px 70px -26px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(167, 139, 250, 0.12);
}
.frame-phone {
  position: absolute; right: 0; bottom: 0; z-index: 2; width: 158px; border-radius: 26px; padding: 7px; background: #0b0b0c;
  border: 1px solid var(--hb-line-strong); box-shadow: 0 30px 70px -26px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(167, 139, 250, 0.12);
}
/* A generated image fills its frame exactly: desktop 16:10, iPad 9 3:4, iPhone 16 393:852. */
.slot { position: relative; display: block; aspect-ratio: 1440 / 900; background: #1c1c1e; }
.slot-tablet { aspect-ratio: 768 / 1024; border-radius: 12px; overflow: hidden; }
.slot-phone { aspect-ratio: 393 / 852; border-radius: 23px; overflow: hidden; }
.slot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* Device glyphs on the "One app" card: each opens its lightbox. */
.card-media.devices { display: flex; flex-wrap: wrap; margin-top: 16px; gap: 22px; align-items: flex-end; }
.dev { display: grid; justify-items: center; gap: 8px; color: var(--hb-text-secondary); text-decoration: none; font: 600 11px/1 var(--hb-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.dev svg { fill: none; stroke: var(--hb-mint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.dev svg .v { stroke: var(--hb-violet); stroke-width: 2.4; opacity: 0.8; }
.dev-desk svg { width: 150px; height: 95px; } .dev-tab svg { width: 62px; height: 81px; } .dev-phone svg { width: 36px; height: 72px; }
.dev:hover { color: var(--hb-text); text-decoration: none; } .dev:hover svg { filter: drop-shadow(0 0 8px rgba(90, 230, 171, 0.45)); }

/* Lightboxes: CSS :target only, so no script under the site CSP; the close link returns to the
   showcase. They sit after </main> so main's last child stays a .section (#4689 S4). */
.lightbox { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 28px; background: rgba(10, 10, 12, 0.92); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lightbox:target { display: grid; }
/* While a lightbox is open, the page behind it leaves the tab order and the accessibility tree, so
   keyboard focus cannot move under the overlay (WCAG 2.2 SC 2.4.11). Closing restores it. */
body:has(.lightbox:target) > :not(.lightbox:target) { visibility: hidden; }
.lightbox figure { margin: 0; max-width: min(1400px, 100%); max-height: 100%; display: grid; gap: 12px; justify-items: center; position: relative; z-index: 1; pointer-events: none; }   /* #4904: a click on the image or caption falls through to .lb-surface */
.lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 110px); width: auto; height: auto; border-radius: 12px; border: 1px solid var(--hb-line-strong); box-shadow: 0 40px 120px -40px rgba(59, 21, 120, 1); }
.lightbox figcaption { color: var(--hb-text-secondary); font-size: 14px; }
/* #4904: a link to the box's return anchor under the whole overlay, so a click anywhere closes it
   without a script; aria-hidden and out of the tab order, so the X stays the one control. */
.lb-surface { position: absolute; inset: 0; z-index: 0; cursor: zoom-out; -webkit-tap-highlight-color: transparent; }
.lb-close { position: absolute; top: 14px; right: 18px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 2px solid var(--hb-text); border-radius: 50%; background: rgba(10, 10, 12, 0.6); font: 300 28px/1 var(--hb-font); color: var(--hb-text); text-decoration: none; }   /* #4904: the X in a circle */
.lb-close:hover { color: var(--hb-mint); border-color: var(--hb-mint); text-decoration: none; }
.lb-close:focus-visible { outline: 2px solid var(--hb-mint); outline-offset: 3px; }

/* "See it working" closes with the link to the tour page (#4770). */
.ui-more { margin: 18px 0 0; font-weight: 600; }

/* The tour page (#4770): every view in a static tablet frame, in a grid; each opens its lightbox. */
.tour { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 24px; }
.tour.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tour.two { grid-template-columns: repeat(2, minmax(0, 260px)); }
.tour figure { margin: 0; display: grid; gap: 12px; align-content: start; }
.tour a { display: block; color: inherit; text-decoration: none; }
.tour .frame-tablet { position: static; display: block; width: auto; margin: 0; }
.tour a:hover .frame-tablet { outline: 2px solid var(--hb-violet); outline-offset: 3px; }
.tour figcaption { color: var(--hb-text-secondary); font-size: 14px; text-align: center; }

/* Paid add-ons: their own band, in the platform colour. */
.addons-v2 {
  background: linear-gradient(180deg, rgba(30, 10, 62, 0.78), rgba(30, 10, 62, 0.4));
  border-top: 1px solid var(--hb-violet-line); border-bottom: 1px solid var(--hb-violet-line);
}
.addon-card { background: rgba(20, 6, 43, 0.82); border-color: var(--hb-violet-line); gap: 10px; }
.addon-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.addon-card .tag-paid { background: var(--hb-purple); border-color: var(--hb-violet-line); }
.addon-card h3 { font-size: 19px; }
.addon-card h3 a { color: inherit; text-decoration: none; }   /* #4907: the title links to the add-on's page */
.addon-card h3 a:hover { color: var(--hb-mint); text-decoration: underline; text-underline-offset: 3px; }
.addon-card h3 a:focus-visible { outline: 2px solid var(--hb-mint); outline-offset: 3px; border-radius: 4px; }
.addon-card-current { border-color: var(--hb-mint); }   /* #4907: the current page's card, where the cards close an add-on page */
.addon-points { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 7px; font-size: 14px; color: var(--hb-text-secondary); }
.addon-points li { position: relative; padding-left: 17px; }
.addon-points li::before { content: ""; position: absolute; left: 1px; top: 0.55em; width: 7px; height: 7px; background: var(--hb-violet); transform: scaleY(0.58) rotate(45deg); }

/* Add-on figures: still frames (#4768); their motion and its pause control are #4769's. */
.addon-viz { border: 1px solid var(--hb-line); border-radius: 10px; background: rgba(0, 0, 0, 0.28); padding: 8px 6px; }
.addon-viz svg { display: block; width: 100%; height: auto; }
.addon-viz .rail { fill: none; stroke: rgba(255, 255, 255, 0.2); stroke-width: 1.2; }
.addon-viz .rail.v { stroke: rgba(167, 139, 250, 0.6); stroke-dasharray: 3 3; }
.addon-viz .st circle, .addon-viz .st rect { fill: var(--hb-purple-deep); stroke: var(--hb-violet); stroke-width: 1.2; }
.addon-viz .st2 { fill: var(--hb-purple-deep); stroke: var(--hb-violet); stroke-width: 1.2; }
.addon-viz .pm { fill: var(--hb-purple); stroke: var(--hb-violet); stroke-width: 1.2; }
.addon-viz .lb text { font: 600 8.5px var(--hb-mono); fill: var(--hb-text-secondary); text-anchor: middle; }
.addon-viz .num text { font: 700 9.5px var(--hb-font); fill: #fff; text-anchor: middle; }
.addon-viz .t { font: 600 8.5px var(--hb-font); fill: #fff; text-anchor: middle; }
.addon-viz .evd rect { fill: rgba(12, 51, 39, 0.9); stroke: rgba(90, 230, 171, 0.5); stroke-width: 1; }
.addon-viz .evd text { font: 500 8px var(--hb-mono); fill: var(--hb-text-secondary); text-anchor: middle; }
.addon-viz .tok-ring { fill: none; stroke: var(--hb-mint); stroke-width: 1.8; }
.addon-viz .tok { fill: var(--hb-mint); }
.addon-viz .tok.v { fill: var(--hb-violet); }
.addon-viz .scr { fill: #0b1210; stroke: rgba(90, 230, 171, 0.4); stroke-width: 1; }
.addon-viz .grd { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 1; }
.addon-viz .wave { fill: none; stroke: var(--hb-mint); stroke-width: 2; stroke-linecap: round; }
.addon-viz .probe-l { fill: none; stroke: rgba(90, 230, 171, 0.6); stroke-width: 1.2; stroke-dasharray: 3 3; }

/* A drawn circuit board (the Hardware Bench figure). */
.pcbg * { vector-effect: non-scaling-stroke; }
.pcbg .bd { fill: #0d2a21; stroke: #2f9c74; stroke-width: 1.4; }
.pcbg .tr { fill: none; stroke: #2f9c74; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.pcbg .ic { fill: #17171a; stroke: #a78bfa; stroke-width: 1.2; }
.pcbg .pin { fill: none; stroke: #cfd3d6; stroke-width: 1.3; }
.pcbg .pad { fill: #cfd3d6; }
.pcbg .via { fill: #0d2a21; stroke: #cfd3d6; stroke-width: 1; }
.pcbg .tp { fill: #0d2a21; stroke: #5ae6ab; stroke-width: 1.5; }
.pcbg .cn { fill: #2c2c2e; stroke: #8e8e93; stroke-width: 1; }
.pcbg .ps { fill: #3a3a3e; stroke: #8e8e93; stroke-width: 0.8; }
.pcbg .hole { fill: #14062b; stroke: #cfd3d6; stroke-width: 1.1; }
.pcbg .silk { font: 700 6.5px var(--hb-mono); fill: rgba(255, 255, 255, 0.8); }
.pcbg .led { fill: #5ae6ab; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .install-grid, .two-col { grid-template-columns: 1fr; gap: 22px; }
  .page-hero.with-figure .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .doc-layout { grid-template-columns: 1fr; gap: 22px; }
  .toc { position: static; }
  .beat-pair { grid-template-columns: 1fr; }
  /* .ui-stage-scoped so it outranks .ui-stage a { display: block } (0,1,1); without it the two frames stacked and overlapped (F1, #4768 → #4769). */
  .ui-stage .frame-tablet, .ui-stage .frame-phone { position: relative; right: auto; bottom: auto; display: inline-block; vertical-align: bottom; margin: -56px 0 0 4%; }
  .frame-tablet { width: 46%; } .frame-phone { width: 24%; }
  .tour, .tour.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .status-table th, .status-table td { padding: 10px 8px; }
  .table-card { padding: 4px 12px 6px; }
  :root { --header-h: 56px; }
  body { font-size: 15.5px; }
  .hero { padding: 38px 0 38px; }
  .hero .subline { font-size: 16.5px; }
  .page-hero { padding: 38px 0 22px; }
  .section { padding: 46px 0; }
  .beat { font-size: 18.5px; }
  .grid-2 { grid-template-columns: 1fr; gap: 10px; }
  .grid-3 { gap: 10px; }
  .card { padding: 18px; }
  .btn-row .btn { flex: 1 1 100%; }
  .hero-figure { margin: 6px calc(-1 * var(--hb-gutter)) 0; }
  .beat.beat-wide { font-size: 19px; text-align: left; }
  .page-hero.with-figure .wrap { grid-template-columns: 1fr; gap: 14px; }
  .page-hero figure img { margin: 0 auto; max-width: 300px; }
  .wordmark { font-size: 19px; }
  .footer-brand, .footer-nav { flex: 1 1 100%; }   /* #5004: each on its own row, as the one-column grid did */
  .footer-nav ul { justify-content: flex-start; }
  .facts { grid-template-columns: 1fr; gap: 4px; }
  .facts dd { margin-bottom: 10px; }
  .panel { padding: 22px; }
  .hero .keylines span { font-size: 16px; }
  .beat-block .beat { font-size: 17.5px; }
  .frame-phone { border-radius: 20px; padding: 5px; } .frame-tablet { border-radius: 14px; padding: 6px; }
  .slot-phone { border-radius: 18px; }
  .tour, .tour.four, .tour.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .tour .frame-tablet { padding: 5px; border-radius: 12px; } .tour .slot-tablet { border-radius: 8px; }
  .dev-desk svg { width: 110px; height: 70px; } .dev-tab svg { width: 46px; height: 60px; } .dev-phone svg { width: 27px; height: 54px; } .card-media.devices { gap: 16px; }
}

/* ---------- Case studies (/case-studies, 2026-10-16) ---------- */
/* Layout L1 (round 3): each study is a grid with ONE gap, so nothing sits flush on the block below it, and
   every block spans the same column. The .dg chart classes extend the diagram palette: amber = before,
   red = a limit, mint = after. */
.cs-hero .lead { margin-bottom: 22px; }
.cs-index { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cs-index a { display: grid; gap: 6px; align-content: start; padding: 18px; border: 1px solid var(--hb-line); border-radius: var(--hb-r-lg); background: var(--hb-deepest); color: inherit; text-decoration: none; height: 100%; }
.cs-index a:hover { border-color: var(--hb-mint); text-decoration: none; }
.cs-index .eyebrow { margin: 0; font-size: 11px; }
.cs-index b { font-size: 15.5px; line-height: 1.35; }
.cs-index span { font-size: 13.5px; color: var(--hb-text-secondary); }
.cs-loop { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 42px; align-items: start; }
.cs-n { font: 700 12px/34px var(--hb-mono); letter-spacing: 0.1em; color: var(--hb-mint); text-align: center; border: 1px solid var(--hb-line-strong); border-radius: 8px; height: 34px; }
.cs-body { display: grid; gap: 40px; }
.cs-head { display: grid; gap: 8px; max-width: 760px; }
.cs-head .eyebrow { margin: 0; }
.cs-head h2 { font-size: 27px; letter-spacing: -0.01em; margin: 0; }
.cs-head p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--hb-text-secondary); }
.ad-fig.cs-figure { margin: 0; width: 100%; max-width: none; min-width: 0; }  /* a grid item: without min-width 0 it grows to the phone-scroll SVG */
.cs-swipe { display: none; }
.cs-h3 { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--hb-mint); margin: 0 0 14px; font-weight: 700; }
.cs-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 40px; align-items: start; }
.cs-did { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.cs-did li { position: relative; padding-left: 20px; color: var(--hb-text-secondary); line-height: 1.58; font-size: 15.5px; }
.cs-did li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--hb-mint); }
.cs-did li b { color: var(--hb-text); }
.cs-result { background: var(--hb-deepest); border: 1px solid var(--hb-line); border-radius: var(--hb-r-lg); padding: 24px; }
.cs-stats { display: grid; gap: 15px; margin: 0; }
.cs-stat { display: grid; gap: 3px; }
.cs-stat dt { font-size: 13px; color: var(--hb-text-secondary); font-weight: 600; }
.cs-stat dd { margin: 0; font-size: 17.5px; font-weight: 700; color: var(--hb-text); line-height: 1.35; }
.cs-stat .from { color: var(--hb-text-secondary); font-weight: 500; }
.cs-stat .arrow { color: var(--hb-mint); margin: 0 7px; }
.cs-stat .note { font-size: 12.5px; font-weight: 500; color: var(--hb-muted); }
.cs-who { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--hb-line); font-size: 14px; line-height: 1.55; color: var(--hb-text-secondary); }
.cs-who b { color: var(--hb-text); }
.cs-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.cs-tools li { font: 600 10.5px/1.2 var(--hb-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--hb-text-secondary); border: 1px solid var(--hb-line-strong); border-radius: 999px; padding: 7px 10px; }
/* "From the bench": real captures from the engagements, one card each. */
.cs-ev-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-ev-grid.cs-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cs-ev-grid.cs-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-ev-grid.cs-cols-1 { grid-template-columns: minmax(0, 1fr); }
.cs-ev { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--hb-line-strong); border-radius: 12px; overflow: hidden; background: var(--hb-deepest); }
.cs-ev-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; cursor: zoom-in; }
.cs-ev-media:hover { text-decoration: none; }
.cs-ev-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.cs-ev-media.fit-contain img { object-fit: contain; }
.cs-ev-media:hover img { transform: scale(1.03); }
.cs-cols-1 .cs-ev-media { aspect-ratio: auto; }
.cs-cols-1 .cs-ev-media img { height: auto; }
.cs-ev-media.bg-dark { background: #111113; }
.cs-ev-media.bg-white { background: #ffffff; }
.cs-ev-media.bg-black { background: #000000; }
.cs-ev-media.bg-chart { background: #1b1b1d; }
.cs-ev-media.bg-paper { background: #f5f4ef; }
.cs-ev-media.bg-dash { background: #0d1117; }
.cs-ev-media.bg-pale { background: #d3d9df; }
.cs-ev figcaption { display: grid; gap: 6px; padding: 12px 14px 14px; font-size: 13.5px; line-height: 1.5; color: var(--hb-text-secondary); }
.cs-ev figcaption b { color: var(--hb-text); }
.cs-tag { justify-self: start; font: 700 10px/1 var(--hb-mono); letter-spacing: 0.12em; text-transform: uppercase; color: #0c3327; background: var(--hb-mint); border-radius: 4px; padding: 4px 6px; }
.cs-about p { margin: 0; max-width: 76ch; }
.dg .lim { fill: none; stroke: #f87171; stroke-width: 1.3; stroke-dasharray: 5 4; }
.dg .crv { fill: none; stroke: #a78bfa; stroke-width: 1.8; stroke-linecap: round; }
.dg .wave-b { fill: none; stroke: #f59e0b; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dg .wave-m { fill: none; stroke: #5ae6ab; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dg .tx-r { font: 600 10.5px var(--hb-mono); fill: #f87171; }
.dg .tx-a { font: 600 10.5px var(--hb-mono); fill: #f59e0b; }
.dg .tx-m { font: 600 10.5px var(--hb-mono); fill: #5ae6ab; }
.dg .bar-b { fill: rgba(245, 158, 11, 0.8); }
.dg .bar-m { fill: #5ae6ab; }
.dg .pt-b { fill: #f59e0b; }
.dg .pt-m { fill: #5ae6ab; }
.dg .bat { fill: none; stroke: #c7c7cc; stroke-width: 1.4; }
.dg .cap { fill: #c7c7cc; }
@media (max-width: 960px) {
  .cs-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-loop, .cs-split { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .cs-ev-grid, .cs-ev-grid.cs-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Phones: the figures keep a legible text size and scroll sideways inside their frame. */
@media (max-width: 560px) {
  .cs-index, .cs-ev-grid, .cs-ev-grid.cs-cols-4, .cs-ev-grid.cs-cols-2 { grid-template-columns: minmax(0, 1fr); }
  .cs-head h2 { font-size: 24px; }
  .cs-figure-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ad-fig.cs-figure .cs-figure-scroll svg { width: 640px; max-width: none; }  /* beats the later .ad-fig svg { width: 100% } */
  .cs-swipe { display: block; margin: 8px 2px 0; font: 600 10.5px/1.3 var(--hb-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--hb-mint); }
}

/* ---------- The paid add-on pages (#4771) ---------- */
/* The Story layout of /hosted/issue-workflow, /hosted/project-manager and /hosted/hardware-bench, ported from the
   mockup's addon-mock-v5.css (branch hapi-website-launch-design-work @ 10e1c67d1); its generic class names are
   under ad- here (.prompt would also have styled Install's command prompt). ORDER MATTERS: every .ad- grid rule
   comes first, then ONE 960 px block that stacks them all, then the 680 px block. A review round shipped a
   two-column rule after the phone block and no add-on page stacked on a phone; publicSite.test.ts guards the
   order. This section follows the responsive blocks above, so its 960 px block is not the file's first (#4769's
   test reads that one), and it restyles nothing in the header (#4713). */
.ad-hero { position: relative; z-index: 0; padding: 58px 0 50px; border-bottom: 1px solid var(--hb-line); }
.ad-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(640px 400px at 78% 40%, rgba(59, 21, 120, 0.45), transparent 72%); }
.ad-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 42px; align-items: center; }
.ad-hero h1 { font-size: clamp(34px, 7vw, 46px); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 16px; }
.ad-eyebrow { font: 600 11.5px/1.2 var(--hb-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--hb-violet); margin: 0 0 14px; }
.ad-eyebrow a { color: inherit; text-decoration: none; }
.ad-tag { display: inline-block; margin: 0 0 16px; padding: 7px 13px; border-radius: 9px; border: 1px solid rgba(90, 230, 171, 0.45); background: rgba(12, 51, 39, 0.6); color: var(--hb-mint); font-weight: 650; font-size: 15.5px; }
.ad-line { font-size: 21px; line-height: 1.4; color: var(--hb-text); font-weight: 500; margin: 0 0 12px; }
.ad-long { font-size: 16px; line-height: 1.65; color: var(--hb-text-secondary); margin: 0 0 24px; max-width: 58ch; }
.ad-long strong, .ad-long em { color: var(--hb-text); }
.ad-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

/* The add-on figures: inline SVG under the motion rules (the .anim and .still groups above). */
.ad-fig { margin: 0; border: 1px solid var(--hb-violet-line); border-radius: 16px; padding: 16px 16px 12px; background: linear-gradient(180deg, rgba(30, 10, 62, 0.86), rgba(20, 6, 43, 0.86)); }
.ad-fig svg { display: block; width: 100%; height: auto; }
.ad-fig-cap { font: 600 10.5px/1.3 var(--hb-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--hb-text-secondary); margin: 10px 2px 0; }
.dg .ln { fill: none; stroke: rgba(255, 255, 255, 0.24); stroke-width: 1.3; }
.dg .ln-v { fill: none; stroke: rgba(167, 139, 250, 0.6); stroke-width: 1.2; stroke-dasharray: 4 4; }
.dg .ln-m { fill: none; stroke: rgba(90, 230, 171, 0.5); stroke-width: 1.2; stroke-dasharray: 4 4; }
.dg .nd { fill: #1e0a3e; stroke: #a78bfa; stroke-width: 1.4; }
.dg .nd-m { fill: #0c3327; stroke: #5ae6ab; stroke-width: 1.4; }
.dg .nd-p { fill: #3b1578; stroke: #a78bfa; stroke-width: 1.4; }
.dg .cone { fill: rgba(90, 230, 171, 0.07); stroke: none; }
.dg .tx { font: 600 10.5px var(--hb-mono); fill: #c7c7cc; }
.dg .tx-s { font: 500 9.5px var(--hb-mono); fill: #c7c7cc; }
.dg .tx-b { font: 700 12.5px var(--hb-font); fill: #ffffff; }
.dg .tx-v { font: 600 10.5px var(--hb-mono); fill: #a78bfa; }
.dg .tok { fill: #5ae6ab; }
.dg .tok-v { fill: #a78bfa; }
.dg .wave { fill: none; stroke: #5ae6ab; stroke-width: 1.8; stroke-linecap: round; }
.dg .led { fill: #5ae6ab; }
.dg .scr { fill: #0b1210; stroke: rgba(90, 230, 171, 0.38); stroke-width: 1; }
.dg .grd { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 1; }
.dg .dig { font: 700 12px var(--hb-mono); fill: #5ae6ab; }
.dg .dig.s { font-size: 10px; fill: #c7c7cc; }
.dg .tm { fill: #5ae6ab; stroke: #0c3327; stroke-width: 1; }
.dg .tm.v { fill: #a78bfa; stroke: #1e0a3e; }
.dg .kn { fill: #a78bfa; }
.dg .mat { fill: rgba(167, 139, 250, 0.05); stroke: rgba(167, 139, 250, 0.34); stroke-width: 1; stroke-dasharray: 3 4; }
/* The label-flow figure: the repo's checkpoint labels and a stylised GitHub issue card (iss-). */
.dg.flow .fl-bg { fill: #2c2c2e; stroke: rgba(255, 255, 255, 0.14); stroke-width: 1; }
.dg.flow .fl-t { font: 600 10px var(--hb-font); fill: #8e8e93; }
.dg.flow .fl-t.on { fill: #0d1117; }
.dg.flow .fl-a { font: 600 9.5px var(--hb-mono); fill: #a78bfa; }
.dg.flow .fl-n { font: 500 8.5px var(--hb-mono); fill: #a1a1a6; }
.dg.flow .opt .fl-bg { stroke-dasharray: 3 3; }
.dg.flow .iss-badge.open { fill: #238636; }
.dg.flow .iss-badge.done { fill: #8957e5; }
.dg.flow .iss-bt { font: 700 7.5px var(--hb-font); fill: #fff; }
.dg.flow .iss-title { font: 600 8.5px var(--hb-font); fill: #e6edf3; }
.dg.flow .muted2 { fill: #9198a1; font-weight: 400; }
.dg.flow .iss-line { fill: #161b22; stroke: #30363d; stroke-width: 0.8; }
.dg.flow .iss-lt { font: 500 7.3px var(--hb-font); fill: #c9d1d9; }

/* One icon tile, beside the card headings and the steps. */
.ad-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex: none; background: linear-gradient(160deg, #2c1560, var(--hb-purple-deep)); border: 1px solid var(--hb-violet-line); }
.ad-icon svg { width: 19px; height: 19px; fill: none; stroke: var(--hb-mint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ad-icon svg .v { stroke: var(--hb-violet); }
.ad-values .card { gap: 12px; }
.ad-values .card-head { align-items: center; gap: 12px; }
.ad-values h3 { font-size: 17px; }

/* The steps beside the images; every second row flips. */
.ad-row { display: grid; grid-template-columns: minmax(0, 0.66fr) minmax(0, 1.34fr); gap: 46px; align-items: center; }
.ad-row.flip { grid-template-columns: minmax(0, 1.34fr) minmax(0, 0.66fr); }
.ad-row.tab-row { grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr); }
.ad-row.tab-row.flip { grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr); }
.ad-built .ad-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ad-row + .ad-row { margin-top: 64px; }
.ad-row.flip > :first-child { order: 2; }
.ad-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.ad-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; align-items: start; }
.ad-steps li > div { display: grid; gap: 3px; }
.ad-steps b { color: var(--hb-text); font-size: 16px; }
.ad-steps span { color: var(--hb-text-secondary); font-size: 14.5px; line-height: 1.55; }
.ad-built { background: linear-gradient(180deg, rgba(30, 10, 62, 0.5), transparent); }
.ad-p { font-size: 16px; line-height: 1.65; color: var(--hb-text-secondary); margin: 0 0 14px; max-width: 60ch; }
.ad-extra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 46px; }
.ad-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 42px; align-items: start; }
.ad-use { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 52px; align-items: center; }
.ad-second { margin-top: 40px; }

/* The images: a frame per device, each opening its :target lightbox. */
.ad-cap { margin: 0; }
.ad-cap .frame-desktop { width: 100%; }
.ad-cap .frame-tablet, .ad-cap .frame-phone { position: relative; right: auto; bottom: auto; margin: 0 auto; }
.ad-row.tab-row .ad-cap .frame-tablet { width: min(100%, 420px); }
.ad-use .ad-cap .frame-phone { width: min(100%, 290px); border-radius: 38px; padding: 10px; }
.ad-use .ad-cap .slot-phone { border-radius: 29px; }
.ad-cap-note { margin-top: 10px; font-size: 12.5px; color: var(--hb-text-secondary); text-align: center; }
.ad-extra .ad-cap-note { font-size: 12px; }
.ad-strip { max-width: 760px; margin: 46px auto 0; }
.frame-strip { border: 1px solid var(--hb-line-strong); border-radius: 12px; overflow: hidden; background: #1c1c1e; box-shadow: 0 24px 60px -30px rgba(59, 21, 120, 0.9); }
.frame-strip img { display: block; width: 100%; height: auto; }
.lb-open { display: block; color: inherit; text-decoration: none; border-radius: 12px; }
.lb-open:hover { outline: 2px solid var(--hb-violet); outline-offset: 3px; text-decoration: none; }
.ad-credit { margin: 22px 0 0; font-size: 12.5px; color: var(--hb-text-secondary); text-align: center; }

/* What it can do, and the prompts of a session. */
.ad-can { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ad-can li { position: relative; padding-left: 20px; font-size: 15px; color: var(--hb-text-secondary); }
.ad-can li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 8px; height: 8px; background: var(--hb-mint); transform: scaleY(0.58) rotate(45deg); }
.ad-prompt { border: 1px solid var(--hb-line-strong); border-radius: var(--hb-r-lg); background: var(--hb-deepest); overflow: hidden; }
.ad-prompt-head { padding: 10px 14px; border-bottom: 1px solid var(--hb-line); font: 600 11px var(--hb-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--hb-muted); }
.ad-prompt ol { list-style: none; margin: 0; padding: 14px; display: grid; gap: 10px; font: 500 14px/1.5 var(--hb-mono); color: var(--hb-text); }
.ad-prompt li { position: relative; padding-left: 18px; }
.ad-prompt li::before { content: "›"; position: absolute; left: 0; color: var(--hb-mint); font-weight: 700; }

/* The closing band: the paywall stated again. */
.ad-band { background: linear-gradient(180deg, rgba(30, 10, 62, 0.78), rgba(30, 10, 62, 0.4)); border-top: 1px solid var(--hb-violet-line); border-bottom: 1px solid var(--hb-violet-line); }
.ad-band .cta-band h2 { margin-bottom: 8px; }

/* Home's and Hosted's add-on cards: the link to each add-on page, at the card's foot. */
.addon-more { margin-top: auto; padding-top: 8px; font-weight: 700; }

/* The one 960 px block for the add-on pages: every two-column arrangement above stacks below 960 px. */
@media (max-width: 960px) {
  .ad-hero .wrap, .ad-row, .ad-row.flip, .ad-row.tab-row, .ad-row.tab-row.flip, .ad-built .ad-row, .ad-split, .ad-use, .ad-extra { grid-template-columns: 1fr; gap: 26px; }
  .ad-row.flip > :first-child { order: 0; }
  .ad-row .ad-cap, .ad-use .ad-cap, .ad-extra .ad-cap { width: 100%; }
  .ad-cap .frame-tablet, .ad-cap .frame-phone, .ad-row.tab-row .ad-cap .frame-tablet, .ad-use .ad-cap .frame-phone { width: min(100%, 360px); margin: 0 auto; }
  .ad-row + .ad-row { margin-top: 40px; }
}
@media (max-width: 680px) {
  .ad-hero { padding: 38px 0 36px; }
  .ad-line { font-size: 18.5px; }
}

/* ---------- The interest form (#4901) ---------- */
/* interest.js builds one native <dialog> and opens it with showModal(): the top layer, the inert page
   behind it, and Escape come from the browser. The panel fills the dialog box, so a click that lands
   on the dialog itself is a click on its backdrop. Mint marks the action and the focus; purple frames
   the panel (#4768). The page behind it does not scroll while it is open. */
html:has(dialog.interest-dialog[open]) { overflow: hidden; }
.interest-dialog {
  width: min(600px, calc(100vw - 32px)); max-width: none;
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--hb-line-strong) transparent;
  color: var(--hb-text); background: var(--hb-surface);
  border: 1px solid var(--hb-violet-line); border-radius: var(--hb-r-lg);
  box-shadow: 0 40px 120px -40px rgba(59, 21, 120, 1);
}
/* ::backdrop does not inherit the page's custom properties in every browser: the values are literal
   (--hb-purple-ink at alpha). The open transition is interest.js's (the Web Animations API, skipped
   under reduced motion), because this file keeps flat rules: the docs site's tests parse it (#4899). */
.interest-dialog::backdrop { background: rgba(20, 6, 43, 0.74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.if-panel { padding: 26px 28px 24px; background: radial-gradient(120% 70% at 100% 0%, rgba(59, 21, 120, 0.38), transparent 62%); }
.if-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.if-head h2 { font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; margin: 4px 0 8px; }
.if-close {
  flex: none; width: 40px; height: 40px; margin: -4px -6px 0 0; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--hb-line-strong); border-radius: 50%; background: transparent;
  font: 300 24px/1 var(--hb-font); color: var(--hb-text); cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.if-close:hover { color: var(--hb-mint); border-color: var(--hb-mint); }
.if-close:focus-visible { border-radius: 50%; }
.if-intro { margin: 0 0 22px; font-size: 15px; line-height: 1.5; color: var(--hb-text-secondary); }
.if-form { display: grid; gap: 18px; }
.if-form[hidden], .if-done[hidden] { display: none; }
.if-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.if-field { display: grid; gap: 6px; min-width: 0; }
.if-field label, .if-group legend { font-size: 14px; font-weight: 600; color: var(--hb-text); }
.if-hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--hb-text-secondary); }
/* 16 px text keeps iOS from zooming the page when a field takes the focus. */
.if-form input[type="text"], .if-form input[type="email"], .if-form textarea {
  width: 100%; min-width: 0; padding: 11px 13px; font: inherit; font-size: 16px; line-height: 1.4; color: var(--hb-text);
  background: var(--hb-deepest); border: 1px solid var(--hb-line-strong); border-radius: var(--hb-r-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.if-form textarea { min-height: 104px; resize: vertical; }
.if-form input[type="text"]:focus-visible, .if-form input[type="email"]:focus-visible, .if-form textarea:focus-visible {
  outline: 2px solid var(--hb-mint); outline-offset: 1px; border-color: var(--hb-mint);
}
.if-form input[type="file"] { max-width: 100%; font: inherit; font-size: 14px; color: var(--hb-text-secondary); }
.if-form input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--hb-text);
  background: var(--hb-raised); border: 1px solid var(--hb-line-strong); border-radius: var(--hb-r-md); cursor: pointer;
}
.if-form input[type="file"]::file-selector-button:hover { border-color: var(--hb-mint); }
/* The interest and size choices: one pill per choice, its native box kept and tinted mint. */
.if-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.if-group legend { padding: 0; margin: 0 0 4px; }
.if-group .if-hint { margin-bottom: 4px; }
.if-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.if-option {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 11px;
  font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--hb-text-secondary);
  background: var(--hb-deepest); border: 1px solid var(--hb-line-strong); border-radius: var(--hb-r-pill); cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.if-option:hover { color: var(--hb-text); border-color: var(--hb-mint-dim); }
.if-option input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--hb-mint); }
.if-option:has(input:checked) { color: var(--hb-text); border-color: var(--hb-mint); background: rgba(90, 230, 171, 0.1); }
.if-option:has(input:focus-visible) { outline: 2px solid var(--hb-mint); outline-offset: 2px; }
.if-option input:focus-visible { outline: none; }
.if-error { margin: 0; font-size: 13px; font-weight: 600; color: var(--hb-red); }
.if-invalid input[type="text"], .if-invalid input[type="email"], .if-invalid textarea { border-color: var(--hb-red); }
/* The honeypot: out of sight and out of the tab order (aria-hidden, tabindex -1). */
.if-hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.if-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 2px; }
.if-actions .btn { min-width: 132px; }
.if-actions .btn:disabled { opacity: 0.65; cursor: progress; box-shadow: none; }
.if-status { flex: 1 1 220px; margin: 0; font-size: 14px; line-height: 1.45; color: var(--hb-text); }
.if-consent { margin: 0; font-size: 13px; line-height: 1.5; color: var(--hb-text-secondary); }
.if-done { display: grid; gap: 12px; justify-items: start; padding: 4px 0 2px; }
.if-done:focus { outline: none; }
.if-done p { margin: 0; color: var(--hb-text-secondary); }
.if-done .if-done-title { font-size: 22px; font-weight: 700; color: var(--hb-mint); }
.if-done strong { color: var(--hb-text); overflow-wrap: anywhere; }
/* Phones, and short landscape screens: the dialog fills the viewport, clear of the safe areas. The
   query is written so it is not a "max-width: 480px" block, which must precede the 360 px block (#4713). */
@media (max-width: 480px), (max-height: 540px) {
  .interest-dialog { width: 100%; max-width: 100%; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .if-panel {
    min-height: 100%;
    padding: calc(16px + var(--safe-top)) max(18px, calc(var(--safe-right) + 12px)) calc(24px + var(--safe-bottom)) max(18px, calc(var(--safe-left) + 12px));
  }
  .if-row { grid-template-columns: minmax(0, 1fr); }
  .if-actions .btn { flex: 1 1 100%; }
}
