@import url('assets/tokens.css');

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes float1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(40px,-30px); } }
@keyframes float2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-30px,40px); } }
@keyframes float3 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(20px,-50px); } }
@keyframes gradient-shift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@keyframes glow-breathe { 0%,100% { box-shadow: 0 0 30px rgba(124,106,255,0.25); } 50% { box-shadow: 0 0 60px rgba(124,106,255,0.5); } }
@keyframes pulse-ring { 0% { transform: scale(0.8); opacity: 0.7; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes type-blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }
@keyframes count-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hover-rise { from { transform: translateY(0); } to { transform: translateY(-3px); } }

/* ============================================================
   Base
   ============================================================ */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
:root { color-scheme: dark; }

/* anchored sections clear the fixed nav */
section[id], header { scroll-margin-top: 84px; }

/* Skip link (a11y) */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  background: #7c6aff; color: white; padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  transform: translateY(-200%); transition: transform .2s var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* Focus visible for keyboard users */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0c0a14; }
::-webkit-scrollbar-thumb { background: rgba(124,106,255,0.25); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,106,255,0.45); }

/* ============================================================
   Utility classes Tailwind doesn't generate (custom tokens)
   ============================================================ */
.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }
.font-mono    { font-family: var(--font-mono); }

.text-text1 { color: var(--color-text1); }
.text-text2 { color: var(--color-text2); }
.text-text3 { color: var(--color-text3); }
.text-accent  { color: var(--color-accent); }
.text-accent2 { color: var(--color-accent2); }
.text-accent3 { color: var(--color-accent3); }

.bg-bg { background: var(--color-bg); }
.bg-surface { background: var(--color-surface); }
.bg-surface2 { background: var(--color-surface2); }
.bg-surface3 { background: var(--color-surface3); }

.tabular-nums { font-variant-numeric: tabular-nums; }

.gradient-text {
  background-image: linear-gradient(135deg, #7c6aff 0%, #e879f9 40%, #06d6a0 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradient-shift 8s ease infinite;
}

/* ============================================================
   Status dot — calmer pulse, lower repaint cost
   ============================================================ */
.status-dot {
  width: 6px; height: 6px; border-radius: 9999px;
  background: var(--color-accent3);
  position: relative; flex-shrink: 0;
}
.status-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 9999px;
  border: 2px solid rgba(6,214,160,0.45);
  animation: pulse-ring 2.4s ease-out infinite;
  pointer-events: none;
}

/* ============================================================
   Reveal — passthrough by default
   ============================================================ */
