/* ─── Omni design tokens ──────────────────────────────────────────── */
:root {
  --bg: #0a0a0a;
  --ink: #f2f4f3;
  --ink-dim: #8b9491;
  --ink-faint: #565e5b;
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --glass: rgba(255, 255, 255, 0.035);
  --glass-hi: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);
  /* system fonts only — no webfonts, no font names the browser has to
     hunt for in the OS: anything not present locally gets matched
     asynchronously and swaps in after first paint, jolting the layout */
  --sans: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --r: 16px;
  --bubble-ease: cubic-bezier(0.34, 1.45, 0.5, 1);
}

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

html { scrollbar-color: #2a2f2d var(--bg); overflow-anchor: none; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  overflow-anchor: none;
}

/* ─── ambient background ──────────────────────────────────────────── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }

.aurora {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
/* orbs live on the page PERIMETER: edges and corners only —
   the center stays clean for content, but no edge is left empty */
.aurora-a { /* left edge */
  width: 74vw; height: 54vh; left: -30vw; top: 24vh;
  background: radial-gradient(ellipse at center,
    rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.06) 45%, transparent 70%);
  animation: drift-a 15s ease-in-out infinite alternate,
             shimmer-a 9s ease-in-out infinite;
}
.aurora-b { /* top-right edge */
  width: 72vw; height: 52vh; right: -28vw; top: -6vh;
  background: radial-gradient(ellipse at center,
    rgba(45, 212, 191, 0.15) 0%, rgba(45, 212, 191, 0.05) 45%, transparent 70%);
  animation: drift-b 19s ease-in-out infinite alternate,
             shimmer-b 12s ease-in-out infinite;
}
.aurora-c { /* bottom-left corner */
  width: 58vw; height: 44vh; left: -16vw; bottom: -20vh;
  background: radial-gradient(ellipse at center,
    rgba(52, 211, 153, 0.13) 0%, transparent 65%);
  animation: drift-c 13s ease-in-out infinite alternate,
             shimmer-a 7.5s ease-in-out infinite;
}
.aurora-d { /* right edge, mid-low */
  width: 34vw; height: 34vw; right: -12vw; top: 56vh;
  background: radial-gradient(circle at center,
    rgba(52, 211, 153, 0.15) 0%, rgba(45, 212, 191, 0.05) 45%, transparent 65%);
  animation: float-d 11s ease-in-out infinite alternate,
             shimmer-b 6.5s ease-in-out infinite;
}
.aurora-e { /* top edge */
  width: 26vw; height: 26vw; left: 30vw; top: -16vw;
  background: radial-gradient(circle at center,
    rgba(16, 185, 129, 0.11) 0%, transparent 65%);
  animation: float-e 14s ease-in-out infinite alternate,
             shimmer-a 10.5s ease-in-out infinite;
}
.aurora-f { /* bottom-right corner */
  width: 30vw; height: 30vw; right: -8vw; bottom: -14vw;
  background: radial-gradient(circle at center,
    rgba(45, 212, 191, 0.12) 0%, transparent 65%);
  animation: float-f 12.5s ease-in-out infinite alternate,
             shimmer-b 8.5s ease-in-out infinite;
}
@keyframes drift-a { to { transform: translate(10vw, -8vh) scale(1.14) rotate(8deg); } }
@keyframes drift-b { to { transform: translate(-9vw, 9vh) scale(1.12) rotate(-7deg); } }
@keyframes drift-c { to { transform: translate(7vw, -8vh) scale(1.2); } }
@keyframes float-d {
  from { transform: translate(0, -5vh) scale(0.95); }
  to   { transform: translate(-5vw, 6vh) scale(1.15); }
}
@keyframes float-e {
  from { transform: translate(-4vw, 0) scale(0.92); }
  to   { transform: translate(6vw, 3vh) scale(1.12); }
}
@keyframes float-f {
  from { transform: translate(0, 3vh) scale(1.1); }
  to   { transform: translate(-5vw, -5vh) scale(0.94); }
}
/* opacity-only shimmer: the emerald and teal orbs pulse in counter-phase,
   so their overlap shifts colour without animating filters (cheap on GPU) */
@keyframes shimmer-a {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}
@keyframes shimmer-b {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.dotgrid {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, black 30%, transparent 100%);
}

