/* ==========================================================================
   LUMEN — AI Product Kit
   A premium HTML template kit for AI tools, agents and LLM products.
   --------------------------------------------------------------------------
   TABLE OF CONTENTS
   01. Design tokens (:root)
   02. Dark theme overrides
   03. Reset & base
   04. Typography
   05. Layout primitives
   06. Buttons
   07. Header & navigation
   08. Footer
   09. Cards & surfaces
   10. Badges, pills, eyebrows
   11. Hero & demo console
   12. Logos, stats, steps
   13. Code blocks & syntax highlighting
   14. Tabs
   15. Tables (responsive → cards)
   16. Forms
   17. Pricing & calculator
   18. Playground
   19. API reference
   20. FAQ / accordion
   21. Utilities & motion
   ========================================================================== */

/* ==========================================================================
   01. DESIGN TOKENS
   --------------------------------------------------------------------------
   REBRAND IN 60 SECONDS — change these six variables:
     --brand            primary accent (links, highlights, active states)
     --brand-strong     hover / pressed accent
     --brand-contrast   text colour that sits on top of --brand
     --brand-soft       10% tint of the accent, used for chips & callouts
     --ink              near-black used for primary buttons + headings
     --radius           global corner rounding
   Everything else derives from the neutral ramp below.
   ========================================================================== */

:root {
  color-scheme: light;

  /* -- Brand ------------------------------------------------------------ */
  --brand: #a45a10;
  --brand-strong: #82450a;
  --brand-contrast: #ffffff;
  --brand-soft: #fbf1e2;
  --ink: #16161c;
  --radius: 14px;

  /* -- Neutral ramp (warm grey) ----------------------------------------- */
  --bg: #fcfbf9;
  --bg-subtle: #f5f3ef;
  --bg-inset: #efece6;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --surface-raised: #ffffff;

  --border: #e7e3db;
  --border-strong: #d5cfc4;
  --border-hover: #c3bcae;

  --text: #16161c;
  --text-muted: #5c5a55;
  --text-subtle: #86837c;
  --text-inverse: #fbfaf8;

  /* -- Semantic --------------------------------------------------------- */
  --success: #1a7f4b;
  --success-soft: #e6f4ec;
  --warning: #a06207;
  --warning-soft: #fdf3e0;
  --danger: #b4271f;
  --danger-soft: #fbecea;
  --info: #1f5fa8;
  --info-soft: #eaf2fb;

  /* -- Primary action (dark button on light bg) ------------------------- */
  --primary-bg: #16161c;
  --primary-bg-hover: #2a2a33;
  --primary-fg: #fbfaf8;

  /* -- Code surface ----------------------------------------------------- */
  --code-bg: #14141a;
  --code-bg-2: #1b1b23;
  --code-border: #2a2a35;
  --code-text: #e6e4df;
  --code-gutter: #55535f;

  /* -- Syntax tokens (tuned for the dark code surface) ------------------ */
  --tok-comment: #7e7c8b;
  --tok-keyword: #d59bf6;
  --tok-string: #9fd68a;
  --tok-number: #f2b36b;
  --tok-function: #7fc4f2;
  --tok-property: #f0d59b;
  --tok-operator: #b9b6c4;
  --tok-punct: #8d8a99;
  --tok-tag: #f28b82;
  --tok-const: #f2b36b;

  /* -- Elevation -------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(20, 20, 26, 0.05);
  --shadow-sm: 0 1px 3px rgba(20, 20, 26, 0.06), 0 1px 2px rgba(20, 20, 26, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(20, 20, 26, 0.08), 0 2px 6px -2px rgba(20, 20, 26, 0.05);
  --shadow-lg: 0 18px 40px -12px rgba(20, 20, 26, 0.16), 0 6px 14px -6px rgba(20, 20, 26, 0.08);
  --shadow-xl: 0 36px 80px -24px rgba(20, 20, 26, 0.24), 0 10px 24px -12px rgba(20, 20, 26, 0.1);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 26%, transparent);

  /* -- Type ------------------------------------------------------------- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --step--2: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);
  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.90rem);
  --step-0: clamp(0.95rem, 0.92rem + 0.16vw, 1.03rem);
  --step-1: clamp(1.09rem, 1.03rem + 0.29vw, 1.26rem);
  --step-2: clamp(1.29rem, 1.18rem + 0.53vw, 1.60rem);
  --step-3: clamp(1.55rem, 1.34rem + 0.99vw, 2.11rem);
  --step-4: clamp(1.86rem, 1.49rem + 1.75vw, 2.85rem);
  --step-5: clamp(2.24rem, 1.62rem + 2.94vw, 3.90rem);
  --step-6: clamp(2.60rem, 1.60rem + 4.70vw, 5.20rem);

  /* -- Space ------------------------------------------------------------ */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 2.5rem;
  --sp-8: 3rem;
  --sp-9: 4rem;
  --sp-10: 5rem;
  --sp-11: 6.5rem;
  --sp-12: 8rem;

  --container: 1160px;
  --container-wide: 1320px;
  --container-narrow: 760px;

  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --header-h: 64px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   02. DARK THEME
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --brand: #f0b357;
    --brand-strong: #f8ca85;
    --brand-contrast: #1a1206;
    --brand-soft: rgba(240, 179, 87, 0.13);
    --ink: #f2f1ee;

    --bg: #0b0b0f;
    --bg-subtle: #101015;
    --bg-inset: #16161d;
    --surface: #131319;
    --surface-2: #17171e;
    --surface-raised: #1a1a22;

    --border: #26262f;
    --border-strong: #34343f;
    --border-hover: #45454f;

    --text: #f2f1ee;
    --text-muted: #a6a39c;
    --text-subtle: #7d7a74;
    --text-inverse: #14141a;

    --success: #4ac48a;
    --success-soft: rgba(74, 196, 138, 0.12);
    --warning: #f0b357;
    --warning-soft: rgba(240, 179, 87, 0.12);
    --danger: #f2837a;
    --danger-soft: rgba(242, 131, 122, 0.12);
    --info: #7fb4f2;
    --info-soft: rgba(127, 180, 242, 0.12);

    --primary-bg: #f2f1ee;
    --primary-bg-hover: #ffffff;
    --primary-fg: #14141a;

    --code-bg: #0f0f14;
    --code-bg-2: #14141a;
    --code-border: #24242e;
    --code-text: #e6e4df;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.6), 0 2px 6px -2px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 44px -14px rgba(0, 0, 0, 0.75), 0 6px 14px -6px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 40px 90px -28px rgba(0, 0, 0, 0.85), 0 12px 26px -14px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --brand: #f0b357;
  --brand-strong: #f8ca85;
  --brand-contrast: #1a1206;
  --brand-soft: rgba(240, 179, 87, 0.13);
  --ink: #f2f1ee;

  --bg: #0b0b0f;
  --bg-subtle: #101015;
  --bg-inset: #16161d;
  --surface: #131319;
  --surface-2: #17171e;
  --surface-raised: #1a1a22;

  --border: #26262f;
  --border-strong: #34343f;
  --border-hover: #45454f;

  --text: #f2f1ee;
  --text-muted: #a6a39c;
  --text-subtle: #7d7a74;
  --text-inverse: #14141a;

  --success: #4ac48a;
  --success-soft: rgba(74, 196, 138, 0.12);
  --warning: #f0b357;
  --warning-soft: rgba(240, 179, 87, 0.12);
  --danger: #f2837a;
  --danger-soft: rgba(242, 131, 122, 0.12);
  --info: #7fb4f2;
  --info-soft: rgba(127, 180, 242, 0.12);

  --primary-bg: #f2f1ee;
  --primary-bg-hover: #ffffff;
  --primary-fg: #14141a;

  --code-bg: #0f0f14;
  --code-bg-2: #14141a;
  --code-border: #24242e;
  --code-text: #e6e4df;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.6), 0 2px 6px -2px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 44px -14px rgba(0, 0, 0, 0.75), 0 6px 14px -6px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 40px 90px -28px rgba(0, 0, 0, 0.85), 0 12px 26px -14px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   03. RESET & BASE
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "cv11" 1;
  overflow-x: hidden;
  min-height: 100vh;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}

