/* ============================================================
   Nexus — marketing site · shared design system
   Sleek dark. Brand blue→teal gradient. Theme-aware accent.
   Display: Space Grotesk · Body: Manrope
   ============================================================ */

:root {
  --bg:      #070c15;
  --bg2:     #0a111d;
  --panel:   #0c1422;
  --surface: rgba(255,255,255,.035);
  --line:    rgba(255,255,255,.08);
  --line2:   rgba(255,255,255,.15);

  --ink:   #eef3fa;
  --mut:   #94a6bd;
  --faint: #6e839c; /* ≥4.5:1 on bg AND panel (was #5d7088 at 3.9:1) */

  --brandA: #3a9bf0;   /* blue   */
  --brandB: #24c9a6;   /* teal   */
  --grad: linear-gradient(110deg, var(--brandA), var(--brandB));

  /* theme-driven accent (changed live by the switcher) */
  --accent: #2bb8d0;
  --glow:   #1a8fa8;

  --green: #3fb950;
  --amber: #d6a42a;
  --red:   #f0563f;

  --disp: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);

  --maxw: 1240px;
  --nav-h: 70px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: color-mix(in oklch, var(--accent) 40%, transparent); }

/* page ambient background */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 50% at 80% -5%, color-mix(in oklch, var(--glow) 30%, transparent), transparent 70%),
    radial-gradient(50% 40% at 0% 10%, rgba(58,155,240,.10), transparent 70%);
  transition: background .5s var(--ease);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(130% 80% at 50% 0%, #000 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(130% 80% at 50% 0%, #000 25%, transparent 75%);
}

/* ---------- layout ---------- */
.container { width: min(var(--maxw), 92vw); margin: 0 auto; }
.section { padding: 100px 0; position: relative; }
.section.tight { padding: 70px 0; }
.sec-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.sec-head.left { margin-left: 0; text-align: left; }

/* ---------- type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; font-size: 13px;
  letter-spacing: .05em; text-transform: uppercase; font-weight: 700;
  color: color-mix(in oklch, var(--accent) 75%, white 25%);
  border: 1px solid color-mix(in oklch, var(--accent) 32%, transparent);
  background: color-mix(in oklch, var(--accent) 9%, transparent);
  padding: 7px 15px; border-radius: 999px;
}
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
h1, h2, h3 { font-family: var(--disp); font-weight: 700; letter-spacing: -.025em; line-height: 1.02; margin: 0; }
h2.title { font-size: clamp(32px, 4.4vw, 52px); margin: 18px 0 0; }
.lead { color: var(--mut); font-size: clamp(17px, 2vw, 20px); line-height: 1.6; margin: 20px auto 0; max-width: 60ch; font-weight: 450; }
.sec-head.left .lead { margin-left: 0; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.accent-text { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--body);
  font-weight: 600; font-size: 15.5px; padding: 13px 24px; border-radius: 12px;
  cursor: pointer; border: 1px solid transparent; transition: transform .18s var(--ease), box-shadow .18s, background .18s, border-color .18s;
  white-space: nowrap;
}
.btn .arr { transition: transform .18s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn.primary { background: var(--grad); color: #04121b; box-shadow: 0 12px 34px -10px color-mix(in oklch, var(--brandB) 70%, transparent); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 18px 46px -10px color-mix(in oklch, var(--brandB) 80%, transparent); }
.btn.ghost { background: rgba(255,255,255,.04); border-color: var(--line2); color: var(--ink); }
.btn.ghost:hover { background: rgba(255,255,255,.09); transform: translateY(-2px); }
.btn.sm { padding: 9px 17px; font-size: 14px; border-radius: 10px; }
.btn.lg { padding: 15px 28px; font-size: 16.5px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 100;
  display: flex; align-items: center; transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.solid { background: color-mix(in oklch, var(--bg) 78%, transparent); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand b { font-family: var(--disp); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { font-size: 15px; color: var(--mut); font-weight: 500; transition: color .15s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 2px; background: var(--grad); border-radius: 2px; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 6px; }
.nav-toggle svg { width: 26px; height: 26px; }

/* scroll progress */
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--grad); z-index: 101; transition: width .1s linear; }

