/* ==========================================================================
   PasteBox showcase - stylesheet for docs/index.html (GitHub Pages build).
   Owner: Worker A. JavaScript partner: docs/assets/js/landing.js (Worker B).
   Frozen DOM contract: /opt/pastebin/LANDING-CONTRACT.md - IDs, classes and
   data attributes named there must not be renamed.

   --------------------------------------------------------------------------
   STATE CLASSES AND HOOKS FOR WORKER B
   --------------------------------------------------------------------------
   Contract-defined state:
     html[data-theme="dark"|"light"]   set by the head bootstrap and flipped by
                                       #theme-toggle (which also swaps the
                                       #hljs-dark / #hljs-light disabled flags)
     body.nav-open                     mobile nav panel open (#nav-toggle keeps
                                       aria-expanded in sync)
     .site-header.is-scrolled          added after 12px of scroll: border +
                                       shadow + blur on the sticky header
     .reveal.is-visible                scroll-in reveal (IntersectionObserver)
     .nav-link.is-active               the section currently in view
     .faq-item.is-open                 accordion open; CSS animates .faq-a
                                       (max-height + opacity) and the chevron
     .is-running (on .arch-scene)      replays the request-path animation;
                                       remove, force reflow, re-add to restart

   Reveal / hide convention:
     Elements that start hidden carry the `hidden` attribute. Reveal them with
     `el.hidden = false` - this stylesheet never overrides [hidden]. That
     applies to #create-result, #raw-copied, #api-copied, #password-content,
     #burn-content, #burn-response, #password-status and the inactive
     .account-view panels.

   Progress bars (transform-driven, no layout thrash):
     --progress        unitless 0..1 factor on .progress-fill and .rail-fill,
                       e.g. el.style.setProperty('--progress', 0.42).
                       A literal inline style="width:60%" also works: the
                       stylesheet disables scaling when it sees an inline width.
     --burn-progress   unitless 0..1 factor for the burn fuse, or just add
                       .is-burning to .burn-stage for the built-in animation.

   Demo-specific state (Worker B drives these; all additive):
     01 create    .create-stage.is-cursor              shows .os-cursor
                  .field.is-active                    field under the cursor
                  --cursor-x / --cursor-y             px offsets for .os-cursor
     02 exposure  .tab.is-active + aria-selected       on [data-exposure]
                  .role-btn.is-active + aria-pressed  on [data-role]
                  #exposure-panel[data-mode=...]      mirrored mode
                  #exposure-response[data-state=ok|forbidden|locked|notfound]
                  .status-chip[data-status=200|401|403|404|413|429|listed|hidden]
     03 raw       #raw-toggle[data-view=rendered|plain]  (+ aria-pressed)
                  the stage can mirror data-view itself; :has() already swaps
                  the panes when only #raw-toggle is updated
     04 expiry    .expiry-node.is-active
                  --marker-x / --marker-w on #expiry-rail move #expiry-marker
                  #expiry-countdown and #expiry-cleanup text
                  .state-step.is-active (data-state=created|counting|expired|removed)
                  .expiry-stage.is-playing pulses the rail
     05 burn      .burn-stage.is-burning -> fuse animation (or --burn-progress)
                  #burn-first.is-read, #burn-second.is-burned
                  remove hidden from #burn-content / #burn-response
     06 password  .is-shaking on #password-lock (400ms, then remove)
                  remove hidden from #password-content, .is-on on .dot
                  #password-status data-state="forbidden"
     07 syntax    .tab.is-active on #syntax-tabs [data-lang]
                  swap #syntax-code text, call hljs.highlightElement, update the
                  .gutter children and #syntax-caption. Ready-made samples:
                  <template class="pb-sample" data-lang="..."> in index.html
     08 api       .api-endpoint.is-active; #api-nokey is the 401 case
                  .status-chip.is-on / .is-off inside #api-demo-status
                  type into the <code> inside #api-demo-request / -response
     09 archive   .chip.is-active on #archive-filters (data-filter), row.hidden
                  = true/false, #archive-count text, #archive-demo-type types a
                  sample query into #archive-search
     10 accounts  .step.is-active, .account-view hidden toggling + .is-active,
                  --progress on #account-progress, disable the .account-nav
                  buttons at the ends
   ========================================================================== */

