/* Relay Hub marketing site — single page, zero build, no external requests. */

:root {
  --accent: #2f6fed;
  --button-bg: #2f6fed;
  --button-hover: #1f56c9;
  --accent-strong: #1f56c9;
  --accent-soft: #eaf1fe;
  --accent-ring: rgba(47, 111, 237, 0.22);

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --border: #e4e7ec;
  --border-strong: #d3d8e0;
  --text: #171b21;
  --muted: #5b6472;

  --ok: #1a7f4b;
  --ok-soft: rgba(26, 127, 75, 0.1);
  --ok-line: rgba(26, 127, 75, 0.28);
  --warn: #8f5a00;
  --warn-soft: rgba(154, 98, 0, 0.12);
  --warn-line: rgba(154, 98, 0, 0.3);
  --bad: #b3261e;

  --app-bg: #f6f7f9;
  --app-surface: #ffffff;
  --app-border: #e2e5ea;
  --app-text: #1b1f24;
  --app-muted: #5c6570;

  --cursor-fill: #1b1f24;
  --cursor-stroke: #ffffff;

  --header-bg: rgba(255, 255, 255, 0.84);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, 0.04), 0 16px 40px rgba(16, 24, 40, 0.1);

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

  color-scheme: light;
}

:root:not([data-theme="light"]) {
    --accent: #6f9bff;
    --accent-strong: #9dbaff;
    --accent-soft: rgba(111, 155, 255, 0.16);
    --accent-ring: rgba(111, 155, 255, 0.28);

    --bg: #0f1115;
    --surface: #161a21;
    --surface-2: #1b2029;
    --border: #262c35;
    --border-strong: #333a45;
    --text: #e8eaed;
    --muted: #9aa3ad;

    --ok: #57c98a;
    --ok-soft: rgba(87, 201, 138, 0.14);
    --ok-line: rgba(87, 201, 138, 0.35);
    --warn: #e0aa5a;
    --warn-soft: rgba(224, 170, 90, 0.16);
    --warn-line: rgba(224, 170, 90, 0.4);
    --bad: #ef7a72;

    --app-bg: #14161a;
    --app-surface: #1c1f24;
    --app-border: #2c3138;
    --app-text: #e8eaed;
    --app-muted: #9aa3ad;

    --cursor-fill: #f2f4f7;
    --cursor-stroke: #10131a;

    --header-bg: rgba(15, 17, 21, 0.84);

    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.45);

    color-scheme: dark;
}

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

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

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

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 650;
}

p {
  margin: 0;
}

a {
  color: var(--accent-strong);
}

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

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--text);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

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

.small {
  font-size: 0.875rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
}

.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--accent);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.28);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

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

/* Buttons, chips, links */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.15s ease;
}

.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.875rem;
}

.btn-lg {
  min-height: 54px;
  padding: 0 28px;
  font-size: 1.0625rem;
}

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