.reveal { opacity: 1; transform: none; }
.reveal.reveal-pre { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.reveal-pre.in { opacity: 1; transform: translateY(0); }

/* ============================================================
   Featured pricing — breathing glow
   ============================================================ */
.pricing-featured {
  border-color: rgba(124,106,255,0.35) !important;
  animation: glow-breathe 4s ease-in-out infinite;
}

/* ============================================================
   Hero — responsive brain envelope
   ============================================================ */
/* Magnetic button: avoid stretching on small viewports */
@media (max-width: 480px) {
  .hero-cta a, .hero-cta .inline-flex { min-width: 0; padding-left: 18px; padding-right: 18px; font-size: 14px; }
}

/* Section padding on mobile */
@media (max-width: 640px) {
  section[id] > div, section.relative > div { padding-left: 18px; padding-right: 18px; }
}
.hero { padding-top: 110px; padding-bottom: 0; }
.hero-stage {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  height: clamp(620px, 62vw, 760px);
  position: relative;
  contain: layout style;
}
.hero-inner { padding: 64px 32px; }
.hero-title {
  font-size: clamp(48px, 8vw, 104px);
  margin-top: 14px;
  text-wrap: balance;
}
.hero-sub {
  font-size: clamp(20px, 3vw, 36px);
  max-width: 760px;
  padding: 0 12px;
  margin-top: 10px;
  text-wrap: balance;
}
.hero-lead {
  font-size: clamp(15px, 1.5vw, 18px);
  max-width: 620px;
  margin-top: 18px;
  text-wrap: pretty;
}
.hero-cta { margin-top: 28px; }

@media (max-width: 1024px) {
  .hero-stage { height: clamp(620px, 78vw, 760px); }
}
@media (max-width: 768px) {
  .hero { padding-top: 78px; }
  .hero-stage { height: clamp(640px, 110vw, 800px); padding: 0 8px; }
  .hero-inner { padding: 32px 18px; }
  .hero-lead { max-width: 92%; }
}
@media (max-width: 480px) {
  .hero-stage { height: clamp(600px, 145vw, 740px); }
  .hero-inner { padding: 24px 12px; }
  .hero-title { font-size: clamp(40px, 13vw, 64px); }
  .hero-sub { font-size: clamp(17px, 5.4vw, 22px); }
  .hero-lead { font-size: 14.5px; line-height: 1.55; }
}

/* Stat strip cards: subtle hover lift */
.stat-card {
  transition: transform .25s var(--ease-out), border-color .25s var(--ease-out);
  will-change: transform;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(124,106,255,0.22); }

/* ============================================================
   Comparison table — responsive grid
   ============================================================ */
.cmp-table { display: grid; grid-template-columns: 1.7fr 1fr 1fr; }
.cmp-table > * { padding: 16px 20px; }
.cmp-row { display: contents; }
.cmp-row:hover > .cmp-cell { background: rgba(124,106,255,0.03); }
.cmp-cell { transition: background .15s linear; }

@media (max-width: 640px) {
  .cmp-table { grid-template-columns: 1.4fr 0.7fr 0.7fr; font-size: 13px; }
  .cmp-table > * { padding: 14px 12px; }
}

/* ============================================================
   Pricing cards — even heights
   ============================================================ */
.price-row { display: grid; gap: 20px; }
@media (min-width: 768px) { .price-row { grid-template-columns: 1fr 1fr 1fr; } }
.price-card { display: flex; flex-direction: column; }
.price-card > .price-features { margin-top: auto; }
.price-card .price-desc { min-height: 0; }
@media (min-width: 768px) { .price-card .price-desc { min-height: 80px; } }

/* ============================================================
   Mobile nav menu — slide
   ============================================================ */
.mobile-menu {
  overflow: hidden;
  animation: count-up .25s var(--ease-out);
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Architecture section — sci-fi 3-column visual
   ============================================================ */
.arch-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.2fr) minmax(260px, 1fr);
  gap: 32px;
  align-items: center;
}
@media (max-width: 1024px) {
  .arch-grid { grid-template-columns: 1fr; gap: 28px; }
  .arch-core-wrap { order: -1; }
}
.arch-stages { display: grid; gap: 14px; }
.arch-stage {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(18,16,30,0.7), rgba(18,16,30,0.4));
  border: 1px solid rgba(255,255,255,0.07);
  position: relative;
  overflow: hidden;
  transition: transform .25s var(--ease-out), border-color .25s var(--ease-out);
}
.arch-stage::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--stage-color, #7c6aff), transparent);
  opacity: 0.85;
}
.arch-stage:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.14); }
.arch-stage-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(18,16,30,0.95);
  border: 1px solid rgba(124,106,255,0.30);
  box-shadow: 0 0 18px rgba(124,106,255,0.20);
}
.arch-stage-body { display: grid; gap: 4px; min-width: 0; }
.arch-stage-n { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.15em; color: rgba(255,255,255,0.4); }
.arch-stage-t { font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: rgba(255,255,255,0.95); line-height: 1.25; }
.arch-stage-d { font-size: 12.5px; color: rgba(255,255,255,0.6); line-height: 1.45; }