/* --------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;
  --bg: #0f1216;
  --bg-2: #161b22;
  --bg-3: #1c2430;
  --border: #262d36;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #4f9cf9;
  --accent-strong: #2f81f7;
  --danger: #f85149;
  --ok: #3fb950;
  --warn: #d29922;
  --code-bg: #0b0f14;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --speed: 200ms;
  --speed-fast: 140ms;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 12px 32px -18px rgba(0, 0, 0, 0.75);
  --gutter-bg: rgba(255, 255, 255, 0.03);
  --tint: rgba(79, 156, 249, 0.12);
  --tint-strong: rgba(79, 156, 249, 0.2);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fa;
  --bg-2: #ffffff;
  --bg-3: #eef2f6;
  --border: #d0d7de;
  --text: #1f2328;
  --muted: #59636e;
  --code-bg: #f6f8fa;
  --shadow-soft: 0 1px 2px rgba(31, 35, 40, 0.06);
  --shadow: 0 1px 2px rgba(31, 35, 40, 0.07), 0 12px 28px -20px rgba(31, 35, 40, 0.35);
  --gutter-bg: rgba(31, 35, 40, 0.03);
  --tint: rgba(47, 129, 247, 0.1);
  --tint-strong: rgba(47, 129, 247, 0.18);
}

/* ----------------------------------------------------------------- base */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.015em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

pre { margin: 0; font-family: var(--mono); }

pre code { font: inherit; background: none; border: 0; padding: 0; color: inherit; }

/* the vendor highlight.js themes set a background of their own: drop it so the
   code sits on our window instead of punching a lighter rectangle through it */
pre code.hljs { background: transparent; padding: 0; }

code:not(pre code) {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

[hidden] { display: none !important; }

section[id] { scroll-margin-top: 64px; }

.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;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -72px;
  z-index: 90;
  padding: 12px 18px;
  border-radius: 0 0 10px 10px;
  background: var(--accent-strong);
  color: #ffffff;
  font-weight: 600;
  transition: top var(--speed-fast) ease;
}

.skip-link:focus { top: 0; }

/* ------------------------------------------------------------ utilities */
.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.mono { font-family: var(--mono); }

.scroller {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
}

/* Scroll-reveal. Guarded on html.js so a JavaScript-free visitor still gets
   the whole page (the head bootstrap adds the class before first paint). */
.reveal { transition: opacity 480ms ease, transform 480ms ease; }
html.js .reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 52px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease,
              background-color var(--speed) ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: var(--bg-2);
  box-shadow: 0 8px 24px -20px rgba(0, 0, 0, 0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.brand-mark { color: var(--accent); flex: 0 0 auto; }

.brand-name { font-size: 1rem; }

.site-nav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 52px;
  padding: 0 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--speed-fast) ease, border-color var(--speed-fast) ease;
}

.nav-link:hover { color: var(--text); text-decoration: none; }

.nav-link.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.nav-cta { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  cursor: pointer;
}

.nav-toggle .bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--text);
  transition: transform var(--speed-fast) ease, opacity var(--speed-fast) ease;
}

body.nav-open .nav-toggle .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle .bar:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

#theme-toggle::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' d='M12 3.5v2M12 18.5v2M3.5 12h2M18.5 12h2M6 6l1.5 1.5M16.5 16.5 18 18M18 6l-1.5 1.5M7.5 16.5 6 18'/%3E%3Ccircle cx='12' cy='12' r='4' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' d='M12 3.5v2M12 18.5v2M3.5 12h2M18.5 12h2M6 6l1.5 1.5M16.5 16.5 18 18M18 6l-1.5 1.5M7.5 16.5 6 18'/%3E%3Ccircle cx='12' cy='12' r='4' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}