.btn-primary:hover {
  background: var(--button-hover);
}

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

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.link {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.sep {
  margin-inline: 6px;
  color: var(--border-strong);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Hero */

.hero {
  padding-block: clamp(56px, 9vw, 112px) clamp(40px, 6vw, 72px);
}

.eyebrow {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  letter-spacing: -0.03em;
}

.lede {
  margin-top: 18px;
  max-width: 62ch;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}

.hero .meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.hero .meta + .meta {
  margin-top: 6px;
}

/* Section scaffolding */

.section-head {
  max-width: 68ch;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.section-head h2,
.features h2,
.install h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.section-sub {
  margin-top: 10px;
  color: var(--muted);
}

.walkthrough {
  padding-block: clamp(24px, 4vw, 40px) clamp(40px, 6vw, 72px);
}

/* Walkthrough demo */

.demo-frame {
  container: demo / inline-size;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.chrome {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

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

.chrome-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.demo-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--border);
}

.demo-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.demo-viewport {
  position: relative;
  overflow: hidden;
  background: var(--app-bg);
}

/* The app window inside the demo */

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

.app-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(6px, 1.4cqw, 16px);
  padding: clamp(7px, 1.4cqw, 14px) clamp(10px, 2.2cqw, 24px);
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(5px, 0.9cqw, 9px);
  font-weight: 650;
  font-size: clamp(10px, 1.5cqw, 15px);
}

.app-mark {
  width: clamp(11px, 1.7cqw, 17px);
  height: clamp(11px, 1.7cqw, 17px);
  border-radius: clamp(3px, 0.5cqw, 5px);
  background: var(--accent);
}

.app-nav {
  display: inline-flex;
  gap: clamp(2px, 0.5cqw, 6px);
}

.app-nav-item {
  padding: clamp(2px, 0.55cqw, 6px) clamp(6px, 1.1cqw, 12px);
  border-radius: var(--radius-sm);
  font-size: clamp(8.5px, 1.25cqw, 13px);
  font-weight: 550;
  color: var(--app-muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}

#demo[data-screen="hub"] .app-nav-item[data-nav="hub"],
#demo[data-screen="accounts"] .app-nav-item[data-nav="accounts"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.app-top-right {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 1.2cqw, 14px);
  margin-left: auto;
}

.foundation {
  font-size: clamp(7.5px, 1.1cqw, 11.5px);
  color: var(--app-muted);
}

.app-body {
  position: relative;
  display: grid;
  padding: clamp(10px, 2.2cqw, 26px);
}

.screen-hub {
  position: relative;
  grid-area: 1 / 1;
}

/* The drawer shares the hub's grid cell, so the window grows to whichever
   is taller and the drawer content is never clipped. It stays in flow while
   closed, which also keeps the demo frame height constant across steps. */

.screen-accounts {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.screen-accounts {
  padding: clamp(10px, 2.2cqw, 26px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(1.5%);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
  z-index: 10;
}

#demo[data-screen="accounts"] .screen-accounts {
  opacity: 1;
  visibility: visible;
  transform: none;
}

#demo[data-screen="accounts"] .screen-hub {
  opacity: 0;
  visibility: hidden;
}

.screen-hub {
  transition: opacity 0.35s ease, visibility 0.35s;
}

/* Metrics */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(5px, 1.1cqw, 14px);
}

.metric {
  padding: clamp(6px, 1.3cqw, 16px) clamp(7px, 1.4cqw, 18px);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.metric-label {
  font-size: clamp(8px, 1.25cqw, 12.5px);
  color: var(--app-muted);
  line-height: 1.3;
}

.metric-value {
  margin-top: clamp(2px, 0.5cqw, 6px);
  font-size: clamp(15px, 3cqw, 32px);
  font-weight: 650;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.metric-hint {
  margin-top: clamp(1px, 0.35cqw, 4px);
  font-size: clamp(7.5px, 1.1cqw, 11.5px);
  color: var(--app-muted);
  line-height: 1.3;
}

/* Blocks and rows */

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 1.4cqw, 16px);
  margin-top: clamp(10px, 2.2cqw, 26px);
  margin-bottom: clamp(6px, 1.2cqw, 14px);
}

.block-head h3 {
  font-size: clamp(10px, 1.55cqw, 15px);
}

.block-head .muted {
  font-size: clamp(8px, 1.2cqw, 12px);
  margin-top: clamp(1px, 0.3cqw, 3px);
  max-width: 48ch;
}

.note,
.screen-accounts .note {
  font-size: clamp(8px, 1.15cqw, 11.5px);
  color: var(--app-muted);
  margin-bottom: clamp(4px, 0.9cqw, 10px);
}

.rows {
  display: grid;
  gap: clamp(5px, 1cqw, 11px);
}

.row-card {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.3cqw, 14px);
  padding: clamp(6px, 1.2cqw, 14px) clamp(7px, 1.4cqw, 16px);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease,
    transform 0.3s ease;
}

