/* VaultX website — design system (light/dark), layout, components, motion. No build step. */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --bg-muted: #f1f5f9;
  --fg: #0f172a;
  --fg-muted: #475569;
  --fg-subtle: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --accent: #06b6d4;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --ring: rgba(79, 70, 229, 0.35);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 30px 80px -24px rgba(30, 27, 75, 0.35), 0 8px 24px -8px rgba(15, 23, 42, 0.12);
  --glow: radial-gradient(60% 60% at 50% 40%, rgba(99, 102, 241, 0.28), transparent 70%);
  --grid-line: rgba(15, 23, 42, 0.05);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --container: 1180px;
  --header-h: 68px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020;
    --bg-elev: #111832;
    --bg-muted: #161e3a;
    --fg: #e8ecf8;
    --fg-muted: #a6b0cf;
    --fg-subtle: #7d88aa;
    --border: #232c4d;
    --border-strong: #2f3a63;
    --primary: #818cf8;
    --primary-600: #6366f1;
    --primary-50: rgba(99, 102, 241, 0.12);
    --primary-100: rgba(99, 102, 241, 0.2);
    --ring: rgba(129, 140, 248, 0.45);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, 0.75), 0 8px 24px -8px rgba(0, 0, 0, 0.45);
    --glow: radial-gradient(60% 60% at 50% 40%, rgba(99, 102, 241, 0.35), transparent 70%);
    --grid-line: rgba(148, 163, 255, 0.06);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020;
  --bg-elev: #111832;
  --bg-muted: #161e3a;
  --fg: #e8ecf8;
  --fg-muted: #a6b0cf;
  --fg-subtle: #7d88aa;
  --border: #232c4d;
  --border-strong: #2f3a63;
  --primary: #818cf8;
  --primary-600: #6366f1;
  --primary-50: rgba(99, 102, 241, 0.12);
  --primary-100: rgba(99, 102, 241, 0.2);
  --ring: rgba(129, 140, 248, 0.45);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, 0.75), 0 8px 24px -8px rgba(0, 0, 0, 0.45);
  --glow: radial-gradient(60% 60% at 50% 40%, rgba(99, 102, 241, 0.35), transparent 70%);
  --grid-line: rgba(148, 163, 255, 0.06);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
h1,
h2,
h3,
h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--fg);
}
h1 {
  font-size: clamp(2.3rem, 5.2vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  font-weight: 750;
}
h3 {
  font-size: 1.2rem;
  font-weight: 650;
}
p {
  margin: 0 0 1em;
  color: var(--fg-muted);
}
code,
kbd,
pre {
  font-family: var(--mono);
  font-size: 0.88em;
}
code {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  color: var(--fg);
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.12em 0.45em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 0.8em;
  text-align: center;
}
::selection {
  background: var(--primary-100);
}
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
}
.skip-link:focus {
  top: 12px;
}

.container {
  width: min(var(--container), 100% - 32px);
  margin-inline: auto;
}
.section {
  padding: clamp(64px, 9vw, 120px) 0;
  position: relative;
}
.section--muted {
  background: var(--bg-muted);
  border-block: 1px solid var(--border);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}