a:hover {
  color: var(--brand-strong);
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

::selection {
  background: color-mix(in srgb, var(--brand) 26%, transparent);
  color: var(--text);
}

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

:target {
  scroll-margin-top: calc(var(--header-h) + 32px);
}

/* ==========================================================================
   04. TYPOGRAPHY
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 640;
  line-height: 1.14;
  letter-spacing: -0.022em;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-5);
  letter-spacing: -0.033em;
  line-height: 1.04;
}

h2 {
  font-size: var(--step-4);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

h3 {
  font-size: var(--step-2);
  letter-spacing: -0.02em;
}

h4 {
  font-size: var(--step-1);
  letter-spacing: -0.014em;
  line-height: 1.35;
}

h5 {
  font-size: var(--step-0);
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 620;
  color: var(--text);
}

small {
  font-size: var(--step--1);
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-variant-ligatures: none;
}

:not(pre) > code {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.38em;
  font-size: 0.855em;
  color: var(--text);
  white-space: nowrap;
}

kbd {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.1em 0.45em;
  font-size: 0.8em;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}

.lead {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--text-muted);
  letter-spacing: -0.011em;
}

.muted {
  color: var(--text-muted);
}

.subtle {
  color: var(--text-subtle);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  letter-spacing: -0.01em;
}

.display {
  font-size: var(--step-6);
  letter-spacing: -0.04em;
  line-height: 1;
}

.text-brand {
  color: var(--brand);
}

.text-center {
  text-align: center;
}

.text-balance {
  text-wrap: balance;
}

/* Gradient text used sparingly — one word, never a whole headline */
.text-gradient {
  background: linear-gradient(
    100deg,
    var(--brand) 0%,
    color-mix(in srgb, var(--brand) 62%, var(--text)) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   05. LAYOUT PRIMITIVES
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

@media (min-width: 640px) {
  .container {
    padding-inline: var(--sp-6);
  }
}

.section {
  padding-block: clamp(3.5rem, 2.2rem + 6vw, 7rem);
}

.section--tight {
  padding-block: clamp(2.5rem, 1.8rem + 3.4vw, 4.5rem);
}

.section--flush-top {
  padding-top: 0;
}

.section--subtle {
  background: var(--bg-subtle);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 660px;
  margin-bottom: clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head p {
  margin-top: var(--sp-4);
  font-size: var(--step-1);
  color: var(--text-muted);
  line-height: 1.6;
}

.stack > * + * {
  margin-top: var(--sp-4);
}

.stack-lg > * + * {
  margin-top: var(--sp-6);
}

.grid {
  display: grid;
  gap: var(--sp-5);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

.cluster--center {
  justify-content: center;
}

.split {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .split--40-60 {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .split--60-40 {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  border: 0;
  margin: 0;
}

/* ==========================================================================
   06. BUTTONS
   ========================================================================== */

.btn {
  --btn-py: 0.6rem;
  --btn-px: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: var(--btn-py) var(--btn-px);
  font-size: var(--step--1);
  font-weight: 560;
  letter-spacing: -0.008em;
  line-height: 1.3;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease),
    color 0.16s var(--ease), transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  flex: none;
  width: 1em;
  height: 1em;
}

.btn--primary {
  background: var(--primary-bg);
  color: var(--primary-fg);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--primary-bg-hover);
  color: var(--primary-fg);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn--secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-hover);
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover {
  background: var(--bg-inset);
  color: var(--text);
}

.btn--brand {
  background: var(--brand);
  color: var(--brand-contrast);
}

.btn--brand:hover {
  background: var(--brand-strong);
  color: var(--brand-contrast);
}

.btn--lg {
  --btn-py: 0.78rem;
  --btn-px: 1.4rem;
  font-size: var(--step-0);
  border-radius: 12px;
}

.btn--sm {
  --btn-py: 0.36rem;
  --btn-px: 0.7rem;
  font-size: var(--step--2);
  border-radius: 8px;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

/* Text link with animated arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 550;
  font-size: var(--step--1);
  color: var(--brand);
}

.link-arrow svg {
  width: 0.95em;
  height: 0.95em;
  transition: transform 0.2s var(--ease);
}

.link-arrow:hover svg {
  transform: translateX(3px);
}

/* ==========================================================================
   07. HEADER & NAVIGATION
   ========================================================================== */

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--primary-bg);
  color: var(--primary-fg);
  padding: 0.6rem 1.1rem;
  border-radius: 0 0 10px 10px;
  font-size: var(--step--1);
  font-weight: 560;
  transition: transform 0.18s var(--ease);
}

.skip-link:focus {
  transform: translate(-50%, 0);
  color: var(--primary-fg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.site-header > .container {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 640;
  font-size: 1.02rem;
  letter-spacing: -0.026em;
  color: var(--text);
  flex: none;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

:root[data-theme="dark"] .brand-mark,
.brand-mark {
  background: var(--ink);
  color: var(--bg);
}

.brand-mark svg {
  width: 17px;
  height: 17px;
}

.nav {
  display: none;
  align-items: center;
  gap: 0.15rem;
  margin-right: auto;
}

.nav a {
  padding: 0.42rem 0.7rem;
  border-radius: 8px;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.nav a:hover {
  color: var(--text);
  background: var(--bg-inset);
}

.nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 560;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--text-muted);
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease),
    border-color 0.15s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-inset);
  border-color: var(--border);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

.nav-toggle {
  display: grid;
}

.header-cta {
  display: none;
}

@media (min-width: 900px) {
  .nav {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .header-cta {
    display: inline-flex;
  }
}

/* Mobile drawer */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  z-index: 99;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-4) var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
}

.mobile-nav.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.mobile-nav ul {
  display: grid;
  gap: 2px;
}

.mobile-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  color: var(--text);
  font-weight: 520;
  font-size: var(--step-0);
}

.mobile-nav a:hover,
.mobile-nav a[aria-current="page"] {
  background: var(--bg-inset);
}

.mobile-nav a[aria-current="page"] {
  color: var(--brand);
}

.mobile-nav .btn {
  margin-top: var(--sp-4);
}

@media (min-width: 900px) {
  .mobile-nav {
    display: none;
  }
}

/* ==========================================================================
   08. FOOTER
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding-block: var(--sp-9) var(--sp-6);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  gap: var(--sp-7);
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: var(--sp-6);
  }
}

.footer-about p {
  margin-top: var(--sp-4);
  color: var(--text-muted);
  font-size: var(--step--1);
  max-width: 34ch;
  line-height: 1.6;
}

.footer-col h3 {
  font-size: var(--step--2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  color: var(--text-subtle);
  margin-bottom: var(--sp-4);
}

.footer-col ul {
  display: grid;
  gap: 0.6rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: var(--step--1);
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
  justify-content: space-between;
  font-size: var(--step--2);
  color: var(--text-subtle);
}

.footer-social {
  display: flex;
  gap: var(--sp-2);
}

/* ==========================================================================
   09. CARDS & SURFACES
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  position: relative;
}

.card--pad-lg {
  padding: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
}

.card--inset {
  background: var(--bg-subtle);
  box-shadow: none;
}

.card--raised {
  box-shadow: var(--shadow-md);
}

.card--interactive {
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.card--interactive:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  margin-bottom: var(--sp-4);
}

.card-icon svg {
  width: 19px;
  height: 19px;
}

.card h3 {
  font-size: var(--step-1);
  margin-bottom: 0.45rem;
}

.card p {
  color: var(--text-muted);
  font-size: var(--step--1);
  line-height: 1.62;
}

/* Feature card with a top hairline accent on hover */
.feature-card {
  overflow: hidden;
}

.feature-card::after {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.feature-card:hover::after {
  opacity: 1;
}

/* ==========================================================================
   10. BADGES, PILLS, EYEBROWS
   ========================================================================== */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--sp-4);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.section-head--center .eyebrow::before {
  display: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: var(--step--2);
  font-weight: 560;
  letter-spacing: -0.005em;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge--brand {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--brand);
}

.badge--success {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 24%, transparent);
  color: var(--success);
}

.badge--danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 24%, transparent);
  color: var(--danger);
}

