/* ═══════════════════════════════════════════════════════════════════════
   Rayburst — Website
   Direction: deep-space precision + restrained speed-light accents.
   Typography: Inter Variable (display) + system stack (body).
   Zero dependencies. Scroll-driven animations as progressive enhancement.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Font ──────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Inter Var';
  src: url('../fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

/* ── Design tokens ─────────────────────────────────────────────────── */
:root {
  /* Deep-space dark (default) */
  --bg: #1d1b1e;
  --bg-soft: #211f22;
  --surface: #28252a;
  --surface-2: #322f33;
  --line: rgba(255, 255, 255, 0.07);
  --line-soft: rgba(255, 255, 255, 0.045);
  --text: #e7e1e6;
  --text-dim: #cbc4cf;
  --text-muted: #b0a9b4;

  --accent: #d6baff;
  --accent-deep: #b695e0;
  --accent-soft: rgba(214, 186, 255, 0.09);
  --accent-line: rgba(214, 186, 255, 0.25);
  --accent-glow: rgba(214, 186, 255, 0.18);

  --rose: #e85d75;
  --rose-soft: linear-gradient(180deg, rgba(232, 93, 117, 0.14), rgba(232, 93, 117, 0.08));
  --rose-hover: linear-gradient(180deg, rgba(232, 93, 117, 0.2), rgba(232, 93, 117, 0.12));
  --rose-line: rgba(232, 93, 117, 0.25);
  --rose-hover-line: rgba(232, 93, 117, 0.42);
  --rose-glow: rgba(232, 93, 117, 0.2);

  --grid-dot: rgba(255, 255, 255, 0.055);
  --overlay: rgba(4, 4, 6, 0.86);
  --nav-bg: rgba(29, 27, 30, 0.72);
  --code-bg: rgba(214, 186, 255, 0.08);
  --chip-bg: rgba(255, 255, 255, 0.04);
  --ghost-color: #a99ade;
  --ghost-bg: linear-gradient(180deg, rgba(169, 154, 222, 0.09), rgba(112, 87, 180, 0.055));
  --ghost-border: rgba(169, 154, 222, 0.26);
  --ghost-hover-bg: linear-gradient(180deg, rgba(169, 154, 222, 0.14), rgba(112, 87, 180, 0.09));
  --ghost-hover-border: rgba(169, 154, 222, 0.42);
  --ghost-glow: rgba(112, 87, 180, 0.18);
  --secondary-btn-highlight: rgba(255, 255, 255, 0.12);
  --secondary-btn-shadow: rgba(0, 0, 0, 0.22);
  --shadow-app: 0 40px 120px -24px rgba(0, 0, 0, 0.7), 0 0 140px -40px rgba(214, 186, 255, 0.14);
  --shadow-menu: 0 12px 40px -8px rgba(0, 0, 0, 0.6);

  /* Type */
  --font-display: 'Inter Var', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;

  /* Motion (mirrors the app's M3 tokens) */
  --ease-enter: cubic-bezier(0.2, 0, 0, 1);
  --ease-exit: cubic-bezier(0.3, 0, 0.8, 0.15);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Primary action */
  --cta-grad: #d6baff;
  --cta-text: #401676;
  --cta-glow: rgba(214, 186, 255, 0.35);

  /* Layout */
  --col: min(720px, 92vw);
  --col-wide: min(1120px, 94vw);
  --radius: 14px;
  --radius-lg: 20px;
}

