/* ═══════════════════════════════════════════════════════════════
   fooform — base: design tokens (dark + light), reset, atmosphere,
   shared components. Loaded by every page.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* brand hues stay constant across themes */
  --violet:  #8b6bff;
  --cyan:    #25e6d0;
  --pink:    #ff5cae;
  --lime:    #c6ff4d;
  --amber:   #ffb020;

  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out:    cubic-bezier(.19,1,.22,1);
  --ease-spring: cubic-bezier(.16,1.24,.3,1);
  --ease-in-out: cubic-bezier(.76,0,.24,1);

  --shell: min(1240px, 92vw);
  --nav-h: 74px;
}

/* ── dark (default) ───────────────────────────────────────── */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg:       #06060b;
  --bg-2:     #0b0b14;
  --surface:  rgba(255,255,255,.038);
  --surface-2:rgba(255,255,255,.065);
  --card:     linear-gradient(165deg, rgba(255,255,255,.05), rgba(255,255,255,.014));
  --card-hi:  linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.022));
  --line:     rgba(255,255,255,.09);
  --line-2:   rgba(255,255,255,.17);
  --ink:      #f2f2f7;
  --ink-2:    #a4a4b6;
  --ink-3:    #6e6e83;
  --accent:   #8b6bff;
  --accent-2: #25e6d0;
  --on-accent:#08060f;
  --particle: 160,150,255;
  --shadow:   0 40px 100px -40px rgba(0,0,0,1);
  --shadow-sm:0 14px 40px -22px rgba(0,0,0,.9);
  --grain-op: .26;
  --veil:     rgba(10,10,18,.72);
  --atmos:
    radial-gradient(120vw 80vh at 50% -10%, rgba(139,107,255,.22), transparent 60%),
    radial-gradient(80vw 60vh at 100% 26%, rgba(37,230,208,.10), transparent 60%),
    radial-gradient(70vw 60vh at 0% 72%, rgba(255,92,174,.09), transparent 60%);
}

/* ── light ────────────────────────────────────────────────── */
:root[data-theme="light"] {
  color-scheme: light;
  --bg:       #f4f4fa;
  --bg-2:     #ffffff;
  --surface:  rgba(255,255,255,.85);
  --surface-2:#ffffff;
  --card:     linear-gradient(165deg, #ffffff, #fbfaff);
  --card-hi:  linear-gradient(165deg, #ffffff, #f5f2ff);
  --line:     rgba(22,18,60,.10);
  --line-2:   rgba(22,18,60,.20);
  --ink:      #12101f;
  --ink-2:    #55536b;
  --ink-3:    #85839a;
  --accent:   #6d4aff;
  --accent-2: #00a795;
  --on-accent:#ffffff;
  --particle: 120,100,235;
  --shadow:   0 40px 90px -44px rgba(40,30,90,.5);
  --shadow-sm:0 14px 34px -20px rgba(40,30,90,.34);
  --grain-op: .09;
  --veil:     rgba(255,255,255,.78);
  --atmos:
    radial-gradient(120vw 80vh at 50% -14%, rgba(139,107,255,.15), transparent 62%),
    radial-gradient(80vw 60vh at 100% 24%, rgba(0,190,170,.10), transparent 62%),
    radial-gradient(70vw 60vh at 0% 74%, rgba(255,92,174,.08), transparent 62%);
}

:root { --grad: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%); }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .5s ease, color .5s ease;
}

body::before {
  content: "";
  position: fixed; inset: 0; z-index: -3;
  background: var(--atmos), var(--bg);
  pointer-events: none;
  transition: background .5s ease;
}

img, svg, canvas, iframe { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

::selection { background: color-mix(in oklab, var(--accent) 45%, transparent); }

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

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-weight: 600;
  transform: translateY(-180%);
  transition: transform .3s var(--ease-out);
}
.skip:focus { transform: none; }

/* ── atmosphere ───────────────────────────────────────────── */
#fx-canvas {
  position: fixed; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  opacity: .6; pointer-events: none;
}
:root[data-theme="light"] #fx-canvas { opacity: .38; }

.grain {
  position: fixed; inset: -120%; z-index: 60;
  pointer-events: none;
  opacity: var(--grain-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
  mix-blend-mode: overlay;
}
@keyframes grain {
  0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-3%)}
  60%{transform:translate(-2%,-2%)} 80%{transform:translate(3%,1%)} 100%{transform:translate(0,0)}
}