.badge--info {
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info) 24%, transparent);
  color: var(--info);
}

.badge--warning {
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 24%, transparent);
  color: var(--warning);
}

.announce {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.85rem 0.3rem 0.35rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  font-size: var(--step--1);
  color: var(--text-muted);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.announce:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
}

.announce strong {
  background: var(--brand-soft);
  color: var(--brand);
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.01em;
}

.announce svg {
  width: 13px;
  height: 13px;
  color: var(--text-subtle);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent);
}

/* ==========================================================================
   11. HERO & DEMO CONSOLE
   ========================================================================== */

.hero {
  position: relative;
  padding-block: clamp(3rem, 1.6rem + 6.5vw, 6rem) clamp(3rem, 2rem + 5vw, 5.5rem);
  overflow: hidden;
  isolation: isolate;
}

/* Subtle grid + radial wash. No purple gradients. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  opacity: 0.42;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 78%);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 130%);
  aspect-ratio: 1.5;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--brand) 15%, transparent) 0%,
    transparent 62%
  );
  opacity: 0.75;
  pointer-events: none;
}

.hero-inner {
  display: grid;
  gap: clamp(2.5rem, 1.5rem + 4vw, 4rem);
  align-items: center;
}

@media (min-width: 1000px) {
  .hero-inner {
    grid-template-columns: 1fr 1.06fr;
    gap: clamp(2.5rem, 0.5rem + 4vw, 4.5rem);
  }
}

.hero-copy h1 {
  margin-top: var(--sp-5);
}

.hero-copy .lead {
  margin-top: var(--sp-5);
  max-width: 46ch;
}

.hero-actions {
  margin-top: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.hero-meta {
  margin-top: var(--sp-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  font-size: var(--step--1);
  color: var(--text-subtle);
}

.hero-meta li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-meta svg {
  width: 14px;
  height: 14px;
  color: var(--success);
  flex: none;
}

/* --- Demo console --------------------------------------------------- */

.console {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  position: relative;
}

.console::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--text) 5%, transparent);
  pointer-events: none;
  z-index: 3;
}

.console-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.65rem 0.85rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.console-dots {
  display: flex;
  gap: 6px;
  flex: none;
}