.arch-core-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.arch-core { position: relative; width: clamp(220px, 26vw, 320px); aspect-ratio: 1 / 1; }
.arch-core-aura {
  position: absolute; inset: -22%; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,106,255,0.45) 0%, rgba(232,121,249,0.18) 40%, transparent 70%);
  filter: blur(24px);
  animation: arch-pulse 4s ease-in-out infinite;
}
@keyframes arch-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.06); opacity: 1; }
}
.arch-core-rings { position: absolute; inset: 0; width: 100%; height: 100%; }
.arch-core-chip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.arch-core-chip-inner {
  width: 44%; aspect-ratio: 1/1; border-radius: 22%;
  background: linear-gradient(135deg, #1a1828, #0c0a14);
  border: 1px solid rgba(196,184,255,0.45);
  box-shadow: 0 0 40px rgba(124,106,255,0.45), inset 0 1px 0 rgba(255,255,255,0.12);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
}
.arch-core-chip-label {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(20px, 2.6vw, 32px);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #c4b8ff, #7aebcb);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.arch-core-chip-sub { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.3em; color: rgba(255,255,255,0.55); }
.arch-core-caption { font-size: 10px; letter-spacing: 0.18em; color: rgba(255,255,255,0.5); text-align: center; max-width: 280px; }

.arch-spheres { display: grid; gap: 14px; align-content: start; }
.arch-sphere-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; color: rgba(255,255,255,0.45); text-transform: uppercase; margin-bottom: 2px; }
.arch-sphere {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 14px; border-radius: 14px;
  background: rgba(18,16,30,0.55);
  border: 1px solid rgba(255,255,255,0.07);
  position: relative; overflow: hidden;
  transition: transform .25s var(--ease-out), border-color .25s;
}
.arch-sphere:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.15); }
.arch-sphere::before {
  content: ""; position: absolute; inset: 0 0 0 auto; width: 3px;
  background: linear-gradient(180deg, var(--sphere-color, #7c6aff), transparent);
}
.arch-sphere-orb { width: 52px; height: 52px; flex-shrink: 0; }
.arch-sphere-name { font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: rgba(255,255,255,0.95); }
.arch-sphere-projects { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.arch-sphere-chip {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 2px 7px; border-radius: 99px;
  background: rgba(124,106,255,0.10);
  border: 1px solid rgba(124,106,255,0.30);
  color: rgba(255,255,255,0.78);
}
.arch-pipes {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(124,106,255,0.10), transparent 55%);
  z-index: 0;
}
.arch-grid > * { position: relative; z-index: 1; }
.arch-pipe { display: none; }

@media (max-width: 640px) {
  .arch-stage { padding: 12px; }
  .arch-stage-icon { width: 34px; height: 34px; }
  .arch-stage-t { font-size: 14px; }
  .arch-core { width: clamp(200px, 60vw, 260px); }
}

/* ============================================================
   Architecture — tiered hologram core (override of .arch-core)
   ============================================================ */
.arch-stack {
  position: relative;
  width: clamp(280px, 32vw, 400px);
  aspect-ratio: 1 / 1.55;
  display: flex; flex-direction: column; align-items: center;
}
.arch-stack .arch-core-aura {
  position: absolute; top: 0; left: 0; right: 0; aspect-ratio: 1 / 1;
  inset: auto; width: 100%; height: auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,106,255,0.55) 0%, rgba(232,121,249,0.20) 40%, transparent 70%);
  filter: blur(28px); animation: arch-pulse 4s ease-in-out infinite;
}
.arch-stack-orb {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
}
.arch-stack-orb .arch-core-rings { position: absolute; inset: 0; width: 100%; height: 100%; }
.arch-stack-label {
  position: absolute; bottom: 12%; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -0.02em;
  background: linear-gradient(135deg, #c4b8ff, #7aebcb);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 18px rgba(124,106,255,0.5);
  white-space: nowrap;
}
.arch-stack-beam {
  position: absolute; top: 52%; bottom: 0; left: 50%;
  width: 2px; transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(124,106,255,0.0), rgba(124,106,255,0.6) 10%, rgba(232,121,249,0.6) 50%, rgba(6,214,160,0.6) 90%, transparent);
  filter: blur(1px); opacity: 0.7; z-index: 0;
}
.arch-stack-tiers {
  position: relative; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: -8px; z-index: 1;
}
.arch-stack-tier {
  width: 96%; position: relative;
  animation: arch-tier-rise 0.8s cubic-bezier(0.16,1,0.3,1) backwards;
}
@keyframes arch-tier-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.arch-stack-tier-ring {
  position: relative; width: 100%; aspect-ratio: 4.5 / 1;
}
.arch-stack-tier-disk {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--tier-color), transparent 70%);
  opacity: 0.22; filter: blur(8px);
}
.arch-stack-tier-edge {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--tier-color);
  box-shadow: 0 0 22px var(--tier-color), inset 0 0 12px color-mix(in oklab, var(--tier-color) 50%, transparent);
  opacity: 0.75; animation: arch-tier-pulse 3.4s ease-in-out infinite;
}
@keyframes arch-tier-pulse {
  0%, 100% { box-shadow: 0 0 14px var(--tier-color), inset 0 0 10px color-mix(in oklab, var(--tier-color) 40%, transparent); }
  50%      { box-shadow: 0 0 30px var(--tier-color), inset 0 0 18px color-mix(in oklab, var(--tier-color) 60%, transparent); }
}
.arch-stack-tier-particles {
  position: absolute; inset: 0; overflow: hidden; border-radius: 50%;
}
.arch-stack-tier-particles span {
  position: absolute; left: calc(8% + var(--p) * 11%); top: 50%;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--tier-color);
  box-shadow: 0 0 6px var(--tier-color);
  animation: arch-particle-flow 3.4s linear infinite;
  animation-delay: calc(var(--p) * -0.45s);
  opacity: 0.85;
}
@keyframes arch-particle-flow {
  0%   { transform: translate(0, -18px) scale(0.6); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translate(0, 20px) scale(0.4); opacity: 0; }
}
.arch-stack-tier-label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-mono); font-size: clamp(9px, 0.85vw, 10.5px);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 0 12px rgba(0,0,0,0.7), 0 0 4px var(--tier-color);
  white-space: nowrap; pointer-events: none;
}
@media (max-width: 1024px) {
  .arch-stack { width: clamp(280px, 78vw, 420px); }
}