.row-card[data-account="work"] {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
}

#demo[data-work="shown"] .row-card[data-account="work"] {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(17px, 2.6cqw, 30px);
  height: clamp(17px, 2.6cqw, 30px);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: clamp(8px, 1.2cqw, 12px);
  font-weight: 650;
}

.row-main {
  min-width: 0;
  flex: 1;
}

.row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(3px, 0.7cqw, 8px);
}

.row-name {
  font-size: clamp(9px, 1.35cqw, 13.5px);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(4px, 1cqw, 12px);
  margin-top: clamp(1px, 0.35cqw, 4px);
  font-size: clamp(7.5px, 1.1cqw, 11.5px);
  color: var(--app-muted);
}

.cooldown {
  visibility: hidden;
  color: var(--warn);
  font-weight: 600;
}

#demo[data-cooldown="on"] .cooldown {
  visibility: visible;
}

.row-action {
  flex: none;
}

#demo[data-cooldown="on"] .row-card[data-account="personal"] .pill-state {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: var(--warn-line);
}

/* Pills and fake controls */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: clamp(7.5px, 1.05cqw, 11px);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.pill-ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: var(--ok-line);
}

.pill-warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: var(--warn-line);
}

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: clamp(3px, 0.7cqw, 8px) clamp(7px, 1.3cqw, 15px);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: clamp(8.5px, 1.2cqw, 12.5px);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease,
    color 0.2s ease;
}

.app-btn-xs {
  padding: clamp(2px, 0.55cqw, 6px) clamp(6px, 1.1cqw, 13px);
}

.app-btn-primary {
  background: var(--button-bg);
  color: #ffffff;
}

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

.app-btn-ghost {
  color: var(--app-muted);
}

.app-btn.is-hot,
.row-card.is-hot,
.app-nav-item.is-hot {
  box-shadow: 0 0 0 3px var(--accent-ring);
  border-color: var(--accent);
}

/* Add-account popover (kept out of flow so nothing shifts) */

.add-wrap {
  position: relative;
}

.add-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 15;
  width: min(240px, 62cqw);
  padding: clamp(7px, 1.4cqw, 14px);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

#demo[data-form="open"] .add-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.field-label {
  display: block;
  font-size: clamp(8px, 1.15cqw, 11.5px);
  color: var(--app-muted);
  margin-bottom: clamp(2px, 0.4cqw, 5px);
}

.fake-input {
  display: block;
  width: 100%;
  min-height: clamp(14px, 2.2cqw, 26px);
  padding: clamp(2px, 0.5cqw, 6px) clamp(4px, 0.8cqw, 9px);
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  font-size: clamp(8.5px, 1.2cqw, 12.5px);
  line-height: 1.5;
  overflow: hidden;
}

.fake-input-tall {
  min-height: clamp(24px, 3.6cqw, 44px);
}

.add-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(4px, 0.8cqw, 9px);
  margin-top: clamp(5px, 1cqw, 10px);
}

.typed {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
}

#demo[data-form="closed"] .typed {
  transition: none;
}

#demo[data-typed="on"] .typed {
  max-width: 12ch;
  transition: max-width 1.1s steps(12, end);
}

.caret {
  display: inline-block;
  width: 1px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--app-text);
  animation: caret-blink 1.1s step-end infinite;
}

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

/* Drawer */

.scrim {
  position: absolute;
  inset: 0;
  z-index: 18;
  background: rgba(15, 20, 30, 0.22);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

#demo[data-drawer="open"] .scrim {
  opacity: 1;
  visibility: visible;
}

.drawer {
  grid-area: 1 / 1;
  justify-self: end;
  width: min(62%, 340px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--app-surface);
  border-left: 1px solid var(--app-border);
  box-shadow: -14px 0 34px rgba(16, 24, 40, 0.16);
  transform: translateX(102%);
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

#demo[data-drawer="open"] .drawer {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: clamp(6px, 1.3cqw, 14px) clamp(8px, 1.5cqw, 16px);
  border-bottom: 1px solid var(--app-border);
}