:root[data-theme='light'] {
  --cta-grad: #704ba8;
  --cta-text: #ffffff;
  --bg: #f2ecf1;
  --bg-soft: #e9e4e8;
  --surface: #fffbff;
  --surface-2: #e1dbe0;
  --line: rgba(29, 27, 30, 0.12);
  --line-soft: rgba(29, 27, 30, 0.07);
  --text: #1d1b1e;
  --text-dim: #4a454e;
  --text-muted: #625c67;

  --accent: #704ba8;
  --accent-deep: #825cba;
  --accent-soft: rgba(112, 75, 168, 0.08);
  --accent-line: rgba(112, 75, 168, 0.3);
  --accent-glow: rgba(112, 75, 168, 0.3);

  --rose: #d14e66;
  --rose-soft: linear-gradient(180deg, rgba(209, 78, 102, 0.13), rgba(209, 78, 102, 0.07));
  --rose-hover: linear-gradient(180deg, rgba(209, 78, 102, 0.19), rgba(209, 78, 102, 0.11));
  --rose-line: rgba(209, 78, 102, 0.25);
  --rose-hover-line: rgba(209, 78, 102, 0.4);
  --rose-glow: rgba(209, 78, 102, 0.18);

  --grid-dot: rgba(29, 27, 30, 0.13);
  --overlay: rgba(242, 236, 241, 0.92);
  --nav-bg: rgba(242, 236, 241, 0.75);
  --code-bg: rgba(112, 75, 168, 0.09);
  --chip-bg: rgba(29, 27, 30, 0.04);
  --ghost-color: #665298;
  --ghost-bg: linear-gradient(180deg, rgba(102, 82, 152, 0.11), rgba(102, 82, 152, 0.06));
  --ghost-border: rgba(102, 82, 152, 0.26);
  --ghost-hover-bg: linear-gradient(180deg, rgba(102, 82, 152, 0.17), rgba(102, 82, 152, 0.1));
  --ghost-hover-border: rgba(102, 82, 152, 0.4);
  --ghost-glow: rgba(102, 82, 152, 0.17);
  --secondary-btn-highlight: rgba(255, 255, 255, 0.55);
  --secondary-btn-shadow: rgba(29, 27, 30, 0.12);
  --shadow-app: 0 40px 120px -24px rgba(29, 27, 30, 0.25), 0 0 140px -40px rgba(112, 75, 168, 0.12);
  --shadow-menu: 0 12px 40px -8px rgba(29, 27, 30, 0.18);
}

/* ── View transition (theme circular reveal) ───────────────────────── */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) {
  z-index: 1;
}
::view-transition-new(root) {
  z-index: 9999;
}

/* ── Base ──────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Page-wide ambience — identical structure in both themes:
   soft corner glows + an ultra-faint dot grid over the whole page. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 52% 40% at 10% 18%, var(--accent-glow), transparent 70%),
    radial-gradient(ellipse 40% 32% at 92% 50%, var(--accent-glow), transparent 70%),
    radial-gradient(ellipse 48% 36% at 30% 92%, var(--accent-glow), transparent 70%);
  opacity: 0.5;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--grid-dot) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.4;
  mask-image: linear-gradient(180deg, black, transparent 55%, black);
  -webkit-mask-image: linear-gradient(180deg, black, transparent 55%, black);
}

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

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.9rem, 4.2vw, 2.75rem);
  font-weight: 700;
}

h3 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--code-bg);
  color: var(--accent);
  padding: 0.2em 0.5em;
  border-radius: 5px;
}

.ic {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.ic-fill {
  fill: currentColor;
  stroke: none;
}

/* Brand accent text */
/* ── i18n cross-fade ───────────────────────────────────────────────── */
@keyframes i18nOut {
  to {
    opacity: 0.25;
    filter: blur(3px);
  }
}
@keyframes i18nIn {
  from {
    opacity: 0.25;
    filter: blur(3px);
  }
}
main.i18n-fade-out,
footer.i18n-fade-out {
  animation: i18nOut 150ms ease forwards;
}
main.i18n-fade-in,
footer.i18n-fade-in {
  animation: i18nIn 200ms ease forwards;
}

/* ═══ Navigation ═══════════════════════════════════════════════════ */
#nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding-inline: clamp(1rem, 4vw, 2.75rem);
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--line-soft);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.nav-logo img {
  border-radius: 6px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-gh {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: color 180ms;
}

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

.nav-cta {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cta-text);
  background: var(--cta-grad);
  padding: 0.42rem 1.1rem;
  border-radius: 99px;
  transition:
    transform 200ms var(--ease-enter),
    box-shadow 200ms var(--ease-enter);
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--cta-glow);
}

/* ── Pickers (lang / theme) ────────────────────────────────────────── */
.picker {
  position: relative;
}

.picker-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 550;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--line);
  padding: 0.32rem 0.7rem;
  border-radius: 99px;
  cursor: pointer;
  transition:
    color 200ms,
    border-color 200ms;
}

.picker-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.picker-toggle .ic {
  width: 14px;
  height: 14px;
}

.picker-toggle .icon-sun {
  display: none;
}
[data-theme='light'] .picker-toggle .icon-sun {
  display: block;
}
[data-theme='light'] .picker-toggle .icon-moon {
  display: none;
}