.console-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.console-title {
  font-size: var(--step--2);
  color: var(--text-subtle);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.console-title svg {
  width: 12px;
  height: 12px;
}

.console-body {
  padding: var(--sp-5);
  display: grid;
  gap: var(--sp-4);
  /* Fixed height keeps the hero from reflowing while the demo streams. */
  height: 366px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  align-content: start;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, var(--brand-soft), transparent 70%),
    var(--surface);
  /* Softens the top edge once the transcript has scrolled. */
  mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
}

.msg {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 0.75rem;
  align-items: start;
  opacity: 0;
  transform: translateY(6px);
  animation: msg-in 0.45s var(--ease-out) forwards;
}

@keyframes msg-in {
  to {
    opacity: 1;
    transform: none;
  }
}

.msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 640;
}

.msg-avatar svg {
  width: 14px;
  height: 14px;
}

.msg--ai .msg-avatar {
  background: var(--ink);
  border-color: transparent;
  color: var(--bg);
}

.msg-content {
  min-width: 0;
  padding-top: 1px;
}

.msg-role {
  font-size: var(--step--2);
  font-weight: 620;
  color: var(--text-subtle);
  letter-spacing: 0.045em;
  text-transform: uppercase;
  margin-bottom: 0.28rem;
}

.msg-text {
  font-size: var(--step--1);
  line-height: 1.66;
  color: var(--text);
}

.msg--user .msg-text {
  color: var(--text-muted);
}

.msg-text p + p {
  margin-top: 0.6rem;
}

.msg-text ul {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.3rem;
}

.msg-text li {
  padding-left: 1.05rem;
  position: relative;
}

.msg-text li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.62em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: var(--brand);
  vertical-align: -0.18em;
  margin-left: 2px;
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Tool-call chips inside the demo */
.tool-call {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--text-muted);
  margin-top: 0.55rem;
}

.tool-call svg {
  width: 12px;
  height: 12px;
  color: var(--brand);
  flex: none;
}

.tool-call .spinner {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--brand) 30%, transparent);
  border-top-color: var(--brand);
  animation: spin 0.7s linear infinite;
  flex: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.console-input {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.7rem 0.85rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.console-input .fake-field {
  flex: 1;
  min-width: 0;
  font-size: var(--step--1);
  color: var(--text-subtle);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-send {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-bg);
  color: var(--primary-fg);
  display: grid;
  place-items: center;
  flex: none;
}

.console-send svg {
  width: 14px;
  height: 14px;
}

/* Floating stat chip attached to the console */
.console-float {
  position: absolute;
  left: -18px;
  bottom: -22px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: var(--step--2);
}

.console-float strong {
  display: block;
  font-size: var(--step-0);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.console-float span {
  color: var(--text-subtle);
}

@media (max-width: 560px) {
  .console-float {
    display: none;
  }

  /* Not enough room for the filename and the replay control together. */
  .console-title {
    display: none;
  }

  .console-body {
    height: 330px;
    padding: var(--sp-4);
  }
}

.console-wrap {
  position: relative;
}

/* Sits in the console bar's flex row, so it can never overlap the title. */
.replay-btn {
  flex: none;
  z-index: 5;
}

/* ==========================================================================
   12. LOGOS, STATS, STEPS
   ========================================================================== */

.logo-strip {
  padding-block: var(--sp-7);
}

.logo-strip p {
  text-align: center;
  font-size: var(--step--2);
  font-weight: 560;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: var(--sp-5);
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1.75rem, 1rem + 3.5vw, 3.75rem);
}

.logo-row svg {
  height: 24px;
  width: auto;
  color: var(--text-subtle);
  opacity: 0.75;
  transition: opacity 0.2s var(--ease), color 0.2s var(--ease);
}

.logo-row a:hover svg,
.logo-row li:hover svg {
  opacity: 1;
  color: var(--text-muted);
}

.stat-row {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.stat {
  padding: var(--sp-2) 0;
}

.stat-value {
  font-size: var(--step-4);
  font-weight: 640;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--text);
}

.stat-value .unit {
  color: var(--brand);
}

.stat-label {
  margin-top: 0.55rem;
  font-size: var(--step--1);
  color: var(--text-muted);
  line-height: 1.5;
}

.stat--bordered {
  border-left: 2px solid var(--border);
  padding-left: var(--sp-5);
}

.steps {
  counter-reset: step;
  display: grid;
  gap: var(--sp-5);
}

.step {
  position: relative;
  padding-left: 3.25rem;
}

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 600;
  color: var(--brand);
  box-shadow: var(--shadow-xs);
}

.step h3 {
  font-size: var(--step-1);
  margin-bottom: 0.35rem;
}

.step p {
  color: var(--text-muted);
  font-size: var(--step--1);
}

/* Testimonials */
.quote-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  height: 100%;
}

.quote-card blockquote {
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  letter-spacing: -0.008em;
}

.quote-card blockquote::before {
  content: "\201C";
  color: var(--brand);
  font-size: 1.4em;
  line-height: 0;
  vertical-align: -0.22em;
  margin-right: 1px;
}

.quote-author {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: auto;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  font-size: var(--step--2);
  font-weight: 640;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.quote-author .name {
  font-size: var(--step--1);
  font-weight: 580;
  color: var(--text);
  line-height: 1.35;
}

.quote-author .role {
  font-size: var(--step--2);
  color: var(--text-subtle);
  line-height: 1.35;
}

/* Big CTA band */
.cta-band {
  position: relative;
  border-radius: var(--radius-xl);
  padding: clamp(2.5rem, 1.6rem + 4vw, 4.5rem) clamp(1.5rem, 1rem + 3vw, 4rem);
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000, transparent 75%);
}

.cta-band::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--brand) 30%, transparent),
    transparent 60%
  );
}

.cta-band h2 {
  color: var(--bg);
  max-width: 18ch;
  margin-inline: auto;
}

.cta-band p {
  color: color-mix(in srgb, var(--bg) 72%, var(--ink));
  font-size: var(--step-1);
  max-width: 52ch;
  margin: var(--sp-4) auto 0;
}

.cta-band .cluster {
  margin-top: var(--sp-6);
}

.cta-band .btn--primary {
  background: var(--bg);
  color: var(--ink);
}

.cta-band .btn--primary:hover {
  background: #fff;
  color: #16161c;
}

.cta-band .btn--secondary {
  background: transparent;
  color: var(--bg);
  border-color: color-mix(in srgb, var(--bg) 28%, transparent);
}

