:root {
  --bg: #07080b;
  --surface: #12141a;
  --surface-2: #171a21;
  --text: #eef1f6;
  --text-dim: #a6adba;
  --accent: #7c8cf8;
  --rim: #b9c3ff;
  --line: rgba(238, 241, 246, 0.12);
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

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

img, canvas { max-width: 100%; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; color: var(--text-dim); }

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #0a0a0a;
  padding: 0.75em 1.25em;
  z-index: 1000;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

:focus-visible {
  outline: 2px solid var(--rim);
  outline-offset: 3px;
}

/* ---------- the fixed 3D stage ---------- */

.scene-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(120% 90% at 65% 35%, #141822 0%, #0b0d13 55%, #07080b 100%);
}
.scene-stage__poster,
#scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scene-stage__poster { opacity: 1; transition: opacity 0.8s ease; }
.scene-stage__poster.is-hidden { opacity: 0; }
#scene-canvas { opacity: 0; transition: opacity 0.6s ease; }
#scene-canvas.is-visible { opacity: 1; }

.scrim-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 140px;
  z-index: 5;
  background: linear-gradient(to bottom, rgba(7,8,11,0.85), rgba(7,8,11,0));
  pointer-events: none;
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(7, 8, 11, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
}
.nav__mark svg { color: var(--accent); }
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-size: 0.9rem;
}
.nav__links a { text-decoration: none; color: var(--text-dim); }
.nav__links a:hover { color: var(--text); }
.nav__cta {
  border: 1px solid var(--line);
  padding: 0.5em 1em;
  border-radius: 999px;
  color: var(--text) !important;
}
@media (max-width: 700px) {
  .nav__links a:not(.nav__cta) { display: none; }
}

/* ---------- layout scaffolding ---------- */

main { position: relative; z-index: 1; }

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
}
.hero__copy {
  max-width: 620px;
  padding: 0 clamp(1.25rem, 6vw, 5rem);
  background: linear-gradient(100deg, rgba(7,8,11,0.88) 0%, rgba(7,8,11,0.7) 55%, rgba(7,8,11,0.2) 88%, rgba(7,8,11,0) 100%);
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rim);
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
}
.hero__sub {
  font-size: 1.05rem;
  max-width: 46ch;
}
.hero__actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.btn--primary {
  background: var(--accent);
  color: #14100a;
}
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost {
  border: 1px solid var(--line);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--rim); color: var(--rim); }