.picker-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  inset-inline-end: 0;
  min-width: 160px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.375rem;
  box-shadow: var(--shadow-menu);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top;
  transition:
    opacity 180ms var(--ease-enter),
    transform 180ms var(--ease-enter);
  z-index: 110;
}

.picker-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.picker-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: start;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  padding: 0.42rem 0.7rem;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  transition:
    background 150ms,
    color 150ms;
}

.picker-option .ic {
  width: 14px;
  height: 14px;
  opacity: 0.55;
}

.picker-option:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.picker-option.active {
  color: var(--accent);
  font-weight: 600;
}

.picker-sep {
  height: 1px;
  background: var(--line);
  margin: 0.25rem 0.4rem;
}

/* ═══ Hero ═════════════════════════════════════════════════════════ */
#hero {
  position: relative;
  padding: 7.5rem 1.5rem 4rem;
  text-align: center;
  overflow: clip;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Launch beam — a glowing horizon line right under the nav */
.hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 82vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.55;
}

.hero-bg::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, 66vw);
  height: 90px;
  background: radial-gradient(ellipse 50% 100% at 50% 0%, var(--accent-glow), transparent 70%);
  opacity: 0.8;
}

/* Precision dot grid, faded at edges */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--grid-dot) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 75% 62% at 50% 36%, black 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 62% at 50% 36%, black 25%, transparent 78%);
}

/* Aurora glow */
.hero-aurora {
  position: absolute;
  top: -22%;
  left: 50%;
  width: min(1100px, 130vw);
  height: 640px;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse 46% 56% at 42% 40%, var(--accent-glow), transparent 65%),
    radial-gradient(ellipse 44% 52% at 60% 45%, var(--accent-glow), transparent 68%);
  filter: blur(10px);
}

/* Speed streaks — the download metaphor, restrained */
.hero-streaks {
  position: absolute;
  inset: 0;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, black 30%, transparent 75%);
}

.hero-streaks i {
  position: absolute;
  height: 1px;
  width: 220px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  animation: streak var(--d, 5s) linear var(--t, 0s) infinite;
}

.hero-streaks i:nth-child(1) {
  top: 18%;
  --d: 4.6s;
  --t: 0.2s;
}
.hero-streaks i:nth-child(2) {
  top: 30%;
  --d: 6.2s;
  --t: 2.1s;
  width: 150px;
}
@keyframes streak {
  0% {
    transform: translateX(-30vw);
    opacity: 0;
  }
  12% {
    opacity: 0.2;
  }
  88% {
    opacity: 0.2;
  }
  100% {
    transform: translateX(130vw);
    opacity: 0;
  }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo {
  width: 84px;
  height: 84px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 20px var(--accent-glow));
  animation: rise 700ms var(--ease-enter) both;
}

#hero h1 {
  font-size: clamp(3rem, 8vw, 5.25rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  margin-bottom: 0.85rem;
  background: linear-gradient(180deg, var(--text) 30%, var(--text-dim));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rise 700ms 60ms var(--ease-enter) both;
}

.tagline {
  font-size: clamp(1.05rem, 2.3vw, 1.25rem);
  color: var(--text-dim);
  max-width: 60ch;
  animation: rise 700ms 120ms var(--ease-enter) both;
}

/* Stats strip */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin: 1.6rem 0 2rem;
  animation: rise 700ms 180ms var(--ease-enter) both;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.84rem;
  color: var(--text-dim);
  transition: color 200ms;
}

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

.stat .ic {
  width: 14px;
  height: 14px;
  opacity: 0.55;
}

.stat-value {
  display: inline-block;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-value.loading {
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

.stat-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
}

/* Actions */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  animation: rise 700ms 240ms var(--ease-enter) both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.72rem 1.7rem;
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 220ms var(--ease-enter),
    box-shadow 220ms var(--ease-enter),
    background 220ms,
    border-color 220ms,
    color 220ms;
}

.btn .ic {
  width: 17px;
  height: 17px;
}

.btn-primary {
  color: var(--cta-text);
  background: var(--cta-grad);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 10px 32px var(--cta-glow);
}