/* ─── nav ─────────────────────────────────────────────────────────── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1180px; margin: 0 auto; padding: 22px 32px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 19px; letter-spacing: -0.02em;
}
.brand-mark { width: 26px; height: 26px; color: var(--green); }
.nav-links { display: flex; gap: 30px; }
.nav-links a {
  color: var(--ink-dim); text-decoration: none; font-size: 14.5px;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-cta {
  color: var(--green); text-decoration: none; font-size: 14px; font-weight: 600;
  border: 1px solid rgba(52, 211, 153, 0.35); border-radius: 999px;
  padding: 8px 18px; transition: all 0.25s;
}
.nav-cta:hover { background: var(--green-soft); box-shadow: 0 0 24px rgba(52,211,153,0.25); }

/* ─── hero ────────────────────────────────────────────────────────── */
.hero {
  max-width: 1020px; margin: 0 auto;
  padding: 72px 32px 40px;
  text-align: center;
  position: relative;
}
.headline {
  font-size: clamp(40px, 6.2vw, 72px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.headline .dim { color: var(--ink-dim); }
.subline {
  margin-top: 22px;
  font-size: clamp(17px, 2vw, 21px);
  color: var(--green);
  font-weight: 500;
}

/* ─── plasma orbit backdrop ───────────────────────────────────────── */
.orbit-bg {
  position: absolute;
  left: 50%;
  top: -36px;
  transform: translateX(-50%);
  width: min(1020px, 96vw);
  z-index: -1;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { .orbit-bg { display: none; } }

/* ─── chat ────────────────────────────────────────────────────────── */
.chat {
  margin: 64px auto 0;
  max-width: 780px;
  display: flex; flex-direction: column; gap: 14px;
  text-align: left;
}
.bubble {
  border-radius: var(--r);
  padding: 16px 22px;
  font-size: 15.5px;
  line-height: 1.5;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  max-width: 78%;
}
.bubble.user {
  align-self: flex-end;
  background: var(--glass-hi);
  color: var(--ink);
  border-bottom-right-radius: 6px;
  min-width: 56px;
  min-height: 52px;
}
.caret {
  display: inline-block;
  width: 2px; height: 1.05em;
  background: var(--ink);
  margin-left: 2px;
  vertical-align: -0.15em;
  animation: caret-blink 0.85s steps(1) infinite;
}
.caret.off { display: none; }
@keyframes caret-blink { 50% { opacity: 0; } }

.bubble.agent .w { opacity: 0; }
.bubble.agent .w.on { opacity: 1; transition: opacity 0.32s ease-out; }
.bubble.agent {
  align-self: flex-start;
  background: var(--glass);
  border-color: rgba(52, 211, 153, 0.22);
  box-shadow: 0 0 34px rgba(52, 211, 153, 0.07);
  border-bottom-left-radius: 6px;
}
.bubble.agent strong { color: var(--green); font-weight: 600; }

.bubble.typing { display: none; padding: 18px 22px; gap: 5px; }
.bubble.typing.show { display: inline-flex; }
.tdot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-dim);
  animation: tblink 1.1s infinite;
}
.tdot:nth-child(2) { animation-delay: 0.18s; }
.tdot:nth-child(3) { animation-delay: 0.36s; }
@keyframes tblink { 0%, 70%, 100% { opacity: 0.25; } 35% { opacity: 1; } }

/* ─── rows ────────────────────────────────────────────────────────── */
.rows {
  margin: 44px auto 0;
  max-width: 960px;
  display: flex; flex-direction: column; gap: 14px;
  text-align: left;
}
.row {
  display: flex; align-items: center; gap: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 32px rgba(0,0,0,0.35),
              0 0 26px rgba(255,255,255,0.028);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.row:hover {
  border-color: var(--glass-hi);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 0 40px rgba(255,255,255,0.05);
}
.p-img { width: 64px; height: 64px; border-radius: 12px; flex: none; }
.p-info { width: 172px; flex: none; }
.p-info h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.p-info p { font-size: 12.5px; color: var(--ink-dim); margin-top: 3px; }

.chips { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 6px 10px 6px 6px;
  color: var(--ink-dim);
  font-family: var(--sans); font-size: 12.5px;
  cursor: pointer;
  transition: all 0.22s;
}
.chip:hover { border-color: var(--line); color: var(--ink); transform: translateY(-1px); }
.chip.optimal {
  border-color: rgba(52, 211, 153, 0.45);
  background: var(--green-soft);
  color: var(--ink);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.16);
}
.c-img { width: 26px; height: 26px; border-radius: 6px; flex: none; }
.c-brand { font-weight: 500; white-space: nowrap; }
.c-price { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.chip.optimal .c-price { color: var(--green); }
.grade {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  border-radius: 6px; padding: 2px 6px; white-space: nowrap;
}
.g-a { color: var(--green); background: rgba(52, 211, 153, 0.12); }
.g-b { color: #d5c896; background: rgba(213, 200, 150, 0.10); }
.g-c { color: var(--ink-dim); background: rgba(255, 255, 255, 0.06); }

.p-side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  flex: none; width: 92px;
}
.p-price { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.more {
  background: none; border: 1px solid transparent; border-radius: 8px;
  color: var(--ink-faint); font-size: 12.5px; font-family: var(--sans);
  padding: 4px 10px; cursor: pointer; transition: all 0.2s;
  text-decoration: none; display: inline-block;
}
.more:hover { color: var(--ink); border-color: var(--line); }

.row.pantry { opacity: 0.4; }
.row.pantry.anim { opacity: 0; }        /* animation start state override */
.row.pantry.in { opacity: 0.4; }
.pantry-note { font-style: italic; }

/* ─── tagline / summary ──────────────────────────────────────────── */
.tagline {
  margin-top: 36px;
  color: var(--ink-dim);
  font-size: 15px;
  letter-spacing: 0.01em;
}

.summary {
  margin: 28px auto 0;
  max-width: 960px;
  display: flex; align-items: center; gap: 24px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 26px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 48px rgba(52, 211, 153, 0.06);
  text-align: left;
}
.s-total { display: flex; align-items: baseline; gap: 12px; flex: none; }
.s-big { font-size: 22px; font-weight: 500; }
.s-big strong { font-family: var(--mono); font-weight: 700; }
.s-note { color: var(--ink-dim); font-size: 13px; }
.s-save { flex: 1; color: var(--ink-dim); font-size: 14.5px; }
.s-save s { color: var(--ink-faint); margin: 0 4px; }
.s-saved { margin-left: 10px; color: var(--ink); }
.s-saved strong { color: var(--green); font-family: var(--mono); }
.order {
  flex: none;
  background: var(--green);
  color: #05130d;
  border: none; border-radius: 12px;
  font-family: var(--sans); font-size: 15.5px; font-weight: 700;
  padding: 13px 38px;
  cursor: pointer;
  box-shadow: 0 0 28px rgba(52, 211, 153, 0.35);
  transition: all 0.25s;
}
.order:hover { box-shadow: 0 0 44px rgba(52, 211, 153, 0.55); transform: translateY(-1px); }

.footnote {
  margin-top: 26px;
  color: var(--ink-faint);
  font-size: 13.5px;
}

/* ─── replay + status ─────────────────────────────────────────────── */
.replay {
  position: absolute; right: 32px; bottom: -6px;
  background: none; border: 1px solid var(--line-soft); border-radius: 999px;
  color: var(--ink-faint); font-family: var(--mono); font-size: 12px;
  padding: 6px 14px; cursor: pointer; transition: all 0.2s;
}
.replay:hover { color: var(--ink); border-color: var(--line); }

.status {
  margin: 70px auto 0;
  max-width: 1180px;
  padding: 18px 32px 26px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-dim); font-family: var(--mono); font-size: 12px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.stats { margin-left: auto; color: var(--ink-faint); }

/* the reel hands off to the product page: fade out rather than cut, so the
   next page (same black) reads as one continuous shot */
body.leaving { opacity: 0; transition: opacity 0.5s ease-in; }

/* while the reel plays the page is a screening: no selection, no pointer
   affordances — JS blocks the events, this kills the visual invitations */
body.playing { user-select: none; -webkit-user-select: none; }
body.playing * { cursor: default !important; }

/* ─── the agent's cursor ──────────────────────────────────────────── */
/* a phantom pointer that opens the product page itself: the demo must feel
   like the agent is driving, so nobody is ever asked to click anything */
.fake-cursor {
  position: fixed; left: 0; top: 0; z-index: 60;
  width: 22px; height: 22px;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.65));
}
.fake-cursor.on { opacity: 1; }
.fake-cursor svg { display: block; width: 100%; height: 100%; transition: transform 0.12s; }
.fake-cursor.press svg { transform: scale(0.84); transform-origin: 5px 4px; }
.cursor-ripple {
  position: fixed; z-index: 59;
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid rgba(52, 211, 153, 0.8);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: cursor-ripple 0.55s ease-out forwards;
}
@keyframes cursor-ripple {
  to { width: 48px; height: 48px; opacity: 0; }
}
.more.pressed {
  color: var(--ink);
  border-color: rgba(52, 211, 153, 0.5);
  background: var(--green-soft);
}

/* ─── iris: the window snaps shut into a square ───────────────────── */
/* a hole in a full-screen curtain shrinks onto the viewport centre; the
   square it leaves is picked up by preview.html as the demo card */
.iris {
  position: fixed; left: 50%; top: 50%; z-index: 70;
  width: 240vmax; height: 240vmax;
  transform: translate(-50%, -50%);
  border-radius: 28px;
  box-shadow: 0 0 0 240vmax #050505;
  pointer-events: none;
  transition: width 0.45s cubic-bezier(0.7, 0, 0.85, 0.6),
              height 0.45s cubic-bezier(0.7, 0, 0.85, 0.6);
}
.iris.shut { width: 300px; height: 300px; }
.iris::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 28px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  box-shadow: 0 0 70px rgba(52, 211, 153, 0.25);
  opacity: 0;
  transition: opacity 0.25s 0.28s;
}
.iris.shut::after { opacity: 1; }
.logo-flash {
  position: fixed; left: 50%; top: 50%; z-index: 71;
  width: 84px; height: 84px;
  transform: translate(-50%, -50%) scale(0.8);
  color: var(--green);
  opacity: 0;
  transition: opacity 0.4s ease-out, transform 0.5s var(--bubble-ease);
  pointer-events: none;
}
.logo-flash.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ─── embed mode: the page runs as a looping demo inside an iframe ──── */
/* page chrome goes away, scrollbars hide (scrolling still works), and the
   aurora stops animating — two live auroras (parent + iframe) is exactly
   the kind of compositor load that used to black out screenshots */