.btn--large { font-size: 1.05rem; }

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.scroll-hint span {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, var(--rim), transparent);
  animation: scrollpulse 1.8s ease-in-out infinite;
}
@keyframes scrollpulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.facet-divider {
  position: relative;
  z-index: 1;
  height: 40px;
  margin: 0 auto;
  max-width: 1200px;
}
.facet-divider svg { width: 100%; height: 100%; }
.facet-divider polyline {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

.section {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding: clamp(4rem, 10vw, 7rem) clamp(1.25rem, 6vw, 5rem);
}
.section--dark { background: #05060a; }
.section__lede {
  max-width: 60ch;
  font-size: 1.05rem;
}
.section h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  max-width: 18ch;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
  transform: perspective(800px) rotateX(0deg) rotateY(0deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}
.card:hover, .card:focus-visible { border-color: var(--rim); }
.card__corner {
  position: absolute;
  top: 0; left: 0;
  width: 22px; height: 22px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  border-radius: 14px 0 0 0;
  opacity: 0.85;
}
.card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.95rem; margin-bottom: 0; }

.process {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.process__num {
  display: block;
  font-family: var(--font-mono);
  color: var(--rim);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.process h3 { font-size: 1.1rem; }
.process p { font-size: 0.95rem; }

.faq {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.75rem;
  max-width: 720px;
}
.faq__item h3 {
  font-size: 1.1rem;
  color: var(--text);
}
.faq__item p { font-size: 0.98rem; margin-bottom: 0; }

.contact {
  position: relative;
  z-index: 1;
  min-height: 90svh;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(7,8,11,0) 0%, rgba(7,8,11,0.4) 100%);
}
.contact__copy {
  max-width: 560px;
  padding: 4rem clamp(1.25rem, 6vw, 5rem);
  background: linear-gradient(100deg, rgba(7,8,11,0.88) 0%, rgba(7,8,11,0.78) 60%, rgba(7,8,11,0.35) 92%, rgba(7,8,11,0) 100%);
  border-radius: 0 24px 24px 0;
}
.contact__note {
  font-size: 0.85rem;
  margin-top: 1rem;
  color: var(--text-dim);
}

.footer {
  position: relative;
  z-index: 1;
  background: #05060a;
  border-top: 1px solid var(--line);
  padding: 2.5rem clamp(1.25rem, 6vw, 5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.footer__mark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-family: var(--font-display);
}
.footer a { text-decoration: none; color: var(--text-dim); }
.footer a:hover { color: var(--text); }

/* ---------- entrances (skipped entirely under reduced motion, see page.js) ---------- */

[data-enter] {
  opacity: 0;
  transform: translateY(24px);
}
[data-enter].is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-enter-skew] {
  opacity: 0;
  transform: translateY(20px) skewY(2deg);
}
[data-enter-skew].is-in {
  opacity: 1;
  transform: translateY(0) skewY(0deg);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  [data-enter], [data-enter-skew] {
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-hint span { animation: none; }
}

/* ---------- the assistant demo ---------- */
.agent{
  margin-top:2.5rem;border:1px solid var(--line);border-radius:14px;
  background:var(--surface);overflow:hidden;max-width:44rem;
}
.agent__log{
  padding:1.25rem;min-height:16rem;max-height:22rem;overflow-y:auto;
  display:flex;flex-direction:column;gap:.6rem;
}
.agent__msg{
  max-width:82%;padding:.7rem .95rem;border-radius:14px;line-height:1.5;
  font-size:.95rem;animation:agentIn .28s cubic-bezier(.22,.61,.36,1) both;
}
.agent__msg--you{
  align-self:flex-end;background:var(--accent);color:#0b0d1a;font-weight:500;
  border-bottom-right-radius:5px;
}
.agent__msg--bot{
  align-self:flex-start;background:var(--surface-2);
  border:1px solid var(--line);border-bottom-left-radius:5px;
}
.agent__typing{display:flex;gap:.3rem;align-items:center;padding:.85rem 1rem}
.agent__typing span{
  width:.4rem;height:.4rem;border-radius:50%;background:currentColor;opacity:.35;
  animation:agentDot 1.1s infinite ease-in-out;
}
.agent__typing span:nth-child(2){animation-delay:.16s}
.agent__typing span:nth-child(3){animation-delay:.32s}
.agent__prompts{
  display:flex;flex-wrap:wrap;gap:.5rem;padding:1rem 1.25rem;
  border-top:1px solid var(--line);background:rgba(0,0,0,.18);
}
.agent__prompt{
  font:inherit;font-size:.85rem;cursor:pointer;
  padding:.5rem .85rem;border-radius:999px;
  background:transparent;color:inherit;border:1px solid var(--line);
  transition:border-color .25s,transform .25s,opacity .25s;
}
.agent__prompt:hover:not(:disabled){border-color:var(--accent);transform:translateY(-1px)}
.agent__prompt:disabled{opacity:.4;cursor:default}
.agent__note{
  margin-top:1rem;font-size:.85rem;opacity:.62;max-width:44rem;
}
@keyframes agentIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes agentDot{0%,60%,100%{opacity:.25;transform:translateY(0)}30%{opacity:.9;transform:translateY(-3px)}}
@media (prefers-reduced-motion:reduce){
  .agent__msg{animation:none}
  .agent__typing span{animation:none}
}

/* ---------- the arithmetic ---------- */
.stats{
  display:grid;gap:1px;margin-top:2.5rem;
  grid-template-columns:repeat(auto-fit,minmax(13rem,1fr));
  background:var(--line);border:1px solid var(--line);border-radius:14px;overflow:hidden;
}
.stat{background:var(--surface);padding:1.5rem 1.25rem}
.stat__num{
  display:block;font-family:var(--font-display);font-weight:700;
  font-size:clamp(2rem,4.5vw,2.9rem);letter-spacing:-.03em;color:var(--accent);
  font-variant-numeric:tabular-nums;line-height:1;
}
.stat__cap{
  display:block;margin-top:.6rem;font-size:.88rem;color:var(--text-dim);line-height:1.45;
}
.stats__src{margin-top:1rem;font-size:.8rem;color:var(--text-dim);opacity:.75;max-width:56ch}
.card__when{
  font-family:var(--font-mono);font-size:.7rem;letter-spacing:.14em;text-transform:uppercase;
  color:var(--rim);margin:0 0 .5rem;
}

.hero h1{text-wrap:balance}

/* ---------- pricing ---------- */
.tiers{
  display:grid;gap:1.25rem;margin-top:2.5rem;
  grid-template-columns:repeat(auto-fit,minmax(18rem,1fr));
}
.tier{
  background:var(--surface);border:1px solid var(--line);border-radius:14px;
  padding:1.75rem 1.5rem;
}
.tier--lead{border-color:var(--accent)}
.tier h3{margin:0 0 .75rem;font-size:1.25rem}
.tier__price{
  font-family:var(--font-display);font-size:1.05rem;color:var(--text-dim);
  margin:0 0 .35rem;
}
.tier__price span{
  font-size:2.1rem;font-weight:700;color:var(--text);
  letter-spacing:-.03em;font-variant-numeric:tabular-nums;
}
.tier__note{
  font-family:var(--font-mono);font-size:.72rem;letter-spacing:.1em;
  text-transform:uppercase;color:var(--rim);margin:0 0 1.1rem;
}
.tier p{font-size:.94rem}
.tier__math{
  margin-top:1rem;padding-top:1rem;border-top:1px solid var(--line);
  color:var(--text-dim);font-size:.86rem;
}
.tier__founder{
  margin-top:1.75rem;padding:1.25rem 1.4rem;border-radius:12px;
  border:1px dashed var(--line);background:rgba(124,140,248,.05);
  max-width:60ch;font-size:.94rem;
}
.tier__founder strong{color:var(--accent)}

/* ---------- review fixes: overflow, living elements, pause ---------- */
/* hidden alone still lets code scroll the page sideways; clip is the real fix */
html, body { overflow-x: hidden; overflow-x: clip; }

/* One living element per section, whisper level, negative delays so they are
   mid-cycle at first paint rather than all starting together on load. */
.stat__num{ animation: breathe 9s ease-in-out -2.4s infinite; }
.tier--lead{ animation: edgeGlow 11s ease-in-out -3.1s infinite; }
.card__corner{ animation: cornerPulse 8s ease-in-out -1.2s infinite; }
.facet-divider svg{ animation: driftLine 14s ease-in-out -5s infinite; }

@keyframes breathe{ 0%,100%{opacity:.88} 50%{opacity:1} }
@keyframes edgeGlow{ 0%,100%{border-color:var(--accent)} 50%{border-color:rgba(124,140,248,.45)} }
@keyframes cornerPulse{ 0%,100%{opacity:.55} 50%{opacity:1} }
@keyframes driftLine{ 0%,100%{transform:translateX(0)} 50%{transform:translateX(10px)} }

/* animation-play-state is not inherited, so a container class silently never
   reaches nested elements or pseudo-elements. This is the pattern that cannot miss. */
body.is-paused *,
body.is-paused *::before,
body.is-paused *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce){
  .stat__num, .tier--lead, .card__corner, .facet-divider svg { animation: none !important; }
}

/* ---------- section 02 as a split ledger ----------
   Section 03 is a header stacked over a three-card grid. Two neighbours with
   the same skeleton read as one template stamped twice, so this one is a
   side-by-side: the argument on the left, the numbers as ruled rows on the right. */
.numbers{
  display:grid;gap:clamp(2rem,6vw,5rem);align-items:start;
  grid-template-columns:minmax(0,5fr) minmax(0,6fr);
}
.numbers__intro{position:sticky;top:6rem}
.numbers .section__lede{max-width:44ch}
.numbers .stats__src{margin-top:1.5rem;max-width:44ch}

.ledger{list-style:none;margin:0;padding:0;border-top:1px solid var(--line)}
.ledger .stat{
  display:grid;grid-template-columns:minmax(7.5rem,auto) 1fr;gap:1.5rem;
  align-items:baseline;background:none;
  padding:1.6rem 0;border-bottom:1px solid var(--line);
}
.ledger .stat__num{font-size:clamp(2.4rem,5.2vw,3.6rem);margin:0}
.ledger .stat__cap{margin:0;font-size:1rem;max-width:30ch}

@media (max-width: 860px){
  .numbers{grid-template-columns:1fr}
  .numbers__intro{position:static}
  .ledger .stat{grid-template-columns:1fr;gap:.4rem;padding:1.25rem 0}
}

/* ---------- section 03 cards: the dramatic tilt ----------
   Transform is driven by page.js with damping. While tilting, the transform
   transition inherited from the entrance ([data-enter].is-in, 0.8s) has to go,
   or every frame lags behind the cursor. This selector outranks it. */
#capability-cards .card{ transform-style:preserve-3d; }
#capability-cards .card.is-tilting{ transition:border-color .35s ease, opacity .45s ease; }
#capability-cards .card.is-hot{ border-color:var(--accent); z-index:2; }
#capability-cards.has-hot .card:not(.is-hot){ opacity:.5; }

/* Halo: the shadow sits at full strength on a pseudo-element and only its
   opacity animates, which stays cheap. */
#capability-cards .card::before{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  box-shadow:0 44px 90px -34px rgba(124,140,248,.75), 0 0 0 1px rgba(124,140,248,.9);
  opacity:0; transition:opacity .45s ease;
}
#capability-cards .card.is-hot::before{ opacity:1; }

/* The light that follows the cursor, clipped in its own layer so the card
   itself can stay preserve-3d. */
.card__glow{
  position:absolute; inset:0; border-radius:inherit; overflow:hidden;
  pointer-events:none; transform:translateZ(1px);
}
.card__glow-blob{
  position:absolute; left:0; top:0; width:440px; height:440px; margin:-220px 0 0 -220px;
  background:radial-gradient(circle, rgba(124,140,248,.42) 0%, rgba(124,140,248,.14) 34%, transparent 66%);
  transform:translate(var(--gx,0px), var(--gy,0px));
  opacity:0; transition:opacity .45s ease;
}
.card.is-hot .card__glow-blob{ opacity:1; }
.card__sheen{
  position:absolute; inset:-40%;
  background:linear-gradient(115deg, transparent 42%, rgba(255,255,255,.09) 50%, transparent 58%);
  transform:translateX(-60%); opacity:0;
  transition:transform .95s cubic-bezier(.2,.8,.2,1), opacity .5s ease;
}
.card.is-hot .card__sheen{ transform:translateX(60%); opacity:1; }

/* Contents float off the surface at different depths when the card is hot. */
#capability-cards .card > h3,
#capability-cards .card > p{
  position:relative;
  transform:translateZ(2px);
  transition:transform .6s cubic-bezier(.2,.8,.2,1);
}
#capability-cards .card.is-hot > .card__when{ transform:translateZ(64px); }
#capability-cards .card.is-hot > h3{ transform:translateZ(48px); }
#capability-cards .card.is-hot > p{ transform:translateZ(26px); }
#capability-cards .card__corner{ transition:transform .6s cubic-bezier(.2,.8,.2,1); }
#capability-cards .card.is-hot .card__corner{ transform:translateZ(72px); opacity:1; }

@media (prefers-reduced-motion: reduce){
  .card__glow{ display:none; }
  #capability-cards .card > *{ transform:none !important; }
}