/* ---------- hero (immersive) ---------- */
.hero { position: relative; padding: calc(var(--nav-h) + 64px) 0 0; text-align: center; overflow: hidden; }
.hero .copy { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 22px; position: relative; z-index: 5; }
.hero h1 { font-size: clamp(42px, 7vw, 84px); }
.hero .lead { margin-top: 0; }
.hero .ctas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-stats { display: flex; gap: 30px; flex-wrap: wrap; justify-content: center; margin-top: 6px; font-size: 14px; color: var(--faint); }
.hero-stats b { color: var(--mut); font-weight: 700; }

.hero-board-zone { position: relative; width: min(1120px, 94vw); margin: 46px auto 6px; perspective: 1600px; padding-bottom: 18px; }
.hero-board-zone .hglow {
  position: absolute; left: 50%; top: 110px; width: 940px; height: 540px; transform: translateX(-50%);
  background: radial-gradient(ellipse, color-mix(in oklch, var(--glow) 85%, transparent), transparent 65%);
  filter: blur(70px); opacity: .55; z-index: 0; transition: background .5s var(--ease); pointer-events: none;
}
.hero-board-tilt { transform: rotateX(10deg); transform-origin: 50% 45%; transition: transform .5s var(--ease); position: relative; z-index: 1; }
.hero-board {
  width: 100%; border-radius: 14px; border: 1px solid var(--line2);
  box-shadow: 0 60px 130px -40px rgba(0,0,0,.9); transition: opacity .35s; display: block;
}
.hero-fade { position: absolute; left: -14%; right: -14%; bottom: -1px; height: 300px; background: linear-gradient(to bottom, transparent, var(--bg) 60%); z-index: 3; pointer-events: none; }