html[data-theme="light"] #theme-toggle::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' d='M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' d='M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--text);
  font: inherit;
  font-size: 0.925rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--speed-fast) ease, background-color var(--speed-fast) ease,
              border-color var(--speed-fast) ease, color var(--speed-fast) ease,
              box-shadow var(--speed-fast) ease;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 10px 22px -14px rgba(47, 129, 247, 0.95);
}

.btn-primary:hover { filter: brightness(1.06); }

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

.btn-ghost:hover { background: var(--bg-3); border-color: var(--muted); }

.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
}

/* ---------------------------------------------------------------- chips */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--speed-fast) ease, border-color var(--speed-fast) ease,
              background-color var(--speed-fast) ease, transform var(--speed-fast) ease;
}

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

.chip.is-active,
.chip[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--accent);
  background: var(--tint);
}

.chip-sm {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: default;
}

.chip-ok { color: var(--ok); border-color: rgba(63, 185, 80, 0.35); background: rgba(63, 185, 80, 0.1); }
.chip-warn { color: var(--warn); border-color: rgba(210, 153, 34, 0.35); background: rgba(210, 153, 34, 0.1); }
.chip-danger { color: var(--danger); border-color: rgba(248, 81, 73, 0.35); background: rgba(248, 81, 73, 0.1); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* status + response chips (200 / 401 / 403 / 404 / 413 ...) */
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--bg-3);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-chip[data-status="200"],
.status-chip[data-status="listed"] {
  color: var(--ok);
  border-color: rgba(63, 185, 80, 0.4);
  background: rgba(63, 185, 80, 0.12);
}

.status-chip[data-status="401"],
.status-chip[data-status="429"] {
  color: var(--warn);
  border-color: rgba(210, 153, 34, 0.4);
  background: rgba(210, 153, 34, 0.12);
}

.status-chip[data-status="403"] {
  color: var(--danger);
  border-color: rgba(248, 81, 73, 0.4);
  background: rgba(248, 81, 73, 0.12);
}

.status-chip[data-status="404"],
.status-chip[data-status="hidden"] {
  color: var(--muted);
  border-color: var(--border);
  background: var(--bg-3);
}

.status-chip[data-status="413"] {
  color: #a371f7;
  border-color: rgba(163, 113, 247, 0.4);
  background: rgba(163, 113, 247, 0.12);
}

.status-chip.is-off { opacity: 0.35; }
.status-chip.is-on { opacity: 1; }

.response-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 0.9rem;
  font-weight: 500;
  animation: chip-in 220ms ease both;
}

.response-chip::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--chip-color, var(--muted));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--chip-color, var(--muted)) 18%, transparent);
}

.response-chip[data-state="ok"] {
  --chip-color: var(--ok);
  border-color: rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.08);
}

.response-chip[data-state="forbidden"] {
  --chip-color: var(--danger);
  border-color: rgba(248, 81, 73, 0.45);
  background: rgba(248, 81, 73, 0.08);
}

.response-chip[data-state="locked"] {
  --chip-color: var(--warn);
  border-color: rgba(210, 153, 34, 0.45);
  background: rgba(210, 153, 34, 0.08);
}

.response-chip[data-state="notfound"] {
  --chip-color: var(--muted);
  border-color: var(--border);
  background: var(--bg-3);
}

.result-chip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(63, 185, 80, 0.45);
  border-radius: 10px;
  background: rgba(63, 185, 80, 0.08);
  font-size: 0.86rem;
  animation: chip-in 220ms ease both;
}

