/* =========================================================
   EDGE TRANSFORMATION — Premium Space-Tech Studio
   Design tokens + global styles
   ========================================================= */

:root {
  /* Core palette */
  --bg:            #080012;
  --bg-2:          #0B001A;
  --deep-purple:   #1A0033;
  --violet:        #7C3AED;
  --neon-violet:   #A855F7;
  --accent:        #C084FC;
  --white:         #FFFFFF;

  --text:          rgba(255,255,255,0.92);
  --text-soft:     rgba(255,255,255,0.82);
  --text-muted:    rgba(255,255,255,0.58);
  --text-faint:    rgba(255,255,255,0.38);

  --glass:         rgba(255,255,255,0.06);
  --glass-2:       rgba(255,255,255,0.04);
  --border:        rgba(255,255,255,0.12);
  --border-soft:   rgba(255,255,255,0.07);

  --glow:          0 0 60px rgba(168,85,247,0.35);
  --glow-soft:     0 0 40px rgba(124,58,237,0.25);

  --font-display: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
  --font-body:    'Manrope', system-ui, sans-serif;
  --font-mono:    'Space Mono', ui-monospace, monospace;

  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 22px;
  --radius-lg: 32px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  position: relative;
}

::selection { background: rgba(168,85,247,0.4); color: #fff; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* =========================================================
   Layout helpers
   ========================================================= */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(90px, 12vh, 170px);
  z-index: 2;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-violet));
}

.section-title {
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  max-width: 18ch;
}
.section-lead {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  max-width: 56ch;
  margin-top: 22px;
}

/* =========================================================
   Cosmic background layers (fixed)
   ========================================================= */
.cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 80% -10%, rgba(124,58,237,0.18), transparent 55%),
    radial-gradient(90% 60% at 10% 110%, rgba(168,85,247,0.14), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 45%, #06000F 100%);
}
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.nebula {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
  mix-blend-mode: screen;
  will-change: transform;
}
.nebula.n1 {
  width: 60vw; height: 60vw; top: -10vw; right: -12vw;
  background: radial-gradient(circle, rgba(124,58,237,0.55), transparent 65%);
}
.nebula.n2 {
  width: 50vw; height: 50vw; bottom: -8vw; left: -10vw;
  background: radial-gradient(circle, rgba(168,85,247,0.4), transparent 65%);
}

/* Mouse-follow glow */
#cursor-glow {
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,85,247,0.10), transparent 60%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  transition: opacity .4s;
  will-change: left, top;
}

/* Film grain */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 60;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-2%, 4%); }
  80% { transform: translate(4%, -2%); }
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s;
  white-space: nowrap;
  will-change: transform;
}
.btn .arrow { transition: transform .35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-primary {
  background: linear-gradient(135deg, var(--neon-violet), var(--violet));
  color: #fff;
  box-shadow: 0 10px 40px rgba(124,58,237,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-primary:hover {
  box-shadow: 0 14px 60px rgba(168,85,247,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(12px);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(168,85,247,0.5);
}

/* =========================================================
   Glass card base
   ========================================================= */
.glass {
  background: var(--glass);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* =========================================================
   Reveal animation (scroll)
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .grain, .nebula { animation: none !important; }
}