.btn-ghost {
  color: var(--ghost-color);
  background: var(--ghost-bg);
  border: 1px solid var(--ghost-border);
  box-shadow:
    inset 0 1px 0 var(--secondary-btn-highlight),
    0 1px 3px var(--secondary-btn-shadow);
}

.btn-ghost:hover {
  background: var(--ghost-hover-bg);
  border-color: var(--ghost-hover-border);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 var(--secondary-btn-highlight),
    0 8px 28px var(--ghost-glow);
}

.btn-ghost .ic-fill {
  fill: currentColor;
}

.btn-sponsor {
  color: var(--rose);
  background: var(--rose-soft);
  border: 1px solid var(--rose-line);
  box-shadow:
    inset 0 1px 0 var(--secondary-btn-highlight),
    0 1px 3px var(--secondary-btn-shadow);
}

.btn-sponsor:hover {
  background: var(--rose-hover);
  border-color: var(--rose-hover-line);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 var(--secondary-btn-highlight),
    0 8px 28px var(--rose-glow);
}

.btn-lg {
  font-size: 1rem;
  padding: 0.9rem 2.4rem;
}

.hero-meta {
  margin-top: 1.1rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  animation: rise 700ms 300ms var(--ease-enter) both;
}

/* ── Hero duo — both themes shown together, staggered ─────────────── */
.hero-duo {
  position: relative;
  z-index: 1;
  max-width: min(1020px, 94vw);
  margin: 3.5rem auto 0;
  padding-bottom: clamp(3rem, 9vw, 6.5rem);
  perspective: 1400px;
  animation: rise 800ms 380ms var(--ease-enter) both;
}

.hero-duo-glow {
  position: absolute;
  inset: 10% -6% 0;
  background: radial-gradient(ellipse 60% 55% at 50% 55%, var(--accent-glow), transparent 70%);
  filter: blur(20px);
  z-index: -1;
}

.duo-shot {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-app);
  cursor: zoom-in;
  transition:
    transform 300ms var(--ease-enter),
    box-shadow 300ms var(--ease-enter),
    border-color 300ms;
}

.duo-shot img {
  display: block;
  width: 100%;
}

.duo-shot figcaption {
  position: absolute;
  top: 0.8rem;
  inset-inline-start: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.3rem 0.75rem;
  pointer-events: none;
}

.duo-shot figcaption .ic {
  width: 12px;
  height: 12px;
  color: var(--accent);
  opacity: 0.85;
}

.duo-dark {
  width: 82%;
}

.duo-light {
  position: absolute;
  width: 62%;
  inset-inline-end: 0;
  bottom: 0;
  z-index: 2;
}

.duo-shot:hover {
  transform: translateY(-5px);
  border-color: var(--accent-line);
}

/* Hovering the back (dark) shot: the front one gracefully yields —
   slides aside and fades so the full dark screenshot is readable.
   No z-index jumps, everything transitions. */
.hero-duo:has(.duo-dark:hover) .duo-light {
  transform: translate(5%, 7%) scale(0.965);
  opacity: 0.3;
}

[dir='rtl'] .hero-duo:has(.duo-dark:hover) .duo-light {
  transform: translate(-5%, 7%) scale(0.965);
}

.duo-light {
  transition:
    transform 380ms var(--ease-enter),
    opacity 380ms var(--ease-enter),
    border-color 300ms,
    box-shadow 300ms var(--ease-enter);
}

/* Scroll-driven un-tilt (progressive enhancement) */
@supports (animation-timeline: view()) {
  .hero-duo {
    animation:
      rise 800ms 380ms var(--ease-enter) both,
      untilt linear both;
    animation-timeline: auto, view();
    animation-range:
      normal,
      entry 0% cover 42%;
    transform-style: preserve-3d;
  }
  @keyframes untilt {
    from {
      transform: rotateX(6deg) scale(0.985);
    }
    to {
      transform: rotateX(0deg) scale(1);
    }
  }
}

/* Tech pills below the screenshots */
.hero-pills {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.2rem;
  animation: rise 700ms 460ms var(--ease-enter) both;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 550;
  padding: 0.38rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--text-dim);
  background: var(--chip-bg);
  transition:
    border-color 200ms,
    color 200ms;
}

.pill:hover {
  border-color: var(--accent-line);
  color: var(--text);
}