html.embed { scrollbar-width: none; }
html.embed::-webkit-scrollbar { display: none; }
html.embed .nav, html.embed .status, html.embed .replay { display: none; }
html.embed .aurora { animation: none; }

/* ─── intro: the logo alone in the dark, then the world fades in ──── */
/* while html.intro is set, the page itself is invisible */
html.intro .bg, html.intro .nav, html.intro .status,
html.intro .orbit-bg, html.intro .headline, html.intro .subline,
html.intro .replay { opacity: 0; }

.intro-veil {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 26px;
  pointer-events: none;
}
html:not(.intro) .intro-veil { display: none; }
.intro-halo {
  position: absolute;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.13), transparent 68%);
  opacity: 0;
  animation: intro-fade 1.6s ease-out 0.3s forwards;
}
.intro-logo {
  width: 200px; height: 200px;
  opacity: 0;
  animation: intro-appear 0.9s ease-out 0.12s forwards;
}
/* the orbit draws itself, then the satellite joins the lap */
.intro-draw {
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: intro-draw 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.25s forwards;
}
.intro-sat { opacity: 0; animation: intro-fade 0.5s ease-out 1.3s forwards; }
.intro-word {
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  letter-spacing: 0.5em; margin-left: 0.5em; /* recentre the tracking */
  color: var(--ink);
  opacity: 0;
  animation: intro-fade 0.9s ease-out 1.15s forwards;
}
@keyframes intro-fade { to { opacity: 1; } }
@keyframes intro-appear {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes intro-draw { to { stroke-dashoffset: 0; } }

/* stage 2 (html.intro-go): the veil dissolves, the page assembles behind
   it — aurora first, then the backdrop orbit (the logo "settles" into it),
   then the words, then the chrome */
html.intro-go .intro-veil {
  opacity: 0; transform: scale(1.05);
  transition: opacity 0.95s ease 0.1s, transform 1.3s ease 0.1s;
}
html.intro-go .bg       { opacity: 1; transition: opacity 2.6s ease 0.15s; }
html.intro-go .orbit-bg { opacity: 1; transition: opacity 2s ease 0.35s; }
html.intro-go .headline { opacity: 1; transition: opacity 1.3s ease 1s; }
html.intro-go .subline  { opacity: 1; transition: opacity 1.3s ease 1.25s; }
html.intro-go .nav      { opacity: 1; transition: opacity 1s ease 1.5s; }
html.intro-go .status,
html.intro-go .replay   { opacity: 1; transition: opacity 1s ease 1.7s; }

/* ─── animation states ────────────────────────────────────────────── */
/* translate only — never scale: scaling re-rasterises text and reads as a
   jarring "pop" in size as each block settles */
.anim {
  opacity: 0;
  transform: translateY(46px);
}
.anim.in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s ease-out, transform 0.7s var(--bubble-ease);
}
.bubble.user.anim { transform: translateY(18px); }
.bubble.agent.anim { transform: translateY(18px); }
.tagline.anim, .footnote.anim { transform: translateY(14px); }

@media (prefers-reduced-motion: reduce) {
  .anim { opacity: 1 !important; transform: none !important; transition: none !important; }
  .aurora { animation: none !important; }
}

/* ─── responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .row { flex-wrap: wrap; }
  .p-info { width: auto; flex: 1; }
  .chips { order: 3; width: 100%; }
  .p-side { flex-direction: row; align-items: center; width: auto; margin-left: auto; }
  .summary { flex-wrap: wrap; }
  .s-save { width: 100%; order: 3; }
}
