/* ---------- tokens ---------- */
:root {
  --bg-0: #f7f4ff;
  --ink-0: #1a0f33;
  --ink-1: #2b1a4d;
  --ink-2: #5b4d7a;
  --ink-3: #8b7fae;
  --line: rgba(76, 29, 149, 0.10);
  --line-strong: rgba(76, 29, 149, 0.18);
  --primary: #6d28d9;
  --primary-2: #7c3aed;
  --primary-3: #a855f7;
  --primary-4: #c084fc;
  --primary-deep: #4c1d95;
  --grad: linear-gradient(135deg, #4c1d95 0%, #7c3aed 45%, #a855f7 75%, #c084fc 100%);
  --shadow-sm: 0 1px 2px rgba(76, 29, 149, 0.06), 0 2px 6px rgba(76, 29, 149, 0.04);
  --shadow-md: 0 4px 12px rgba(76, 29, 149, 0.08), 0 12px 32px rgba(76, 29, 149, 0.10);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 220ms;
  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-body: 'Inter', 'Bricolage Grotesque', system-ui, -apple-system, Segoe UI, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink-1);
  background: var(--bg-0);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- mesh background ---------- */
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  background:
    radial-gradient(40% 50% at 15% 20%, rgba(168, 85, 247, 0.18), transparent 60%),
    radial-gradient(35% 45% at 85% 15%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(50% 50% at 80% 85%, rgba(192, 132, 252, 0.20), transparent 60%),
    radial-gradient(45% 45% at 10% 90%, rgba(76, 29, 149, 0.14), transparent 60%),
    var(--bg-0);
  filter: saturate(1.05);
  animation: meshShift 22s ease-in-out infinite alternate;
  z-index: -3;
}
@keyframes meshShift {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(-1.5%, 1%) scale(1.03); }
  100% { transform: translate(1.5%, -1%) scale(1.02); }
}

/* ---------- grid overlay ---------- */
.grid-overlay {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(to right, rgba(76, 29, 149, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(76, 29, 149, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, rgba(0,0,0,0.6), transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, rgba(0,0,0,0.6), transparent 80%);
  z-index: -2;
  pointer-events: none;
}

/* ---------- cursor spotlight ---------- */
.spotlight {
  position: fixed;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.18), transparent 60%);
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
  left: 50%; top: 40%;
  z-index: -1;
  transition: opacity 400ms ease;
  mix-blend-mode: multiply;
  will-change: transform;
}

/* ---------- orbs ---------- */
.orbs {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}
.orb-1 { width: 320px; height: 320px; background: #c084fc; top: -80px; left: -60px; animation: float1 16s ease-in-out infinite alternate; }
.orb-2 { width: 260px; height: 260px; background: #7c3aed; bottom: -90px; right: 8%; animation: float2 19s ease-in-out infinite alternate; }
.orb-3 { width: 200px; height: 200px; background: #a855f7; top: 30%; right: -60px; animation: float3 22s ease-in-out infinite alternate; opacity: 0.4; }
.orb-4 { width: 180px; height: 180px; background: #d8b4fe; bottom: 20%; left: 18%; animation: float4 25s ease-in-out infinite alternate; opacity: 0.5; }
@keyframes float1 { from { transform: translate(0,0) scale(1); } to { transform: translate(40px,30px) scale(1.1); } }
@keyframes float2 { from { transform: translate(0,0) scale(1); } to { transform: translate(-30px,-20px) scale(1.08); } }
@keyframes float3 { from { transform: translate(0,0); } to { transform: translate(-20px,40px); } }
@keyframes float4 { from { transform: translate(0,0); } to { transform: translate(50px,-30px); } }

/* ---------- stage (constrained to ~70vw on desktop) ---------- */
.stage {
  position: relative;
  width: 100%;
  max-width: min(70vw, 1280px);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(18px, 2.2vh, 32px) 0;
  z-index: 1;
}

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.logo {
  height: clamp(28px, 2.6vw, 36px);
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 18px rgba(124, 58, 237, 0.18));
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
.brand:hover .logo { transform: translateY(-1px); filter: drop-shadow(0 6px 22px rgba(124, 58, 237, 0.28)); }

.live {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: pulseDot 1.8s ease-out infinite;
}
@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* live pill attached to the diagram */
.live-attached {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  white-space: nowrap;
  animation: chipFloat 6s ease-in-out infinite alternate;
}
.live-connector {
  position: absolute;
  top: 24px;
  left: 50%;
  width: 1px;
  height: 36px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    to bottom,
    var(--primary-3) 0 3px,
    transparent 3px 7px
  );
  opacity: 0.55;
  z-index: 3;
  pointer-events: none;
}
.live-connector::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary-3);
  transform: translateX(-50%);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  padding: clamp(12px, 3vh, 32px) 0;
}

/* ---------- text column ---------- */
.hero-text { display: flex; flex-direction: column; gap: clamp(16px, 2.4vh, 26px); max-width: 600px; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.badge svg { color: var(--primary-3); }

.headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 5.4vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  color: var(--ink-0);
  margin: 0;
  font-variation-settings: "opsz" 96;
}
.headline .line { display: block; }
.headline .word {
  display: inline-block;
}
.headline .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 400;
  letter-spacing: -0.012em;
}