.pill .ic {
  width: 13px;
  height: 13px;
  opacity: 0.55;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ═══ Sections ═════════════════════════════════════════════════════ */
.section {
  max-width: var(--col);
  margin: 0 auto;
  padding: 5.5rem 1.5rem;
}

.section-wide {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 5.5rem 1.5rem;
}

.section-head {
  text-align: center;
  margin-bottom: 2.75rem;
}

.lead {
  color: var(--text-dim);
  margin-top: 0.75rem;
  font-size: 1.05rem;
}

.prose p {
  color: var(--text-dim);
  margin-bottom: 0.9rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose a {
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}

.prose a:hover {
  border-color: var(--accent);
}

/* Reveal on scroll */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 700ms var(--ease-enter),
    transform 700ms var(--ease-enter);
}

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

/* ═══ Story ════════════════════════════════════════════════════════ */
#connect {
  max-width: var(--col-wide);
}

.story-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.story-head {
  position: sticky;
  top: 6.5rem;
}

.story-body {
  display: grid;
  gap: 1.5rem;
}

.engine-note {
  padding: 1.15rem 1.35rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--accent-soft), transparent 65%);
}

.engine-note p {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.65;
}

.engine-note a:hover {
  border-bottom: 1px solid var(--accent);
}

/* ═══ Motion cards ═════════════════════════════════════════════════ */
.motion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.mcard {
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition:
    border-color 250ms,
    background 250ms;
}

.mcard:hover {
  border-color: var(--accent-line);
  background: var(--surface);
}

.mcard h3 {
  margin-bottom: 0.35rem;
}

.mcard p {
  color: var(--text-dim);
  font-size: 0.875rem;
  line-height: 1.6;
}

.mcard-demo {
  height: 56px;
  margin-bottom: 1.1rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
}

/* demo 1 — asymmetric timing: two dots, slow in / fast out */
.demo-timing i {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  translate: 0 -50%;
}

.demo-timing i:nth-child(1) {
  left: 12%;
  animation: dEnter 2.6s var(--ease-enter) infinite;
}

.demo-timing i:nth-child(2) {
  left: 12%;
  opacity: 0.35;
  animation: dExit 2.6s var(--ease-exit) infinite;
}

@keyframes dEnter {
  0%,
  12% {
    transform: translateX(0);
  }
  50%,
  100% {
    transform: translateX(240%);
  }
}
@keyframes dExit {
  0%,
  40% {
    transform: translateX(0) translateY(180%);
  }
  62%,
  100% {
    transform: translateX(240%) translateY(180%);
  }
}

/* demo 2 — easing curve trace */
.demo-easing svg {
  position: absolute;
  inset: 8px 12px;
  width: calc(100% - 24px);
  height: calc(100% - 16px);
}

.demo-easing path {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: trace 2.8s var(--ease-enter) infinite;
}

@keyframes trace {
  25%,
  70% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -160;
  }
}

/* demo 3 — spring pop */
.demo-spring i {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  animation: springPop 2.4s var(--ease-spring) infinite;
}

@keyframes springPop {
  0%,
  10% {
    transform: scale(0.4);
    opacity: 0;
  }
  35%,
  75% {
    transform: scale(1);
    opacity: 1;
  }
  92%,
  100% {
    transform: scale(0.4);
    opacity: 0;
  }
}

/* demo 4 — token chips */
.demo-tokens {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.demo-tokens code {
  font-size: 0.62rem;
}

.curves {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.7rem;
}

/* ═══ Features bento ═══════════════════════════════════════════════ */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

.bcard {
  position: relative;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
  transition:
    border-color 250ms,
    background 250ms,
    transform 250ms var(--ease-enter);
}

.bcard:hover {
  border-color: var(--accent-line);
  background: var(--surface);
  transform: translateY(-3px);
}

/* spotlight follow (set via JS custom props) */
.bcard::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 65%);
  opacity: 0;
  transition: opacity 300ms;
  pointer-events: none;
}

.bcard:hover::before {
  opacity: 1;
}

.bcard > * {
  position: relative;
}

.bcard-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  margin-bottom: 0.85rem;
}

.bcard-icon .ic {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.bcard h3 {
  margin-bottom: 0.3rem;
}

.bcard p {
  color: var(--text-dim);
  font-size: 0.855rem;
  line-height: 1.6;
}

/* Big protocol card */
.b-protocol {
  grid-column: span 2;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 2.1rem;
}

.b-protocol h3 {
  font-size: 1.3rem;
}

.b-protocol p {
  font-size: 0.95rem;
}

.proto-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.3rem;
}