.cta-band .btn--secondary:hover {
  background: color-mix(in srgb, var(--bg) 10%, transparent);
  color: var(--bg);
  border-color: color-mix(in srgb, var(--bg) 45%, transparent);
}

.cta-note {
  margin-top: var(--sp-5);
  font-size: var(--step--2);
  color: color-mix(in srgb, var(--bg) 55%, var(--ink));
}

/* ==========================================================================
   13. CODE BLOCKS & SYNTAX HIGHLIGHTING
   ========================================================================== */

.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  color-scheme: dark;
}

.code-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  background: var(--code-bg-2);
  border-bottom: 1px solid var(--code-border);
  min-height: 42px;
}

.code-file {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: #9c99a8;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-file svg {
  width: 13px;
  height: 13px;
  flex: none;
  opacity: 0.7;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: var(--step--2);
  font-weight: 520;
  color: #9c99a8;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease),
    border-color 0.15s var(--ease);
  flex: none;
}

.copy-btn:hover {
  color: #e6e4df;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.copy-btn svg {
  width: 13px;
  height: 13px;
}

.copy-btn .icon-check {
  display: none;
  color: #7fd6a0;
}

.copy-btn.is-copied .icon-check {
  display: block;
}

.copy-btn.is-copied .icon-copy {
  display: none;
}

.copy-btn.is-copied {
  color: #7fd6a0;
}

.code-block pre {
  margin: 0;
  padding: var(--sp-4) var(--sp-5);
  overflow-x: auto;
  font-size: clamp(0.76rem, 0.72rem + 0.16vw, 0.845rem);
  line-height: 1.72;
  color: var(--code-text);
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: #3b3b47 transparent;
}

.code-block pre::-webkit-scrollbar {
  height: 8px;
}

.code-block pre::-webkit-scrollbar-thumb {
  background: #33333f;
  border-radius: 4px;
}

.code-block pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  white-space: pre;
  display: block;
  min-width: max-content;
}

.code-block--plain pre {
  padding: var(--sp-4);
}

/* Line numbers */
.code-block--numbered pre code {
  counter-reset: line;
}

.code-block--numbered .ln {
  display: block;
  counter-increment: line;
  position: relative;
  padding-left: 2.75rem;
}

.code-block--numbered .ln::before {
  content: counter(line);
  position: absolute;
  left: 0;
  width: 1.9rem;
  text-align: right;
  color: var(--code-gutter);
  user-select: none;
}

.ln--add {
  background: rgba(74, 196, 138, 0.1);
  box-shadow: inset 2px 0 0 #4ac48a;
}

.ln--highlight {
  background: rgba(240, 179, 87, 0.09);
  box-shadow: inset 2px 0 0 var(--tok-number);
}

/* -- Syntax tokens (hand-authored spans, no highlighter library) ------- */
.tok-com {
  color: var(--tok-comment);
  font-style: italic;
}

.tok-kw {
  color: var(--tok-keyword);
}

.tok-str {
  color: var(--tok-string);
}

.tok-num {
  color: var(--tok-number);
}

.tok-fn {
  color: var(--tok-function);
}

.tok-prop {
  color: var(--tok-property);
}

.tok-op {
  color: var(--tok-operator);
}

.tok-punc {
  color: var(--tok-punct);
}

.tok-tag {
  color: var(--tok-tag);
}

.tok-const {
  color: var(--tok-const);
}

.tok-var {
  color: #cfccd8;
}

.tok-meth {
  color: #7fc4f2;
}

.tok-dim {
  color: #6f6d7b;
}

/* ==========================================================================
   14. TABS
   ========================================================================== */

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: var(--step--1);
  font-weight: 520;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 570;
  box-shadow: var(--shadow-xs);
}

/* Tabs styled to sit inside a dark code header */
.tabs--code {
  background: transparent;
  border: none;
  padding: 0;
  gap: 1px;
  margin-right: auto;
}

.tabs--code .tab {
  color: #85828f;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  padding: 0.32rem 0.6rem;
  border-radius: 7px;
}

.tabs--code .tab:hover {
  color: #d6d3de;
  background: rgba(255, 255, 255, 0.05);
}

.tabs--code .tab[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  box-shadow: none;
}

/* Underline tab variant */
.tabs--underline {
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0;
  gap: var(--sp-5);
}

.tabs--underline .tab {
  border-radius: 0;
  padding: 0.6rem 0;
  box-shadow: none;
  background: none;
  position: relative;
}

.tabs--underline .tab[aria-selected="true"] {
  background: none;
  box-shadow: none;
  color: var(--text);
}

.tabs--underline .tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px 2px 0 0;
}

[role="tabpanel"][hidden] {
  display: none;
}

/* ==========================================================================
   15. TABLES
   ========================================================================== */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

caption {
  text-align: left;
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--step--1);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

thead th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--text-subtle);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: bottom;
}

tbody td,
tbody th {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
  color: var(--text-muted);
  line-height: 1.55;
}

tbody th {
  color: var(--text);
  font-weight: 580;
  white-space: nowrap;
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: none;
}

tbody tr {
  transition: background-color 0.15s var(--ease);
}

.table--hover tbody tr:hover {
  background: var(--bg-subtle);
}

.table--fixed-first th:first-child,
.table--fixed-first td:first-child {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
}

.table--fixed-first thead th:first-child {
  background: var(--bg-subtle);
  z-index: 2;
}

.table--fixed-first tbody tr:hover th:first-child {
  background: var(--bg-subtle);
}