.spotlight {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none; opacity: 0;
  background: radial-gradient(380px circle at var(--mx,50%) var(--my,50%),
              color-mix(in oklab, var(--accent) 14%, transparent), transparent 70%);
  transition: opacity .6s ease;
}
body.pointer-fine .spotlight { opacity: 1; }

.warp {
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none; opacity: 0;
  background: radial-gradient(60vw 60vh at 50% 50%, color-mix(in oklab, var(--accent) 38%, transparent), transparent 65%);
  mix-blend-mode: screen;
}
.warp.is-firing { animation: warpFlash .62s var(--ease-out); }
@keyframes warpFlash {
  0%{opacity:0;transform:scale(1.4)} 22%{opacity:.8;transform:scale(1)} 100%{opacity:0;transform:scale(.9)}
}

.scroll-rail { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 80; pointer-events: none; }
.scroll-rail span {
  display: block; height: 100%; width: 0%;
  background: var(--grad);
  box-shadow: 0 0 14px color-mix(in oklab, var(--accent) 70%, transparent);
}

/* ── custom cursor ────────────────────────────────────────── */
.cursor { display: none; }
body.pointer-fine .cursor { display: block; }
body.pointer-fine .cursor__dot,
body.pointer-fine .cursor__ring {
  position: fixed; top: 0; left: 0; z-index: 100;
  pointer-events: none; border-radius: 50%;
  will-change: transform;
}
.cursor__dot {
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.cursor__ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid color-mix(in oklab, var(--accent) 60%, transparent);
  transition: width .25s var(--ease-out), height .25s var(--ease-out),
              margin .25s var(--ease-out), background .25s var(--ease-out);
}
body.cursor-hot .cursor__ring {
  width: 58px; height: 58px; margin: -29px 0 0 -29px;
  background: color-mix(in oklab, var(--accent) 12%, transparent);
}

/* ── reveal ───────────────────────────────────────────────── */
.reveal { opacity: 0; will-change: transform, opacity; }
.reveal[data-reveal="up"]    { transform: translateY(34px) }
.reveal[data-reveal="scale"] { transform: scale(.965) translateY(28px) }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .9s var(--ease-out), transform 1.05s var(--ease-out);
  transition-delay: var(--rd, 0ms);
}

/* ── buttons ──────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px; border-radius: 999px;
  font-weight: 600; font-size: 15px; letter-spacing: -.01em;
  overflow: hidden; isolation: isolate;
  transition: transform .35s var(--ease-spring), box-shadow .35s var(--ease-out),
              border-color .3s ease, background .3s ease;
  will-change: transform;
}
.btn__label { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 10px; }
.btn__arrow { transition: transform .4s var(--ease-spring); }
.btn:hover .btn__arrow { transform: translateX(5px); }
.btn--primary {
  color: var(--on-accent);
  background: var(--grad);
  box-shadow: 0 12px 40px -12px color-mix(in oklab, var(--accent) 85%, transparent);
}
.btn--primary:hover { box-shadow: 0 20px 60px -14px color-mix(in oklab, var(--accent) 95%, transparent); }
.btn--ghost {
  color: var(--ink);
  border: 1px solid var(--line-2);
  background: var(--surface);
  backdrop-filter: blur(10px);
}
.btn--ghost:hover { border-color: color-mix(in oklab, var(--accent) 55%, var(--line-2)); background: var(--surface-2); }
.btn--danger:hover { border-color: color-mix(in oklab, var(--pink) 70%, transparent); color: var(--pink); }
.btn--wide { width: 100%; }
.btn:active { transform: scale(.97); }

/* the big one */
.btn--hero {
  padding: 26px 54px;
  font-size: clamp(17px, 1.7vw, 21px);
  font-weight: 700;
  letter-spacing: -.02em;
  border-radius: 22px;
  box-shadow: 0 24px 70px -18px color-mix(in oklab, var(--accent) 90%, transparent),
              0 0 0 1px color-mix(in oklab, var(--accent) 30%, transparent);
}
.btn--hero .btn__label { gap: 14px; }
.btn--hero:hover { transform: translateY(-3px) scale(1.02); }
.btn--hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit;
  background: radial-gradient(120% 140% at 50% 0%, rgba(255,255,255,.4), transparent 60%);
  opacity: .5; pointer-events: none;
}
.btn--pulse::before {
  content: ""; position: absolute; inset: -3px; border-radius: inherit; z-index: 0;
  border: 2px solid color-mix(in oklab, var(--accent) 60%, transparent);
  animation: ctaPulse 2.8s var(--ease-out) infinite;
}
@keyframes ctaPulse {
  0%   { opacity: .8; transform: scale(1) }
  70%  { opacity: 0;  transform: scale(1.14) }
  100% { opacity: 0;  transform: scale(1.14) }
}