.eyebrow svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--fg-muted);
  max-width: 62ch;
}
.section-head {
  max-width: 760px;
  margin: 0 auto 56px;
  text-align: center;
}
.section-head .lead {
  margin-inline: auto;
}
.gradient-text {
  background: linear-gradient(110deg, #6366f1 0%, #8b5cf6 35%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 1.15rem;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 12px;
  list-style: none;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--fg-muted);
  font-size: 0.93rem;
  font-weight: 550;
}
.nav-links a:hover {
  color: var(--fg);
  background: var(--bg-muted);
  text-decoration: none;
}
.nav-links a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-50);
}
.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.icon-btn:hover {
  color: var(--fg);
  border-color: var(--border-strong);
}
.icon-btn:active {
  transform: scale(0.96);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.theme-toggle .sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .moon {
  display: none;
}
.menu-toggle {
  display: none;
}

@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 12px 16px 20px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .nav-links a {
    padding: 12px 14px;
    font-size: 1rem;
  }
  body.nav-open .nav-links {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .menu-toggle {
    display: inline-grid;
  }
  .nav-actions .btn--github span {
    display: none;
  }
}

/* ------------------------------------------------------------------ buttons */
.btn {
  --btn-bg: var(--bg-elev);
  --btn-fg: var(--fg);
  --btn-border: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 0.97rem/1 var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s, border-color 0.2s;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn:active {
  transform: translateY(0) scale(0.98);
}
.btn svg {
  width: 18px;
  height: 18px;
}
.btn--primary {
  --btn-bg: linear-gradient(135deg, #6366f1, #4f46e5 55%, #4338ca);
  --btn-fg: #fff;
  --btn-border: transparent;
  background: var(--btn-bg);
  box-shadow: 0 10px 24px -10px rgba(79, 70, 229, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn--primary:hover {
  box-shadow: 0 16px 32px -12px rgba(79, 70, 229, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-border: transparent;
}
.btn--sm {
  height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 0.9rem;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0 clamp(64px, 8vw, 110px);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -10% -10% auto;
  height: 820px;
  background: var(--glow);
  z-index: -2;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%);
  z-index: -1;
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  margin-bottom: 20px;
}
.hero .lead {
  margin-bottom: 30px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 80%, transparent);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.pill b {
  background: var(--primary);
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 28px;
  font-size: 0.9rem;
  color: var(--fg-subtle);
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hero-meta svg {
  width: 16px;
  height: 16px;
  color: var(--success);
}
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

/* browser frame + floating cards */
.stage {
  position: relative;
  perspective: 1600px;
}
.browser {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: rotateY(-8deg) rotateX(4deg);
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.stage:hover .browser {
  transform: rotateY(-3deg) rotateX(2deg);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
}
.dots {
  display: flex;
  gap: 6px;
}
.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #f87171;
}
.dots i:nth-child(2) {
  background: #fbbf24;
}
.dots i:nth-child(3) {
  background: #34d399;
}
.url {
  flex: 1;
  height: 24px;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font: 12px/22px var(--mono);
  color: var(--fg-subtle);
  padding: 0 10px;
  overflow: hidden;
  white-space: nowrap;
}
.browser img {
  width: 100%;
}
.float-card {
  position: absolute;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-lg);
  animation: float 7s ease-in-out infinite;
}
.float-card.popup {
  width: 38%;
  right: -4%;
  bottom: -14%;
  animation-delay: -2s;
}
.float-card.save {
  width: 44%;
  left: -8%;
  top: 58%;
  animation-delay: -4.5s;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
@media (max-width: 960px) {
  .stage {
    margin: 10px 8px 70px;
  }
  .float-card.save {
    left: -2%;
  }
  .float-card.popup {
    right: -2%;
  }
}

/* ------------------------------------------------------------------ trust strip */
.trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.trust div {
  background: var(--bg-elev);
  padding: 22px 20px;
}
.trust strong {
  display: block;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--fg);
}
.trust span {
  font-size: 0.88rem;
  color: var(--fg-subtle);
}
@media (max-width: 720px) {
  .trust {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ------------------------------------------------------------------ cards / grids */
.grid {
  display: grid;
  gap: 20px;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 960px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}
.card {
  position: relative;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card h3 {
  margin-bottom: 8px;
}
.card p {
  margin: 0;
  font-size: 0.95rem;
}
a.card {
  color: inherit;
  display: block;
}
a.card:hover,
.card.hoverable:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}
/* pointer spotlight */
.card.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--primary) 12%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.card.spot:hover::before {
  opacity: 1;
}
.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  margin-bottom: 18px;
  color: var(--primary);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
}
.icon-tile svg {
  width: 22px;
  height: 22px;
}
.icon-tile.cyan {
  color: #0891b2;
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.2);
}
.icon-tile.green {
  color: var(--success);
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.2);
}
.icon-tile.amber {
  color: var(--warning);
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.2);
}
.icon-tile.rose {
  color: #e11d48;
  background: rgba(225, 29, 72, 0.08);
  border-color: rgba(225, 29, 72, 0.18);
}
.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-weight: 600;
  font-size: 0.92rem;
}
.more svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}
a.card:hover .more svg {
  transform: translateX(3px);
}