/* theme switcher */
.themes-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 4px; position: relative; z-index: 6; }
.themes-row .lbl { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13.5px;
  color: var(--mut); font-weight: 600; font-family: var(--body); transition: .16s var(--ease);
}
.chip:hover { border-color: var(--line2); color: var(--ink); transform: translateY(-1px); }
.chip .dot { width: 13px; height: 13px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset; }
.chip.on { color: #051018; border-color: transparent; }

/* ---------- stat band ---------- */
.statband { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.statband .cell { background: var(--bg2); padding: 26px 20px; text-align: center; }
.statband .num { font-family: var(--disp); font-weight: 700; font-size: 38px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.statband .cap { font-size: 12.5px; color: var(--mut); margin-top: 6px; letter-spacing: .02em; }

/* ---------- cards / features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.fcard {
  background: linear-gradient(180deg, var(--surface), rgba(255,255,255,.012)); border: 1px solid var(--line);
  border-radius: 16px; padding: 26px 24px; transition: transform .25s var(--ease), border-color .25s, background .25s; position: relative; overflow: hidden;
}
.fcard:hover { transform: translateY(-4px); border-color: color-mix(in oklch, var(--accent) 40%, var(--line2)); }
.fcard .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px;
  background: color-mix(in oklch, var(--accent) 14%, transparent); border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent); color: var(--accent); }
.fcard .ico svg { width: 24px; height: 24px; }
.fcard h3 { font-size: 19px; margin-bottom: 10px; }
.fcard p { color: var(--mut); font-size: 14.5px; line-height: 1.65; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tags span { font-size: 11.5px; color: color-mix(in oklch, var(--accent) 70%, white 30%); border: 1px solid var(--line2); border-radius: 6px; padding: 3px 9px; white-space: nowrap; }
.fcard.span2 { grid-column: span 2; }

/* ---------- device section ---------- */
/* Screenshots keep their NATURAL aspect ratio — never stretch the columns to
   equal heights and cover-crop (that zoomed the boards and chopped the phone).
   Cards size to their image; the columns top-align. */
/* The PHONE keeps its natural aspect and defines the row height; the two board
   cards flex to fill that height exactly (bottoms line up), cover-cropping only
   the few % difference — never the runaway zoom of an ambiguous stretch. */
.device-wrap { display: grid; grid-template-columns: 1.6fr .9fr; gap: 24px; align-items: stretch; }
.device-col { display: flex; flex-direction: column; gap: 24px; min-height: 0; }
.device-col .device-main { flex: 1; min-height: 0; }
.device-main, .device-side { border-radius: 16px; border: 1px solid var(--line2); overflow: hidden; box-shadow: 0 40px 90px -40px rgba(0,0,0,.8); background: var(--bg2); }
.device-col .device-main img { width: 100%; height: 100%; object-fit: cover; object-position: left top; display: block; }
.device-side img { width: 100%; height: auto; display: block; }
.platform-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; justify-content: center; }
.pchip { display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; }
.pchip b { color: var(--ink); } .pchip span { color: var(--faint); font-weight: 500; font-size: 13px; }
.pchip .pico { color: var(--accent); display: grid; place-items: center; } .pchip .pico svg { width: 18px; height: 18px; }

/* ---------- themes gallery ---------- */
.theme-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tg-item { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); position: relative; transition: transform .25s var(--ease), border-color .25s; }
.tg-item:hover { transform: translateY(-4px) scale(1.01); border-color: var(--line2); }
.tg-item img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.tg-item .name { position: absolute; left: 12px; bottom: 10px; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: rgba(6,10,18,.6); backdrop-filter: blur(8px); display: flex; align-items: center; gap: 8px; }
.tg-item .name .dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px 26px; position: relative; }
.step .n { font-family: var(--disp); font-weight: 700; font-size: 16px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: #04121b; margin-bottom: 18px; }
.step h3 { font-size: 19px; margin-bottom: 9px; }
.step p { color: var(--mut); font-size: 14.5px; margin: 0; line-height: 1.6; }
.step:not(:last-child)::after { content: "→"; position: absolute; right: -16px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 20px; z-index: 2; }

/* ---------- pricing ---------- */
.price-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 5px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); margin: 26px auto 0; }
.price-toggle button { border: 0; background: none; color: var(--mut); font-family: var(--body); font-weight: 600; font-size: 14px; padding: 8px 18px; border-radius: 999px; cursor: pointer; transition: .18s; }
.price-toggle button.on { background: var(--grad); color: #04121b; }
.price-toggle .save { font-size: 11px; color: var(--green); font-weight: 700; margin-left: 2px; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.ptier { background: linear-gradient(180deg, var(--surface), rgba(255,255,255,.012)); border: 1px solid var(--line); border-radius: 18px; padding: 30px 26px; display: flex; flex-direction: column; position: relative; transition: transform .25s var(--ease), border-color .25s; }
.ptier:hover { transform: translateY(-4px); }
.ptier.featured { border-color: color-mix(in oklch, var(--brandB) 55%, transparent); box-shadow: 0 30px 80px -40px color-mix(in oklch, var(--brandB) 70%, transparent); }
.ptier .badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #04121b; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 5px 14px; border-radius: 999px; white-space: nowrap; }
.ptier .tier-ico { width: 52px; height: 52px; margin-bottom: 16px; }
.ptier .tier-name { font-family: var(--disp); font-weight: 700; font-size: 22px; }
.ptier .tier-desc { color: var(--mut); font-size: 14px; margin: 8px 0 20px; min-height: 42px; line-height: 1.5; }
.ptier .price { display: flex; align-items: baseline; gap: 4px; }
.ptier .price .amt { font-family: var(--disp); font-weight: 700; font-size: 46px; }
.ptier .price .per { color: var(--faint); font-size: 14px; }
.ptier .price-sub { font-size: 12.5px; color: var(--faint); margin-top: 4px; min-height: 18px; }
.ptier .btn { margin: 22px 0; justify-content: center; }
.ptier ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.ptier li { display: flex; gap: 11px; font-size: 14px; color: var(--mut); line-height: 1.45; }
.ptier li svg { width: 18px; height: 18px; flex: none; color: var(--accent); margin-top: 1px; }

/* ---------- security strip ---------- */
.sec-strip { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; background: linear-gradient(120deg, var(--bg2), var(--panel)); border: 1px solid var(--line); border-radius: 22px; padding: 44px; }
.sec-strip > * { min-width: 0; }
.sec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.sec-list .it { display: flex; gap: 12px; }
.sec-list .it svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.sec-list .it b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.sec-list .it p { margin: 0; font-size: 13px; color: var(--mut); line-height: 1.5; }

/* ---------- FAQ ---------- */
.faq { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { width: 100%; text-align: left; background: none; border: 0; color: var(--ink); font-family: var(--body); font-weight: 600; font-size: 17px; padding: 22px 40px 22px 0; cursor: pointer; position: relative; }
.faq-q::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--accent); transition: transform .25s; }
.faq-item.open .faq-q::after { content: "−"; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); color: var(--mut); font-size: 15px; line-height: 1.65; }
.faq-a p { margin: 0 0 22px; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; background: linear-gradient(120deg, color-mix(in oklch, var(--brandA) 14%, var(--bg2)), color-mix(in oklch, var(--brandB) 12%, var(--bg2))); border: 1px solid var(--line2); border-radius: 24px; padding: 64px 40px; position: relative; overflow: hidden; }
.cta-band h2 { font-size: clamp(30px, 4vw, 46px); }
.cta-band .ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 64px 0 40px; margin-top: 40px; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer .brand { margin-bottom: 14px; }
.footer .blurb { color: var(--mut); font-size: 14px; max-width: 34ch; line-height: 1.6; }
.footer .selfhost { font-size: 13px; color: var(--faint); margin-top: 14px; display: flex; align-items: center; gap: 8px; }
.footer .selfhost .lock { color: var(--accent); }
.footer h4 { font-family: var(--body); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 0 0 16px; font-weight: 700; }
.footer .col a { display: block; color: var(--mut); font-size: 14px; padding: 6px 0; transition: color .15s; }
.footer .col a:hover { color: var(--ink); }
.footer-bot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); flex-wrap: wrap; }
.footer-bot .by a { color: var(--mut); border-bottom: 1px solid color-mix(in oklch, var(--accent) 50%, transparent); }
.footer-bot .by a:hover { color: var(--accent); }