.result-label {
  font-weight: 700;
  color: var(--ok);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

.result-sep { color: var(--muted); }

.copied-flag {
  color: var(--ok);
  font-size: 0.82rem;
  font-weight: 600;
  animation: chip-in 180ms ease both;
}

/* ------------------------------------------------------------ containers */
.panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.demo-stage .panel,
.section-alt .panel {
  background: var(--bg);
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pane-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.pane-note,
.panel-note,
.stage-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.panel-note { margin: 0 0 14px; }

.code-window {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.code-dots,
.terminal-dots { display: inline-flex; gap: 6px; }

.code-dots i,
.terminal-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.code-dots i:nth-child(1),
.terminal-dots i:nth-child(1) { background: #f85149; }
.code-dots i:nth-child(2),
.terminal-dots i:nth-child(2) { background: #d29922; }
.code-dots i:nth-child(3),
.terminal-dots i:nth-child(3) { background: #3fb950; }

.code-caption {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.code-body {
  display: flex;
  align-items: stretch;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gutter {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: 14px 10px 14px 16px;
  border-right: 1px solid var(--border);
  background: var(--gutter-bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.62;
  text-align: right;
  user-select: none;
}

.gutter span { display: block; }

.code-body pre {
  flex: 0 0 auto;
  padding: 14px 18px;
  font-size: 0.8rem;
  line-height: 1.62;
}

.plain-pre {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.62;
  white-space: pre;
  overflow-x: auto;
}

/* ------------------------------------------------ shared section chrome */
.section { padding: 80px 0; }

.section-alt {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background-image: radial-gradient(900px 320px at 50% 0, var(--tint), transparent 72%);
}

.section-head { max-width: 76ch; }

.section-head h2 {
  margin: 12px 0 0;
  font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.15rem);
}

.section-lede {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.66;
}

/* ----------------------------------------------------------------- hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1100px 420px at 10% -10%, rgba(79, 156, 249, 0.22), transparent 62%),
    radial-gradient(820px 380px at 92% 0%, rgba(63, 185, 80, 0.12), transparent 58%),
    linear-gradient(180deg, var(--bg-2), transparent 76%);
}

.hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.28;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 70%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 70%);
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: 48px;
  align-items: start;
}

.hero-copy h1 {
  margin: 16px 0 0;
  font-size: clamp(2rem, 1.15rem + 3.4vw, 3.2rem);
  letter-spacing: -0.028em;
}

.lede {
  margin: 18px 0 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.68;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.86rem;
}

.fact-row li {
  position: relative;
  padding-left: 16px;
}

.fact-row li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
}

/* terminal */
.terminal {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 340px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--code-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.terminal-title {
  flex: 1 1 auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-body {
  padding: 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.terminal-body pre { margin: 0; }

#terminal-code {
  display: block;
  min-height: 232px;
  white-space: pre;
  font-size: 0.8rem;
  line-height: 1.66;
}

.terminal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  font-size: 0.76rem;
  color: var(--muted);
}

.terminal-status {
  font-family: var(--mono);
  color: var(--ok);
  white-space: nowrap;
}

.terminal-hint { text-align: right; }

.caret {
  display: inline-block;
  width: 8px;
  height: 1.02em;
  margin-left: 1px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: caret-blink 1.05s steps(1, end) infinite;
}

/* stats */
.stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.stat { display: grid; gap: 2px; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* ------------------------------------------------------------- features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.feature-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: var(--shadow-soft);
  transition: transform var(--speed) ease, border-color var(--speed) ease,
              box-shadow var(--speed) ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow);
}

.feature-icon { color: var(--accent); }

.feature-card h3 {
  margin: 16px 0 0;
  font-size: 1.02rem;
}

.feature-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.feature-grid .feature-card:nth-child(3n + 2) { --reveal-delay: 60ms; }
.feature-grid .feature-card:nth-child(3n + 3) { --reveal-delay: 120ms; }
.reveal { transition-delay: var(--reveal-delay, 0ms); }

/* ---------------------------------------------------------------- demos */
.demo-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.demo-card {
  margin-top: 24px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  box-shadow: var(--shadow-soft);
}

.demo-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 4px;
  align-items: start;
  margin-bottom: 20px;
}

.demo-index {
  grid-row: 1 / span 2;
  align-self: start;
  padding: 7px 9px;
  border: 1px solid rgba(79, 156, 249, 0.35);
  border-radius: 9px;
  background: var(--tint);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.demo-head h3 { margin: 0; font-size: 1.16rem; }

.demo-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.demo-stage { display: grid; gap: 16px; }

.demo-notes {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding: 18px 0 0;
  border-top: 1px dashed var(--border);
  list-style: none;
}

.demo-notes li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.6;
}

.demo-notes li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---- demo 01: create ------------------------------------------------- */
.mock-form {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.mock-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.field label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  outline: none;
}

.field textarea { min-height: 118px; resize: vertical; }

.field:focus-within,
.field.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tint);
  background: var(--bg-3);
}

.mock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.os-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translate(var(--cursor-x, 0px), var(--cursor-y, 0px));
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease;
  z-index: 4;
}

.create-stage.is-cursor .os-cursor { opacity: 1; }

.os-cursor::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-left: 8px solid var(--text);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  transform: rotate(-24deg);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
}

/* ---- demo 02: exposure ---------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }

.exposure-panel[data-mode="unlisted"] .panel-note,
.exposure-panel[data-mode="private"] .panel-note { color: var(--text); }

.role-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.route-table { min-width: 460px; }

.route-kind {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.74rem;
}

.route-table td:last-child { white-space: nowrap; }

/* ---- demo 03: raw --------------------------------------------------- */
.raw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
}

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

.switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-3);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 180ms ease, background-color 180ms ease;
}