.cell-num {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cell-yes,
.cell-no {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.cell-yes {
  background: var(--success-soft);
  color: var(--success);
}

.cell-no {
  background: var(--bg-inset);
  color: var(--text-subtle);
}

.cell-yes svg,
.cell-no svg {
  width: 12px;
  height: 12px;
}

.table-note {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: var(--step--2);
  color: var(--text-subtle);
}

/* --- Responsive: table → stacked cards ------------------------------- */
@media (max-width: 860px) {
  .table--cards {
    display: block;
  }

  .table--cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table--cards tbody,
  .table--cards tr,
  .table--cards td,
  .table--cards th,
  .table--cards caption {
    display: block;
    width: auto;
  }

  .table--cards tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: var(--sp-4);
    overflow: hidden;
  }

  .table--cards tr:last-child {
    margin-bottom: 0;
  }

  .table--cards tbody th {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 0.9rem;
    font-size: var(--step-0);
    white-space: normal;
  }

  .table--cards tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
    text-align: right;
  }

  .table--cards tbody td::before {
    content: attr(data-label);
    font-size: var(--step--2);
    font-weight: 580;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-subtle);
    text-align: left;
    flex: none;
  }

  .table--cards tbody tr td:last-child {
    border-bottom: none;
  }

  .table-wrap--cards {
    border: none;
    background: none;
    overflow: visible;
  }

  .table-wrap--cards .table-scroll {
    overflow: visible;
  }

  .table-wrap--cards caption {
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: -1px;
  }

  .table-wrap--cards .table-note {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: var(--sp-4);
  }
}

/* ==========================================================================
   16. FORMS
   ========================================================================== */

.field {
  display: grid;
  gap: 0.4rem;
}

.field + .field {
  margin-top: var(--sp-4);
}

.label {
  font-size: var(--step--1);
  font-weight: 560;
  color: var(--text);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
}

.label .optional {
  font-weight: 450;
  color: var(--text-subtle);
  font-size: var(--step--2);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.62rem 0.8rem;
  font-size: var(--step--1);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease),
    background-color 0.15s var(--ease);
  appearance: none;
}

.textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.6;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-subtle);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-hover);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2386837c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 15px;
  padding-right: 2.2rem;
  cursor: pointer;
}

.hint {
  font-size: var(--step--2);
  color: var(--text-subtle);
  line-height: 1.5;
}

.error-text {
  font-size: var(--step--2);
  color: var(--danger);
  display: none;
  align-items: center;
  gap: 0.3rem;
}

.error-text svg {
  width: 12px;
  height: 12px;
  flex: none;
}

.field.is-invalid .error-text {
  display: flex;
}

.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea {
  border-color: var(--danger);
}

.field.is-invalid .input:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent);
}

/* Checkbox / radio */
.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  cursor: pointer;
  font-size: var(--step--1);
  color: var(--text-muted);
  line-height: 1.55;
}

.check input {
  appearance: none;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
  flex: none;
}

.check input[type="radio"] {
  border-radius: 50%;
}

.check input::after {
  content: "";
  width: 9px;
  height: 9px;
  transform: scale(0);
  transition: transform 0.15s var(--ease);
  background: var(--brand-contrast);
  clip-path: polygon(14% 44%, 0 65%, 40% 100%, 100% 16%, 82% 0%, 38% 62%);
}

.check input[type="radio"]::after {
  clip-path: none;
  border-radius: 50%;
  width: 7px;
  height: 7px;
}

.check input:checked {
  background: var(--brand);
  border-color: var(--brand);
}

.check input:checked::after {
  transform: scale(1);
}

.check input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Segmented control (radios styled as buttons) */
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 11px;
  gap: 2px;
}

.segmented label {
  position: relative;
  display: inline-flex;
}

.segmented input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.segmented span {
  padding: 0.38rem 0.85rem;
  border-radius: 8px;
  font-size: var(--step--1);
  font-weight: 520;
  color: var(--text-muted);
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
  white-space: nowrap;
}

.segmented input:checked + span {
  background: var(--surface);
  color: var(--text);
  font-weight: 570;
  box-shadow: var(--shadow-xs);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* Inside a form field the control fills the row and splits evenly. */
.field > .segmented {
  display: flex;
  width: 100%;
}

.field > .segmented label {
  flex: 1;
}

.field > .segmented span {
  display: block;
  width: 100%;
  text-align: center;
}

/* Range slider */
.range-row {
  display: grid;
  gap: 0.55rem;
}

.range-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
}

.range-head .label {
  display: block;
}

.range-value {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 560;
  color: var(--text);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.12rem 0.5rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--brand) 0%,
    var(--brand) var(--fill, 50%),
    var(--bg-inset) var(--fill, 50%),
    var(--bg-inset) 100%
  );
  border: 1px solid var(--border);
}

input[type="range"]::-moz-range-track {
  height: 5px;
  border-radius: 3px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
}

input[type="range"]::-moz-range-progress {
  height: 5px;
  border-radius: 3px;
  background: var(--brand);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7.5px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s var(--ease), border-color 0.14s var(--ease);
}

input[type="range"]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  box-shadow: var(--shadow-sm);
}

input[type="range"]:hover::-webkit-slider-thumb {
  border-color: var(--brand);
  transform: scale(1.08);
}

input[type="range"]:focus-visible {
  outline: none;
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  border-color: var(--brand);
  box-shadow: var(--ring);
}

input[type="range"]:focus-visible::-moz-range-thumb {
  border-color: var(--brand);
  box-shadow: var(--ring);
}

/* ==========================================================================
   17. PRICING & CALCULATOR
   ========================================================================== */

.price-grid {
  display: grid;
  gap: var(--sp-5);
  align-items: start;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .price-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1080px) {
  .price-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.plan {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.plan:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.plan--featured {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
  box-shadow: var(--shadow-lg);
}

.plan--featured::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--brand) 55%, transparent),
    transparent 45%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.plan-flag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.22rem 0.7rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.plan-name {
  font-size: var(--step-1);
  font-weight: 620;
  letter-spacing: -0.018em;
}

.plan-desc {
  margin-top: 0.35rem;
  font-size: var(--step--1);
  color: var(--text-muted);
  line-height: 1.55;
  min-height: 2.9em;
}

