/* ==========================================================================
 * stoka design system — Cursor-inspired
 *
 * All public pages share one stylesheet. Every class name used across
 * index, docs, and dashboard is defined here; touching one
 * token cascades everywhere. No framework.
 *
 * Layers (top to bottom):
 *   1. Design tokens (:root)
 *   2. Fonts + base (html, body, typography defaults)
 *   3. Layout primitives (.wrap, .site-nav, hero, footer)
 *   4. Content primitives (.retro-*, .pre-block, tables, buttons)
 *   5. Dashboard surface (.dash-*, .kpi-*)
 *   6. Responsive shims
 *
 * The "retro-*" class names are historical (early design was retro
 * terminal). We kept the names so no HTML churn was required for the
 * Cursor redesign; the new definitions ignore the old visual theme.
 * ========================================================================== */

/* -- 1. Tokens ---------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Surfaces — a near-black canvas with subtle cool tint. */
  --bg:         #0a0b0d;
  --bg-soft:    #0e1014;
  --surface:    #121317;
  --surface-hi: #1a1c22;

  /* Borders — 1px outlines, never filled. */
  --border:     rgba(255, 255, 255, 0.08);
  --border-hi:  rgba(255, 255, 255, 0.14);
  --border-em:  rgba(255, 255, 255, 0.22);

  /* Ink. Off-white with a trace of warmth so it doesn't feel clinical.
   *
   * `--muted` is tuned to stay >=6:1 against the lightest glass panels
   * (`--surface-hi` + highlight), not just against `--bg`. Previous
   * value (#8a8c95) dipped near 5.6:1 on frosted cards; this value
   * (#9395a0) holds ~6.2:1 on glass and ~7.8:1 on the page bg, while
   * still staying perceptibly below `--muted-hi` so the two-tier
   * hierarchy (metadata vs subhead) survives. */
  --fg:         #f4f4f6;
  --muted:      #9395a0;
  --muted-hi:   #c0c2ca;

  /* Accent. Cursor-ish muted blue; used sparingly. */
  --accent:     #7aa2f7;
  --accent-hi:  #a6c0f9;
  --accent-weak:#2a3a5e;

  /* Status — muted, not shouty. */
  --success:    #7ee787;
  --danger:     #ff7b7b;

  /* Effects */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  --shadow-focus: 0 0 0 3px rgba(122, 162, 247, 0.25);

  /* Frosted-glass recipe. Every card on the page derives its chrome
   * from these tokens so the dashboard KPI cards, pricing spec,
   * integrations grid, API drawers, and hero terminal all share one
   * coherent "frosted" look. Reference: the hero-wire terminal --
   * heavy blur + boosted saturation for a real depth-of-field cue,
   * a faint purple-tinted border in place of plain white (warms the
   * chrome, pulls the brand accent through), and a two-stage shadow
   * that layers a violet haze over straight black depth so cards
   * feel lifted off the shader background rather than pasted flat. */
  --glass-blur:         20px;
  --glass-saturate:     160%;
  --glass-border:       color-mix(in srgb, #a78bfa 22%, transparent);
  --glass-border-hi:    color-mix(in srgb, #a78bfa 45%, transparent);
  --glass-highlight:    inset 0 1px 0 color-mix(in srgb, white 8%, transparent);
  --glass-highlight-hi: inset 0 1px 0 color-mix(in srgb, white 16%, transparent);
  /* Soft violet haze for the "lift" + black depth shadow stacked
   * underneath. The haze colour is the same violet as the hero
   * backdrop halo (#2a1458) so hovered cards read as a continuation
   * of the hero glow rather than a new light source. */
  --glass-haze:         0 20px 60px -24px color-mix(in srgb, #2a1458 85%, transparent);
  --glass-haze-sm:      0 12px 36px -18px color-mix(in srgb, #2a1458 70%, transparent);
  --glass-haze-lg:      0 28px 72px -20px color-mix(in srgb, #2a1458 90%, transparent);
  --glass-depth:        0 4px 18px -8px   color-mix(in srgb, black 60%, transparent);
  --glass-depth-sm:     0 4px 14px -10px  color-mix(in srgb, black 55%, transparent);

  /* Type scale (px). */
  --fs-xs:  12px;
  --fs-sm:  14px;
  --fs-md:  16px;
  --fs-lg:  18px;
  --fs-xl:  22px;
  --fs-2xl: 28px;
  --fs-3xl: 40px;
  --fs-4xl: 56px;

  /* Spacing scale (px). */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;
  --sp-7:  48px;
  --sp-8:  64px;
  --sp-9:  96px;
}

/* -- 2. Fonts + base ---------------------------------------------------- */

@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

/* The `hidden` HTML attribute maps to `display: none` via UA styles,
 * but any explicit `display: flex` / `display: grid` on a class
 * overrides it. Make it authoritative so `<div hidden>` is actually
 * hidden no matter what else the element's class says. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.55;
  font-feature-settings: "cv11", "ss03";
  letter-spacing: -0.005em;
}

/* Subtle single-vignette glow at the top of the viewport for the home
 * page. Keeps the canvas flat elsewhere. */
body.home-retro {
  background:
    radial-gradient(900px 420px at 50% -100px, rgba(122, 162, 247, 0.07), transparent 70%),
    var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms ease;
}
a:hover {
  color: var(--accent-hi);
}
a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

h1, h2, h3, h4 {
  color: var(--fg);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: var(--sp-7) 0 var(--sp-4);
}
h1 { font-size: var(--fs-3xl); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

h1:first-child, h2:first-child, h3:first-child {
  margin-top: 0;
}

p  { margin: var(--sp-3) 0; color: var(--fg); }
p.sub   { color: var(--muted); font-size: var(--fs-sm); margin-top: calc(-1 * var(--sp-2)); }
p.note  { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--sp-7); border-top: 1px solid var(--border); padding-top: var(--sp-4); }

code, kbd, samp {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono",
    "Roboto Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

/* Inline code — pill on the darker surface. */
p code, li code, td code, th code, .retro-lede code, .retro-tight code,
.hero__subhead code, article code:not(.pre-block code) {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--muted-hi);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--sp-7) 0;
}

::selection {
  background: rgba(122, 162, 247, 0.35);
  color: var(--fg);
}

/* -- 3. Layout primitives ----------------------------------------------- */

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-5) var(--sp-8);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-4) var(--sp-6);
  /* Purple-tinted hairline matching every other glass surface
   * on the page, only the bottom edge is drawn so the nav reads
   * as floating above the content, not boxed in. */
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.site-nav a {
  color: var(--muted-hi);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  position: relative;
  transition:
    color 200ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    background 220ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow 240ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 220ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
/* Hover: a light glass tint — never competing with the active
 * "you are here" indicator below. Subtle lift keeps the nav
 * feeling responsive. */
.site-nav a:not(.brand):hover {
  color: var(--fg);
  background: color-mix(in srgb, white 5%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 10%, transparent);
}
/* Active page indicator. Violet→blue glass bubble with an inset
 * highlight and a soft accent shadow so it reads as a lit pill,
 * not a grey rectangle. The underline reveal (further down in
 * "Motion + polish") already anchors it visually. */
.site-nav a[aria-current="page"] {
  color: var(--fg);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, #a78bfa 22%, transparent) 0%,
      color-mix(in srgb, var(--accent) 14%, transparent) 100%
    );
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 22%, transparent),
    inset 0 0 0 1px color-mix(in srgb, #a78bfa 32%, transparent),
    0 6px 18px -10px color-mix(in srgb, #a78bfa 60%, transparent);
}
.site-nav a[aria-current="page"]:hover {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, #a78bfa 28%, transparent) 0%,
      color-mix(in srgb, var(--accent) 18%, transparent) 100%
    );
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 28%, transparent),
    inset 0 0 0 1px color-mix(in srgb, #a78bfa 40%, transparent),
    0 8px 22px -10px color-mix(in srgb, #a78bfa 70%, transparent);
}
.site-nav a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.site-nav .brand {
  color: var(--fg);
  margin-right: auto;
  padding: 0;
  background: transparent;
}
.site-nav .brand:hover {
  background: transparent;
  color: var(--fg);
}
.site-nav .brand svg {
  height: 22px;
  width: auto;
  display: block;
}

/* External-link glyph for nav entries that leave the current
 * origin (e.g. the Docs subdomain). Inline with the label text so
 * the visual hint travels with the link regardless of layout. The
 * subtle color + smaller size keeps it from shouting. */
.nav-external-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.85em;
  line-height: 1;
  color: var(--muted);
  transform: translateY(-1px);
  transition: transform 120ms ease, color 120ms ease;
}
.site-nav a.nav-external:hover .nav-external-icon,
a.nav-external:hover .nav-external-icon {
  color: var(--accent);
  transform: translate(1px, -2px);
}
.btn .nav-external-icon {
  color: inherit;
  opacity: 0.75;
}
.btn:hover .nav-external-icon {
  opacity: 1;
}

/* -- Nav dropdown (Storage → Documents / Media) -------------------------
 *
 * Small CSS-only dropdown with progressive JS enhancement. The trigger
 * (<button data-nav-dropdown-trigger>) looks and behaves like the
 * other top-level nav links; the <ul> menu pops out on :hover,
 * :focus-within, or when the trigger is aria-expanded="true". We
 * layer the glass panel exactly like the hero terminals so the
 * dropdown reads as "same material" as the rest of the surface.
 */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dropdown-trigger {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted-hi);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition:
    color 200ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    background 220ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow 240ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger[aria-expanded="true"],
.nav-dropdown:focus-within .nav-dropdown-trigger {
  color: var(--fg);
  background: color-mix(in srgb, white 5%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 10%, transparent);
}
.nav-dropdown-trigger:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.nav-dropdown-caret {
  font-size: 0.75em;
  transform: translateY(-1px);
  transition: transform 200ms var(--ease-out-quart);
}
.nav-dropdown-trigger[aria-expanded="true"] .nav-dropdown-caret,
.nav-dropdown:hover .nav-dropdown-caret {
  transform: translateY(0) rotate(180deg);
}
/* Indicate "you are on a child route" with the same violet-glass pill
 * we use for active top-level links. The JS adds this attribute when
 * the current page URL starts with one of the submenu hrefs. */
.nav-dropdown-trigger[data-nav-current="true"] {
  color: var(--fg);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, #a78bfa 22%, transparent) 0%,
      color-mix(in srgb, var(--accent) 14%, transparent) 100%
    );
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 22%, transparent),
    inset 0 0 0 1px color-mix(in srgb, #a78bfa 32%, transparent),
    0 6px 18px -10px color-mix(in srgb, #a78bfa 60%, transparent);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow:
    0 12px 30px -12px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 color-mix(in srgb, white 8%, transparent);
  display: none;
  z-index: 20;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown-trigger[aria-expanded="true"] + .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu li {
  margin: 0;
}
.nav-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  color: var(--muted-hi);
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition:
    color 160ms var(--ease-out-quart),
    background 200ms var(--ease-out-quart);
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible {
  color: var(--fg);
  background: color-mix(in srgb, white 6%, transparent);
  outline: none;
}
.nav-dropdown-menu a[aria-current="page"] {
  color: var(--fg);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, #a78bfa 22%, transparent) 0%,
      color-mix(in srgb, var(--accent) 14%, transparent) 100%
    );
}

/* Keep the dropdown closed when motion is reduced, unless the user
 * is actively interacting with it. Prevents the caret rotation from
 * feeling chatty for users who opted out of motion. */
@media (prefers-reduced-motion: reduce) {
  .nav-dropdown-caret,
  .nav-dropdown-trigger {
    transition: none !important;
  }
}

/* The landing-page hero. Retains the existing class names; the
 * old "retro window" chrome is retired — the hero is now a clean
 * centered block with a subtle divider. */
.hero,
.hero--sell {
  padding: var(--sp-8) 0 var(--sp-7);
}
.hero .wrap {
  padding-top: 0;
  padding-bottom: 0;
}
.retro-window {
  background: transparent;
  padding: 0;
  border: 0;
  border-radius: 0;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.retro-window__titlebar { display: none; }
.retro-window__body { padding: 0; }

.hero__headline {
  /* Headline scale bump for ADA-tier first impression. The
   * previous clamp(36–64) read like a card title next to the
   * brand chips above it; 44–88 with text-wrap:balance lands
   * like a proper display line without breaking narrow screens
   * (min stays generous). */
  font-size: clamp(44px, 8vw, 88px);
  line-height: 1.04;
  text-wrap: balance;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin: 0 auto var(--sp-5);
  max-width: 18ch;
  color: var(--fg);
}
.hero__subhead {
  font-size: var(--fs-lg);
  color: var(--muted-hi);
  font-weight: 400;
  max-width: 52ch;
  margin: 0 auto var(--sp-6);
  line-height: 1.5;
}

.cta {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn:hover {
  background: var(--surface-hi);
  border-color: var(--border-em);
  color: var(--fg);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
/* Primary action buttons across the app (wallet connect, any other
 * affirmative CTA using `.btn.primary`). Shares the violet-glass
 * language with the hero CTA and the try-op action buttons so
 * "primary" reads the same everywhere. More specific rules
 * (`.try-op__cta.primary`, `.btn--hero`) opt into their own
 * treatments and override this base. */
.btn.primary {
  position: relative;
  isolation: isolate;
  color: #fff;
  border: 1px solid color-mix(in srgb, white 30%, transparent);
  background-image:
    linear-gradient(
      180deg,
      color-mix(in srgb, white 22%, transparent) 0%,
      transparent 55%
    ),
    linear-gradient(
      135deg,
      #8b5cf6 0%,
      #6366f1 50%,
      #3b82f6 100%
    );
  background-color: #6366f1;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 34%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 18%, transparent),
    0 0 0 1px color-mix(in srgb, #a78bfa 38%, transparent),
    0 6px 18px -8px color-mix(in srgb, #8b5cf6 60%, transparent),
    0 10px 26px -14px color-mix(in srgb, #3b82f6 50%, transparent);
}
.btn.primary:hover {
  color: #fff;
  filter: brightness(1.06);
  border-color: color-mix(in srgb, white 44%, transparent);
}

/* Destructive action buttons (e.g. Delete). Same glass structure
 * as `.btn.primary` so they feel native, but in a red palette so
 * the user never confuses "confirm" with "delete". More specific
 * rules (like `.try-op__cta.danger`) can still opt into bespoke
 * treatments without rewriting the whole base. */
.btn.danger {
  position: relative;
  isolation: isolate;
  color: #fff;
  border: 1px solid color-mix(in srgb, white 28%, transparent);
  background-image:
    linear-gradient(
      180deg,
      color-mix(in srgb, white 20%, transparent) 0%,
      transparent 55%
    ),
    linear-gradient(
      135deg,
      #f43f5e 0%,
      #ef4444 50%,
      #b91c1c 100%
    );
  background-color: #ef4444;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 32%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 22%, transparent),
    0 0 0 1px color-mix(in srgb, #fca5a5 38%, transparent),
    0 6px 18px -8px color-mix(in srgb, #ef4444 65%, transparent),
    0 10px 26px -14px color-mix(in srgb, #b91c1c 55%, transparent);
}
.btn.danger:hover {
  color: #fff;
  filter: brightness(1.06);
  border-color: color-mix(in srgb, white 42%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 42%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 24%, transparent),
    0 0 0 1px color-mix(in srgb, #fca5a5 55%, transparent),
    0 10px 24px -6px color-mix(in srgb, #ef4444 82%, transparent),
    0 18px 40px -14px color-mix(in srgb, #b91c1c 68%, transparent);
}
.btn.danger:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 42%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 24%, transparent),
    0 0 0 3px color-mix(in srgb, #fca5a5 60%, transparent),
    0 10px 24px -6px color-mix(in srgb, #ef4444 80%, transparent);
}

/* Footer sits on a quiet line, never shouts. */
.footer-sell {
  border-top: 1px solid var(--border);
  margin-top: var(--sp-9);
  padding: var(--sp-5) 0;
}
.footer-sell__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.footer-sell__legal a {
  color: var(--muted);
}
.footer-sell__legal a:hover {
  color: var(--fg);
}
.footer-sell__attrib {
  font-size: var(--fs-xs);
  color: var(--muted);
  opacity: 0.75;
  margin: 0;
}
.footer-sell__attrib a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
}
.footer-sell__attrib a:hover {
  color: var(--fg);
}
.footer-sell__attrib-sep {
  margin: 0 0.35em;
  opacity: 0.6;
}

/* -- 4. Content primitives ---------------------------------------------- */

.retro-lede {
  font-size: var(--fs-lg);
  color: var(--muted-hi);
  max-width: 68ch;
  line-height: 1.6;
  margin: var(--sp-4) 0 var(--sp-5);
}
.retro-tight {
  color: var(--muted-hi);
  max-width: 68ch;
}

.retro-list {
  padding: 0;
  margin: var(--sp-4) 0 var(--sp-6);
  list-style: none;
  display: grid;
  gap: var(--sp-3);
}
.retro-list li {
  position: relative;
  padding: var(--sp-3) var(--sp-4) var(--sp-3) 28px;
  color: var(--muted-hi);
  line-height: 1.55;
  /* Darker --bg base (instead of --surface) so bullet rows read as
   * the same material as the hero terminal. */
  background-color: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-sm),
    var(--glass-depth-sm);
}
.retro-list li::before {
  content: "";
  position: absolute;
  left: var(--sp-4);
  top: calc(var(--sp-3) + 10px);
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--muted);
}
.retro-list li strong {
  color: var(--fg);
  font-weight: 600;
}
.retro-list--num {
  counter-reset: retro-num;
}
.retro-list--num li {
  padding-left: 56px;
  counter-increment: retro-num;
}
.retro-list--num li::before {
  content: counter(retro-num, decimal-leading-zero);
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-3);
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* Hero terminal + landing code blocks share one frosted stack so
 * DevTools computed values match (same background, filters, shadow
 * longhands — no `background-color` vs `background` drift). */
.hero-wire,
.pre-block {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-lg),
    var(--glass-depth);
}

/* Code blocks. Quiet container, subtle border, monospace. */
.pre-block {
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-5) 0;
  overflow-x: auto;
  /* Fluid code-font sizing so narrow phones don't need horizontal
   * scroll to read a line. Floor at 11px (still legible monospace),
   * ceiling at the regular --fs-sm (14px) so desktop reads as it
   * always has. `2.6vw` puts the kink in the ramp right around a
   * 540px viewport -- anything narrower scales down smoothly. */
  font-size: clamp(11px, 2.6vw, var(--fs-sm));
  line-height: 1.65;
  color: var(--muted-hi);
}
@media (max-width: 520px) {
  /* Also reclaim a bit of horizontal room by tightening the inner
   * padding on small screens. Keeps the rounded card shape while
   * giving the widest code line more breathing space. */
  .pre-block {
    padding: var(--sp-3) var(--sp-4);
  }
}
.pre-block code {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  white-space: pre;
}

/* Hand-rolled syntax highlight for the landing-page snippet. Tokens
 * pick up the same purple/green/amber accents used on .hero-wire so
 * the page reads as one palette. Two extra accents (peach + soft
 * blue) differentiate numbers and keyword arguments. */
.pre-block {
  position: relative;
}
.pre-block[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
  pointer-events: none;
}
.pre-block .t-kw  { color: #a78bfa; }
.pre-block .t-cls { color: #7ee787; }
.pre-block .t-str { color: #ffb454; }
.pre-block .t-num { color: #f78c6c; }
.pre-block .t-arg { color: #82aaff; }
.pre-block .t-cmt { color: var(--muted); font-style: italic; }

/* Tables — thin-lined, muted. */
.retro-table,
.pricing-spec {
  width: 100%;
  border-collapse: collapse;
  /* Switched from `--surface` (~12% lighter) to the hero's `--bg`
   * base so data tables read as the same near-black glass as
   * every other card. */
  background-color: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--sp-5) 0;
  font-size: var(--fs-sm);
  /* Full-strength haze + depth matching `.hero-wire` so every glass
   * card on the page renders as identical chrome. */
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-lg),
    var(--glass-depth);
}
.retro-table thead,
.pricing-spec thead {
  /* Header row: same `--bg` base as the rest of the table but at
   * slightly higher opacity to give a subtle hierarchy without
   * introducing a different colour. */
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}
.retro-table th,
.retro-table td,
.pricing-spec th,
.pricing-spec td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.retro-table tbody tr:last-child td,
.pricing-spec tbody tr:last-child td {
  border-bottom: 0;
}
.retro-table th,
.pricing-spec th {
  color: var(--muted);
  font-weight: 500;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.retro-table td,
.pricing-spec td {
  color: var(--muted-hi);
}
.retro-table td:first-child,
.pricing-spec th[scope="row"] {
  color: var(--fg);
  font-weight: 500;
}
/* Limits rows — slightly recessed, separated from the priced
 * operations above so "max object size / TTL" reads as a
 * constraint, not another billable line. */
.pricing-spec tfoot th,
.pricing-spec tfoot td {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--muted-hi);
}
.pricing-spec tfoot tr:first-child th,
.pricing-spec tfoot tr:first-child td {
  border-top: 1px solid color-mix(in srgb, white 12%, transparent);
}
.pricing-spec tfoot tr:last-child th,
.pricing-spec tfoot tr:last-child td {
  border-bottom: 0;
}

.section-pricing {
  margin: var(--sp-7) 0;
}
.pricing-panel {
  margin-top: var(--sp-4);
}

/* Product line — a sub-section inside the pricing list. Each
 * <article class="product"> is scoped to one product (Blobs
 * today; queues / signing / search tomorrow) so the pricing
 * section reads as a catalog rather than a flat table. */
.product {
  margin: var(--sp-6) 0 var(--sp-5);
}
.product + .product {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px dashed color-mix(in srgb, white 10%, transparent);
}
.product__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product__name {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: var(--fs-xl);
  letter-spacing: -0.01em;
  margin: 0;
}
.product__tag {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.product__sub {
  color: var(--muted-hi);
  font-size: var(--fs-sm);
  margin: 0;
}

/* Endpoint cells inside an endpoint-oriented pricing table.
 * Default <th scope="row"> is uppercase + tracked — wrong for
 * code. Reset it on these rows so VERB + /v1/path reads like
 * the wire, not a label. */
.pricing-spec--endpoints th[scope="row"] {
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--fs-sm);
  padding: 12px 14px;
}
.endpoint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 13px;
  color: var(--fg);
  background: transparent;
  border: 0;
  padding: 0;
  white-space: nowrap;
}
.endpoint em {
  font-style: normal;
  color: var(--muted);
}

/* HTTP verb pills. Colours follow industry convention (GET =
 * green, PUT = amber/blue, DELETE = red) so API readers pattern-
 * match instantly. Sized to sit inline with `/v1/path`. */
.verb {
  display: inline-block;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  line-height: 1;
  min-width: 48px;
  text-align: center;
}
.verb--get {
  color: #7ee787;
  background: color-mix(in srgb, #7ee787 14%, transparent);
  border-color: color-mix(in srgb, #7ee787 30%, transparent);
}
.verb--post {
  color: #79c0ff;
  background: color-mix(in srgb, #79c0ff 14%, transparent);
  border-color: color-mix(in srgb, #79c0ff 30%, transparent);
}
.verb--put {
  color: #a78bfa;
  background: color-mix(in srgb, #a78bfa 14%, transparent);
  border-color: color-mix(in srgb, #a78bfa 30%, transparent);
}
.verb--del {
  color: #ff7b7b;
  background: color-mix(in srgb, #ff7b7b 14%, transparent);
  border-color: color-mix(in srgb, #ff7b7b 30%, transparent);
}

/* Visibility helper for screen readers. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* -- 5. Dashboard surface ---------------------------------------------- */
/* The dashboard uses a slightly different layout — it's an app, not a
 * content page. Same palette, more surface chrome, denser controls. */

body.dashboard-page .wrap {
  max-width: 1100px;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  margin: var(--sp-5) 0 var(--sp-4);
  flex-wrap: wrap;
  row-gap: var(--sp-3);
}
.dash-header > div:first-child {
  min-width: 0;
}
.dash-header h1 {
  margin: 0 0 2px;
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.dash-header .sub {
  margin: 0;
}
.dash-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.dash-api-row {
  font-size: var(--fs-xs);
  color: var(--muted);
  padding: 6px 10px;
  background-color: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 var(--sp-4);
  /* Tighter shadow since this is a narrow inline chip -- the
   * full haze would bloom out past the chip's own footprint. */
  box-shadow:
    var(--glass-highlight),
    0 4px 14px -10px color-mix(in srgb, #2a1458 60%, transparent);
}
.dash-api-row code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--muted-hi);
  font-size: var(--fs-xs);
}
.dash-api-change {
  color: var(--accent);
  cursor: pointer;
  font-size: var(--fs-xs);
}
.dash-api-change:hover { color: var(--accent-hi); }
/* Greyed-out state for pages (the demo) where the API is pinned.
 * Native `:disabled` flips the pointer to `not-allowed` and the
 * browser already blocks clicks; we just mute the colour so the
 * button visibly reads as unavailable. The `title` attribute on
 * the HTML element is what surfaces the explanation on hover. */
.dash-api-change:disabled {
  color: var(--muted);
  cursor: not-allowed;
}
.dash-api-change:disabled:hover { color: var(--muted); }

/* KPI row. Four equal cards, big number + label + optional trend. */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
}
.kpi-card {
  /* Darker `--bg` base (same as the hero terminal) instead of
   * the lighter `--surface` so the dashboard reads as one
   * continuous near-black frosted stack. At 72% opacity the
   * shader still bleeds through enough to read the card as
   * glass rather than an opaque panel. */
  background-color: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition:
    border-color 200ms ease,
    background 200ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-sm),
    var(--glass-depth-sm);
}
.kpi-card:hover {
  border-color: var(--glass-border-hi);
  /* Hover stays inside the dark family -- a hair brighter than
   * the resting `--bg` so the card reads as "lifted" without
   * jumping back to the lighter `--surface`. */
  background: color-mix(in srgb, var(--bg-soft) 78%, transparent);
  box-shadow:
    var(--glass-highlight-hi),
    var(--glass-haze),
    var(--glass-depth);
}
.kpi-label {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kpi-number {
  color: var(--fg);
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: 4px;
}
.kpi-unit {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 400;
  margin-left: 4px;
}
.kpi-sub {
  color: var(--muted);
  font-size: var(--fs-xs);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* Chart card. Same chrome as KPI, deeper padding for the canvas. */
.dash-chart-card {
  /* Matches the KPI row above (and the hero terminal on the
   * landing page): darker `--bg` base at 72% opacity so the
   * whole dashboard reads as one layered near-black stack. */
  background-color: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin: var(--sp-4) 0;
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-sm),
    var(--glass-depth-sm);
}
.dash-chart-card h2 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-lg);
  font-weight: 600;
}
.dash-chart-card .sub {
  margin: 0 0 var(--sp-4);
  color: var(--muted);
  font-size: var(--fs-sm);
}
/* Card header with an action slot on the right — used by the
 * per-day breakdown table ("Export CSV" lives here) and anywhere
 * else a card needs a small action beside its title. Flex so the
 * button floats right; wraps on narrow screens. */
.dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.dash-card-head h2 {
  margin: 0 0 2px;
}
.dash-card-head .sub {
  margin: 0;
}

/* Usage table. Scrollable wrapper on small viewports; header is
 * sticky inside its own wrapper so scrolling a long period keeps
 * the column labels visible. */
.dash-table-wrap {
  /* Usage table sits on the same `--bg`-based near-black as the
   * KPI and chart cards above. 78% opacity keeps the long rows
   * legible while the shader still bleeds through subtly. */
  background-color: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: auto;
  max-height: 420px;
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-sm),
    var(--glass-depth-sm);
}
.dash-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--muted-hi);
}
.dash-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--muted);
  font-weight: 500;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.dash-table th.num,
.dash-table td.num {
  text-align: right;
}
.dash-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.dash-table tbody tr:last-child td {
  border-bottom: 0;
}
.dash-table tbody tr:hover td {
  /* 0.02 was barely perceptible on the frosted-glass card — the
   * hover row and the resting row looked identical. 0.04 lands
   * as a visible "lift" without going near zebra-stripe territory. */
  background: rgba(255, 255, 255, 0.04);
}
.dash-table td:first-child {
  color: var(--fg);
  font-weight: 500;
  white-space: nowrap;
}
.dash-table-empty td {
  text-align: center;
  color: var(--muted);
  padding: var(--sp-6) var(--sp-4);
}

/* Grouped header row ("Documents", "Media", "USDC") that spans the
 * detail columns below it. Slightly bolder than the uppercase leaf
 * row so the two tiers read as a hierarchy at a glance without
 * introducing color. Border on the bottom keeps the two header rows
 * visually attached when the table is scrolled horizontally. */
.dash-table .dash-table-grouphead th {
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.04em;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.dash-table .dash-table-grouphead th[colspan] {
  text-align: center;
  border-left: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

/* Chart.js canvas must live inside a size-bounded box when
 * `maintainAspectRatio: false` is set — otherwise the canvas
 * grows to fit its parent, the parent grows to fit the canvas,
 * and the chart eats the viewport. `position: relative` +
 * explicit height clamps the layout; `!important` on the canvas
 * sizing is defensive against Chart.js's inline resize styles. */
.dash-chart-card .chart-wrap {
  position: relative;
  width: 100%;
  height: 320px;
}
.dash-chart-card .chart-wrap canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
}

.dash-range {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.dash-range button {
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 6px 12px;
  font-size: var(--fs-xs);
  font-weight: 500;
  font-family: inherit;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.dash-range button:hover {
  color: var(--fg);
}
.dash-range button[aria-pressed="true"] {
  color: var(--fg);
  background: var(--surface-hi);
}

/* Network selector variant — same pill group as .dash-range but
 * with a left-side dot that matches the wallet-chip "connected"
 * indicator, so the user ties "Testnet is active" to "my wallet
 * is signing on testnet" without having to read two labels. The
 * dot hides when neither button is pressed (custom API host). */
.dash-network button {
  position: relative;
  padding-left: 22px;
}
.dash-network button::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--fg) 22%, transparent);
  transition: background 120ms ease, box-shadow 120ms ease;
}
.dash-network button[aria-pressed="true"]::before {
  background: var(--success, #3ddc97);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success, #3ddc97) 22%, transparent);
}
/* Mainnet gets the accent colour instead of success-green so the
 * two networks are visually distinct at a glance. */
.dash-network button[data-network="main"][aria-pressed="true"]::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.dash-network button[data-network="local"][aria-pressed="true"]::before {
  background: color-mix(in srgb, var(--accent) 70%, var(--fg) 30%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* GitHub-style contribution heatmap. 53 columns × 7 rows, fills
 * the card's content width. Columns use fractional sizing
 * (`1fr`) so the cells stretch to consume all horizontal space
 * the card offers; height follows from aspect-ratio so they
 * stay square. Below ~640 px we drop down to 26 columns (half-
 * year) to avoid microscopic pills. */
.heatmap {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 3px;
  margin: var(--sp-2) 0 var(--sp-3);
  width: 100%;
}
.heatmap-cell {
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  min-width: 0;
}
.heatmap-cell[data-level="1"] { background: rgba(122, 162, 247, 0.22); }
.heatmap-cell[data-level="2"] { background: rgba(122, 162, 247, 0.40); }
.heatmap-cell[data-level="3"] { background: rgba(122, 162, 247, 0.65); }
.heatmap-cell[data-level="4"] { background: #7aa2f7; }
.heatmap-cell:hover {
  outline: 1px solid rgba(255, 255, 255, 0.25);
  outline-offset: 0;
}
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--fs-xs);
  margin-top: var(--sp-2);
}
.heatmap-legend .heatmap-cell {
  width: 11px;
  height: 11px;
  aspect-ratio: auto;
  margin: 0;
}

/* The Activity card is info-dense and already small — reduce
 * vertical chrome so it doesn't compete with the Spend/Ops cards
 * for visual weight. Padding stays horizontal so the heatmap
 * breathes inside its track. */
#heatmapCard {
  padding-top: var(--sp-4);
  padding-bottom: var(--sp-4);
}
#heatmapCard h2 {
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--muted-hi);
  margin: 0 0 2px;
}
#heatmapCard .sub {
  margin-bottom: var(--sp-3);
}

@media (max-width: 640px) {
  .heatmap {
    grid-template-columns: repeat(26, 1fr);
  }
  /* When only half the year is visible, hide the older half so
   * nothing wraps weirdly. */
  .heatmap-cell:nth-child(n + 183) { display: none; }
}

.dash-error {
  background: rgba(255, 123, 123, 0.08);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 123, 123, 0.35);
  color: #ffa5a5;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  margin: var(--sp-4) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  gap: var(--sp-3);
}
.dash-error button {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255, 123, 123, 0.4);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  cursor: pointer;
  font-family: inherit;
}
.dash-error button:hover {
  background: rgba(255, 123, 123, 0.12);
}

#walletBtn {
  padding: 10px 16px;
}

/* -- 6. Responsive ------------------------------------------------------ */

@media (max-width: 720px) {
  .site-nav { gap: var(--sp-3); padding: var(--sp-3); }
  .site-nav a { padding: 6px 8px; }
  .wrap { padding: var(--sp-4); }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .hero, .hero--sell { padding: var(--sp-7) 0 var(--sp-6); }
  h1 { font-size: var(--fs-2xl); }
  .footer-sell__inner { flex-direction: column; align-items: flex-start; }
  .dash-chart-card .chart-wrap { height: 240px; }
}

/* ---------------------------------------------------------------
 * /api playground. Four action cards laid out in a responsive grid,
 * a shared response panel below, and a warning banner that sits
 * between the header and the grid so it can't be missed when users
 * first load the page. The cards deliberately inherit the dashboard
 * `.dash-chart-card` look so there's one visual language for all
 * wallet-connected surfaces.
 * ------------------------------------------------------------- */

.try-warn {
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  color: var(--muted-hi);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  margin-bottom: var(--sp-5);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

/* Compact network badge in the page header. Just labels which
 * Stellar network this demo targets — the detailed "no real money
 * / get USDC from the faucet" nuance is carried by the funding
 * banner when it's actually relevant, instead of a permanent wall
 * of copy. Amber to match the rest of the testnet accents. */
.try-testnet-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  margin-top: var(--sp-2);
  border: 1px solid color-mix(in srgb, #f5a524 30%, var(--border));
  background: color-mix(in srgb, #f5a524 8%, transparent);
  color: var(--muted-hi);
  border-radius: 999px;
  font-size: var(--fs-xs);
  line-height: 1;
  white-space: nowrap;
}
.try-testnet-chip strong {
  color: #f5a524;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.try-testnet-chip__label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 600;
}
.try-testnet-chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f5a524;
  box-shadow: 0 0 0 3px color-mix(in srgb, #f5a524 18%, transparent);
  flex: 0 0 auto;
}
.try-warn strong {
  color: var(--fg);
  margin-right: 6px;
}
.try-warn a {
  color: var(--accent);
}

/* Dedicated funding alert. Triggered when the server/simulator
 * reports a balance/trustline/account-missing error — i.e. "your
 * wallet isn't funded yet". Amber, high-contrast, and always sits
 * above the ops list so a fresh user sees the address + faucet
 * link + trustline hint without having to expand the error drawer.
 * Dismissable (the close button just toggles `hidden`); any later
 * funding error re-shows it. */
.fund-alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
  border: 1px solid color-mix(in srgb, #f5a524 40%, var(--border));
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, #f5a524 14%, transparent),
      color-mix(in srgb, #f5a524 6%, transparent)
    );
  border-radius: var(--radius);
  box-shadow: 0 0 0 4px color-mix(in srgb, #f5a524 8%, transparent);
  color: var(--muted-hi);
  line-height: 1.5;
  font-size: var(--fs-sm);
  animation: fund-alert-in 160ms ease-out;
}
@keyframes fund-alert-in {
  from { transform: translateY(-4px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
.fund-alert__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f5a524;
  color: #1a1205;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  flex: 0 0 auto;
}
.fund-alert__body { min-width: 0; }
.fund-alert__title {
  margin: 0 0 4px 0;
  font-size: var(--fs-md);
  color: #f5a524;
  font-weight: 600;
}
.fund-alert__desc {
  margin: 0 0 var(--sp-3) 0;
  color: var(--muted-hi);
}
.fund-alert__steps {
  margin: 0;
  padding-left: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fund-alert__steps li {
  margin: 0;
  padding: 0;
}
.fund-alert__steps li[hidden] { display: none; }
.fund-alert__steps > li > span { margin-right: 8px; }
.fund-alert__addr {
  display: inline-block;
  max-width: 100%;
  padding: 2px 8px;
  margin-right: 6px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  border: 1px solid var(--border);
  border-radius: 6px;
  word-break: break-all;
  vertical-align: middle;
}
.fund-alert__copy {
  padding: 2px 10px;
  font-size: var(--fs-xs);
}
.fund-alert__faucet {
  color: #f5a524;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fund-alert__faucet:hover { color: var(--fg); }
.fund-alert__close {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-hi);
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.fund-alert__close:hover {
  color: var(--fg);
  border-color: var(--fg);
}
@media (max-width: 640px) {
  .fund-alert {
    grid-template-columns: 1fr auto;
  }
  .fund-alert__icon {
    grid-row: 1;
    grid-column: 1;
  }
  .fund-alert__close {
    grid-row: 1;
    grid-column: 2;
  }
  .fund-alert__body {
    grid-row: 2;
    grid-column: 1 / -1;
  }
}

/* Custom wallet chip for /api. Replaces the Stellar Wallets Kit's
 * default blue button (which looks out of place against the dark
 * surface) with a pill that shows USDC balance + a short address,
 * plus a `✕` to disconnect. The kit still handles the auth /
 * signing flows; this chip is a thin display layer.  */
.wallet-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}
.wallet-chip__connect {
  font-size: var(--fs-sm);
}
.wallet-chip__connected {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--fs-sm);
  line-height: 1;
  overflow: hidden;
}
.wallet-chip__bal {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 9px 14px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.wallet-chip__bal-amount {
  font-weight: 600;
  font-size: var(--fs-sm);
}
.wallet-chip__bal-label {
  font-size: var(--fs-xs);
  color: var(--muted-hi);
  letter-spacing: 0.04em;
}
/* Amber tint when we've confirmed the balance is 0; hides when
 * we don't know. */
.wallet-chip[data-balance="empty"] .wallet-chip__bal {
  background: color-mix(in srgb, #f5a524 18%, transparent);
}
.wallet-chip[data-balance="empty"] .wallet-chip__bal-amount {
  color: #f5a524;
}
.wallet-chip[data-balance="unknown"] .wallet-chip__bal {
  background: color-mix(in srgb, var(--fg) 6%, transparent);
}
.wallet-chip__addr {
  appearance: none;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--muted-hi);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.wallet-chip__addr:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 6%, transparent);
}
.wallet-chip__addr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success, #3ddc97);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success, #3ddc97) 22%, transparent);
}
.wallet-chip[data-balance="empty"] .wallet-chip__addr-dot {
  background: #f5a524;
  box-shadow: 0 0 0 3px color-mix(in srgb, #f5a524 22%, transparent);
}
.wallet-chip__disconnect {
  appearance: none;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 14px;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.wallet-chip__disconnect:hover {
  color: var(--danger, #e5484d);
  background: color-mix(in srgb, var(--danger, #e5484d) 10%, transparent);
}

/* Swagger-UI-style operation list. Each <details> is a drawer: the
 * summary row shows the HTTP method badge, path, short description,
 * and a status dot; clicking expands the form + a result pane that
 * lands right under the Execute button so output never hides below
 * the fold. Only one row is open by default (Store), but users can
 * open several at once if they want to compare.
 *
 * Method badges use Swagger's canonical palette so the colour is a
 * 1:1 cue for the verb — POST green, GET blue, PUT orange, DELETE
 * red — adapted to our darker surface with softer backgrounds. */
.try-ops {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.try-op {
  /* Frosted to match the hero terminal. The drawers were the one
   * card type still rendering as a flat opaque surface; bringing
   * them onto the shared --glass-* recipe makes the API
   * playground feel like it's floating on the shader like
   * everything else instead of a flat panel pasted on top. */
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  /* Same darker `--bg` base the hero terminal uses so the drawers
   * sit on the page as the same material. Was `--surface` at 68%,
   * which rendered ~10% lighter and broke the unified glass pass. */
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-sm),
    var(--glass-depth-sm);
  overflow: hidden;
  transition:
    border-color 280ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow 280ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    background 280ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
.try-op[open] {
  border-color: var(--glass-border-hi);
  /* Open state: same `--bg` base as resting, slightly more opaque
   * so the expanded drawer reads as lifted without falling back to
   * the lighter `--surface` and losing the dark-glass continuity. */
  background: color-mix(in srgb, var(--bg-soft) 78%, transparent);
  box-shadow:
    var(--glass-highlight-hi),
    var(--glass-haze),
    var(--glass-depth);
}

.try-op__summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  user-select: none;
}
.try-op__summary::-webkit-details-marker { display: none; }
/* Translucent hover so the frosted drawer underneath stays visible.
 * Uses the same `--bg-soft` base as the open state (just lower
 * opacity) so the hover feedback is a brightness step on the same
 * material, not a colour swap. */
.try-op__summary:hover {
  background: color-mix(in srgb, var(--bg-soft) 55%, transparent);
}
.try-op__summary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.try-op__method {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: #0a0b0d;
  min-width: 52px;
  text-align: center;
}
.try-op[data-method="post"]   .try-op__method { background: #49cc90; }
.try-op[data-method="get"]    .try-op__method { background: #61affe; }
.try-op[data-method="put"]    .try-op__method { background: #fca130; }
.try-op[data-method="delete"] .try-op__method { background: #f93e3e; color: #fff; }

.try-op__path {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-sm);
  color: var(--fg);
}
.try-op__path code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.try-op__desc {
  color: var(--muted-hi);
  font-size: var(--fs-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status dot on the summary: reflects the most recent run. Colors
 * stay in sync with the inline result pane so users can skim the
 * collapsed list and see which operations succeeded / errored. */
.try-op__badge {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-em);
  transition: background 120ms ease, box-shadow 120ms ease;
  flex: 0 0 auto;
}
.try-op__badge[data-status="loading"] {
  background: var(--accent);
  animation: try-pulse 1.2s ease-in-out infinite;
}
.try-op__badge[data-status="ok"] { background: var(--success); }
.try-op__badge[data-status="err"] { background: var(--danger); }
@keyframes try-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); }
}

.try-op__body {
  border-top: 1px solid var(--border);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  background: var(--bg-soft);
}

.try-op__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
/* Main call-to-action button per op row. Sized to feel clickable
 * without dwarfing the cost strip beside it; primary variant gets
 * a subtle gradient + lift so the eye lands on it instantly. */
.try-op__cta {
  min-width: 120px;
  min-height: 40px;
  padding: 10px 20px;
  justify-content: center;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  position: relative;
  isolation: isolate;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 120ms ease,
    transform 160ms ease,
    box-shadow 200ms ease,
    filter 160ms ease;
}
.try-op__cta.primary {
  color: #fff;
  border: 1px solid color-mix(in srgb, white 30%, transparent);
  background-image:
    linear-gradient(
      180deg,
      color-mix(in srgb, white 22%, transparent) 0%,
      transparent 55%
    ),
    linear-gradient(
      135deg,
      #8b5cf6 0%,
      #6366f1 50%,
      #3b82f6 100%
    );
  background-color: #6366f1;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 34%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 18%, transparent),
    0 0 0 1px color-mix(in srgb, #a78bfa 38%, transparent),
    0 6px 18px -8px color-mix(in srgb, #8b5cf6 60%, transparent),
    0 10px 26px -14px color-mix(in srgb, #3b82f6 50%, transparent);
}
.try-op__cta.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  border-color: color-mix(in srgb, white 44%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 44%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 20%, transparent),
    0 0 0 1px color-mix(in srgb, #a78bfa 55%, transparent),
    0 10px 24px -6px color-mix(in srgb, #8b5cf6 78%, transparent),
    0 18px 40px -14px color-mix(in srgb, #3b82f6 65%, transparent);
}
.try-op__cta.primary:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.96);
  transition-duration: 100ms;
}
.try-op__cta.primary:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 44%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 20%, transparent),
    0 0 0 3px color-mix(in srgb, #a78bfa 60%, transparent),
    0 10px 24px -6px color-mix(in srgb, #8b5cf6 78%, transparent);
}
.try-op__cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading state: inline spinner + live elapsed timer. The button
 * keeps its label ("Store", "Retrieve", …) visible so the user
 * still knows which op is in flight, with the spinner sitting to
 * the left. Disabled during loading to prevent double-submits. */
.try-op__cta--loading {
  position: relative;
  padding-left: 38px;
}
.try-op__cta--loading::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: try-spin 700ms linear infinite;
}
@keyframes try-spin {
  to { transform: rotate(360deg); }
}
.try-op__hint {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.try-op--connected .try-op__hint { display: none; }

/* Per-row cost strip. Sits right next to the Pay button so the user
 * can see, at the moment of decision, exactly how much USDC this
 * click will move. The amount is amber to draw the eye (money!)
 * without looking alarming; the note ("testnet USDC" / "wallet-signed,
 * no payment" / "minimum … + … per KiB") explains what the number
 * actually means. Updates live as the user edits key/body/TTL. */
.try-op__cost {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, #f5a524 30%, var(--border));
  background: color-mix(in srgb, #f5a524 6%, transparent);
  border-radius: var(--radius-sm);
  line-height: 1.2;
}
.try-op__cost-amount {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #f5a524;
}
.try-op__cost-note {
  font-size: 11px;
  color: var(--muted);
}
.try-op__cost--free {
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
  background: color-mix(in srgb, var(--success) 6%, transparent);
}
.try-op__cost--free .try-op__cost-amount { color: var(--success); }

/* Inline result pane. Status strip at top (HTTP code + relative time +
 * copy button), monospace body below with a bounded height so large
 * JSON bodies don't push the next operation off-screen. */
.try-op__result {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--bg);
  overflow: hidden;
}
.try-op__result-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px var(--sp-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--fs-xs);
}
.try-op__result-status {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.try-op__result--ok .try-op__result-status {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
  background: color-mix(in srgb, var(--success) 8%, transparent);
}
.try-op__result--err .try-op__result-status {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}
.try-op__result--loading .try-op__result-status {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  /* Gentle blue pulse so the status chip keeps signalling
   * activity even when the elapsed counter is the only thing
   * moving (Soroban RPC can stall for 10+ seconds before the
   * ledger replies). */
  animation: try-loading-pulse 1.6s ease-in-out infinite;
}
@keyframes try-loading-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
  50%      { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 15%, transparent); }
}

/* Indeterminate progress bar shown under the result header while
 * a call is in flight. Two-keyframe sweeping bar (Material-style)
 * because "the transaction is still happening" is a statement
 * better made by motion than text. */
.try-op__progress {
  position: relative;
  height: 3px;
  width: 100%;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  overflow: hidden;
}
.try-op__progress::before,
.try-op__progress::after {
  content: "";
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}
.try-op__progress::before {
  width: 40%;
  animation: try-progress-a 2.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.try-op__progress::after {
  width: 60%;
  animation: try-progress-b 2.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: 1.15s;
}
@keyframes try-progress-a {
  0%   { left: -40%; }
  60%  { left: 100%; }
  100% { left: 100%; }
}
@keyframes try-progress-b {
  0%   { left: -60%; }
  60%  { left: 107%; }
  100% { left: 107%; }
}

/* Stage list inside the loading body. Each stage is a row with a
 * status glyph on the left (● current, ✓ done, ○ pending) and
 * human-readable text on the right. Makes it obvious that work is
 * progressing even when a single stage (Soroban settlement) is
 * taking most of the wall time. */
.try-op__stages {
  margin: 0;
  padding: var(--sp-3);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-sm);
}
.try-op__stage {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}
.try-op__stage[data-state="active"] { color: var(--fg); }
.try-op__stage[data-state="done"]   { color: var(--success); }
.try-op__stage-glyph {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 10px;
  line-height: 1;
}
.try-op__stage[data-state="active"] .try-op__stage-glyph {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  animation: try-stage-pulse 1.2s ease-in-out infinite;
}
.try-op__stage[data-state="done"] .try-op__stage-glyph {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg);
}
.try-op__stage[data-state="pending"] .try-op__stage-glyph {
  border-style: dashed;
}
@keyframes try-stage-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  50%      { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.try-op__stage-label {
  min-width: 0;
}
.try-op__stage-elapsed {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.try-op__result-meta {
  color: var(--muted);
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.try-op__result-copy {
  padding: 4px 10px;
  font-size: var(--fs-xs);
}
.try-op__result-body {
  margin: 0;
  padding: var(--sp-3);
  max-height: 360px;
  overflow: auto;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-sm);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg);
}

.try-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--muted-hi);
}
.try-field > span { font-weight: 500; color: var(--fg); }
.try-field input[type="text"],
.try-field textarea,
.try-field select {
  width: 100%;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-sm);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 8px 10px;
  box-sizing: border-box;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.try-field textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.45;
}
.try-field input[type="text"]:focus,
.try-field textarea:focus,
.try-field select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.try-field--inline {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-3);
}
.try-field--inline > span { flex: 0 0 auto; }
.try-field--inline select { flex: 1 1 auto; max-width: 200px; }

.try-field--checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-weight: 400;
  color: var(--muted-hi);
  cursor: pointer;
  line-height: 1.45;
}
.try-field--checkbox input[type="checkbox"] {
  margin: 3px 0 0;
  flex: 0 0 auto;
  accent-color: color-mix(in srgb, var(--accent) 85%, #fff);
}
.try-field--checkbox code {
  font-size: 0.92em;
}

.try-price {
  max-height: 380px;
  overflow: auto;
  white-space: pre;
  font-size: var(--fs-sm);
  line-height: 1.55;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* -- 6. Optional shader backdrop --------------------------------------- */
/* Fixed-position WebGL canvas inserted at the top of <body> by
 * `src/shared/starNest.ts`. Purely decorative; the page must
 * remain fully readable and interactive regardless of whether
 * this element exists. We scale the render buffer down 40% and
 * rely on CSS to stretch it back to viewport size — the slight
 * softness reads like depth-of-field and keeps the GPU cost
 * sane on integrated graphics. */
.starnest-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  display: block;
  background: transparent;
}

/* When the backdrop shader is active we hand the page's
 * background over to the shader. Every other style on the page
 * stays identical — only the body's own background flips
 * transparent so the canvas underneath is visible. Keeping the
 * container glass as *default* (not a has-starnest override)
 * means the UI is one consistent design system whether or not
 * the user opts in. */
body.has-starnest {
  background: transparent !important;
}
body.has-starnest.home-retro {
  background: transparent !important;
}

/* Hero "window" is actually just a text column — never a panel.
 * A legibility text-shadow carries contrast against either
 * background (solid --bg below or the shader). */
.hero__headline,
.hero__subhead {
  text-shadow:
    0 1px 2px color-mix(in srgb, black 60%, transparent),
    0 6px 24px color-mix(in srgb, black 45%, transparent);
}

/* ===== Legibility for floating (non-glassed) body text ==============
 *
 * A handful of elements deliberately live OUTSIDE the glass-card
 * system -- section intros (eyebrow + h2 + subtitle), the foot
 * paragraphs below the MCP and Claude-log cards, and the site
 * footer. On a plain `--bg` these read fine on their own; on top
 * of the animated shader they had to compete with bright Voronoi
 * tubes / spiral bands / nebula plumes and the thin anti-aliased
 * strokes of the type got eaten.
 *
 * Fix: add a subtle "ink" text-shadow stack ONLY when the shader
 * is active (`body.has-starnest`). The stack is two-tier --
 * a tight, dark 1px drop to sharpen edge contrast, plus a wider
 * soft halo (0 0 blur) that darkens the immediate surround so
 * each letter sits in a small dimmed pool regardless of what the
 * shader happens to be painting at that pixel. The halo is
 * intentionally symmetric (0 0) rather than directional because
 * the shader is equally bright in every direction -- a one-sided
 * drop-shadow only helps when the neighbouring pixel happens to
 * be on the "wrong" side.
 *
 * Why gate on `.has-starnest`: on solid backgrounds a heavy halo
 * can look slightly muddy, and the page still renders well
 * without it when the user has turned the shader off or on a
 * device where WebGL failed. Keeping the baseline chrome clean
 * means a non-shader visit looks identical to the original
 * typography.
 *
 * Not gated here (already unconditional above): `.hero__headline`
 * / `.hero__subhead`, because the hero is the first thing anyone
 * sees and benefits from the extra weight even on a flat
 * background.
 * ================================================================= */

/* Headings and display-weight text. Uses the same stack as the
 * hero so the whole top-of-section rhythm feels consistent
 * (eyebrow + h2 + subtitle read as one unit). Slightly smaller
 * second-ring blur than the hero because section h2s are ~60% of
 * the hero headline size and a 24px halo at that weight feels
 * over-darkened.
 *
 * `.product__name` is an h3 that sits inside the margin-only
 * `.product` wrapper (NOT a glass card); it's the only h3 on
 * the page that isn't already inside a glass container, so it
 * earns the same halo as the section h2s. */
body.has-starnest .section-intro h2,
body.has-starnest h1:not(.hero__headline),
body.has-starnest .product__name {
  text-shadow:
    0 1px 2px color-mix(in srgb, black 65%, transparent),
    0 0 16px color-mix(in srgb, black 55%, transparent);
}

/* Body-copy text shadow. Tighter halo (10px) tuned for small
 * type so the letterforms stay crisp rather than smeared, but
 * the 1px drop alone isn't enough on bright shader highlights.
 * Applies to every unglassed paragraph / meta-text on the page:
 *
 *   - section intros (eyebrow + h2 sub + retro-lede inside them)
 *   - product description (`.product__sub`) -- the Blobs line
 *     that sits between the product h3 and the pricing table,
 *     directly on the shader
 *   - MCP + Claude-log foot paragraphs
 *   - site footer text
 *
 * The product's example callout (`.product__example`) already
 * has its own tinted background so it isn't listed here. */
body.has-starnest .section-intro__eyebrow,
body.has-starnest .section-intro__sub,
body.has-starnest .section-intro .retro-lede,
body.has-starnest .product__sub,
body.has-starnest .mcp-panels__foot,
body.has-starnest .claude-log__foot,
body.has-starnest .claude-log__foot p,
body.has-starnest .footer-sell__legal,
body.has-starnest .footer-sell__attrib {
  text-shadow:
    0 1px 2px color-mix(in srgb, black 70%, transparent),
    0 0 10px color-mix(in srgb, black 55%, transparent);
}

/* Links inside the unglassed text inherit the parent's
 * text-shadow by default, which is usually the right answer
 * (they blend into their sentence). For the footer -- where the
 * whole row is basically links on a flat line -- we reinforce
 * the 1px drop so the underline hairline doesn't vanish against
 * bright shader passes. */
body.has-starnest .footer-sell a {
  text-shadow:
    0 1px 2px color-mix(in srgb, black 75%, transparent),
    0 0 8px color-mix(in srgb, black 55%, transparent);
}

/* Users who prefer reduced motion usually also run the shader
 * off or at low quality. Strip the halos in that case too --
 * the extra ink is only earning its keep against a moving
 * backdrop, and on a still page it just reads as slightly blurry
 * type. */
@media (prefers-reduced-motion: reduce) {
  body.has-starnest .section-intro h2,
  body.has-starnest h1:not(.hero__headline),
  body.has-starnest .product__name,
  body.has-starnest .section-intro__eyebrow,
  body.has-starnest .section-intro__sub,
  body.has-starnest .section-intro .retro-lede,
  body.has-starnest .product__sub,
  body.has-starnest .mcp-panels__foot,
  body.has-starnest .claude-log__foot,
  body.has-starnest .claude-log__foot p,
  body.has-starnest .footer-sell__legal,
  body.has-starnest .footer-sell__attrib,
  body.has-starnest .footer-sell a {
    text-shadow: 0 1px 2px color-mix(in srgb, black 60%, transparent);
  }
}

/* Hero chip row — "Built on x402" + "Settles on Stellar". Two
 * small affiliation badges sit above the headline. Violet for
 * x402 (matches the shader accent), cyan for Stellar (its own
 * brand language). Stacks on narrow screens. */
.brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  justify-content: center;
  margin: 0 auto var(--sp-5);
}
.brand-chips .x402-chip,
.brand-chips .stellar-chip { margin: 0; }

/* x402 chip — the single brand signal above the fold. Styled
 * after x402engine/paytoll: small, violet, quietly luminous.
 * It announces affiliation without stealing focus from the
 * headline. Violet pairs with the backdrop shader when active. */
.x402-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: 0 auto var(--sp-5);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #e2d8ff;
  text-decoration: none;
  background: color-mix(in srgb, #8b5cf6 14%, transparent);
  border: 1px solid color-mix(in srgb, #a78bfa 35%, transparent);
  border-radius: 999px;
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 10%, transparent),
    0 0 24px -8px color-mix(in srgb, #8b5cf6 70%, transparent);
  transition: color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.x402-chip:hover {
  color: #fff;
  border-color: color-mix(in srgb, #a78bfa 60%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 16%, transparent),
    0 0 32px -6px color-mix(in srgb, #8b5cf6 90%, transparent);
}
.x402-chip strong {
  font-weight: 700;
  color: #fff;
}
.x402-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 8px #a78bfa, 0 0 14px color-mix(in srgb, #a78bfa 60%, transparent);
  animation: x402-pulse 2.4s ease-in-out infinite;
}
@keyframes x402-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}
@media (prefers-reduced-motion: reduce) {
  .x402-chip__dot { animation: none; }
}

/* Stellar chip — sibling to the x402 chip. Cyan instead of
 * violet so the two affiliations read as distinct signals
 * rather than variants of the same badge. */
.stellar-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #d7f0ff;
  text-decoration: none;
  background: color-mix(in srgb, #38bdf8 12%, transparent);
  border: 1px solid color-mix(in srgb, #7dd3fc 35%, transparent);
  border-radius: 999px;
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 10%, transparent),
    0 0 24px -8px color-mix(in srgb, #38bdf8 70%, transparent);
  transition: color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.stellar-chip:hover {
  color: #fff;
  border-color: color-mix(in srgb, #7dd3fc 60%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 16%, transparent),
    0 0 32px -6px color-mix(in srgb, #38bdf8 90%, transparent);
}
.stellar-chip strong {
  font-weight: 700;
  color: #fff;
}
.stellar-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7dd3fc;
  box-shadow: 0 0 8px #7dd3fc, 0 0 14px color-mix(in srgb, #7dd3fc 60%, transparent);
}

/* Stat row — three big numerals side-by-side, label beneath.
 * Used in the Network section to ground the x402/Stellar pitch
 * in verifiable facts. Same glass treatment as other panels. */
.stat-row {
  list-style: none;
  padding: 0;
  margin: var(--sp-5) 0 var(--sp-4);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}
.stat-row > li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-4) var(--sp-4);
  /* Hero-base glass so the network stats read as the same material
   * as the terminal above them. Was `--surface` at 62%, which
   * made these tiles
   * ~12% lighter and stood out from the rest of the glass pass. */
  background-color: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-sm),
    var(--glass-depth-sm);
}
.stat-row__val {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.stat-row__lbl {
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.02em;
}
@media (max-width: 620px) {
  .stat-row {
    grid-template-columns: 1fr;
  }
}

/* Contrast panel — the "why agents" wedge. Two columns of
 * short, numbered bullets juxtaposing the API-key treadmill
 * vs stoka. Left panel is dimmed + warm-tinted to read as "the
 * old way"; right panel is brighter + green-tinted to read as
 * the resolution. Each <li> is a tiny clause, not a sentence. */
.contrast {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin: var(--sp-5) 0 var(--sp-3);
}
.contrast__col {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  /* Border is left to the per-column amber/green tint below; the
   * shared shadow recipe still lifts both columns consistently. */
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-sm),
    var(--glass-depth-sm);
}
.contrast__col ol {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: cc;
  display: grid;
  gap: 6px;
}
.contrast__col ol li {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-sm);
  line-height: 1.5;
  padding-left: 28px;
  position: relative;
  color: var(--muted-hi);
  counter-increment: cc;
}
.contrast__col ol li::before {
  content: counter(cc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding-top: 4px;
  opacity: 0.55;
}
.contrast__lbl {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--sp-3);
  opacity: 0.85;
}

/* Left column — "today". Warm amber tint, slightly dimmed
 * copy to feel like a wall of friction. */
.contrast__col--old {
  background-color: color-mix(in srgb, #7a4a0e 14%, color-mix(in srgb, var(--surface) 60%, transparent));
  border: 1px solid color-mix(in srgb, #f5a524 22%, transparent);
}
.contrast__col--old .contrast__lbl { color: #f5a524; }
.contrast__col--old ol li { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, #f5a524 40%, transparent); }

/* Right column — "on stoka". Green tint, bright copy. */
.contrast__col--new {
  background-color: color-mix(in srgb, #0e3a24 18%, color-mix(in srgb, var(--surface) 60%, transparent));
  border: 1px solid color-mix(in srgb, #7ee787 28%, transparent);
}
.contrast__col--new .contrast__lbl { color: #7ee787; }
.contrast__col--new ol li { color: var(--fg); }

@media (max-width: 720px) {
  .contrast { grid-template-columns: 1fr; }
}

/* Hero "wire" terminal — the most important visual element on
 * the page. Shows the actual x402 round-trip in two verbs so
 * the reader understands pay-per-call storage in one glance.
 * Modeled on x402engine.app and paytoll.io heroes. */
.hero-wire {
  display: block;
  max-width: 560px;
  margin: var(--sp-7) auto 0;
  padding: var(--sp-4) var(--sp-5);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 13px;
  line-height: 1.85;
  text-align: left;
  color: var(--muted-hi);
  /* Frosted chrome lives in the shared `.hero-wire, .pre-block`
   * block above so this element stays identical to landing
   * `.pre-block` in computed style. */
  overflow-x: auto;
  white-space: pre;
}
.hero-wire code { font: inherit; color: inherit; background: transparent; padding: 0; }

.wire__req {
  color: #a78bfa;
  font-weight: 600;
}
.wire__req::before {
  content: "→ ";
  color: color-mix(in srgb, #a78bfa 70%, transparent);
}
.wire__res {
  font-weight: 600;
}
.wire__res::before {
  content: "← ";
  opacity: 0.8;
}
.wire__res--402 { color: #ffb454; }
.wire__res--200 { color: #7ee787; }
.wire__meta {
  color: var(--muted);
  display: inline-block;
  padding-left: 1.5ch;
}

@media (max-width: 620px) {
  .hero-wire { font-size: 12px; padding: var(--sp-3) var(--sp-4); }
}

/* On the Media page the inline VDJ deck exposes every control
 * the right-sidebar dock would otherwise own (shader picker,
 * Scroll FX, Show FPS, per-shader Quality / Speed / params).
 * Showing both surfaces at once splits attention and
 * risks leaving the user wondering which knob is authoritative
 * — they share state, but the duplicated chrome reads as two
 * separate settings panels. The `stoka-media-page` class is
 * applied by `web/src/media/main.ts` before the panel mounts,
 * so the dock is never visible even momentarily on that page.
 * Every other page keeps the dock as-is. */
body.stoka-media-page .starnest-dock {
  display: none !important;
}

/* The corner pill. Small by design — this is a decoration
 * toggle, not a primary control, so it shouldn't compete with
 * the actual CTAs on the page. */
.starnest-dock {
  position: fixed;
  right: var(--sp-3);
  bottom: var(--sp-3);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}

/* Diagnostic FPS pill. Lives inside the starnest-dock as its
 * topmost flex child so it shares the dock's known-good fixed
 * positioning -- a loose `position: fixed` body child was
 * rendering in-flow on some pages, apparently because of an
 * ancestor containing-block quirk. Keeping the pill inside the
 * dock sidesteps that entirely.
 *
 * Colour-coded via `data-tier`:
 *   - ok    (>=55 fps) -- success green
 *   - warn  (>=30 fps) -- amber
 *   - bad   (< 30 fps) -- red
 *   - measuring        -- muted, shown before the first window
 */
.starnest-fps {
  align-self: flex-end;
  padding: 4px 10px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--muted-hi);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  box-shadow:
    var(--glass-highlight),
    0 6px 18px -10px color-mix(in srgb, black 60%, transparent);
  user-select: none;
  /* pointer-events are `none` on `.starnest-dock` and turned back
   * on for its direct children via `.starnest-dock > *`. The pill
   * is passive anyway, so explicitly keep it non-interactive. */
  pointer-events: none !important;
}
.starnest-fps[data-tier="ok"] {
  color: color-mix(in srgb, var(--success, #7ee787) 88%, white);
  border-color: color-mix(in srgb, var(--success, #7ee787) 40%, transparent);
}
.starnest-fps[data-tier="warn"] {
  color: #ffc978;
  border-color: color-mix(in srgb, #f5a524 45%, transparent);
}
.starnest-fps[data-tier="bad"] {
  color: #ff9f9f;
  border-color: color-mix(in srgb, var(--danger, #ff7b7b) 50%, transparent);
}
.starnest-fps[data-tier="measuring"] {
  color: var(--muted);
}
.starnest-dock > * {
  pointer-events: auto;
}
/* Segmented background picker. A single glass capsule containing
 * one button per shader (plus an Off choice); the active segment
 * lights up with accent color. Sized small on purpose — this is
 * decoration, not a primary control.
 *
 * On narrow viewports the picker collapses: the .starnest-picker__items
 * wrapper hides every non-active pill, leaving just the active one
 * and the leading .starnest-picker__toggle caret that flips the
 * collapse state. This keeps the dock short on phones where 4
 * pills would otherwise span half the viewport width. */
.starnest-picker {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 3px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 6%, transparent);
}
/* Pills live inside an inner wrapper so the collapse rule can
 * target just them (and not the leading collapse toggle) with a
 * single `:not([aria-pressed="true"])` selector. */
.starnest-picker__items {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
}
/* Picker toggle -- serves double duty:
 *   - When expanded, it's a chevron pinned to the start of the
 *     capsule; clicking it retracts the pills back into the
 *     collapsed icon.
 *   - When collapsed, it IS the picker (the pills are hidden),
 *     styled to match the gear so the two share one visual
 *     language -- a circular icon button floating next to the
 *     gear. The glyph is a generic sparkle, not one of the
 *     shader icons, so the trigger doesn't advertise which
 *     shader is currently running. */
.starnest-picker__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition:
    color 180ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    background 220ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 240ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 200ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
.starnest-picker__toggle:hover {
  color: var(--fg);
  background: color-mix(in srgb, white 5%, transparent);
}
.starnest-picker__toggle:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 1px var(--accent),
    0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
/* --- Collapsed state -----------------------------------------------
 * Hide the pill row entirely and reshape the capsule into a single
 * gear-sized circular button. The sparkle-glyph toggle becomes the
 * only thing visible, sized and styled to match .starnest-gear so
 * the two controls read as paired siblings in the dock.
 * -------------------------------------------------------------- */
.starnest-picker[data-collapsed="true"] .starnest-picker__items {
  display: none;
}
.starnest-picker[data-collapsed="true"] {
  /* Tight wrap around the single toggle -- no inner padding-gap
   * so the capsule is a clean circle, not a pill with slack. */
  padding: 0;
}
.starnest-picker[data-collapsed="true"] .starnest-picker__toggle {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  font-size: 14px;
  color: var(--muted-hi);
}
.starnest-picker[data-collapsed="true"] .starnest-picker__toggle:hover {
  color: var(--fg);
  /* Subtle accent ring echoing the gear's hover tint so the user
   * reads the two buttons as one family. */
  background: color-mix(in srgb, white 4%, transparent);
  transform: rotate(12deg);
}
.starnest-picker__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition:
    color 180ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    background 220ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow 240ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
.starnest-picker__item:hover {
  color: var(--fg);
  background: color-mix(in srgb, white 5%, transparent);
}
.starnest-picker__item:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 1px var(--accent),
    0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.starnest-picker__item[aria-pressed="true"] {
  color: var(--fg);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #a78bfa 26%, transparent) 0%,
    color-mix(in srgb, var(--accent) 16%, transparent) 100%
  );
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 22%, transparent),
    inset 0 0 0 1px color-mix(in srgb, #a78bfa 35%, transparent),
    0 4px 14px -8px color-mix(in srgb, #a78bfa 60%, transparent);
}
.starnest-toggle__icon {
  font-size: 12px;
  line-height: 1;
  opacity: 0.7;
}
.starnest-picker__item[aria-pressed="true"] .starnest-toggle__icon {
  opacity: 1;
  text-shadow: 0 0 6px color-mix(in srgb, var(--accent) 70%, transparent);
}
/* Controls row — the picker and the gear button sit side-by-side
 * at the bottom of the dock. The tune panel floats above it. */
.starnest-dock__controls {
  display: inline-flex;
  align-items: stretch;
  gap: 6px;
}

/* Gear button — matches the picker's glass capsule language so
 * the two feel like one surface. */
.starnest-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 14px;
  color: var(--muted-hi);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition:
    color 180ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 200ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 240ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    background 220ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
.starnest-gear:hover {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  transform: rotate(25deg);
}
.starnest-gear:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.starnest-gear[aria-expanded="true"] {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #a78bfa 22%, transparent) 0%,
    color-mix(in srgb, var(--accent) 12%, transparent) 100%
  );
  transform: rotate(60deg);
}

/* Tune panel. A small glass card that slides in from the bottom
 * above the controls. Contents: quality segmented control, a
 * speed slider, per-shader param sliders, and a reset. */
.starnest-tune {
  width: 260px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-sm),
    var(--glass-depth);
  font-size: var(--fs-xs);
  color: var(--muted-hi);
  transform-origin: bottom right;
  animation: starnest-tune-in 180ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
.starnest-tune[hidden] {
  display: none;
}
@keyframes starnest-tune-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.starnest-tune__title {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.starnest-tune__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.starnest-tune__row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.starnest-tune__label {
  color: var(--muted-hi);
}
.starnest-tune__value {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.starnest-tune__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
.starnest-tune__slider::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, #a78bfa 55%, transparent),
    color-mix(in srgb, var(--accent) 45%, transparent)
  );
}
.starnest-tune__slider::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, #a78bfa 55%, transparent),
    color-mix(in srgb, var(--accent) 45%, transparent)
  );
}
.starnest-tune__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #f4f4f6;
  border: 2px solid color-mix(in srgb, #a78bfa 80%, white);
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 160ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
.starnest-tune__slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f4f4f6;
  border: 2px solid color-mix(in srgb, #a78bfa 80%, white);
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 160ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
.starnest-tune__slider:hover::-webkit-slider-thumb { transform: scale(1.12); }
.starnest-tune__slider:hover::-moz-range-thumb     { transform: scale(1.12); }
.starnest-tune__slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent);
}
.starnest-tune__slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent);
}
.starnest-tune__slider:focus { outline: none; }

.starnest-tune__quality {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.starnest-tune__quality-item {
  flex: 1;
  min-width: 44px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition:
    color 180ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    background 200ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow 240ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
.starnest-tune__quality-item:hover {
  color: var(--fg);
  background: color-mix(in srgb, white 5%, transparent);
}
.starnest-tune__quality-item[aria-pressed="true"] {
  color: var(--fg);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #a78bfa 26%, transparent) 0%,
    color-mix(in srgb, var(--accent) 16%, transparent) 100%
  );
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 22%, transparent),
    inset 0 0 0 1px color-mix(in srgb, #a78bfa 35%, transparent);
}
.starnest-tune__quality-item:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 1px var(--accent),
    0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.starnest-tune__section[hidden] {
  display: none;
}

.starnest-tune__reset {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--muted-hi);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color 180ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 200ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1)),
    background 220ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
.starnest-tune__reset:hover {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, white 4%, transparent);
}
.starnest-tune__reset:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* On narrow viewports the segmented labels can crowd the page.
 * Below 480px, collapse to icon-only for the shader entries;
 * the "Off" item still shows its label since it has no icon.
 * The tune panel also narrows to avoid overflowing off-screen. */
@media (max-width: 480px) {
  .starnest-picker__item .starnest-toggle__label {
    display: none;
  }
  .starnest-picker__item:last-child .starnest-toggle__label {
    display: inline;
  }
  .starnest-tune {
    width: min(82vw, 240px);
  }
}
/* ==========================================================================
 * 7. Motion + polish
 *
 * Everything below this line is additive visual polish: entrance
 * animations, scroll-linked reveals, glass-border refinements,
 * hover micro-interactions. All of it is gated by
 * `prefers-reduced-motion: reduce`, and there's a no-JS fallback
 * that guarantees `[data-reveal]` content is visible within ~1.5s
 * even if the observer never runs.
 * ========================================================================== */

:root {
  --ease-out-quart: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --dur-hero:       780ms;
  --dur-reveal:     620ms;
  --dur-fast:       200ms;
}

/* `@property` lets the conic-gradient halo animate its angle as
 * a real numeric CSS var. Browsers without @property support
 * (older Safari) fall back to the initial-value angle — the halo
 * becomes a static gradient, which still looks good. */
@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* -- 7.1 Keyframes ------------------------------------------------------- */

@keyframes hero-rise {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes wire-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    filter: blur(10px);
  }
  to   {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

@keyframes headline-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

@keyframes halo-rotate {
  from { --angle: 0deg; }
  to   { --angle: 360deg; }
}

@keyframes wire-breathe {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, white 6%, transparent),
      0 20px 60px -24px color-mix(in srgb, #2a1458 90%, transparent),
      0 0 28px -8px color-mix(in srgb, #a78bfa 30%, transparent),
      0 4px 18px -8px color-mix(in srgb, black 60%, transparent);
  }
  50% {
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, white 9%, transparent),
      0 24px 72px -20px color-mix(in srgb, #2a1458 95%, transparent),
      0 0 48px -6px color-mix(in srgb, #a78bfa 48%, transparent),
      0 4px 18px -8px color-mix(in srgb, black 60%, transparent);
  }
}

@keyframes reveal-fallback {
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* -- 7.2 Hero entrance --------------------------------------------------- */

/* Hero entrance animations temporarily disabled — static layout so
 * glass / backdrop compositing matches without transform or filter
 * animation layers. Re-enable hero-rise / wire-breathe when ready. */
.hero--sell .retro-window__body > * {
  opacity: 1;
  transform: none;
  animation: none;
}
.hero--sell .hero-wire {
  opacity: 1;
  transform: none;
  filter: none;
  animation: none;
}

/* Hero headline — a slow gradient shimmer sweeps across the text
 * every 8.5s. The base color is still the foreground ink; the
 * gradient only picks up a trace of violet at its peak so the
 * text reads as animated without distracting from the copy.
 *
 * We redeclare the `animation` shorthand here (instead of letting
 * the parent `.retro-window__body > *` rule apply) because we
 * want two animations: the shared hero-rise entrance plus the
 * infinite shimmer. Including the stagger delay inline keeps the
 * hero sequence consistent with its siblings. */
.hero__headline {
  background: linear-gradient(
    110deg,
    var(--fg) 25%,
    #d5c4ff 50%,
    var(--fg) 75%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: none;
  /* Headline shimmer + stagger disabled with hero entrance — see
   * `.hero--sell .retro-window__body > *` above. */
  /* `text-shadow` does not combine with `background-clip: text` —
   * the shadow renders against the transparent glyph and reads
   * as a ghost outline. Use `filter: drop-shadow` instead, which
   * operates on the composited text + gradient and gives us the
   * same legibility win against the shader backdrop. */
  text-shadow: none;
  filter: drop-shadow(0 2px 10px color-mix(in srgb, black 55%, transparent));
  /* The `filter` rasterises glyphs at the element's line-box
   * height. The base `line-height: 1.04` on .hero__headline (set
   * in section 3) was tight enough that descenders on "g" and
   * the bottom of "." fell outside that bitmap and got clipped.
   * A fractional bump + a hair of bottom padding restores the
   * descender area without visibly loosening the headline. */
  line-height: 1.12;
  padding-bottom: 0.06em;
}

/* Subhead — keep the existing legibility shadow but add a subtle
 * violet glow so it floats above the backdrop. */
.hero__subhead {
  filter: drop-shadow(0 0 18px color-mix(in srgb, #a78bfa 18%, transparent));
}

/* -- 7.3 Hero halo (shader-off only) ----------------------------------- */

/* When the backdrop shader is off we lose the main source of
 * ambient motion on the page. Replace it with a subtle orbiting
 * conic-gradient halo behind the hero window so the hero is
 * never static. When the shader is on, this is suppressed — the
 * shader is the ambient motion. */
.retro-window {
  position: relative;
  isolation: isolate;
}
body:not(.has-starnest) .retro-window::before {
  content: "";
  position: absolute;
  inset: -60px;
  z-index: -1;
  background: conic-gradient(
    from var(--angle),
    transparent 0deg,
    color-mix(in srgb, #8b5cf6 28%, transparent) 60deg,
    transparent 140deg,
    transparent 220deg,
    color-mix(in srgb, #38bdf8 22%, transparent) 300deg,
    transparent 360deg
  );
  filter: blur(32px);
  opacity: 0.55;
  animation: none;
  pointer-events: none;
  border-radius: 50%;
}

/* -- 7.4 Glass border reflection --------------------------------------- */

/* A 1px gradient stroke that simulates light catching an edge.
 * Applied on top of the existing solid border via a masked
 * pseudo-element, so the base border stays as the accessibility
 * contrast line and the reflection is pure decoration.
 *
 * Only applied to elements that are actually cards — have a
 * background + border + radius of their own. `.product` is a
 * layout wrapper with no chrome, so adding a stroke to it would
 * trace a ghost box around its children (heading + table +
 * example) and look broken.
 *
 * The full set is the hero terminal plus every other glass card
 * on the landing page — pricing table, code blocks, and the
 * integrations / language tiles — so they all read as the same
 * piece of backlit glass. */
.hero-wire,
.pricing-spec,
.pre-block {
  position: relative;
  isolation: isolate;
}
.hero-wire::after,
.pricing-spec::after,
.pre-block::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, white 24%, transparent) 0%,
    color-mix(in srgb, white 0%, transparent) 38%,
    color-mix(in srgb, white 0%, transparent) 62%,
    color-mix(in srgb, white 16%, transparent) 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
          mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

/* -- 7.5 Scroll reveal --------------------------------------------------- */

/* Scroll-reveal disabled for now — content is always visible; JS may
 * still add `.is-visible` but it is a no-op. Re-enable fade + rise
 * when motion is tuned with glass compositing. */
[data-reveal] {
  opacity: 1;
  transform: none;
  transition: none;
  will-change: auto;
  animation: none;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* -- 7.6 Micro-interactions --------------------------------------------- */

/* Stat cards lift on hover. */
.stat-row > li {
  transition:
    transform 280ms var(--ease-out-quart),
    border-color 280ms var(--ease-out-quart),
    box-shadow 280ms var(--ease-out-quart);
}
.stat-row > li:hover {
  transform: translate3d(0, -2px, 0);
  border-color: color-mix(in srgb, white 14%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 12%, transparent),
    0 14px 36px -16px color-mix(in srgb, #2a1458 70%, transparent),
    0 6px 18px -10px color-mix(in srgb, black 60%, transparent);
}

/* Buttons — replace the flat 120ms linear transitions with a
 * spring-ish curve and a small lift. */
.btn {
  transition:
    transform 220ms var(--ease-out-quart),
    background 220ms var(--ease-out-quart),
    border-color 220ms var(--ease-out-quart),
    color 220ms var(--ease-out-quart),
    box-shadow 220ms var(--ease-out-quart);
}
.btn:hover {
  transform: translate3d(0, -1px, 0);
  box-shadow:
    0 10px 28px -14px color-mix(in srgb, var(--accent) 55%, transparent),
    0 4px 14px -8px color-mix(in srgb, black 60%, transparent);
}
.btn.primary:hover {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 44%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 20%, transparent),
    0 0 0 1px color-mix(in srgb, #a78bfa 55%, transparent),
    0 10px 24px -6px color-mix(in srgb, #8b5cf6 78%, transparent),
    0 18px 40px -14px color-mix(in srgb, #3b82f6 65%, transparent);
}
.btn:active {
  transform: translate3d(0, 0, 0);
}

/* Chip lift. */
.x402-chip,
.stellar-chip {
  transform: translate3d(0, 0, 0);
  transition:
    transform 240ms var(--ease-out-quart),
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 240ms ease;
}
.x402-chip:hover,
.stellar-chip:hover {
  transform: translate3d(0, -1px, 0);
}

/* Nav underline reveal. Brand is excluded — logos don't animate. */
.site-nav a:not(.brand) {
  position: relative;
  transition: color 200ms var(--ease-out-quart);
}
.site-nav a:not(.brand)::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -3px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 70%, transparent),
    transparent
  );
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 280ms var(--ease-out-quart);
}
.site-nav a:not(.brand):hover::after,
.site-nav a:not(.brand)[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Code block hover was previously a full-width diagonal shimmer
 * sweep via ::after. Removed: the translucent purple band was
 * interfering with the dark-glass reading at rest (even off-screen
 * the gradient contributed a faint wash to the element), which
 * broke the "same material as the hero terminal" pass. The code
 * block now reads as pure dark glass with only the shared inset
 * highlight + haze shadows defining its edges. */

/* Pricing table row hover — a barely-there highlight. */
.pricing-spec tbody tr {
  transition: background-color 220ms var(--ease-out-quart);
}
.pricing-spec tbody tr:hover {
  background-color: color-mix(in srgb, white 3%, transparent);
}

/* Brand mark hover — a slight lift and sharpen. */
.site-nav .brand {
  transition: transform 200ms var(--ease-out-quart);
}
.site-nav .brand:hover {
  transform: translate3d(0, -1px, 0);
}

/* Footer attrib — smoother hover on the links. */
.footer-sell a {
  transition: color 200ms var(--ease-out-quart);
}

/* -- 7.7 Reduced-motion escape hatch ----------------------------------- */

/* One place to disable everything above. We deliberately force
 * final-state values so content never sits mid-animation for
 * users who opt out of motion. */
@media (prefers-reduced-motion: reduce) {
  .hero--sell .retro-window__body > *,
  .hero--sell .hero-wire,
  .hero__headline {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .hero__headline {
    background: none !important;
    -webkit-text-fill-color: var(--fg) !important;
    color: var(--fg) !important;
  }
  body:not(.has-starnest) .retro-window::before {
    animation: none !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  .btn,
  .stat-row > li,
  .x402-chip,
  .stellar-chip,
  .pricing-spec tbody tr,
  .site-nav a:not(.brand),
  .site-nav a:not(.brand)::after,
  .site-nav .brand,
  .footer-sell a {
    transition: none !important;
    animation: none !important;
  }
}

/* -- 7.8 Flow and rhythm ------------------------------------------------
 *
 * Every section on the landing page opens with a `.section-intro`
 * — a small uppercase eyebrow, the h2, and a one-line subtitle,
 * all centred. The dense content below (code blocks, pricing
 * tables, product cards) is then centred in a narrower column
 * inside the 960px wrap. This gives the page a repeating beat:
 *
 *   [eyebrow]           <- .section-intro__eyebrow, centred
 *   HEADLINE            <- h2, centred
 *   one-line subtitle   <- .section-intro__sub, centred
 *   [dense content]     <- pre-block / table / product card,
 *                          left-aligned internally but centred
 *                          as a column.
 *
 * The hero already uses a centred layout, so sections below the
 * hero inherit the same axis of symmetry instead of pulling left. */

.section-intro {
  max-width: 56ch;
  margin: 0 auto var(--sp-6);
  text-align: center;
}
.section-intro__eyebrow {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 var(--sp-2);
  opacity: 0.85;
}
.section-intro h2 {
  margin: 0 0 var(--sp-3);
}
/* Shared styling for the one-liner beneath the h2. The explicit
 * `.retro-lede` override wins over the default left-aligned lede
 * rule (section 4) when a lede lives inside an intro block. */
.section-intro__sub,
.section-intro .retro-lede {
  max-width: 56ch;
  margin: 0 auto;
  color: var(--muted-hi);
  font-size: var(--fs-md);
  line-height: 1.55;
  text-align: center;
}

/* Centred content columns. Each dense block sits in its own
 * comfortable reading width, centred inside the wrap. The
 * `.pre-block--col` modifier is additive so a future left-
 * aligned pre-block in a table cell won't accidentally collapse. */
.pre-block--col {
  max-width: 720px;
  margin-inline: auto;
}
.section-pricing > .product {
  max-width: 820px;
  margin-inline: auto;
}

/* Section rhythm.
 *
 * Each post-hero section gets generous vertical padding so it
 * reads as its own "scene" rather than a dense column. On phones
 * we pin the floor to one small-viewport-height so every section
 * behaves like a self-contained screen the reader swipes past —
 * exactly what narrative single-page sites (Stripe, Vercel,
 * Linear) do on mobile. The hero sits outside <main> and keeps
 * its own padding; we don't touch it. */
main > section {
  padding-block: var(--sp-7);
  /* Deep-link anchor buffer for the sticky nav (~56px tall). */
  scroll-margin-top: 72px;
}

@media (max-width: 720px) {
  main > section {
    /* `svh` (small viewport height) avoids the "section height
     * jumps when the Safari URL bar collapses" class of bug that
     * plain `vh` is known for. Content shorter than one screen
     * gets centred; taller content expands past it normally. */
    min-height: 100svh;
    padding-block: var(--sp-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  /* Keep section children (intro header + payload) at their
   * natural size inside the flex column — we only want the
   * vertical centring, not stretched cards / tables. */
  main > section > * {
    flex: 0 0 auto;
  }
}

/* -- 7.9 Hero primary CTA ----------------------------------------------
 *
 * The "Try it" button is the single action a first-time visitor
 * should feel pulled to click. It gets its own treatment so the
 * calmer `.btn.primary` buttons used elsewhere (wallet connect,
 * API playground submits) can stay utilitarian.
 *
 * Layered effects:
 *   1. Animated gradient background (violet -> indigo -> blue, 6s sweep)
 *   2. Conic hero halo via ::before (rotating blurred glow)
 *   3. Specular shimmer sweep via ::after (~4s cadence)
 *   4. Glass chrome: inner highlight, outer ring, dual drop shadows
 *   5. Arrow that slides right on hover + 2px lift + 1.02 scale
 *
 * Respects prefers-reduced-motion: all animations and the hover
 * lift collapse to the base solid state.
 */
.btn--hero {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #fff;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, white 28%, transparent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background-image:
    linear-gradient(
      180deg,
      color-mix(in srgb, white 22%, transparent) 0%,
      transparent 55%
    ),
    linear-gradient(
      110deg,
      #8b5cf6 0%,
      #6366f1 35%,
      #3b82f6 65%,
      #8b5cf6 100%
    );
  background-size: 100% 100%, 220% 100%;
  background-position: 0 0, 0% 50%;
  background-color: #6366f1;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 34%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 18%, transparent),
    0 0 0 1px color-mix(in srgb, #a78bfa 42%, transparent),
    0 10px 28px -8px color-mix(in srgb, #8b5cf6 70%, transparent),
    0 18px 48px -14px color-mix(in srgb, #3b82f6 55%, transparent);
  animation: hero-cta-sheen 6s ease-in-out infinite;
  transition:
    transform 260ms var(--ease-out-quart),
    box-shadow 260ms var(--ease-out-quart),
    filter 260ms var(--ease-out-quart),
    border-color 260ms var(--ease-out-quart);
}

@keyframes hero-cta-sheen {
  0%, 100% { background-position: 0 0,   0% 50%; }
  50%      { background-position: 0 0, 100% 50%; }
}

.btn--hero::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(
    from var(--angle),
    #8b5cf6 0deg,
    #38bdf8 120deg,
    #a78bfa 240deg,
    #8b5cf6 360deg
  );
  filter: blur(12px);
  opacity: 0.55;
  animation: halo-rotate 7s linear infinite;
  pointer-events: none;
  transition:
    opacity 260ms var(--ease-out-quart),
    filter 260ms var(--ease-out-quart);
}

.btn--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: linear-gradient(
    115deg,
    transparent 38%,
    color-mix(in srgb, white 40%, transparent) 50%,
    transparent 62%
  );
  background-size: 220% 100%;
  background-position: 160% 0;
  background-repeat: no-repeat;
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: hero-cta-shimmer 4s var(--ease-out-expo) 1.2s infinite;
}

@keyframes hero-cta-shimmer {
  0%   { background-position: 160% 0; }
  55%  { background-position: -60% 0; }
  100% { background-position: -60% 0; }
}

.btn--hero__label,
.btn--hero__arrow {
  position: relative;
  z-index: 1;
}
.btn--hero__arrow {
  display: inline-block;
  font-weight: 500;
  transition: transform 260ms var(--ease-out-expo);
  will-change: transform;
}

.btn--hero:hover {
  transform: translate3d(0, -2px, 0) scale(1.02);
  filter: brightness(1.08);
  border-color: color-mix(in srgb, white 42%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 44%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 20%, transparent),
    0 0 0 1px color-mix(in srgb, #a78bfa 60%, transparent),
    0 14px 34px -6px color-mix(in srgb, #8b5cf6 85%, transparent),
    0 24px 60px -14px color-mix(in srgb, #3b82f6 75%, transparent);
}
.btn--hero:hover::before {
  opacity: 0.85;
  filter: blur(16px);
}
.btn--hero:hover .btn--hero__arrow {
  transform: translateX(4px);
}

.btn--hero:active {
  transform: translate3d(0, 0, 0) scale(1.0);
  filter: brightness(0.96);
  transition-duration: 120ms;
}

.btn--hero:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 44%, transparent),
    inset 0 -1px 0 color-mix(in srgb, black 20%, transparent),
    0 0 0 3px color-mix(in srgb, #a78bfa 65%, transparent),
    0 14px 34px -6px color-mix(in srgb, #8b5cf6 85%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .btn--hero,
  .btn--hero::before,
  .btn--hero::after,
  .btn--hero__arrow {
    animation: none !important;
    transition: none !important;
  }
  .btn--hero:hover {
    transform: none !important;
    filter: none !important;
  }
  .btn--hero:hover .btn--hero__arrow {
    transform: none !important;
  }
}

/* -- 7.10 Integrations grid (REMOVED) ---------------------------------
 *
 * The dedicated `#clients` section ("One package. Every MCP host.")
 * was removed: it had become redundant with the Install section
 * (`pip install stoka-agent` in step 1 + host tabs in step 2) and
 * the single-card grid had a visibly awkward "lone tile" layout on
 * desktop regardless of the `--solo` modifier. The adapter-list
 * signal ("LangChain, LlamaIndex, CrewAI, Pydantic AI") was folded
 * into step 1's subtitle so that detail isn't lost.
 *
 * All `.integrations-grid*` + `.integ-card*` selectors have been
 * retired along with the HTML that used them; git history has the
 * full ruleset if a proper framework-card grid ever returns.
 */

/* -- 8. ADA polish -----------------------------------------------------
 *
 * Everything in this section was added during the "win an Apple
 * Design Award" pass and is deliberately grouped at the bottom so
 * it can be audited / pulled without disturbing earlier cascade
 * layers. Each sub-block names its DOM hooks.
 *
 * Contents:
 *  8.1  Skip-to-content link (all pages)
 *  8.2  Hero terminal typing animation (index.html)
 *  8.3  Integrations flagship card (removed; see 7.10 note)
 *  8.4  Pricing calculator (index.html, #price section)
 *  8.5  Dashboard title + keyboard-hint button
 *  8.6  Dashboard KPI card states: idle / loading / ready
 *       — skeleton shimmer
 *       — trend pill
 *       — mini sparkline canvas
 *  8.7  Dashboard chart / heatmap empty state overlay
 *  8.8  Dashboard table empty state
 *  8.9  Dashboard keyboard shortcut <dialog>
 * -------------------------------------------------------------- */

/* 8.1  Skip link
 * ---------------------------------------------------------------
 * Off-screen until focused. When a keyboard user hits Tab on page
 * load, the link springs into the top-left corner so they can
 * jump past the nav / hero directly to the main content. */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 60;
  padding: 8px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, #0a0b0d 92%, transparent);
  border: 1px solid var(--border-em);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 160ms ease;
  box-shadow: var(--shadow-focus);
}
.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

/* 8.2  Hero terminal typing animation
 * ---------------------------------------------------------------
 * While `[data-typing="1"]` is set by `heroWire.ts`, each
 * `[data-wire-line]` starts faded out and slightly nudged down.
 * The script flips `[data-active]` on each line in sequence; the
 * transition does the work. On `[data-typing="0"]` (reduced
 * motion, off-screen, or post-animation) lines render as normal. */
.hero-wire[data-hero-wire] {
  position: relative;
}
.hero-wire[data-hero-wire] [data-wire-line] {
  display: inline;
  transition:
    opacity 260ms ease,
    filter 260ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-wire[data-hero-wire][data-typing="1"] [data-wire-line]:not([data-active]):not([data-done]) {
  opacity: 0;
  filter: blur(2px);
  transform: translateY(3px);
}
.hero-wire[data-hero-wire] [data-wire-line][data-active],
.hero-wire[data-hero-wire] [data-wire-line][data-done] {
  opacity: 1;
  filter: none;
  transform: none;
}
/* Gap lines are empty spans that exist only to pace the animation;
 * they must not render as visible blanks after the newline they
 * sit on. `display:inline` with 0 content is correct. */
.hero-wire .wire__gap {
  display: inline;
}
/* Caret — absolutely positioned, scripted to follow the active
 * line. Blinks while typing, fades out after the last line. */
.hero-wire .wire__caret {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 1.15em;
  background: color-mix(in srgb, #a78bfa 80%, white 20%);
  border-radius: 1px;
  transform: translateY(2px);
  opacity: 0;
  transition: opacity 120ms ease;
}
.hero-wire[data-hero-wire][data-typing="1"] .wire__caret {
  opacity: 0.9;
  animation: hero-wire-caret 900ms steps(2) infinite;
}
@keyframes hero-wire-caret {
  0%, 49% { opacity: 0.9; }
  50%, 100% { opacity: 0.15; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-wire[data-hero-wire] [data-wire-line] {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-wire .wire__caret {
    animation: none !important;
    opacity: 0 !important;
  }
}

/* 8.3  Integrations flagship card (REMOVED)
 * ---------------------------------------------------------------
 * Retired alongside section 7.10 when the `#clients` landing-page
 * block was dropped. See the note at 7.10 for the full rationale. */

/* 8.4  Pricing calculator
 * ---------------------------------------------------------------
 * Glass panel that sits under the Blobs product spec. Two columns
 * on desktop (inputs | outputs), single column under 820px.
 * Inputs use a custom range-track (--fill var driven by JS) so
 * the filled portion matches brand accent. */
.pricing-calc {
  margin-top: var(--sp-7);
  padding: var(--sp-6) var(--sp-6) var(--sp-5);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, #1a1c22 72%, transparent),
      color-mix(in srgb, #121317 78%, transparent));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-sm),
    var(--glass-depth);
}
.pricing-calc__head {
  margin-bottom: var(--sp-5);
}
.pricing-calc__title {
  font-size: var(--fs-xl);
  font-weight: 600;
  margin: 0 0 var(--sp-2);
  letter-spacing: -0.01em;
}
.pricing-calc__sub {
  margin: 0;
  color: var(--muted-hi);
  font-size: var(--fs-sm);
}
.pricing-calc__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  align-items: start;
}
@media (max-width: 820px) {
  .pricing-calc__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }
}
.pricing-calc__inputs {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.pricing-calc__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px var(--sp-3);
  align-items: baseline;
}
.pricing-calc__row-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted-hi);
  letter-spacing: -0.005em;
}
.pricing-calc__row-value {
  font-variant-numeric: tabular-nums;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--fg);
}
/* Custom range track: filled portion is driven by `--fill` which
 * JS updates on every `input` event (see `pricingCalc.ts`). */
.pricing-calc__row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  grid-column: 1 / -1;
  width: 100%;
  height: 6px;
  margin: 0;
  background: linear-gradient(
    to right,
    color-mix(in srgb, #a78bfa 80%, transparent) 0%,
    color-mix(in srgb, #a78bfa 80%, transparent) var(--fill, 0%),
    rgba(255, 255, 255, 0.08) var(--fill, 0%),
    rgba(255, 255, 255, 0.08) 100%
  );
  border-radius: 999px;
  cursor: pointer;
  outline: none;
}
.pricing-calc__row input[type="range"]:focus-visible {
  box-shadow: var(--shadow-focus);
}
/* Thumb — big enough to grab on touch, styled on both engines. */
.pricing-calc__row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f4f4f6;
  border: 2px solid color-mix(in srgb, #a78bfa 80%, transparent);
  box-shadow: 0 4px 12px -4px color-mix(in srgb, #8b5cf6 70%, transparent);
  cursor: grab;
  transition: transform 120ms ease;
}
.pricing-calc__row input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f4f4f6;
  border: 2px solid color-mix(in srgb, #a78bfa 80%, transparent);
  box-shadow: 0 4px 12px -4px color-mix(in srgb, #8b5cf6 70%, transparent);
  cursor: grab;
}
.pricing-calc__row input[type="range"]:active::-webkit-slider-thumb,
.pricing-calc__row input[type="range"]:active::-moz-range-thumb {
  transform: scale(1.12);
  cursor: grabbing;
}
.pricing-calc__toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  border: none;
}
.pricing-calc__toggle legend {
  font-size: var(--fs-sm);
  color: var(--muted-hi);
  font-weight: 500;
  float: left;
  margin-right: var(--sp-3);
}
.pricing-calc__radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.pricing-calc__radio:has(input:checked) {
  background: color-mix(in srgb, #a78bfa 14%, transparent);
  border-color: color-mix(in srgb, #a78bfa 45%, transparent);
  color: var(--fg);
}
.pricing-calc__radio input {
  accent-color: #a78bfa;
}
/* Outputs: three stacked pills; the "monthly" one gets the head
 * treatment (larger number, gradient border). */
.pricing-calc__out {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.pricing-calc__pill {
  padding: var(--sp-4) var(--sp-4);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}
.pricing-calc__pill--head {
  background:
    linear-gradient(140deg,
      color-mix(in srgb, #a78bfa 14%, transparent),
      color-mix(in srgb, #7aa2f7 10%, transparent));
  border-color: color-mix(in srgb, #a78bfa 36%, transparent);
}
.pricing-calc__pill-label {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-hi);
  font-weight: 600;
}
.pricing-calc__pill-value {
  margin: 0 0 2px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.pricing-calc__pill-value--head {
  font-size: 34px;
}
.pricing-calc__unit {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-hi);
  margin-left: 4px;
}
.pricing-calc__pill-sub {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
/* Monthly flash animation: short pulse on the number box when the
 * input changes. Keyed off `[data-just-updated]`; see
 * `pricingCalc.ts` for the reflow trick. */
.pricing-calc__pill-value--head[data-just-updated],
.pricing-calc__pill--head:has([data-just-updated]) .pricing-calc__pill-value--head {
  animation: pricing-flash 520ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes pricing-flash {
  0%   { color: #f4f4f6; text-shadow: 0 0 0 transparent; }
  40%  { color: #d4bfff; text-shadow: 0 0 18px color-mix(in srgb, #a78bfa 60%, transparent); }
  100% { color: var(--fg); text-shadow: 0 0 0 transparent; }
}
.pricing-calc__footnote {
  margin: var(--sp-5) 0 0;
  font-size: 12px;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .pricing-calc__pill-value--head[data-just-updated] {
    animation: none !important;
  }
}

/* 8.5  Dashboard title + keyboard hint
 * ---------------------------------------------------------------
 * Title-row button that opens the `<dialog>` shortcut sheet and
 * doubles as a visual hint that the page is keyboard-driven. */
.dash-title {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0 0 4px;
}
.dash-kbd-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.dash-kbd-hint:hover,
.dash-kbd-hint:focus-visible {
  border-color: var(--border-em);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}
.dash-kbd-hint kbd {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-hi);
  background: transparent;
  border: none;
  padding: 0;
}

/* 8.6  Dashboard KPI card states
 * ---------------------------------------------------------------
 * Each `.kpi-card` starts `[data-state="idle"]` (grey-ish, "—"
 * everywhere), moves to `[data-state="loading"]` during a fetch
 * (skeleton shimmer on number + trend + sparkline), then settles
 * on `[data-state="ready"]` with live values. */
.kpi-card {
  position: relative;
}
.kpi-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: 4px;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 180ms ease;
  min-height: 20px;
}
.kpi-card[data-state="ready"] .kpi-trend {
  opacity: 1;
}
.kpi-trend[data-dir="up"] {
  color: #7ee787;
  background: color-mix(in srgb, #7ee787 16%, transparent);
  border: 1px solid color-mix(in srgb, #7ee787 40%, transparent);
}
.kpi-trend[data-dir="down"] {
  color: #ff9a7b;
  background: color-mix(in srgb, #ff7b7b 16%, transparent);
  border: 1px solid color-mix(in srgb, #ff7b7b 40%, transparent);
}
.kpi-trend[data-dir="flat"],
.kpi-trend[data-dir=""] {
  color: var(--muted-hi);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
/* Skeleton shimmer for loading state. We overlay a moving
 * gradient over the number / sub / canvas so the same DOM shape
 * is used but the content is blocked. */
.kpi-spark {
  display: block;
  width: 100%;
  max-width: 120px;
  height: 22px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 240ms ease;
}
.kpi-card[data-state="ready"] .kpi-spark {
  opacity: 0.95;
}
.kpi-card[data-state="loading"] .kpi-number,
.kpi-card[data-state="loading"] .kpi-sub,
.kpi-card[data-state="loading"] .kpi-trend,
.kpi-card[data-state="loading"] .kpi-spark {
  color: transparent !important;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.10) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 300% 100%;
  animation: kpi-skeleton 1400ms ease infinite;
  border-radius: 6px;
  opacity: 1;
}
.kpi-card[data-state="loading"] .kpi-trend {
  border-color: transparent;
}
.kpi-card[data-state="loading"] .kpi-unit {
  visibility: hidden;
}
@keyframes kpi-skeleton {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .kpi-card[data-state="loading"] .kpi-number,
  .kpi-card[data-state="loading"] .kpi-sub,
  .kpi-card[data-state="loading"] .kpi-trend,
  .kpi-card[data-state="loading"] .kpi-spark {
    animation: none !important;
  }
}
/* Odometer flash: the KPI number pulses briefly when its
 * text content changes (set by JS via data-just-updated). */
.kpi-number[data-just-updated] {
  animation: kpi-pulse 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes kpi-pulse {
  0%   { text-shadow: 0 0 0 transparent; }
  50%  { text-shadow: 0 0 14px color-mix(in srgb, #a78bfa 55%, transparent); }
  100% { text-shadow: 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .kpi-number[data-just-updated] {
    animation: none !important;
  }
}

/* 8.7  Dashboard chart / heatmap empty state overlay
 * ---------------------------------------------------------------
 * The overlay covers the chart / heatmap body with a dashed
 * outline and a two-line message. Visibility is driven by the
 * parent's `[data-card-state="idle"]` — JS flips it to "ready"
 * the first time data lands. */
.dash-chart-card {
  position: relative;
}
.dash-card-empty {
  position: absolute;
  top: 52px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  padding: var(--sp-6) var(--sp-5);
  border: 1.5px dashed color-mix(in srgb, #a78bfa 35%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, #0a0b0d 60%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--muted-hi);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.dash-chart-card[data-card-state="idle"] .dash-card-empty {
  opacity: 1;
}
.dash-card-empty__title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.dash-card-empty__sub {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted);
  max-width: 40ch;
}
.dash-card-empty code {
  color: var(--muted-hi);
}
/* Hide the heatmap cells themselves while idle so the empty-state
 * overlay is the only thing visible. */
.dash-chart-card[data-card-state="idle"] .heatmap,
.dash-chart-card[data-card-state="idle"] .heatmap-legend,
.dash-chart-card[data-card-state="idle"] .chart-wrap {
  opacity: 0.25;
  filter: grayscale(0.3);
}

/* 8.8  Dashboard table empty state
 * ---------------------------------------------------------------
 * Replaces the bare "No activity loaded yet." cell with a
 * centred, two-line block inside the td. */
.dash-table-empty td {
  padding: var(--sp-7) var(--sp-5) !important;
  text-align: center;
}
.dash-table-empty__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dash-table-empty__title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.dash-table-empty__sub {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted);
  max-width: 44ch;
}
.dash-table-empty__sub a {
  color: var(--accent-hi);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, #7aa2f7 40%, transparent);
}
.dash-table-empty__sub a:hover {
  border-bottom-color: var(--accent-hi);
}

/* 8.9  Dashboard keyboard shortcut dialog
 * ---------------------------------------------------------------
 * Native <dialog> element, styled to match the glass cards.
 * Shown / hidden by JS via `.showModal()` / `close()`. */
.dash-kbd-sheet {
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, #0a0b0d 92%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  color: var(--fg);
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: var(--glass-haze-lg), var(--glass-depth);
}
.dash-kbd-sheet::backdrop {
  background: color-mix(in srgb, #05060a 70%, transparent);
  backdrop-filter: blur(4px);
}
.dash-kbd-sheet__body {
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
}
.dash-kbd-sheet__body h2 {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.dash-kbd-sheet__list {
  list-style: none;
  margin: 0 0 var(--sp-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.dash-kbd-sheet__list li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--muted-hi);
}
.dash-kbd-sheet__list kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-hi);
  border-bottom-width: 2px;
  border-radius: 5px;
}
.dash-kbd-sheet__footer {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

/* ================================================================
 * 9. Pass 4 — MCP-first positioning
 * ================================================================
 * Originally introduced a dedicated `#clients` section + a paired
 * "Install in Claude Desktop / Cursor" block. The `#clients`
 * section was later dropped (see the 7.10 note), leaving only the
 * MCP install walkthrough below, which carries the full "works
 * with every host" story via its tab strip. The install cards
 * reuse existing glass tokens so they read as siblings of the
 * surviving `.pre-block` / `.hero-wire` chrome on the page. */

/* 9.1  Solo client grid (REMOVED)
 * ---------------------------------------------------------------
 * Retired alongside section 7.10 when the `#clients` landing-page
 * block was dropped. See the note at 7.10 for the full rationale. */

/* 9.2  Install walkthrough
 * ---------------------------------------------------------------
 * A vertical 3-step flow: pip install, host-tabbed JSON block,
 * restart hint. The JSON itself is identical across every host
 * (that's the whole "works everywhere" story), so instead of
 * repeating the block per host we show *one* block and a tab
 * strip that only swaps the config file path + restart hint.
 *
 * Each step is a glass card that echoes the hero/product glass
 * recipe (same border gradient, same haze layer). Step 2 also
 * has a small secondary tier inside: the host tab strip + a
 * `[role="tabpanel"]` holding the path + code block.
 *
 * The `.mcp-panels__foot` class is retained below for the
 * trailing "each call signs..." paragraph so the shader-legibility
 * rules (which list `.mcp-panels__foot` by name) continue to
 * apply without further selector churn. */
.install-steps {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.install-step {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: var(--sp-4);
  align-items: start;
  padding: var(--sp-5);
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-sm),
    var(--glass-depth);
}
/* Same gradient-border highlight recipe the hero terminal and
 * product cards use. Keeps the glass family visually consistent. */
.install-step::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, white 24%, transparent) 0%,
    color-mix(in srgb, white 0%, transparent) 38%,
    color-mix(in srgb, white 0%, transparent) 62%,
    color-mix(in srgb, white 16%, transparent) 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
          mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.install-step__num {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--fg);
  background: color-mix(in srgb, white 8%, transparent);
  border: 1px solid color-mix(in srgb, white 14%, transparent);
  font-variant-numeric: tabular-nums;
}

.install-step__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.install-step__title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1.25;
}
.install-step__sub {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted-hi);
  line-height: 1.55;
}
.install-step__sub code,
.install-step__sub kbd {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, white 6%, transparent);
  border: 1px solid color-mix(in srgb, white 8%, transparent);
  color: var(--fg);
}

/* Tighten the code block inside the step: the outer glass already
 * provides the card chrome, so the inner `<pre>` just needs to be
 * readable -- no second frosted recipe. */
.install-step .pre-block {
  margin: 0;
  border-radius: var(--radius-md, 12px);
  background: color-mix(in srgb, #0a0b0f 88%, transparent);
  border: 1px solid color-mix(in srgb, white 8%, transparent);
  box-shadow: none;
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.install-step .pre-block::after {
  content: none;
}

/* Host tab strip inside Step 2. Pill-shaped buttons; exactly one
 * tab carries `[data-active="true"]` and `tabindex="0"` at any
 * time -- the rest are `tabindex="-1"` and reachable via arrow
 * keys, matching the WAI-ARIA tab pattern. */
.install-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.install-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, white 10%, transparent);
  background: color-mix(in srgb, white 4%, transparent);
  color: var(--muted-hi);
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}
.install-tab:hover {
  color: var(--fg);
  background: color-mix(in srgb, white 7%, transparent);
  border-color: color-mix(in srgb, white 18%, transparent);
}
.install-tab:focus-visible {
  outline: 2px solid var(--accent, #7ee787);
  outline-offset: 2px;
}
.install-tab[data-active="true"] {
  color: var(--fg);
  background: color-mix(in srgb, white 10%, transparent);
  border-color: color-mix(in srgb, white 28%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, white 10%, transparent) inset;
}
.install-tab__mark {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  flex: 0 0 auto;
}
.install-tab__mark svg {
  width: 100%;
  height: 100%;
  display: block;
}
.install-tab__label {
  white-space: nowrap;
}

.install-config {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.install-config__path {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted-hi);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.install-config__path-label {
  color: var(--muted);
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.install-config__path code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.92em;
  padding: 2px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, white 6%, transparent);
  border: 1px solid color-mix(in srgb, white 8%, transparent);
  color: var(--fg);
  overflow-wrap: anywhere;
}

/* Network hint row. Reuses .install-config__path for the label +
 * pill pairing so the JSON block is bracketed by two matching
 * rows ("Add to ~/.cursor/mcp.json" above, "Network Stellar
 * testnet …" below), then tints the testnet pill accent-green so
 * a reader scanning the page at 2m catches "this is testnet"
 * even without reading the JSON. The hint paragraph wraps beside
 * the pill on wide viewports and below it on phones; inline
 * <code> tags inside keep the monospace tokens readable without
 * triggering the full pre-block styling. */
.install-config__net code:first-of-type {
  color: color-mix(in srgb, var(--success, #7ee787) 90%, white);
  background: color-mix(in srgb, var(--success, #7ee787) 14%, transparent);
  border-color: color-mix(in srgb, var(--success, #7ee787) 40%, transparent);
}
.install-config__net-hint {
  flex: 1 1 200px;
  font-size: 0.86em;
  color: var(--muted);
  line-height: 1.45;
}
.install-config__net-hint code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 3px;
  background: color-mix(in srgb, white 5%, transparent);
  border: 1px solid color-mix(in srgb, white 6%, transparent);
  color: var(--muted-hi);
}
.install-config__net-hint a {
  color: color-mix(in srgb, var(--accent, #a78bfa) 90%, white);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent, #a78bfa) 40%, transparent);
  text-underline-offset: 2px;
}
.install-config__net-hint a:hover {
  text-decoration-color: color-mix(in srgb, var(--accent, #a78bfa) 80%, white);
}

@media (max-width: 600px) {
  .install-step {
    grid-template-columns: 36px 1fr;
    padding: var(--sp-4);
    gap: var(--sp-3);
  }
  .install-step__num {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    border-radius: 10px;
  }
}

/* Trailing paragraph under the install steps. Class name retained
 * (was .mcp-panels__foot back when this section was a pair of
 * panels) so the shader-legibility rule in section 4.x which lists
 * `.mcp-panels__foot` by name still applies. */
.mcp-panels__foot {
  max-width: 720px;
  margin: var(--sp-5) auto 0;
  text-align: center;
  color: var(--muted-hi);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

/* 9.3  Product example callout
 * ---------------------------------------------------------------
 * Small inset card inside `.product__header`, sitting between the
 * subtitle and the endpoint pricing table. Semantically `<aside>`
 * so screen readers announce it as supplementary, not as a second
 * paragraph of the product description. Visually a tinted stripe
 * (left accent bar) so it reads as an example, not a warning. */
.product__example {
  margin: var(--sp-4) 0 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md, 12px);
  background: color-mix(in srgb, #a78bfa 8%, transparent);
  border: 1px solid color-mix(in srgb, #a78bfa 24%, transparent);
  border-left: 3px solid color-mix(in srgb, #a78bfa 70%, transparent);
}
.product__example-lede {
  margin: 0;
  color: var(--muted-hi);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.product__example-lede strong {
  color: var(--fg);
}
.product__example-lede code {
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, white 6%, transparent);
  border: 1px solid color-mix(in srgb, white 8%, transparent);
}

/* 9.4  Claude Desktop example conversation
 * ---------------------------------------------------------------
 * A stylized chat transcript that shows the `stoka-mcp` server
 * being used from Claude Desktop across two sessions. Not a
 * pixel-mimic of Claude's real UI -- we keep it in the site's
 * glass family so (a) it reads as "our example" not as a
 * screenshot, and (b) it won't look dated if Claude Desktop's
 * chrome changes.
 *
 * Layout per turn: role label on the left (narrow gutter), bubble
 * on the right. User bubbles stay neutral; Claude bubbles get a
 * purple accent stripe so the eye can scan which side is which
 * without reading the role label. Tool calls are inset chips
 * inside the Claude bubble, with the atomic USDC cost pinned
 * right so it scans as a price, not as more text. */
.section-example > .section-intro {
  margin-bottom: var(--sp-6);
}

.claude-log {
  position: relative;
  isolation: isolate;
  max-width: 820px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  border-radius: var(--radius-xl, 20px);
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow:
    var(--glass-highlight),
    var(--glass-haze-sm),
    var(--glass-depth);
}
/* Same gradient-border highlight used on `.pre-block` / `.mcp-panel`
 * so the conversation card reads as family, not as a one-off.
 * Previously referenced `.integ-card`; that selector was retired
 * with the `#clients` section (see 7.10 note). */
.claude-log::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, white 24%, transparent) 0%,
    color-mix(in srgb, white 0%, transparent) 38%,
    color-mix(in srgb, white 0%, transparent) 62%,
    color-mix(in srgb, white 16%, transparent) 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
          mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
@media (max-width: 640px) {
  .claude-log {
    padding: var(--sp-5) var(--sp-4);
    gap: var(--sp-5);
  }
}

.claude-log__session {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.claude-log__session-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed color-mix(in srgb, white 10%, transparent);
}
.claude-log__session-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #a78bfa 75%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, #a78bfa 18%, transparent);
  flex: 0 0 auto;
}
.claude-log__session-label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, #c4b5fd 85%, transparent);
}

.claude-log__turns {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.claude-turn {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: var(--sp-3);
  align-items: start;
}
@media (max-width: 640px) {
  .claude-turn {
    grid-template-columns: 54px 1fr;
    gap: 10px;
  }
}

.claude-turn__role {
  align-self: start;
  justify-self: start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, white 10%, transparent);
  background: color-mix(in srgb, white 3%, transparent);
  line-height: 1;
  white-space: nowrap;
}
.claude-turn--assistant .claude-turn__role {
  color: #c4b5fd;
  border-color: color-mix(in srgb, #a78bfa 40%, transparent);
  background: color-mix(in srgb, #8b5cf6 14%, transparent);
}

.claude-turn__bubble {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, #1a1c22 65%, transparent);
  color: var(--fg);
  line-height: 1.6;
  font-size: var(--fs-md);
  overflow-wrap: anywhere;
}
.claude-turn__bubble p {
  margin: 0;
}
.claude-turn__bubble p + p {
  margin-top: 8px;
}
.claude-turn--assistant .claude-turn__bubble {
  border-color: color-mix(in srgb, #a78bfa 28%, transparent);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, #2a2333 72%, transparent),
      color-mix(in srgb, #1a1c22 78%, transparent));
  box-shadow: inset 2px 0 0 color-mix(in srgb, #a78bfa 55%, transparent);
}

.claude-tool-call {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #a78bfa 30%, transparent);
  background: color-mix(in srgb, #a78bfa 8%, transparent);
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.claude-tool-call__head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.claude-tool-call__verb {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  color: color-mix(in srgb, #c4b5fd 95%, white);
  background: color-mix(in srgb, #a78bfa 22%, transparent);
  border: 1px solid color-mix(in srgb, #a78bfa 42%, transparent);
  white-space: nowrap;
}
.claude-tool-call__name {
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.95em;
  color: #e9d5ff;
  font-weight: 600;
}
.claude-tool-call__sep {
  color: var(--muted);
  opacity: 0.55;
}
.claude-tool-call__arg {
  color: var(--muted-hi);
  font-size: 0.95em;
}
.claude-tool-call__arg code {
  font-size: 0.95em;
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, white 6%, transparent);
  border: 1px solid color-mix(in srgb, white 8%, transparent);
  color: var(--fg);
}
.claude-tool-call__cost {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.92em;
  color: #a7f3d0;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #4ade80 38%, transparent);
  background: color-mix(in srgb, #22c55e 12%, transparent);
  white-space: nowrap;
  flex: 0 0 auto;
}

.claude-log__foot {
  max-width: 720px;
  margin: var(--sp-5) auto 0;
  text-align: center;
  color: var(--muted-hi);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.claude-log__foot strong {
  color: var(--fg);
}
.claude-log__foot p {
  margin: 0;
}
.claude-log__foot p + p {
  margin-top: var(--sp-2);
}

/* -----------------------------------------------------------------
 * /media page
 *
 * Layout: dash-header at the top, then the glass `.media-player`
 * hero panel, then `.media-catalog` (track cards grid), then the
 * pricing panel. The cover pane on the player doubles as the
 * visual reactor — starNest is already painting the shader
 * backdrop across the whole page; `data-state` on the cover
 * picks up and reinforces it with a ring that brightens while
 * playing.
 * ----------------------------------------------------------------- */

.media-page main.wrap {
  padding-bottom: var(--sp-8);
}

.media-player {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--sp-5);
  align-items: stretch;
  margin: var(--sp-4) 0 var(--sp-5);
  padding: var(--sp-5);
  background-color: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border-hi);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--glass-highlight-hi),
    var(--glass-haze),
    var(--glass-depth);
}
@media (max-width: 760px) {
  .media-player {
    grid-template-columns: 1fr;
  }
}

.media-player__cover {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  background:
    radial-gradient(
      120% 80% at 30% 20%,
      color-mix(in srgb, #a78bfa 35%, transparent),
      transparent 60%
    ),
    radial-gradient(
      100% 100% at 80% 90%,
      color-mix(in srgb, #7aa2f7 22%, transparent),
      transparent 70%
    ),
    color-mix(in srgb, var(--bg) 85%, transparent);
  border: 1px solid var(--glass-border-hi);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, white 6%, transparent);
  transition: box-shadow 220ms ease;
}
.media-player__cover[data-state="playing"] {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #a78bfa 65%, transparent),
    0 0 42px -8px color-mix(in srgb, #a78bfa 55%, transparent);
}
.media-player__cover[data-state="paused"] {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #a78bfa 30%, transparent);
}
.media-player__pulse {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 50% 50%,
      color-mix(in srgb, #f4f4f6 10%, transparent) 0%,
      transparent 70%
    );
  filter: blur(16px);
  animation: media-pulse 4.5s ease-in-out infinite;
}
@keyframes media-pulse {
  0%, 100% { transform: scale(0.94); opacity: 0.55; }
  50%      { transform: scale(1.06); opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) {
  .media-player__pulse { animation: none; }
}
.media-player__badge {
  position: absolute;
  left: var(--sp-3);
  bottom: var(--sp-3);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--glass-border);
}

.media-player__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}
.media-player__title {
  margin: 0;
  font-size: var(--fs-xl, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.3em;
}
/* Idle placeholder so the title row doesn't collapse before a
 * track is picked. Pseudo-element so JS reads (textContent) still
 * see an empty string. */
.media-player__title:empty::before {
  content: "No track playing";
  color: var(--muted);
  font-weight: 500;
}
.media-player__artist {
  margin: 0;
  color: var(--muted-hi, var(--muted));
  font-size: var(--fs-sm);
  min-height: 1.2em;
}
.media-player__artist:empty::before {
  content: "Pick a track to get started";
  color: var(--muted);
}
.media-player audio {
  display: none;
}

/* Internal state badge — hidden visually. `setBadge()` in main.ts
 * still writes to it so runtime state is introspectable from the
 * DOM, but the polished player UI doesn't surface a label like
 * "idle" / "paused" to the user. Cover-pane glow is the visible
 * state cue instead. */
.media-player__badge {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Scrub row -------------------------------------------------- */

.media-player__scrub {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: var(--sp-4);
}
/* Cross-browser range slider. The track is painted via a
 * linear-gradient on the input's background using a --pct CSS
 * variable that main.ts updates on every RAF tick; this keeps
 * WebKit and Firefox visually identical without needing the
 * Firefox-only ::-moz-range-progress pseudo. Thumb is rendered
 * separately per-engine because the pseudo-elements aren't
 * groupable in a single selector. */
.media-player__scrubber {
  --pct: 0%;
  --track: color-mix(in srgb, var(--fg) 14%, transparent);
  --accent: linear-gradient(
    90deg,
    color-mix(in srgb, #7aa2f7 85%, transparent),
    color-mix(in srgb, #a78bfa 95%, transparent)
  );
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
}
.media-player__scrubber::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, #7aa2f7 85%, transparent) 0%,
      color-mix(in srgb, #a78bfa 95%, transparent) var(--pct),
      transparent var(--pct)
    ),
    color-mix(in srgb, var(--fg) 14%, transparent);
  transition: height 140ms ease;
}
.media-player__scrubber::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 14%, transparent);
}
.media-player__scrubber::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, #7aa2f7 85%, transparent),
    color-mix(in srgb, #a78bfa 95%, transparent)
  );
}
.media-player__scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 999px;
  background: #fff;
  border: 0;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #000 40%, transparent),
    0 2px 8px color-mix(in srgb, #a78bfa 45%, transparent);
  transition: transform 120ms ease, box-shadow 120ms ease;
  opacity: 0;
}
.media-player__scrubber::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #000 40%, transparent),
    0 2px 8px color-mix(in srgb, #a78bfa 45%, transparent);
  transition: transform 120ms ease, box-shadow 120ms ease;
  opacity: 0;
}
.media-player__scrubber:hover::-webkit-slider-thumb,
.media-player__scrubber:focus-visible::-webkit-slider-thumb,
.media-player__scrubber:active::-webkit-slider-thumb {
  opacity: 1;
  transform: scale(1.15);
}
.media-player__scrubber:hover::-moz-range-thumb,
.media-player__scrubber:focus-visible::-moz-range-thumb,
.media-player__scrubber:active::-moz-range-thumb {
  opacity: 1;
  transform: scale(1.15);
}
.media-player__scrubber:hover::-webkit-slider-runnable-track,
.media-player__scrubber:active::-webkit-slider-runnable-track {
  height: 6px;
}
.media-player__scrubber:focus-visible {
  outline: none;
}
.media-player__scrubber:disabled {
  cursor: default;
  opacity: 0.55;
}

.media-player__time {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* --- Transport row --------------------------------------------- */

.media-player__transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.media-player__transport-main {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1 1 auto;
  justify-content: flex-start;
}
/* Prev / next buttons (and the mute glyph). Glass circle, icon
 * inherits currentColor so hover lifts both border and icon in
 * one animation. Kept subtle so the primary play button
 * dominates the visual hierarchy. */
.media-player__tbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--muted-hi, var(--muted));
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 160ms ease;
}
.media-player__tbtn:hover,
.media-player__tbtn:focus-visible {
  color: var(--fg);
  border-color: var(--glass-border-hi);
  background: color-mix(in srgb, var(--bg) 35%, transparent);
  outline: none;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #a78bfa 18%, transparent),
    0 6px 18px -8px color-mix(in srgb, #a78bfa 45%, transparent);
}
.media-player__tbtn:active {
  transform: scale(0.94);
}
.media-player__tbtn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}
.media-player__tbtn svg {
  display: block;
}

/* Play / pause — the star of the transport row. Gradient-filled
 * circle with a soft glow that pulses when actively playing
 * (driven by the [data-playing=true] attribute set in main.ts).
 * The two icons are stacked; CSS shows exactly one based on
 * data-playing. */
.media-player__play {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #a78bfa 50%, transparent);
  background:
    radial-gradient(
      120% 120% at 30% 20%,
      color-mix(in srgb, #c4b5fd 38%, transparent),
      transparent 55%
    ),
    linear-gradient(
      140deg,
      color-mix(in srgb, #a78bfa 85%, transparent),
      color-mix(in srgb, #7aa2f7 85%, transparent)
    );
  color: #fff;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 25%, transparent),
    0 8px 24px -10px color-mix(in srgb, #a78bfa 75%, transparent),
    0 0 0 0 color-mix(in srgb, #a78bfa 55%, transparent);
  transition:
    transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 200ms ease,
    border-color 200ms ease;
}
.media-player__play:hover,
.media-player__play:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: color-mix(in srgb, #a78bfa 75%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 30%, transparent),
    0 10px 30px -8px color-mix(in srgb, #a78bfa 85%, transparent),
    0 0 0 6px color-mix(in srgb, #a78bfa 18%, transparent);
}
.media-player__play:active {
  transform: scale(0.96);
}
.media-player__play:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 15%, transparent),
    0 4px 14px -8px color-mix(in srgb, #a78bfa 40%, transparent);
}
.media-player__play[data-playing="true"] {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 30%, transparent),
    0 10px 30px -8px color-mix(in srgb, #a78bfa 85%, transparent),
    0 0 0 4px color-mix(in srgb, #a78bfa 16%, transparent);
}
.media-player__play svg {
  display: block;
  filter: drop-shadow(0 1px 0 color-mix(in srgb, #000 20%, transparent));
}
.media-player__play [data-play-icon] {
  margin-left: 3px; /* optical centering of the triangle */
}
.media-player__play [data-pause-icon] {
  display: none;
}
.media-player__play[data-playing="true"] [data-play-icon] {
  display: none;
}
.media-player__play[data-playing="true"] [data-pause-icon] {
  display: block;
  margin-left: 0;
}

/* --- Volume group ---------------------------------------------- */

.media-player__volume {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 0 0 auto;
}
.media-player__mute {
  /* Reuse .media-player__tbtn look at a smaller size — defined
   * inline so we can tune padding / icon color independently
   * from the main prev/next pair. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--muted-hi, var(--muted));
  cursor: pointer;
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}
.media-player__mute:hover,
.media-player__mute:focus-visible {
  color: var(--fg);
  border-color: var(--glass-border-hi);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  outline: none;
}
.media-player__mute [data-vol-off] {
  display: none;
}
.media-player__mute[data-muted="true"] [data-vol-on] {
  display: none;
}
.media-player__mute[data-muted="true"] [data-vol-off] {
  display: block;
}
.media-player__mute[data-muted="true"] {
  color: color-mix(in srgb, #ef4444 85%, var(--fg));
}

/* Volume slider — smaller cousin of the scrubber. Always-visible
 * thumb (scrubber hides its thumb when idle; this one we keep
 * because the volume state isn't otherwise signalled). */
.media-player__vol {
  --pct: 80%;
  -webkit-appearance: none;
  appearance: none;
  width: 96px;
  height: 20px;
  background: transparent;
  cursor: pointer;
}
.media-player__vol::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--fg) 78%, transparent) 0%,
      color-mix(in srgb, var(--fg) 78%, transparent) var(--pct),
      transparent var(--pct)
    ),
    color-mix(in srgb, var(--fg) 12%, transparent);
}
.media-player__vol::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 12%, transparent);
}
.media-player__vol::-moz-range-progress {
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 78%, transparent);
}
.media-player__vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  margin-top: -3.5px;
  border-radius: 999px;
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, #000 40%, transparent);
}
.media-player__vol::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, #000 40%, transparent);
}
.media-player__vol:focus-visible {
  outline: none;
}

/* --- Meta row (session + demo CTA) ----------------------------- */

.media-player__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-3);
  min-height: 0;
}
.media-player__meta:empty {
  display: none;
}
.media-player__grant {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, #22c55e 10%, transparent);
  border: 1px solid color-mix(in srgb, #22c55e 28%, transparent);
  font-size: var(--fs-xs);
  color: var(--fg);
}
.media-player__grant-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, #22c55e 80%, var(--fg));
  font-weight: 600;
}
.media-player__grant-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.media-player__grant-refresh {
  padding: 2px 10px;
  font-size: var(--fs-xs);
  border-radius: 999px;
}

.media-player__status {
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--muted);
  min-height: 1em;
  letter-spacing: 0.01em;
}
.media-player__status:empty {
  min-height: 0;
}

/* Pick-a-track + EQ row. Sits below the main playback surface
 * as a subtle chooser strip. No border / background so it reads
 * as part of the same glass panel rather than a separate card. */
.media-player__local {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid color-mix(in srgb, var(--glass-border) 60%, transparent);
  font-size: var(--fs-sm);
}
/* Filename text + "local mode" hint are intentionally not
 * surfaced in the polished player — the track title already
 * shows what's loaded, and the clear (✕) affordance is enough
 * by itself. Element stays in the DOM for main.ts bindings. */
.media-player__local-name {
  display: none;
}
.media-player__local-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background-color: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--fs-sm);
  line-height: 1;
  margin-left: auto;
}
.media-player__local-clear:hover,
.media-player__local-clear:focus-visible {
  color: var(--fg);
  border-color: var(--glass-border-hi);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  outline: none;
}
/* "Choose a track" entry button. Styled as the primary affordance
 * on the local-file row (overrides .btn defaults via the more
 * specific selector) so it reads as the main call-to-action and
 * the EQ icon button reads as a secondary control. */
.media-player__choose-track {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: calc(var(--sp-1) + 2px) var(--sp-3);
  font-size: var(--fs-sm);
  line-height: 1.2;
}

/* Icon-only EQ / audio-reactive tuning button. Square glass
 * affordance that pairs with the "Choose a track" primary button
 * on the same row — icon-only so it reads as a secondary tool,
 * not a parallel action. Size mirrors the transport chips so
 * all icon controls on the page feel like one family. */
.media-player__eq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: color-mix(in srgb, var(--bg) 60%, transparent);
  color: var(--muted-hi, var(--muted));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  flex: 0 0 auto;
}
.media-player__eq-btn:hover,
.media-player__eq-btn:focus-visible {
  color: var(--fg);
  border-color: var(--glass-border-hi);
}
.media-player__eq-btn svg {
  display: block;
}

/* Upload panel. Glass card that sits between the player and the
 * catalogue. The drop zone is a large label wrapping a hidden file
 * input so keyboard + click + drag-and-drop all work with one
 * element. Progress and status surface inline beneath the actions
 * so a user doing their first upload sees every step without
 * scrolling. */
.media-upload {
  margin: var(--sp-5) 0;
  padding: var(--sp-5);
  background-color: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border-hi);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow, 0 1px 0 rgba(255, 255, 255, 0.04) inset);
}
.media-upload__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.media-upload__head h2 {
  margin: 0 0 2px;
}
.media-upload__head .sub {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.media-upload__form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.media-upload__drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: var(--sp-5);
  border: 1px dashed var(--glass-border-hi);
  border-radius: var(--radius-md);
  background-color: color-mix(in srgb, var(--bg) 75%, transparent);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 120ms ease,
    background-color 120ms ease;
}
.media-upload__drop:hover,
.media-upload__drop:focus-within {
  border-color: color-mix(in srgb, var(--accent, #a78bfa) 70%, var(--glass-border-hi));
  background-color: color-mix(in srgb, var(--bg) 65%, transparent);
}
.media-upload__drop[data-dragover="true"] {
  border-color: color-mix(in srgb, var(--accent, #a78bfa) 90%, transparent);
  background-color: color-mix(in srgb, var(--accent, #a78bfa) 10%, var(--bg) 90%);
}
.media-upload__drop[data-has-file="true"] {
  border-style: solid;
}
.media-upload__drop-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--fg);
}
.media-upload__drop-body strong {
  font-size: 1rem;
  font-weight: 600;
}
.media-upload__drop-body span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.media-upload__meta {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--sp-3);
}
@media (max-width: 760px) {
  .media-upload__meta {
    grid-template-columns: 1fr;
  }
}
.media-upload__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-sm);
}
.media-upload__field > span {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.media-upload__field input,
.media-upload__field select {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background-color: color-mix(in srgb, var(--bg) 80%, transparent);
  color: var(--fg);
  font: inherit;
}
.media-upload__field input:focus-visible,
.media-upload__field select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent, #a78bfa) 70%, transparent);
  outline-offset: 1px;
}

.media-upload__quote {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  background-color: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--glass-border);
}
.media-upload__quote-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.media-upload__quote-label {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.media-upload__quote-amount {
  font-size: 1.1rem;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.media-upload__quote-note {
  flex: 1 1 auto;
}

.media-upload__actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.media-upload__progress {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.media-upload__progress-track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background-color: color-mix(in srgb, var(--bg) 65%, transparent);
  overflow: hidden;
}
.media-upload__progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent, #a78bfa) 90%, transparent),
    color-mix(in srgb, var(--accent, #a78bfa) 60%, transparent)
  );
  transition: width 120ms linear;
}
.media-upload__progress-pct {
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  color: var(--muted);
  min-width: 3.5ch;
  text-align: right;
}

.media-upload__status {
  font-size: var(--fs-sm);
  color: var(--muted);
  min-height: 1.2em;
}
.media-upload__status[data-tone="error"] {
  color: var(--danger, #ef4444);
}
.media-upload__status[data-tone="success"] {
  color: color-mix(in srgb, var(--accent, #a78bfa) 70%, var(--fg));
}

/* Catalogue grid. Cards are glass panels themselves so they read
 * as peers of the player above; selected state raises the border
 * tone so the player's title matches the highlighted card. */
.media-catalog {
  margin: var(--sp-5) 0;
}
.media-catalog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.media-catalog__head h2 {
  margin: 0 0 2px;
}
.media-catalog__head .sub {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.media-catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-3);
}
.media-catalog__empty {
  color: var(--muted);
  font-size: var(--fs-sm);
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-4) 0;
}

.media-card {
  all: unset;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background-color: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: border-color 180ms ease, transform 180ms ease;
  box-shadow:
    var(--glass-highlight),
    var(--glass-depth-sm);
}
.media-card:hover,
.media-card:focus-visible {
  border-color: var(--glass-border-hi);
  transform: translateY(-1px);
}
.media-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 2px;
}
.media-card--active {
  border-color: color-mix(in srgb, #a78bfa 60%, transparent);
  box-shadow:
    var(--glass-highlight-hi),
    0 0 0 1px color-mix(in srgb, #a78bfa 45%, transparent),
    var(--glass-haze-sm);
}
.media-card__art {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, #7aa2f7 25%, transparent),
      color-mix(in srgb, #a78bfa 30%, transparent)
    ),
    color-mix(in srgb, var(--bg) 80%, transparent);
}
.media-card__art-wave {
  position: absolute;
  inset: 20% 12%;
  background:
    repeating-linear-gradient(
      90deg,
      color-mix(in srgb, white 50%, transparent) 0px,
      color-mix(in srgb, white 50%, transparent) 2px,
      transparent 2px,
      transparent 6px
    );
  -webkit-mask: radial-gradient(ellipse at center, black 60%, transparent 100%);
          mask: radial-gradient(ellipse at center, black 60%, transparent 100%);
  opacity: 0.45;
}
.media-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.media-card__title {
  margin: 0;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-card__artist {
  margin: 0;
  color: var(--muted-hi, var(--muted));
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-card__dur {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

/* Cover art inside a catalogue card. Mirrors the art pane's
 * dimensions so swapping the wave fallback for a real image
 * doesn't reflow the grid. */
.media-card__art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-card__supporting {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Player header enhancements: cover art overlay (absolute, fits
 * inside the square pane) + supporting-artists subtitle + demo
 * button. Kept scoped so legacy tracks without these still render
 * identically to before. */
.media-player__cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  z-index: 1;
}
.media-player__supporting {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-style: italic;
}
.media-player__demo {
  margin-left: auto;
  font-size: var(--fs-sm);
  white-space: nowrap;
}

/* Upload: two-column layout for audio + cover pickers. Stacks on
 * narrow screens so the drop targets stay comfortably tappable. */
.media-upload__files {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: var(--sp-3);
  align-items: stretch;
}
@media (max-width: 760px) {
  .media-upload__files {
    grid-template-columns: 1fr;
  }
}

.media-upload__cover {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px dashed var(--glass-border-hi);
  border-radius: var(--radius-md);
  background-color: color-mix(in srgb, var(--bg) 75%, transparent);
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background-color 120ms ease;
}
.media-upload__cover:hover,
.media-upload__cover:focus-within {
  border-color: color-mix(in srgb, var(--accent, #a78bfa) 70%, var(--glass-border-hi));
  background-color: color-mix(in srgb, var(--bg) 65%, transparent);
}
.media-upload__cover[data-dragover="true"] {
  border-color: color-mix(in srgb, var(--accent, #a78bfa) 90%, transparent);
  background-color: color-mix(in srgb, var(--accent, #a78bfa) 10%, var(--bg) 90%);
}
.media-upload__cover[data-has-file="true"] {
  border-style: solid;
}
.media-upload__cover-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-upload__cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-upload__cover-placeholder {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-2);
  text-align: center;
  color: var(--muted);
}
.media-upload__cover-placeholder strong {
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 600;
}
.media-upload__cover-placeholder span {
  font-size: var(--fs-xs);
}
.media-upload__cover-clear {
  align-self: center;
  padding: 2px 10px;
  font-size: var(--fs-xs);
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background-color: color-mix(in srgb, var(--bg) 70%, transparent);
  color: var(--fg);
  cursor: pointer;
}
.media-upload__cover-clear:hover {
  border-color: var(--glass-border-hi);
}

/* Wide metadata field — supporting artists spans the full row so
 * the placeholder text doesn't wrap awkwardly. */
.media-upload__field--wide {
  grid-column: 1 / -1;
}

/* -----------------------------------------------------------------
 * Standalone VDJ demo page (`/demo` — deployed to demo.stoka.space).
 *
 * Goals:
 *   - No nav, no footer, no hero: the VDJ IS the page.
 *   - Viewport-sized canvas + deck centered over the shader
 *     backdrop (same starNest background every page runs).
 *   - No horizontal gutter / max-width clamp from `.wrap`; the
 *     dashboard-page / media-page classes we inherit from set a
 *     narrower main column which fights the "full showcase" look.
 *
 * Body carries both `.stoka-media-page` (hides the redundant
 * starnest-dock — the VDJ already mirrors every shader knob) and
 * `.stoka-demo-page` (this block). Both classes are idempotent;
 * the demo page is still reachable from /media-authored CSS.
 * ----------------------------------------------------------------- */

body.stoka-demo-page {
  /* Kill the dashboard-page / media-page top padding so the deck
   * sits flush to the top of the viewport on large screens. The
   * shared `.wrap` class adds horizontal gutters; we override
   * below. */
  min-height: 100dvh;
}

body.stoka-demo-page .stoka-demo-main {
  /* Full-viewport stage. No max-width, no padding — we want the
   * deck centered over an unobstructed shader background. */
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Leave just enough breathing room so the deck's drop shadow
   * doesn't kiss the viewport edge on compact windows. */
  padding: var(--sp-4);
  box-sizing: border-box;
}

body.stoka-demo-page .stoka-demo-mount {
  /* The VDJ panel picks its own width via the audio-panel module's
   * styles; we just make sure the mount lets it center without
   * stretching. */
  width: auto;
  max-width: min(96vw, 1100px);
}

/* On narrow screens (mobile portrait) the deck already stacks
 * its own sections; just shrink the ambient padding so there's
 * no dead space. */
@media (max-width: 600px) {
  body.stoka-demo-page .stoka-demo-main {
    padding: var(--sp-2);
    align-items: flex-start;
  }
  body.stoka-demo-page .stoka-demo-mount {
    max-width: 100vw;
  }
}