#raw-toggle[data-view="plain"] .switch-knob {
  transform: translateX(16px);
  background: var(--accent);
}

#raw-toggle[data-view="plain"] .switch-track {
  border-color: var(--accent);
  background: var(--tint);
}

#raw-toggle[data-view="plain"] .switch-text { color: var(--text); }

.raw-panes { display: grid; gap: 16px; }

#raw-plain { display: none; }

.raw-stage[data-view="plain"] #raw-plain { display: block; }
.raw-stage[data-view="plain"] #raw-rendered { display: none; }

.raw-stage:has(#raw-toggle[data-view="plain"]) #raw-plain { display: block; }
.raw-stage:has(#raw-toggle[data-view="plain"]) #raw-rendered { display: none; }

.raw-pane .code-window,
.password-content .plain-pre,
.burn-content .plain-pre { margin-top: 0; }

.headers {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.headers-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.headers-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 18px;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.headers-list dt { color: var(--muted); }
.headers-list dd { margin: 0; overflow-wrap: anywhere; }

/* ---- demo 04: expiry ------------------------------------------------ */
.expiry-rail {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 22px;
}

.expiry-node {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.expiry-node:hover { color: var(--text); border-color: var(--muted); }

.expiry-node.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--tint);
}

.expiry-marker {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--marker-w, 48px);
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  transform: translateX(var(--marker-x, 0px));
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1), width 240ms ease;
}

/* landing.js drives the marker with a 0..1 fraction (--expiry-pos) set on the
   rail or the marker itself; keep both mechanisms working. */
.expiry-rail { position: relative; }
.expiry-marker {
  left: calc(var(--expiry-pos, 0) * (100% - var(--marker-w, 48px)));
  transform: translateX(var(--marker-x, 0px));
}

/* the second read of a burn-after-read paste is gone */
#burn-second.is-consumed,
#burn-second.is-burned { opacity: 0.55; }

.expiry-stage.is-playing .expiry-rail { animation: rail-pulse 1.4s ease-in-out 2; }