.plan-price {
  margin-top: var(--sp-5);
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.plan-price .amount {
  font-size: var(--step-4);
  font-weight: 640;
  letter-spacing: -0.038em;
  line-height: 1;
}

.plan-price .period {
  font-size: var(--step--1);
  color: var(--text-subtle);
}

.plan-usage {
  margin-top: 0.6rem;
  font-size: var(--step--2);
  color: var(--text-subtle);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.plan .btn {
  margin-top: var(--sp-5);
}

.plan-features {
  margin-top: var(--sp-5);
  display: grid;
  gap: 0.62rem;
  font-size: var(--step--1);
}

.plan-features li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 0.6rem;
  align-items: start;
  color: var(--text-muted);
  line-height: 1.5;
}

.plan-features svg {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  color: var(--brand);
  flex: none;
}

.plan-features .off {
  color: var(--text-subtle);
  opacity: 0.75;
}

.plan-features .off svg {
  color: var(--text-subtle);
}

.plan-features strong {
  color: var(--text);
  font-weight: 580;
}

/* --- Calculator ------------------------------------------------------- */

.calc {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

@media (min-width: 940px) {
  .calc {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.calc-controls {
  padding: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  display: grid;
  gap: var(--sp-5);
  align-content: start;
}

.calc-summary {
  padding: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

@media (min-width: 940px) {
  .calc-summary {
    border-top: none;
    border-left: 1px solid var(--border);
  }
}

.calc-total {
  font-size: clamp(2.4rem, 1.8rem + 2.6vw, 3.4rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.calc-total .cur {
  font-size: 0.5em;
  color: var(--text-subtle);
  font-weight: 560;
}

.calc-total-label {
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 0.7rem;
}

.calc-plan-note {
  margin-top: var(--sp-4);
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  font-size: var(--step--2);
  color: var(--brand);
  line-height: 1.5;
}

.calc-lines {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.55rem;
  font-size: var(--step--1);
}

.calc-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  color: var(--text-muted);
}

.calc-line span:last-child {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}

.calc-line--total {
  padding-top: 0.6rem;
  margin-top: 0.2rem;
  border-top: 1px dashed var(--border-strong);
  color: var(--text);
  font-weight: 580;
}

.calc-line--credit span:last-child {
  color: var(--success);
}

.calc-summary .btn {
  margin-top: var(--sp-6);
}

.calc-fineprint {
  margin-top: var(--sp-4);
  font-size: var(--step--2);
  color: var(--text-subtle);
  line-height: 1.55;
}

/* ==========================================================================
   18. PLAYGROUND
   ========================================================================== */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.36rem 0.78rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--step--1);
  font-weight: 520;
  color: var(--text-muted);
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease),
    border-color 0.16s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  font-weight: 560;
}

.chip .count {
  font-size: 0.85em;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.prompt-grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  align-items: start;
}

.prompt-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
    opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.prompt-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.prompt-card[hidden] {
  display: none;
}

.prompt-head {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  justify-content: space-between;
}

.prompt-head h3 {
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: -0.014em;
  line-height: 1.35;
}

.prompt-tags {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.prompt-io {
  display: grid;
}

.io-block {
  padding: var(--sp-4) var(--sp-5);
  display: grid;
  gap: 0.5rem;
}

.io-block + .io-block {
  border-top: 1px dashed var(--border);
}

.io-block--output {
  background: var(--surface-2);
}

.io-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.io-label svg {
  width: 12px;
  height: 12px;
}

.io-text {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  line-height: 1.68;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.io-block--output .io-text {
  font-family: var(--font-sans);
  font-size: var(--step--1);
  color: var(--text);
  white-space: normal;
}

.io-block--output .io-text ul {
  display: grid;
  gap: 0.28rem;
  margin-top: 0.4rem;
}

.io-block--output .io-text li {
  padding-left: 1rem;
  position: relative;
  color: var(--text-muted);
}

.io-block--output .io-text li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.65em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
}

.prompt-foot {
  margin-top: auto;
  padding: 0.65rem var(--sp-5);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  background: var(--bg-subtle);
}

.prompt-stats {
  display: flex;
  gap: var(--sp-4);
  font-size: var(--step--2);
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

.copy-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--step--2);
  font-weight: 550;
  color: var(--text-muted);
  padding: 0.28rem 0.55rem;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: all 0.15s var(--ease);
}

.copy-inline:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.copy-inline svg {
  width: 13px;
  height: 13px;
}

.copy-inline .icon-check {
  display: none;
}

.copy-inline.is-copied {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  background: var(--success-soft);
}

.copy-inline.is-copied .icon-check {
  display: block;
}

.copy-inline.is-copied .icon-copy {
  display: none;
}

.empty-state {
  text-align: center;
  padding: var(--sp-9) var(--sp-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.empty-state svg {
  width: 30px;
  height: 30px;
  margin: 0 auto var(--sp-4);
  color: var(--text-subtle);
}

/* Live region for copy announcements */
.toast {
  position: fixed;
  bottom: var(--sp-5);
  left: 50%;
  transform: translate(-50%, 12px);
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--step--1);
  font-weight: 520;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.toast svg {
  width: 14px;
  height: 14px;
  color: var(--success);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   19. API REFERENCE
   ========================================================================== */

.docs-layout {
  display: grid;
  gap: var(--sp-7);
  align-items: start;
}

@media (min-width: 1024px) {
  .docs-layout {
    grid-template-columns: 216px minmax(0, 1fr);
    gap: var(--sp-8);
  }
}

.docs-nav {
  display: none;
}

@media (min-width: 1024px) {
  .docs-nav {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + var(--sp-6));
    max-height: calc(100dvh - var(--header-h) - 4rem);
    overflow-y: auto;
  }
}

.docs-nav h2 {
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: var(--sp-3);
}

.docs-nav ul {
  display: grid;
  gap: 1px;
  border-left: 1px solid var(--border);
}

.docs-nav a {
  display: block;
  padding: 0.32rem 0.75rem;
  font-size: var(--step--1);
  color: var(--text-muted);
  margin-left: -1px;
  border-left: 1px solid transparent;
}

.docs-nav a:hover {
  color: var(--text);
  border-left-color: var(--border-hover);
}

.docs-nav a.is-active {
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 540;
}

.docs-nav ul ul {
  border-left: none;
  margin-left: 0.75rem;
}

.docs-nav ul ul a {
  font-size: var(--step--2);
  padding-block: 0.26rem;
}

.docs-main > section + section {
  margin-top: var(--sp-9);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border);
}

.docs-main h2 {
  font-size: var(--step-3);
  scroll-margin-top: calc(var(--header-h) + 2rem);
}

.docs-main h3 {
  font-size: var(--step-1);
  margin-top: var(--sp-7);
  scroll-margin-top: calc(var(--header-h) + 2rem);
}

.docs-main h2 + p,
.docs-main h3 + p {
  margin-top: var(--sp-3);
  color: var(--text-muted);
  max-width: 68ch;
}

.docs-main p + p,
.docs-main p + .code-block,
.docs-main p + .table-wrap,
.docs-main .code-block + p,
.docs-main .table-wrap + p {
  margin-top: var(--sp-4);
}

.docs-main .code-block,
.docs-main .table-wrap,
.docs-main .callout {
  margin-top: var(--sp-5);
}

.endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  margin-top: var(--sp-4);
}

.method {
  padding: 0.14rem 0.5rem;
  border-radius: 6px;
  font-size: var(--step--2);
  font-weight: 680;
  letter-spacing: 0.04em;
  flex: none;
}

.method--get {
  background: var(--info-soft);
  color: var(--info);
}

.method--post {
  background: var(--success-soft);
  color: var(--success);
}

.method--delete {
  background: var(--danger-soft);
  color: var(--danger);
}

.endpoint .path {
  color: var(--text);
  word-break: break-all;
  font-weight: 500;
}

.endpoint .path .param {
  color: var(--brand);
}

.callout {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.75rem;
  padding: var(--sp-4);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--text-muted);
}

.callout svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
  color: var(--text-subtle);
}

.callout strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.callout--info {
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info) 24%, transparent);
}