.proto-chips span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 0.28rem 0.7rem;
  border-radius: 99px;
}

.b-protocol:hover .proto-chips span {
  animation: chipPop 500ms var(--ease-spring) both;
}

.b-protocol:hover .proto-chips span:nth-child(2) {
  animation-delay: 50ms;
}
.b-protocol:hover .proto-chips span:nth-child(3) {
  animation-delay: 100ms;
}
.b-protocol:hover .proto-chips span:nth-child(4) {
  animation-delay: 150ms;
}
.b-protocol:hover .proto-chips span:nth-child(5) {
  animation-delay: 200ms;
}

@keyframes chipPop {
  40% {
    transform: translateY(-4px);
  }
}

/* Wide BT card with animated transfer bars */
.b-bt {
  grid-column: span 2;
}

.bt-bars {
  display: grid;
  gap: 5px;
  margin-top: 1rem;
}

.bt-bars i {
  height: 4px;
  border-radius: 99px;
  background:
    linear-gradient(90deg, var(--accent), var(--accent-deep)) no-repeat,
    var(--line-soft);
  background-size: 0% 100%;
}

.bcard.b-bt:hover .bt-bars i,
.bento.visible .bt-bars i {
  animation: fill var(--d, 2.2s) var(--ease-enter) var(--t, 0s) infinite;
}

.bt-bars i:nth-child(1) {
  --d: 2.4s;
  --t: 0s;
}
.bt-bars i:nth-child(2) {
  --d: 3.1s;
  --t: 0.4s;
}
.bt-bars i:nth-child(3) {
  --d: 2.7s;
  --t: 0.9s;
}

@keyframes fill {
  0% {
    background-size: 0% 100%;
  }
  70%,
  100% {
    background-size: 100% 100%;
  }
}

/* Wide task card */
.b-task {
  grid-column: span 2;
}

/* Full-width lightweight strip */
.b-light {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-block: 1.25rem;
}

.b-light .bcard-icon {
  margin-bottom: 0;
}

/* ═══ Download ═════════════════════════════════════════════════════ */
#download {
  max-width: var(--col-wide);
}

.dl-panel {
  position: relative;
  text-align: center;
  padding: 3.5rem clamp(1.25rem, 5vw, 4rem) 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse 60% 70% at 50% 0%, var(--accent-soft), transparent 70%), var(--bg-soft);
  overflow: hidden;
}

.dl-panel h2 {
  margin-bottom: 0.4rem;
}

.dl-detected {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.6rem;
  min-height: 1.4em;
}

.dl-meta {
  animation: none;
}

.dl-toggle {
  display: inline-block;
  margin-top: 1.75rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--line);
  padding: 0.5rem 1.3rem;
  border-radius: 99px;
  cursor: pointer;
  transition:
    color 200ms,
    border-color 200ms;
}

.dl-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.dl-toggle.active {
  color: var(--accent);
  border-color: var(--accent-line);
}

.dl-all {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 400ms var(--ease-enter),
    opacity 300ms;
}

.dl-all.open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.dl-grid {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: start;
}

.dl-all.open .dl-grid {
  margin-top: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.dl-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.95rem 1.4rem;
}

.dl-row + .dl-row,
.dl-divider + .dl-row {
  border-top: 1px solid var(--line-soft);
}

.dl-divider {
  height: 0;
}

.dl-row-label {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  min-width: 118px;
}

.dl-row-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
  justify-content: flex-end;
}

.dl-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--chip-bg);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 550;
  font-size: 0.8rem;
  transition:
    border-color 200ms,
    background 200ms,
    transform 200ms var(--ease-enter);
}

.dl-pill:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.dl-pill .ic {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.dl-pill-fmt {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ═══ Overlays (lightbox + modal) ══════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  color: var(--text);
  align-items: center;
  justify-content: center;
  background: var(--overlay);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease-enter);
}

.overlay[open] {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.overlay-close {
  position: absolute;
  top: 1.1rem;
  inset-inline-end: 1.25rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-dim);
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition:
    color 200ms,
    transform 200ms var(--ease-enter);
}

.overlay-close:hover {
  color: var(--text);
  transform: scale(1.08);
}

#lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: var(--shadow-app);
  transform: scale(0.94);
  transition: transform 320ms var(--ease-enter);
}

#lightbox[open] img {
  transform: scale(1);
}

.modal-card {
  position: relative;
  width: min(430px, 92vw);
  padding: 2.25rem 2rem 1.75rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transform: scale(0.94) translateY(8px);
  transition: transform 320ms var(--ease-spring);
}

.overlay[open] .modal-card {
  transform: none;
}

.modal-close {
  top: 0.9rem;
  inset-inline-end: 1rem;
  width: 34px;
  height: 34px;
}

.modal-title {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.modal-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.modal-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.2rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  transition:
    border-color 220ms,
    background 220ms,
    transform 220ms var(--ease-enter),
    box-shadow 220ms var(--ease-enter);
}

.modal-opt:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.modal-opt-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.modal-opt-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.modal-opt-action {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.modal-opt-action .ic {
  width: 13px;
  height: 13px;
}

.modal-opt--ghost {
  border-color: var(--line-soft);
  background: transparent;
}

.modal-opt--ghost:hover {
  border-color: var(--text-muted);
  background: var(--bg-soft);
  box-shadow: none;
}

.modal-opt--ghost .modal-opt-action {
  color: var(--text-muted);
}

.modal-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.overlay[open] .modal-opt:nth-child(1) {
  animation: rise 400ms 50ms var(--ease-enter) both;
}

.overlay[open] .modal-opt:nth-child(2) {
  animation: rise 400ms 120ms var(--ease-enter) both;
}

/* ═══ Footer ═══════════════════════════════════════════════════════ */
#footer {
  max-width: var(--col);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--line-soft);
}

.footer-built {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.footer-tech {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-dim);
  font-weight: 500;
  transition: color 180ms;
}

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

.footer-sep {
  opacity: 0.4;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  justify-content: center;
  margin-bottom: 0.9rem;
}

.footer-links a {
  color: var(--text-dim);
  transition: color 180ms;
}

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

.footer-license {
  font-size: 0.74rem;
  opacity: 0.6;
}

/* ═══ Responsive ═══════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }
  .b-protocol {
    grid-row: auto;
  }
  .story-grid {
    grid-template-columns: 1fr;
  }
  .story-head {
    position: static;
  }
}

@media (max-width: 768px) {
  #hero {
    padding-top: 6rem;
  }
  .motion-grid {
    grid-template-columns: 1fr;
  }
  .hero-duo {
    padding-bottom: 0;
  }
  .duo-dark {
    width: 100%;
  }
  .duo-light {
    position: relative;
    width: 100%;
    margin-top: 1rem;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .hero-stats {
    gap: 0.8rem;
  }
  .b-light {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

@media (max-width: 560px) {
  .bento {
    grid-template-columns: 1fr;
  }
  .b-protocol,
  .b-bt,
  .b-task {
    grid-column: auto;
  }
  .section,
  .section-wide {
    padding-block: 3.5rem;
  }
  .dl-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .modal-options {
    grid-template-columns: 1fr;
  }
  .picker-toggle span {
    display: none;
  }
}

/* ═══ Reduced motion ═══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-streaks {
    display: none;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
  .hero-duo {
    transform: none;
  }
}

/* Brand transition and browser companion */
.hero-description {
  max-width: 58ch;
  margin-top: 0.65rem;
  color: var(--text-dim);
  text-wrap: pretty;
}
.rebrand-note {
  max-width: 64ch;
  margin: 1.6rem 1rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  text-align: start;
  font-size: 0.9rem;
  animation: rise 500ms var(--ease-enter) both;
}
.rebrand-note strong {
  color: var(--text);
}
.rebrand-note p {
  margin-top: 0.35rem;
  color: var(--text-dim);
}
.story-head img {
  margin-bottom: 1rem;
}
.story-body .btn {
  margin-top: 1.2rem;
}
.release-note {
  margin: 1rem auto 1.5rem;
  max-width: 50ch;
  color: var(--text-dim);
}
.release-links {
  margin-top: 1.1rem;
}
.release-links a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.screenshot-button {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  cursor: zoom-in;
}
.screenshot-button img {
  display: block;
  width: 100%;
  height: auto;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
html:has(dialog[open]) {
  overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .rebrand-note {
    animation: none;
  }
}