.expiry-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.readout-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.readout-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.countdown {
  font-family: var(--mono);
  font-size: 1.24rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.countdown.is-expired { color: var(--danger); }

.readout-note { color: var(--muted); font-size: 0.86rem; }

.expiry-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.progress {
  position: relative;
  flex: 1 1 180px;
  min-width: 140px;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transform-origin: left center;
  transform: scaleX(var(--progress, 0));
  transition: transform 200ms linear;
}

.state-track {
  display: flex;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.state-step {
  position: relative;
  flex: 1 1 0;
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.state-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--border);
  transition: background-color 200ms ease;
}

.state-step.is-active { color: var(--text); }
.state-step.is-active::before { background: var(--accent); }

/* ---- demo 05: burn -------------------------------------------------- */
.burn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.burn-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.burn-placeholder,
.burn-content { flex: 1 1 auto; }

.burn-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.fuse {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
}

.fuse-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--warn), var(--danger));
  transform-origin: left center;
  transform: scaleX(var(--burn-progress, 0));
}

.burn-stage.is-burning .fuse-fill { animation: burn-down 2200ms ease forwards; }

.fuse-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

#burn-content { animation: chip-in 220ms ease both; }

.burn-controls { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- demo 06: password --------------------------------------------- */
.password-stage { grid-template-columns: 1fr; }

.lock-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 26px 22px;
  text-align: center;
}

.lock-card h4 { margin: 0; font-size: 1.02rem; }

.lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(210, 153, 34, 0.4);
  background: rgba(210, 153, 34, 0.12);
  color: var(--warn);
}

.lock-input {
  width: min(320px, 100%);
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.9rem;
  text-align: center;
  outline: none;
}

.lock-input:focus-visible,
.lock-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tint);
  outline: none;
}

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

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  background: transparent;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.dot.is-on {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.15);
}

.lock-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.lock-note {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

#password-lock.is-shaking { animation: lock-shake 420ms ease; }

#password-content { animation: chip-in 240ms ease both; }

/* ---- demo 07: syntax ----------------------------------------------- */
.syntax-stage .code-window { box-shadow: var(--shadow-soft); }

#syntax-code { display: block; white-space: pre; }

/* ---- demo 08: api demo --------------------------------------------- */
.api-demo-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
}

.api-demo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-content: start;
}

.api-endpoint { justify-content: flex-start; width: 100%; }

.api-endpoint.is-active,
.api-endpoint[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--accent);
  background: var(--tint);
}

.api-demo-panes { display: grid; gap: 14px; min-width: 0; }

.api-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.api-pane { min-width: 0; }

.request-block pre,
.response-block pre {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--code-bg);
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.66;
  min-height: 96px;
}

.response-block pre { min-height: 168px; }

/* ---- demo 09: archive --------------------------------------------- */
.archive-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.archive-input {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
}

.archive-input:focus-visible,
.archive-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tint);
  outline: none;
}