.btn__shine {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.5) 48%, transparent 62%);
  transform: translateX(-120%);
}
.btn:hover .btn__shine { animation: shine .85s var(--ease-out); }
@keyframes shine { to { transform: translateX(120%) } }

/* ── theme toggle ─────────────────────────────────────────── */
.tt {
  position: relative;
  width: 62px; height: 32px; flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  display: flex; align-items: center; padding: 3px;
  transition: background .35s ease, border-color .35s ease;
}
.tt:hover { border-color: color-mix(in oklab, var(--accent) 55%, var(--line-2)); }
.tt__knob {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--grad);
  display: grid; place-items: center;
  color: var(--on-accent);
  transition: transform .5s var(--ease-spring);
  box-shadow: 0 4px 14px -4px color-mix(in oklab, var(--accent) 90%, transparent);
}
:root[data-theme="light"] .tt__knob { transform: translateX(30px); }
.tt svg { width: 14px; height: 14px; }
.tt__sun { display: none; }
:root[data-theme="light"] .tt__sun { display: block; }
:root[data-theme="light"] .tt__moon { display: none; }

/* ── bits ─────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 18px;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
kbd {
  font-family: var(--mono); font-size: 11px;
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink-2);
}

.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 120;
  transform: translate(-50%, 130%) scale(.94);
  padding: 14px 24px; border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in oklab, var(--accent) 20%, transparent);
  backdrop-filter: blur(20px);
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: transform .5s var(--ease-spring), opacity .35s ease;
  max-width: min(420px, 88vw);
}
.toast.is-on { transform: translate(-50%, 0) scale(1); opacity: 1; }

/* ── nav ──────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(22px, calc((100vw - var(--shell)) / 2));
  border-bottom: 1px solid transparent;
  transition: background .45s ease, backdrop-filter .45s ease, border-color .45s ease, height .35s ease;
}
.nav.is-stuck {
  height: 64px;
  background: var(--veil);
  backdrop-filter: blur(22px) saturate(160%);
  border-bottom-color: var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 11px; }
.nav__mark { width: 30px; height: 30px; }
.nav__word { font-weight: 700; font-size: 19px; letter-spacing: -.03em; }
.nav__links { display: flex; align-items: center; gap: 26px; font-size: 14.5px; color: var(--ink-2); }
.nav__links a:not(.nav__cta) { position: relative; transition: color .25s ease; }
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--grad); transition: width .35s var(--ease-out);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover:not(.nav__cta)::after { width: 100%; }
.nav__cta {
  padding: 12px 24px; border-radius: 999px;
  color: var(--on-accent); background: var(--grad);
  font-weight: 600;
  box-shadow: 0 10px 30px -12px color-mix(in oklab, var(--accent) 85%, transparent);
  transition: transform .35s var(--ease-spring), box-shadow .35s ease;
}
.nav__cta:hover { box-shadow: 0 16px 40px -12px color-mix(in oklab, var(--accent) 95%, transparent); }
.nav__burger { display: none; flex-direction: column; gap: 6px; padding: 10px; }
.nav__burger i { display: block; width: 22px; height: 1.5px; background: var(--ink); transition: transform .35s var(--ease-out); }
.nav__burger[aria-expanded="true"] i:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav__burger[aria-expanded="true"] i:last-child { transform: translateY(-3.75px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav__burger { display: flex; }
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; gap: 18px; padding: 26px 22px 32px;
    background: var(--bg-2); backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%); opacity: 0; pointer-events: none;
    transition: transform .5s var(--ease-out), opacity .35s ease;
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__tt-wrap { order: -1; }
}

/* ── footer ───────────────────────────────────────────────── */
.foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  width: var(--shell); margin: 0 auto; padding: 40px 0 56px;
  border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 13.5px;
}
.foot__brand { font-weight: 700; font-size: 17px; color: var(--ink-2); letter-spacing: -.03em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .grain { display: none; }
}