.drawer-title {
  font-size: clamp(9px, 1.4cqw, 14px);
  font-weight: 650;
}

.drawer-sub {
  font-size: clamp(7.5px, 1.1cqw, 11px);
  color: var(--app-muted);
}

.drawer-x {
  color: var(--app-muted);
  font-size: clamp(9px, 1.4cqw, 14px);
  line-height: 1;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: clamp(6px, 1.3cqw, 14px) clamp(8px, 1.5cqw, 16px);
}

.drawer-section {
  padding-block: clamp(4px, 0.9cqw, 10px);
  border-top: 1px solid var(--app-border);
}

.drawer-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.drawer-section h4 {
  font-size: clamp(8.5px, 1.25cqw, 12.5px);
  margin-bottom: clamp(3px, 0.6cqw, 7px);
}

.drawer-section .muted {
  font-size: clamp(7.5px, 1.05cqw, 11px);
  line-height: 1.45;
  margin-bottom: clamp(4px, 0.8cqw, 9px);
}

.kv {
  margin: 0;
  display: grid;
  gap: clamp(2px, 0.4cqw, 5px);
}

.kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: clamp(6px, 1.2cqw, 14px);
  font-size: clamp(7.5px, 1.05cqw, 11px);
}

.kv dt {
  color: var(--app-muted);
}

.kv dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.drawer .field {
  margin-bottom: clamp(4px, 0.8cqw, 9px);
}

.intent {
  margin-top: clamp(4px, 0.9cqw, 10px);
  padding: clamp(4px, 0.8cqw, 9px) clamp(5px, 1cqw, 11px);
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
}

#demo[data-intent="none"] .intent {
  visibility: hidden;
}

.intent-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: clamp(6px, 1.2cqw, 14px);
  font-size: clamp(7.5px, 1.05cqw, 11px);
}

.intent-row + .intent-row {
  margin-top: clamp(1px, 0.3cqw, 4px);
}

.intent-row > span {
  color: var(--app-muted);
}

.intent-row code {
  font-family: var(--mono);
  font-size: 0.95em;
}

.intent-id {
  visibility: hidden;
}

.intent-dispatching,
.intent-sent,
.btn-dispatching {
  display: none;
}

#demo[data-intent="dispatching"] .intent-dispatching,
#demo[data-intent="sent"] .intent-sent,
#demo[data-intent="dispatching"] .btn-dispatching {
  display: inline;
}

#demo[data-intent="dispatching"] .btn-text {
  display: none;
}

#demo[data-intent="sent"] .intent-id {
  visibility: visible;
}

/* Cursor */

.cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 60;
  width: clamp(14px, 2.1cqw, 25px);
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.25s ease;
  will-change: transform;
}

.cursor.is-hidden {
  opacity: 0;
}

.cursor-arrow {
  width: 100%;
  height: auto;
  fill: var(--cursor-fill);
  stroke: var(--cursor-stroke);
  stroke-width: 1.4;
  paint-order: stroke;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.ripple {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(26px, 4.2cqw, 50px);
  height: clamp(26px, 4.2cqw, 50px);
  border-radius: 50%;
  background: var(--accent-ring);
  transform: translate(-50%, -50%) scale(0.25);
  opacity: 0;
}

.cursor.is-click .ripple {
  animation: cursor-ripple 0.55s ease-out;
}

@keyframes cursor-ripple {
  from {
    transform: translate(-50%, -50%) scale(0.25);
    opacity: 0.9;
  }
  to {
    transform: translate(-50%, -50%) scale(1.7);
    opacity: 0;
  }
}

/* Caption and controls */

.demo-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.demo-caption {
  margin: 0;
  max-width: 70ch;
  min-height: 3em;
  color: var(--muted);
  font-size: 0.9375rem;
}

.demo-actions {
  flex: none;
}

/* Features */

.features {
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--border);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 4vw, 40px);
  margin-top: clamp(20px, 3vw, 32px);
}