/* ---------- reveal animations ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-d="1"] { transition-delay: .06s; }
[data-reveal][data-d="2"] { transition-delay: .12s; }
[data-reveal][data-d="3"] { transition-delay: .18s; }
[data-reveal][data-d="4"] { transition-delay: .24s; }
[data-reveal][data-d="5"] { transition-delay: .3s; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1 !important; transform: none !important; } }

/* ---------- docs ---------- */
.docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start; padding-top: calc(var(--nav-h) + 50px); }
.docs-side { position: sticky; top: calc(var(--nav-h) + 30px); max-height: calc(100vh - var(--nav-h) - 50px); overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.docs-side::-webkit-scrollbar { width: 8px; }
.docs-side::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 99px; }
/* The sidebar's <details class="toc"> is inert on desktop (summary hidden, kept
   open) and becomes a collapsible "On this page" disclosure on mobile. */
.docs-side .toc summary { display: none; list-style: none; cursor: pointer; }
.docs-side .toc summary::-webkit-details-marker { display: none; }
.docs-side h4 { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin: 22px 0 10px; font-weight: 700; }
.docs-side a { display: block; color: var(--mut); font-size: 14.5px; padding: 7px 12px; border-radius: 9px; transition: .15s; border-left: 2px solid transparent; }
.docs-side a:hover { color: var(--ink); background: var(--surface); }
.docs-side a.active { color: var(--ink); border-left-color: var(--accent); background: var(--surface); }
.docs-main { max-width: 760px; min-width: 0; }
.docs-main h2 { font-size: 34px; margin-top: 8px; }
.docs-main h3 { font-size: 22px; margin: 48px 0 14px; scroll-margin-top: 100px; }
.docs-main p { color: var(--mut); margin: 0 0 18px; }
.docs-main p code, .docs-main li code { font-family: 'Space Grotesk', monospace; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; font-size: 13.5px; color: color-mix(in oklch, var(--accent) 75%, white 25%); }
.docs-main ul { color: var(--mut); padding-left: 22px; margin: 0 0 18px; }
.docs-main li { margin-bottom: 8px; }
.docs-main p code, .docs-main li code, .docs-main a { overflow-wrap: anywhere; }
.codeblock { background: #060a12; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; overflow-x: auto; margin: 0 0 24px; }
.codeblock pre { margin: 0; font-family: 'Space Grotesk', monospace; font-size: 13.5px; line-height: 1.7; color: #c7d4e6; white-space: pre; }
.codeblock .c { color: var(--faint); }
.codeblock .k { color: var(--accent); }
.callout { display: flex; gap: 14px; background: color-mix(in oklch, var(--accent) 8%, transparent); border: 1px solid color-mix(in oklch, var(--accent) 28%, transparent); border-radius: 12px; padding: 16px 18px; margin: 0 0 24px; }
.callout svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.callout p { margin: 0; font-size: 14px; color: var(--mut); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  /* Six nav links + two buttons don't fit mid-width — collapse to the burger here. */
  .nav-links, .nav-right .btn.ghost { display: none; }
  .nav-toggle { display: block; }
  .mobile-menu { display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 16px 0 24px; z-index: 99; }
  .mobile-menu.show { display: block; }
  .mobile-menu a { display: block; padding: 13px 6vw; color: var(--ink); font-size: 17px; font-weight: 600; }

  .feature-grid, .theme-gallery, .price-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .fcard.span2 { grid-column: span 2; }
  .statband { grid-template-columns: repeat(3, 1fr); }
  .device-wrap { grid-template-columns: 1fr; align-items: stretch; }
  .device-col .device-main { flex: none; }
  .device-col .device-main img, .device-side img { height: auto; object-fit: contain; }
  .sec-strip { grid-template-columns: 1fr; gap: 28px; padding: 32px; }
  .step:not(:last-child)::after { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  /* Mobile: the ToC collapses to an "On this page" disclosure; when open, each
     group heading takes its own line with the links as wrapped pills under it. */
  .docs-side { position: static; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .docs-side .toc summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border: 1px solid var(--line2); border-radius: 12px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14.5px; }
  .docs-side .toc summary::after { content: "▾"; color: var(--faint); transition: transform .15s; }
  .docs-side .toc[open] summary::after { transform: rotate(180deg); }
  .docs-side .toc[open] summary { margin-bottom: 4px; }
  .docs-side h4 { width: 100%; margin: 14px 2px 8px; }
  .docs-side a { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; margin: 0 6px 6px 0; font-size: 13.5px; }
  .docs-side a.active { border-color: var(--accent); }
}
@media (max-width: 680px) {
  .nav.menu-open { background: var(--bg); }
  .feature-grid, .theme-gallery, .price-grid, .steps, .statband, .footer-top, .sec-list { grid-template-columns: 1fr; }
  .fcard.span2 { grid-column: span 1; }
  .hero-board-tilt { transform: rotateX(14deg); }
  .section { padding: 70px 0; }
  .ptier.featured { order: -1; }
}
.mobile-menu { display: none; }


/* ============================================================
   Craft layer — motion, focus & typographic discipline.
   Animate only transform/opacity; one easing, short durations;
   every interactive state has press + keyboard feedback.
   ============================================================ */

/* Keyboard focus: one branded ring, only when navigating by key. */
:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--accent) 80%, white 20%);
  outline-offset: 3px;
  border-radius: 6px;
}
.btn:focus-visible, .nav-links a:focus-visible { outline-offset: 2px; }