.archive-count {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.archive-rows {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.archive-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

.archive-title {
  font-weight: 600;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.archive-snippet {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.archive-meta {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.archive-views {
  color: var(--muted);
  font-size: 0.76rem;
  font-family: var(--mono);
}

.archive-row[hidden] { display: none !important; }

/* ---- demo 10: accounts -------------------------------------------- */
.accounts-stage .rail {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
}

.rail-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transform-origin: left center;
  transform: scaleX(var(--progress, 0.34));
  transition: transform 240ms ease;
}

.steps {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.86rem;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.step.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--tint);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.step.is-active .step-num {
  border-color: var(--accent);
  color: var(--accent);
}

.step-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.account-view {
  display: grid;
  gap: 10px;
  animation: chip-in 220ms ease both;
}

.mock-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 0.88rem;
}

.mock-label { color: var(--muted); }

.mock-value {
  font-family: var(--mono);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.account-nav { display: flex; gap: 10px; }

/* ----------------------------------------------------------- api table */
.api-table { min-width: 720px; }

table { width: 100%; border-collapse: collapse; }

th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  vertical-align: top;
}

tbody tr:first-child td { border-top: 0; }

td code { color: var(--text); }

.method {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.method[data-method="GET"] { color: var(--ok); border-color: rgba(63, 185, 80, 0.4); background: rgba(63, 185, 80, 0.1); }
.method[data-method="POST"] { color: var(--accent); border-color: rgba(79, 156, 249, 0.4); background: var(--tint); }
.method[data-method="DELETE"] { color: var(--danger); border-color: rgba(248, 81, 73, 0.4); background: rgba(248, 81, 73, 0.1); }

/* ----------------------------------------------------------- code card */
.code-card {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
}

.code-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.code-card-title {
  flex: 1 1 auto;
  font-size: 0.86rem;
  font-weight: 600;
}

.code-copy { flex: 0 0 auto; }

.code-card pre {
  margin: 0;
  padding: 16px;
  background: var(--code-bg);
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.68;
}

/* --------------------------------------------------------- architecture */
.arch-scene {
  position: relative;
  overflow: hidden;
  margin-top: 32px;
}

.arch {
  position: relative;
  display: flex;
  align-items: stretch;
  padding: 12px 0;
}

.arch-node {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: var(--shadow-soft);
}

.arch-icon { color: var(--accent); display: inline-flex; }

.arch-name { font-weight: 600; font-size: 0.95rem; }

.arch-caption {
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.5;
}

.arch-link {
  flex: 0 0 34px;
  align-self: center;
  height: 2px;
  background-image: repeating-linear-gradient(90deg, var(--border) 0 6px, transparent 6px 12px);
}

.arch-packet {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.arch-packet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--tint), 0 0 20px 2px color-mix(in srgb, var(--accent) 55%, transparent);
}

.arch-scene.is-visible .arch-packet,
.arch-scene.is-running .arch-packet,
.is-running .arch-packet {
  animation: arch-travel 3200ms cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.arch-scene.is-visible .arch-node,
.arch-scene.is-running .arch-node {
  animation: node-pulse 3200ms ease-in-out infinite;
}

.arch .arch-node:nth-of-type(1) { animation-delay: 0ms; }
.arch .arch-node:nth-of-type(2) { animation-delay: 400ms; }
.arch .arch-node:nth-of-type(3) { animation-delay: 800ms; }
.arch .arch-node:nth-of-type(4) { animation-delay: 1200ms; }
.arch .arch-node:nth-of-type(5) { animation-delay: 1600ms; }

.arch-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.arch-hint { color: var(--muted); font-size: 0.84rem; }

.arch-note {
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.62;
}

.arch-note strong { color: var(--text); }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.badge-row .chip {
  cursor: default;
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* ---------------------------------------------------------------- limits */
.limit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.limit-card {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: var(--shadow-soft);
}

.limit-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.limit-label { font-weight: 600; font-size: 0.94rem; }

.limit-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

/* ---------------------------------------------------------------- deploy */
.deploy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.deploy-grid .code-card { margin-top: 0; }

.deploy-note {
  margin: 24px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------- faq */
.faq {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
  transition: border-color var(--speed) ease;
}

.faq-item.is-open { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 58px;
  padding: 16px 20px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.faq-q:hover { background: var(--bg-3); }

.faq-chev {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 220ms ease, color 220ms ease;
}

.faq-item.is-open .faq-chev { transform: rotate(180deg); color: var(--accent); }

.faq-a {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 240ms ease, opacity 200ms ease;
}

.faq-item.is-open .faq-a { max-height: 32rem; opacity: 1; }

.faq-a p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.68;
  max-width: 92ch;
}

/* ---------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 44px 0 36px;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 28px 40px;
}

.footer-brand .brand-name { font-size: 1.05rem; }

.footer-note {
  margin: 12px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.62;
}

.footer-note-dim { font-size: 0.82rem; opacity: 0.85; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  align-content: start;
  justify-content: flex-end;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-links a:hover { color: var(--accent); }

.footer-copy {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
}

/* ------------------------------------------------------------ keyframes */
@keyframes caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(6px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

@keyframes lock-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes burn-down {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes rail-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes arch-travel {
  0% { opacity: 0; transform: translateX(0); }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { opacity: 0; transform: translateX(100%); }
}

@keyframes node-pulse {
  0%, 100% { border-color: var(--border); }
  45% { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
}

/* --------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .limit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero { padding-top: 48px; }
  .terminal { min-height: 300px; }
  #terminal-code { min-height: 200px; }
  .api-demo-grid { grid-template-columns: minmax(0, 1fr); }
  .api-demo-list { flex-direction: row; flex-wrap: wrap; }
  .api-endpoint { width: auto; }
}

@media (max-width: 880px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - 52px);
    overflow-y: auto;
    padding: 6px 16px 16px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  body.nav-open .site-nav { display: flex; }

  .nav-link {
    height: auto;
    min-height: 48px;
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
    border-left: 2px solid transparent;
  }

  .nav-link:last-of-type { border-bottom: 0; }

  .nav-link.is-active {
    border-left-color: var(--accent);
    background: var(--bg-3);
  }

  .nav-toggle { display: inline-flex; }

  .header-actions { margin-left: auto; }

  .nav-cta { display: flex; margin-top: 10px; }

  .arch { flex-direction: column; gap: 0; }

  .arch-link {
    flex: 0 0 26px;
    width: 2px;
    height: 26px;
    align-self: center;
    background-image: repeating-linear-gradient(180deg, var(--border) 0 6px, transparent 6px 12px);
  }

  .arch-packet { display: none; }

  .section { padding: 64px 0; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .stat-value { font-size: 1.5rem; }
  .demo-card { padding: 20px; border-radius: 14px; }
  .mock-row { grid-template-columns: minmax(0, 1fr); }
  .burn-grid { grid-template-columns: minmax(0, 1fr); }
  .expiry-readout { grid-template-columns: minmax(0, 1fr); }
  .expiry-marker { display: none; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .limit-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-links { justify-content: flex-start; }
  .section-head h2 { font-size: 1.5rem; }
  .lede { font-size: 1rem; }
  .faq-a p { padding: 0 16px 16px; }
  .faq-q { padding: 14px 16px; }
  .stats { gap: 16px; margin-top: 40px; }
}

@media (max-width: 620px) {
  #header-cta { display: none; }
  .brand-name { font-size: 0.95rem; }
  .header-actions { gap: 6px; }
  .section { padding: 52px 0; }
  .hero { padding: 36px 0 32px; }
  .demo-head { column-gap: 12px; }
  .demo-index { padding: 5px 8px; }
  .demo-head h3 { font-size: 1.06rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .state-step { font-size: 0.72rem; }
  .archive-meta { justify-content: flex-start; }
  .archive-row { grid-template-columns: minmax(0, 1fr); }
  .archive-meta { grid-column: 1; grid-row: auto; }
  .terminal-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .terminal-hint { text-align: left; }
}

/* Touch targets: coarse pointers and small screens get 44px minimum. */
@media (max-width: 880px), (pointer: coarse) {
  .btn,
  .btn-sm,
  .chip:not(.chip-sm),
  .switch,
  .expiry-node,
  .archive-input,
  .lock-input {
    min-height: 44px;
  }

  .footer-links a { min-height: 44px; }
}

/* Defensive: if a progress element is driven by an inline width instead of the
   --progress custom property, stop scaling so the inline width wins. */
.progress-fill[style*="width"],
.rail-fill[style*="width"],
.fuse-fill[style*="width"] { transform: none; }

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

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

  .arch-packet { display: none; }
  .caret { animation: none; opacity: 1; }
  .expiry-stage.is-playing .expiry-rail { animation: none; }
  .burn-stage.is-burning .fuse-fill { animation: none; transform: scaleX(1); }
  .faq-a { transition: none; }
}