.sub {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0;
  max-width: 56ch;
}
.sub .accent {
  color: var(--ink-0);
  font-weight: 500;
}

/* ---------- hint row ---------- */
.hint {
  display: inline-flex; align-items: center; gap: 12px;
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hint-line {
  width: 36px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-3));
}

/* ---------- art column ---------- */
.art { position: relative; aspect-ratio: 1 / 1; max-width: 480px; justify-self: end; width: 100%; }
.art-stage { position: relative; width: 100%; height: 100%; }
.halo {
  position: absolute; inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.22), transparent 65%);
  filter: blur(20px);
  animation: haloPulse 5s ease-in-out infinite;
}
@keyframes haloPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50%      { transform: scale(1.06); opacity: 1; }
}

.diagram {
  position: relative;
  width: 100%; height: 100%;
  z-index: 1;
}
.ring-outer { transform-origin: 250px 250px; animation: spin 60s linear infinite; }
.ring-mid   { transform-origin: 250px 250px; animation: spinR 38s linear infinite; }
.ring-inner { transform-origin: 250px 250px; animation: spin 24s linear infinite; }
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes spinR { to { transform: rotate(-360deg); } }

.core-glow {
  transform-origin: 250px 250px;
  transform-box: fill-box;
  animation: corePulse 4s ease-in-out infinite;
}
@keyframes corePulse {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.08); opacity: 1; }
}

.centerpiece {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 42%;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  animation: centerFloat 6s ease-in-out infinite;
}
.centerpiece-logo {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(124, 58, 237, 0.35));
}
@keyframes centerFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-6px); }
}

.p { animation: drift 8s ease-in-out infinite alternate; opacity: 0.7; }
.p1 { animation-duration: 7s; }
.p2 { animation-duration: 9s; animation-delay: 0.6s; }
.p3 { animation-duration: 11s; animation-delay: 1.2s; }
.p4 { animation-duration: 8s;  animation-delay: 0.4s; }
.p5 { animation-duration: 12s; animation-delay: 1.8s; }
.p6 { animation-duration: 10s; animation-delay: 2.2s; }
@keyframes drift {
  from { transform: translate(0,0); }
  to   { transform: translate(12px,-14px); }
}

.scan { animation: scan 3.5s ease-in-out infinite; transform-origin: 250px 250px; }
@keyframes scan {
  0%, 100% { transform: translateY(-160px); opacity: 0; }
  10%      { opacity: 0.6; }
  50%      { transform: translateY(0); opacity: 0.6; }
  90%      { opacity: 0.6; }
}

/* floating chips around the art */
.chip {
  position: absolute;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-1);
  box-shadow: var(--shadow-md);
  animation: chipFloat 6s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
  z-index: 3;
  white-space: nowrap;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.chip-a { top: 6%;  left: -8%; }
.chip-b { top: 48%; right: -10%; }
.chip-c { bottom: 8%; left: 4%; }
@keyframes chipFloat {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}

/* ---------- footer ---------- */
.foot {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 16px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.copy { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: revealIn 800ms var(--ease) forwards;
  animation-delay: calc(var(--delay, 0) * 1ms);
}
@keyframes revealIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .stage { max-width: 78vw; }
}
@media (max-width: 1024px) {
  .stage { max-width: 88vw; }
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .art { max-width: 340px; justify-self: center; order: -1; }
  .chip-a { top: 4%; left: 2%; }
  .chip-b { top: 50%; right: 0; }
  .chip-c { bottom: 4%; left: 4%; }
  body { overflow-y: auto; }
}

@media (max-width: 768px) {
  .stage { max-width: 100%; padding: 18px 22px; }
  .hero { padding: 8px 0; gap: 14px; }
  .art { max-width: 260px; }
  .chip { font-size: 11px; padding: 5px 10px; }
}

@media (max-width: 480px) {
  .headline { font-size: clamp(30px, 9vw, 44px); }
  .art { max-width: 220px; }
  .chip-a, .chip-b, .chip-c { display: none; }
  .live-attached { font-size: 10px; padding: 6px 10px; letter-spacing: 0.1em; }
  .live-connector { height: 24px; top: 22px; }
}

@media (max-width: 360px) {
  .stage { padding: 14px 16px; }
  .sub { font-size: 14px; }
}

/* ---------- a11y: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  body::before { animation: none; }
}