/* Buttons press down as well as lift up — tactile, 60ms snap. */
.btn:active { transform: translateY(0) scale(.985); transition-duration: .06s; }
.btn.primary:active { box-shadow: 0 8px 22px -10px color-mix(in oklch, var(--brandB) 60%, transparent); }

/* Numbers that compare or change must not wobble the layout. */
.ptier .price .amt, .statband .num, .stat b { font-variant-numeric: tabular-nums; }

/* Headline rag control (progressive — older engines just ignore it). */
h1, h2, .sec-head h2 { text-wrap: balance; }
.sec-head p, .lead { text-wrap: pretty; }

/* Prose links (changelog, legal, docs bodies) read as links, not just colour. */
.legal a, .faq-a a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklch, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s var(--ease);
}
.legal a:hover, .faq-a a:hover { text-decoration-color: var(--accent); }

/* Scrollbar joins the theme instead of flashbanging the dark page. */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.14);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.24); }

/* Reduced motion: clamp EVERYTHING, not just the reveals — states still land,
   they just land immediately. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* ============================================================
   🥚 Nexus XP — the releases-page easter egg. Five clicks on the
   brand toggles a full Luna-era skin: token overrides do the heavy
   lifting (everything reads the vars), plus classic bevels, Tahoma,
   the titlebar nav and a Start-green primary button.
   ============================================================ */