.callout--info svg {
  color: var(--info);
}

.callout--warn {
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 26%, transparent);
}

.callout--warn svg {
  color: var(--warning);
}

.param-name {
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 560;
  font-size: 0.95em;
}

.param-type {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--brand);
  display: block;
  margin-top: 2px;
}

.req-flag {
  font-size: var(--step--2);
  color: var(--danger);
  font-weight: 560;
}

.opt-flag {
  font-size: var(--step--2);
  color: var(--text-subtle);
}

/* ==========================================================================
   20. FAQ / ACCORDION
   ========================================================================== */

.faq {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  cursor: pointer;
  list-style: none;
  font-size: var(--step-0);
  font-weight: 570;
  letter-spacing: -0.012em;
  color: var(--text);
  transition: color 0.15s var(--ease);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary:hover {
  color: var(--brand);
}

.faq summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  border-radius: 6px;
}

.faq .chevron {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 3px;
  color: var(--text-subtle);
  transition: transform 0.22s var(--ease), color 0.15s var(--ease);
}

.faq details[open] .chevron {
  transform: rotate(45deg);
  color: var(--brand);
}

.faq .answer {
  padding-bottom: var(--sp-5);
  color: var(--text-muted);
  font-size: var(--step--1);
  line-height: 1.68;
  max-width: 72ch;
}

.faq .answer p + p {
  margin-top: 0.7rem;
}

.faq details[open] .answer {
  animation: fade-up 0.28s var(--ease-out);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* ==========================================================================
   21. WAITLIST / SUCCESS
   ========================================================================== */

.waitlist-layout {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: start;
}

@media (min-width: 980px) {
  .waitlist-layout {
    grid-template-columns: 1fr 480px;
  }
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.5rem, 1.1rem + 1.8vw, 2.25rem);
  position: relative;
  overflow: hidden;
}

.form-card__head {
  margin-bottom: var(--sp-5);
}

.form-card__head h2 {
  font-size: var(--step-2);
}

.form-card__head p {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: var(--step--1);
}

.form-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--sp-5);
  font-size: var(--step--2);
  color: var(--text-subtle);
}

.form-progress .bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-inset);
  overflow: hidden;
}

.form-progress .bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: var(--brand);
  transition: width 0.35s var(--ease);
}

.benefit-list {
  display: grid;
  gap: var(--sp-5);
  margin-top: var(--sp-6);
}

.benefit {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: var(--sp-4);
  align-items: start;
}

.benefit-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--brand);
  box-shadow: var(--shadow-xs);
}

.benefit-icon svg {
  width: 17px;
  height: 17px;
}

.benefit h3 {
  font-size: var(--step-0);
  font-weight: 590;
  margin-bottom: 0.2rem;
}

.benefit p {
  font-size: var(--step--1);
  color: var(--text-muted);
  line-height: 1.6;
}

.success-state {
  text-align: center;
  padding: var(--sp-6) var(--sp-2);
  animation: fade-up 0.4s var(--ease-out);
}

.success-mark {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto var(--sp-5);
  display: grid;
  place-items: center;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
}

.success-mark svg {
  width: 28px;
  height: 28px;
  animation: pop 0.42s var(--ease-out) 0.1s backwards;
}

@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

.success-state h2 {
  font-size: var(--step-2);
}

/* Focus is moved here programmatically so screen readers announce the
   confirmation — that does not warrant a visible ring. */
.success-state h2:focus,
.success-state h2:focus-visible {
  outline: none;
}

.success-state p {
  margin-top: var(--sp-3);
  color: var(--text-muted);
  font-size: var(--step--1);
  max-width: 42ch;
  margin-inline: auto;
}

.queue-card {
  margin-top: var(--sp-6);
  padding: var(--sp-4);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: var(--sp-4);
  text-align: center;
}

.queue-card div {
  flex: 1;
}

.queue-card .num {
  font-size: var(--step-2);
  font-weight: 640;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.queue-card .cap {
  font-size: var(--step--2);
  color: var(--text-subtle);
  margin-top: 0.15rem;
}

.queue-card .sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  flex: none;
}

/* ==========================================================================
   22. UTILITIES & MOTION
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.mt-0 { margin-top: 0; }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }

.full-height {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.page-head {
  padding-block: clamp(2.5rem, 1.8rem + 3.4vw, 4.5rem) clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  position: relative;
  overflow: hidden;
}

.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 70% 100% at 30% 0%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 30% 0%, #000, transparent 70%);
  pointer-events: none;
}

.page-head > * {
  position: relative;
}

.page-head h1 {
  font-size: var(--step-4);
  max-width: 20ch;
}

.page-head .lead {
  margin-top: var(--sp-4);
  max-width: 60ch;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--step--2);
  color: var(--text-subtle);
  margin-bottom: var(--sp-4);
}

.breadcrumb a {
  color: var(--text-subtle);
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb svg {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 70ms; }
.reveal-delay-2 { transition-delay: 140ms; }
.reveal-delay-3 { transition-delay: 210ms; }
.reveal-delay-4 { transition-delay: 280ms; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .mobile-nav,
  .site-footer,
  .replay-btn,
  .copy-btn {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