/* ============================================================
   Demo chat widget
   ============================================================ */
.demo-chat {
  border-radius: 20px; overflow: hidden;
  background: rgba(12,10,20,0.92);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(12px);
  box-shadow: 0 32px 80px rgba(0,0,0,0.45), 0 0 0 1px rgba(124,106,255,0.12);
}
.demo-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(18,16,30,0.5);
}
.demo-chat-body {
  padding: 20px 18px; min-height: 340px;
  display: flex; flex-direction: column; justify-content: center;
}
.demo-start-prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 40px 0; }
.demo-start-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 12px;
  background: #7c6aff; color: white; font-size: 15px; font-weight: 600;
  border: none; cursor: pointer;
  box-shadow: 0 0 28px rgba(124,106,255,0.4);
  transition: box-shadow .2s, transform .2s;
}
.demo-start-btn:hover { box-shadow: 0 0 48px rgba(124,106,255,0.65); transform: translateY(-2px); }
.demo-messages { display: flex; flex-direction: column; gap: 14px; }
.demo-msg { display: flex; }
.demo-msg-user { justify-content: flex-end; }
.demo-msg-bot  { justify-content: flex-start; }
.demo-bubble { max-width: 88%; border-radius: 16px; padding: 12px 16px; font-size: 14px; }
.demo-bubble-user {
  background: #7c6aff; color: white;
  border-radius: 16px 16px 4px 16px; font-size: 14.5px; line-height: 1.5;
}
.demo-bubble-bot {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px 16px 16px 4px;
}
.demo-thinking { display: flex; gap: 5px; align-items: center; padding: 14px 18px; }
.demo-thinking span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(196,184,255,0.7);
  animation: demo-bounce 1.2s ease-in-out infinite;
}
.demo-thinking span:nth-child(2) { animation-delay: 0.2s; }
.demo-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes demo-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40%           { transform: translateY(-6px); opacity: 1; }
}
.demo-cursor {
  display: inline-block; width: 2px; height: 16px;
  background: rgba(255,255,255,0.9); margin-left: 2px; vertical-align: -3px;
  animation: type-blink 0.8s steps(1) infinite;
}
.demo-dots { display: flex; justify-content: center; gap: 6px; padding: 12px 0 16px; }