body.theme-xp {
  --bg: #ECE9D8;
  --bg2: #ECE9D8;
  --panel: #FFFFFF;
  --surface: #F6F4EC;
  --line: #ACA899;
  --line2: #716F64;
  --ink: #1A1714;
  --mut: #4E4B42;
  --faint: #5C594E; /* ≥4.5:1 on the beige (was #716F64 at 4.1:1) */
  --brandA: #0A246A;
  --brandB: #3A6EA5;
  --grad: linear-gradient(180deg, #2A5FCB 0%, #0A246A 100%);
  --accent: #0A246A;
  --glow: #7AA1E0;
  --disp: Tahoma, "Trebuchet MS", Verdana, sans-serif;
  --body: Tahoma, Verdana, "Segoe UI", sans-serif;
  background: #ECE9D8;
  color: #1A1714;
}
body.theme-xp::before {
  background: linear-gradient(180deg, #7AA1E0 0%, #ECE9D8 32%);
  transition: none;
}
body.theme-xp::after { display: none; }
body.theme-xp ::selection { background: #316AC5; color: #fff; }

/* Titlebar nav — Luna blue gradient, white bold Tahoma. */
body.theme-xp .nav {
  background: linear-gradient(180deg, #3A6EA5 0%, #2A5FCB 8%, #0A246A 100%) !important;
  border-bottom: 2px solid #003C74;
  backdrop-filter: none;
}
body.theme-xp .nav-links a,
body.theme-xp .brand { color: #fff; text-shadow: 1px 1px 0 #003C74; }
body.theme-xp .nav-links a:hover { color: #FFE9A6; }
body.theme-xp .nav-links a.active::after { background: #FFE9A6; }
body.theme-xp .progress { background: #73AD45; }

/* Classic window chrome: white panels, square-ish corners, etched borders. */
body.theme-xp .fcard,
body.theme-xp .ptier,
body.theme-xp .cmp-table,
body.theme-xp .tg-item,
body.theme-xp .docs-side,
body.theme-xp .rel,
body.theme-xp .faq-item {
  background: #FFFFFF;
  border: 1px solid #ACA899;
  border-radius: 3px;
  box-shadow: inset 1px 1px 0 #fff, 1px 1px 3px rgba(0, 0, 0, 0.18);
}

/* Buttons — classic bevel; primary goes Start-button green. */
body.theme-xp .btn {
  border-radius: 3px;
  background: linear-gradient(180deg, #FFFFFF 0%, #ECE9D8 100%);
  border: 1px solid #003C74;
  color: #1A1714;
  box-shadow: inset 1px 1px 0 #fff;
  text-shadow: none;
}
body.theme-xp .btn:hover { transform: none; box-shadow: inset 1px 1px 0 #fff, 0 0 0 2px #FFE9A6; }
body.theme-xp .btn.primary {
  background: linear-gradient(180deg, #8DD17E 0%, #3C8527 60%, #2E6B1E 100%);
  border-color: #1F4F12;
  color: #fff;
  text-shadow: 1px 1px 0 #1F4F12;
}
body.theme-xp .eyebrow { color: #0A246A; }
body.theme-xp .eyebrow i { background: #73AD45; }
body.theme-xp .grad-text,
body.theme-xp .statband .num {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: #0A246A;
}
body.theme-xp h1, body.theme-xp h2, body.theme-xp h3 { color: #1A1714; }
body.theme-xp .hero-board-tilt { transform: none; }
body.theme-xp .footer { background: #D6D2C2; border-top: 1px solid #ACA899; }

/* The unlock toast — a little XP balloon. */
.xp-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  max-width: 340px;
  background: #FFFFE1;
  color: #1A1714;
  border: 1px solid #716F64;
  border-radius: 6px;
  padding: 12px 16px;
  font: 13px/1.5 Tahoma, Verdana, sans-serif;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.xp-toast.show { opacity: 1; transform: none; }

/* Docs sub-step headings (h5, used by the per-provider walkthroughs). */
article h5, .docs-main h5, section h5 {
  font-family: var(--disp);
  font-size: 15.5px;
  margin: 26px 0 8px;
  color: var(--ink);
}