/* feature row: text + media */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
}
.feature-row + .feature-row {
  margin-top: clamp(72px, 9vw, 120px);
}
.feature-row.reverse .media {
  order: -1;
}
@media (max-width: 900px) {
  .feature-row {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .feature-row.reverse .media {
    order: 0;
  }
}
.checks {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: grid;
  gap: 12px;
}
.checks li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  color: var(--fg-muted);
}
.checks li::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-top: 2px;
  background: var(--primary-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat;
  border: 1px solid var(--primary-100);
}
.checks b {
  color: var(--fg);
  font-weight: 600;
}
.media {
  position: relative;
}
.media::before {
  content: "";
  position: absolute;
  inset: 8% 6%;
  background: var(--glow);
  filter: blur(30px);
  z-index: -1;
}
.shot {
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--bg-elev);
  overflow: hidden;
  cursor: zoom-in;
}
.shot img {
  width: 100%;
}
.shot-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.shot-pair .shot:nth-child(2) {
  margin-top: 48px;
}
.caption {
  font-size: 0.85rem;
  color: var(--fg-subtle);
  text-align: center;
  margin-top: 12px;
}

/* ------------------------------------------------------------------ steps */
.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step {
  counter-increment: step;
}
.step::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-bottom: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, 0.7);
}
@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ tabs */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border-radius: 14px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font: 600 0.92rem var(--font);
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.tab svg {
  width: 16px;
  height: 16px;
}
.tab:hover {
  color: var(--fg);
}
.tab[aria-selected="true"] {
  background: var(--bg-elev);
  color: var(--fg);
  box-shadow: var(--shadow-sm);
}
.tab-panel[hidden] {
  display: none;
}
.tab-panel {
  animation: fade-up 0.35s ease;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------ generator demo */
.demo {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.demo-out {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px;
  background: linear-gradient(180deg, var(--primary-50), transparent);
  border-bottom: 2px solid var(--success);
}
.demo-pw {
  flex: 1;
  min-width: 0;
  font: 600 clamp(1rem, 2.2vw, 1.35rem) var(--mono);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  color: var(--fg);
}
.demo-pw .d {
  color: var(--primary);
}
.demo-pw .s {
  color: #e11d48;
}
.demo-body {
  padding: 22px;
  display: grid;
  gap: 16px;
}
.demo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.strength {
  font-weight: 700;
}
.meter {
  height: 8px;
  border-radius: 99px;
  background: var(--bg-muted);
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  transition: width 0.35s ease;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}
.switches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--fg);
  user-select: none;
}
.switch input {
  appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 99px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex: none;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.switch input:checked {
  background: var(--primary-600);
}
.switch input:checked::after {
  transform: translateX(16px);
}
@media (max-width: 520px) {
  .switches {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ flow diagram */
.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  position: relative;
}
.flow-node {
  position: relative;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.flow-node strong {
  display: block;
  color: var(--fg);
  margin: 10px 0 4px;
}
.flow-node small {
  color: var(--fg-subtle);
  font-size: 0.84rem;
  line-height: 1.45;
  display: block;
}
.flow-node .icon-tile {
  margin: 0 auto;
}
.flow-node:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 50%;
  width: 14px;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--primary) 0 4px, transparent 4px 8px);
  background-size: 16px 2px;
  animation: dash 1s linear infinite;
}
@keyframes dash {
  to {
    background-position: 16px 0;
  }
}
@media (max-width: 860px) {
  .flow {
    grid-template-columns: 1fr 1fr;
  }
  .flow-node:nth-child(2)::after {
    display: none;
  }
}