.feature {
  border-top: 2px solid var(--accent);
  padding-top: 16px;
}

.feature h3 {
  font-size: 1.0625rem;
}

.feature p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Install */

.install {
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--border);
}

.steps {
  margin: clamp(20px, 3vw, 32px) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: clamp(16px, 2.5vw, 24px);
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  display: grid;
  gap: 8px;
}

.steps h3 {
  font-size: 1.0625rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.steps h3::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.875rem;
  font-weight: 650;
}

.steps p {
  color: var(--muted);
  font-size: 0.9375rem;
}

pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

pre code,
code {
  font-family: var(--mono);
  font-size: 0.875rem;
}

p code {
  padding: 0.1em 0.4em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.install > .muted {
  margin-top: 20px;
  font-size: 0.9375rem;
  max-width: 70ch;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: clamp(28px, 4vw, 44px);
  background: var(--surface-2);
}

.footer-inner {
  display: grid;
  gap: 12px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
}

.footer-nav a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.site-footer .small {
  max-width: 72ch;
}

/* Demo container queries */

@container demo (max-width: 720px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-top-right {
    margin-left: 0;
  }

  .foundation {
    order: 4;
    flex-basis: 100%;
  }
}

@container demo (max-width: 560px) {
  .drawer {
    width: 100%;
  }

  .metric-hint {
    display: none;
  }
}

/* Page responsiveness */

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

  .demo-foot {
    flex-direction: column;
  }

  .demo-caption {
    min-height: 4.5em;
  }
}

@media (max-width: 420px) {
  .cta-row .btn {
    width: 100%;
  }

  .site-nav .nav-link {
    display: none;
  }
}

/* Reduced motion: the animation is opt-in and step changes are instant. */

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

/* The walkthrough is the centerpiece; the surrounding page stays compact. */
.hero { padding-top: 36px; padding-bottom: 24px; text-align: center; }
.hero h1 { max-width: none; font-size: clamp(48px, 6vw, 76px); line-height: 1; letter-spacing: -.05em; margin: 22px 0; }
.hero h1 span { color: var(--accent); }
.hero .lede { max-width: 650px; margin-inline: auto; font-size: clamp(17px, 2vw, 21px); line-height: 1.55; }
.hero .cta-row { justify-content: center; margin-top: 28px; }
.btn-primary { box-shadow: 0 5px 18px var(--accent-ring); }
.demo { border-radius: 20px; box-shadow: var(--shadow-md); }
.section-head { text-align: center; }
.install { margin-top: 36px; padding-block: 22px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.install summary { cursor: pointer; font-weight: 650; font-size: 18px; list-style: none; }
.install summary span { float: right; color: var(--accent); }
.install[open] summary span { transform: rotate(45deg); }
.install .steps { margin-top: 24px; }
.site-footer { margin-top: 32px; }
@media (max-width: 600px) { .hero { padding-top: 36px; } .hero h1 { font-size: clamp(36px, 8vw, 48px); } .hero .meta { font-size: 12px; } }

.section-head { margin-inline: auto; }
#walkthrough-title { scroll-margin-top: 82px; }
.demo-foot { padding: 0 18px 18px; }

/* Theme is dark by default; the explicit choice survives reloads. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.theme-moon { display: none; }
[data-theme="light"] .theme-sun { display: none; }
[data-theme="light"] .theme-moon { display: block; }
.product-context { max-width: 860px; padding-bottom: 16px; }
.product-context h2 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); margin-bottom: 16px; }
.product-context p + p { margin-top: 12px; }
@media (max-width: 420px) { .site-nav > button:disabled { display: none; } }