/* key hierarchy diagram */
.keys {
  display: grid;
  gap: 14px;
  justify-items: center;
}
.key-node {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  min-width: min(380px, 100%);
}
.key-node .icon-tile {
  margin: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex: none;
}
.key-node strong {
  display: block;
  color: var(--fg);
  font-size: 0.97rem;
}
.key-node small {
  color: var(--fg-subtle);
}
.key-arrow {
  width: 2px;
  height: 22px;
  background: linear-gradient(var(--primary), transparent);
}
.key-branch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}
.key-branch .key-node {
  min-width: 0;
}
@media (max-width: 760px) {
  .key-branch {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ docs layout (feature pages) */
.page-hero {
  padding: clamp(48px, 7vw, 84px) 0 clamp(28px, 4vw, 44px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: -30% 10% auto;
  height: 480px;
  background: var(--glow);
  z-index: -1;
}
.page-hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.3rem);
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--fg-subtle);
  margin-bottom: 16px;
}
.breadcrumb a {
  color: var(--fg-subtle);
}
.with-toc {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}
.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  font-size: 0.92rem;
}
.toc p {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 10px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}
.toc a {
  display: block;
  padding: 6px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--fg-muted);
}
.toc a:hover {
  color: var(--fg);
  text-decoration: none;
}
.toc a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.doc-section {
  padding: 8px 0 64px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 56px;
}
.doc-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}
.doc-section h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  display: flex;
  align-items: center;
  gap: 14px;
}
.doc-section h2 .icon-tile {
  margin: 0;
}
@media (max-width: 960px) {
  .with-toc {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
    display: none;
  }
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--fg-muted);
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 22px;
}
.mini {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: var(--bg-elev);
}
.mini strong {
  display: block;
  color: var(--fg);
  margin-bottom: 4px;
}
.mini span {
  font-size: 0.9rem;
  color: var(--fg-muted);
}
@media (max-width: 640px) {
  .mini-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
th,
td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  background: var(--bg-muted);
}
tr:last-child td {
  border-bottom: 0;
}
td:first-child {
  color: var(--fg);
  font-weight: 600;
}
td {
  color: var(--fg-muted);
}
.yes {
  color: var(--success);
  font-weight: 700;
}
.no {
  color: var(--fg-subtle);
}

/* ------------------------------------------------------------------ code block */
.code {
  position: relative;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0b1020;
  color: #e2e8f0;
  overflow: hidden;
}
.code pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.6;
}
.code .copy {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #2f3a63;
  background: #161e3a;
  color: #cbd5e1;
  font: 600 0.78rem var(--font);
  cursor: pointer;
}
.code .copy:hover {
  color: #fff;
}
.code .c {
  color: #7d88aa;
}

/* ------------------------------------------------------------------ callouts, FAQ */
.callout {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--primary-100);
  background: var(--primary-50);
  color: var(--fg);
  margin: 22px 0;
}
.callout svg {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 3px;
  color: var(--primary);
}
.callout p {
  margin: 0;
  color: var(--fg-muted);
}
.callout.warn {
  border-color: rgba(217, 119, 6, 0.25);
  background: rgba(217, 119, 6, 0.08);
}
.callout.warn svg {
  color: var(--warning);
}
.faq {
  display: grid;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}
.faq details {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elev);
  padding: 0 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.faq details[open] {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-weight: 600;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  font-size: 1.3rem;
  line-height: 1;
  color: var(--fg-subtle);
  transition: transform 0.2s;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq details p {
  padding-bottom: 18px;
  margin: 0;
}

/* ------------------------------------------------------------------ CTA + footer */
.cta {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: clamp(40px, 6vw, 72px);
  text-align: center;
  color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #6366f1 0%, #4338ca 45%, #1e1b4b 100%);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(60% 80% at 50% 0%, #000, transparent);
  -webkit-mask-image: radial-gradient(60% 80% at 50% 0%, #000, transparent);
  z-index: -1;
}
.cta h2 {
  color: #fff;
}
.cta p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 56ch;
  margin: 0 auto 28px;
}
.cta .btn-row {
  justify-content: center;
}
.cta .btn:not(.btn--primary) {
  --btn-bg: rgba(255, 255, 255, 0.12);
  --btn-fg: #fff;
  --btn-border: rgba(255, 255, 255, 0.25);
}
.cta .btn--primary {
  --btn-bg: #fff;
  --btn-fg: #312e81;
  background: #fff;
  color: #312e81;
}
.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 40px;
  margin-top: 40px;
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
}
.footer-grid h4 {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 14px;
}
.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 9px;
}
.footer-grid a {
  color: var(--fg-muted);
}
.footer-grid a:hover {
  color: var(--fg);
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--fg-subtle);
  font-size: 0.85rem;
}
@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ------------------------------------------------------------------ lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  cursor: zoom-out;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox img {
  max-width: min(1400px, 100%);
  max-height: 88vh;
  border-radius: 14px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}
.lightbox.open img {
  transform: none;
}
.lightbox figcaption {
  color: #cbd5e1;
  text-align: center;
  margin-top: 12px;
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------ motion */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--d, 0ms);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.no-js .reveal {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .browser {
    transform: none;
  }
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* images that follow the theme */
:root[data-theme="dark"] .only-light,
:root[data-theme="light"] .only-dark {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .only-light {
    display: none;
  }
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .only-dark {
    display: none;
  }
}
