/* ============================================================
   Vortx AI — Nebula Design System
   Palette extracted from the Vortx logo · Space Grotesk type
   Pure CSS · No frameworks · GitHub Pages ready
   ============================================================ */

/* --- Design Tokens (Nebula Palette) --- */
:root {
  /* Deep space backgrounds */
  --bg-primary:    #050b0a;
  --bg-secondary:  #0a1612;
  --bg-card:       #0d1f1a;
  --bg-card-hover: #122a22;
  --bg-surface:    rgba(13, 31, 26, 0.65);

  /* Text — warm cream tones from logo highlights */
  --text-primary:  #f3edd3;
  --text-secondary:#b8c49b;
  --text-muted:    #6b8563;

  /* Accent — nebula teal-green (dominant logo color) */
  --accent:        #35bb9a;
  --accent-bright: #40b895;
  --accent-dim:    rgba(53, 187, 154, 0.12);
  --accent-glow:   rgba(53, 187, 154, 0.30);

  /* Secondary — stellar gold (warm logo highlights) */
  --gold:          #e6ad65;
  --gold-dim:      rgba(230, 173, 101, 0.12);
  --gold-glow:     rgba(230, 173, 101, 0.25);

  /* Tertiary — deep emerald */
  --emerald:       #1eab92;
  --emerald-dim:   rgba(30, 171, 146, 0.15);

  --border:        rgba(184, 196, 155, 0.08);
  --border-hover:  rgba(184, 196, 155, 0.16);

  /* Typography */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body:    'Outfit', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Spacing */
  --section-y: clamp(64px, 10vw, 120px);
  --container: min(1200px, 90vw);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- Ambient Background (Nebula Glow) --- */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.30;
  will-change: transform;
}

.orb-1 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, var(--emerald) 0%, transparent 70%);
  top: -220px;
  right: -120px;
  animation: orb-drift-1 22s ease-in-out infinite;
}

.orb-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  bottom: 18%;
  left: -160px;
  animation: orb-drift-2 28s ease-in-out infinite;
}

.orb-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #469775 0%, transparent 70%);
  bottom: -120px;
  right: 18%;
  animation: orb-drift-3 24s ease-in-out infinite;
}

@keyframes orb-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-80px, 60px) scale(1.1); }
  66% { transform: translate(40px, -40px) scale(0.95); }
}

@keyframes orb-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -50px) scale(1.05); }
  66% { transform: translate(-30px, 30px) scale(0.9); }
}

@keyframes orb-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -60px) scale(1.1); }
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  transition: background 0.4s var(--ease-out), backdrop-filter 0.4s var(--ease-out);
}

.nav.scrolled {
  background: rgba(5, 11, 10, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 101;
}

.logo-gif {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.logo-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color 0.25s var(--ease-out);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--bg-primary);
  background: var(--accent);
  padding: 8px 18px;
  border-radius: 8px;
  transition: all 0.25s var(--ease-out);
}

.nav-cta:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s var(--ease-out);
}

/* --- Hero --- */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  min-height: 100vh;
  max-width: var(--container);
  margin: 0 auto;
  padding: 120px 0 80px;
  gap: 40px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(230, 173, 101, 0.18);
  padding: 8px 16px;
  border-radius: 100px;
  width: fit-content;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up 0.8s var(--ease-out) 0.2s forwards;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(42px, 6vw, 80px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  opacity: 0;
  transform: translateY(30px);
  animation: fade-up 0.8s var(--ease-out) 0.35s forwards;
}

.hero-accent {
  background: linear-gradient(135deg, var(--emerald) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
  opacity: 0;
  transform: translateY(30px);
  animation: fade-up 0.8s var(--ease-out) 0.5s forwards;
}

.hero-subtitle strong {
  color: var(--text-primary);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(30px);
  animation: fade-up 0.8s var(--ease-out) 0.65s forwards;
}

/* Globe Container */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fade-in 1.2s var(--ease-out) 0.6s forwards;
}

.globe-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
}

#globe-canvas {
  width: 100%;
  height: 100%;
}

@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  to { opacity: 1; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-hover);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.btn-lg {
  font-size: 16px;
  padding: 14px 32px;
  border-radius: 12px;
}

/* --- Sections --- */
.section {
  position: relative;
  z-index: 1;
  padding: var(--section-y) 0;
}

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  max-width: 800px;
  opacity: 0;
  transform: translateY(30px);
}

.section-desc {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 740px;
  margin-bottom: 56px;
  opacity: 0;
  transform: translateY(20px);
}

/* Visible state for scroll animations */
.is-visible .section-label,
.is-visible .section-title,
.is-visible .section-desc {
  animation: fade-up 0.7s var(--ease-out) forwards;
}

.is-visible .section-title {
  animation-delay: 0.1s;
}

.is-visible .section-desc {
  animation-delay: 0.2s;
}

/* --- Theory Section --- */
.theory {
  border-top: 1px solid var(--border);
}

.theory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.theory-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
  padding: 36px 30px;
  transition: all 0.4s var(--ease-out);
  opacity: 0;
  transform: translateY(30px);
}

.is-visible .theory-card {
  animation: fade-up 0.6s var(--ease-out) forwards;
}

.is-visible .theory-card:nth-child(1) { animation-delay: 0.15s; }
.is-visible .theory-card:nth-child(2) { animation-delay: 0.25s; }
.is-visible .theory-card:nth-child(3) { animation-delay: 0.35s; }

.theory-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.theory-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  width: 15px; height: 15px;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.theory-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  width: 15px; height: 15px;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.theory-card:hover::before,
.theory-card:hover::after {
  opacity: 0.8;
}

.theory-icon {
  color: var(--accent);
  margin-bottom: 20px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 12px;
}

.theory-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.theory-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.theory-card em {
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
}

/* --- Architecture / Diagram --- */
.architecture {
  text-align: center;
}

.architecture .section-title,
.architecture .section-desc {
  margin-left: auto;
  margin-right: auto;
}


/* --- Thesis Statement (prose block) --- */
.thesis {
  border-top: 1px solid var(--border);
}

.thesis-statement {
  max-width: 780px;
  margin-bottom: 56px;
  opacity: 0;
  transform: translateY(20px);
}

.is-visible .thesis-statement {
  animation: fade-up 0.7s var(--ease-out) 0.25s forwards;
}

.thesis-statement p {
  font-size: clamp(15px, 1.5vw, 17px);
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 20px;
}

.thesis-statement p:last-child {
  margin-bottom: 0;
}

.thesis-statement em {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}

/* --- Frontier Section --- */
.frontier {
  border-top: 1px solid var(--border);
}

.frontier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.frontier-card {
  position: relative;
  padding: 30px 24px;
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.35s var(--ease-out);
  opacity: 0;
  transform: translateY(30px);
}

.is-visible .frontier-card {
  animation: fade-up 0.6s var(--ease-out) forwards;
}

.is-visible .frontier-card:nth-child(1) { animation-delay: 0.08s; }
.is-visible .frontier-card:nth-child(2) { animation-delay: 0.14s; }
.is-visible .frontier-card:nth-child(3) { animation-delay: 0.20s; }
.is-visible .frontier-card:nth-child(4) { animation-delay: 0.26s; }
.is-visible .frontier-card:nth-child(5) { animation-delay: 0.32s; }
.is-visible .frontier-card:nth-child(6) { animation-delay: 0.38s; }
.is-visible .frontier-card:nth-child(7) { animation-delay: 0.44s; }
.is-visible .frontier-card:nth-child(8) { animation-delay: 0.50s; }

.frontier-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.3);
}

.frontier-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
  width: 10px; height: 10px;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.frontier-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  border-bottom: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  width: 10px; height: 10px;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.frontier-card:hover::before,
.frontier-card:hover::after {
  opacity: 1;
}

.frontier-icon {
  color: var(--accent);
  margin-bottom: 18px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 13px;
}

.frontier-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.frontier-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* --- Product Section (geo.qa steps) --- */
.product {
  border-top: 1px solid var(--border);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.product-step {
  position: relative;
  padding: 36px 30px;
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.4s var(--ease-out);
  opacity: 0;
  transform: translateY(30px);
}

.is-visible .product-step {
  animation: fade-up 0.6s var(--ease-out) forwards;
}

.is-visible .product-step:nth-child(1) { animation-delay: 0.1s; }
.is-visible .product-step:nth-child(2) { animation-delay: 0.2s; }
.is-visible .product-step:nth-child(3) { animation-delay: 0.3s; }

.product-step:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.product-step::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  border-top: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  width: 15px; height: 15px;
  opacity: 0.2;
  transition: opacity 0.4s;
  pointer-events: none;
}

.product-step:hover::before {
  opacity: 0.8;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.2;
  margin-bottom: 20px;
  line-height: 1;
}

.product-step h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.product-step p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- CTA Section --- */
.cta-section {
  padding-bottom: 60px;
}

.cta-box {
  text-align: center;
  padding: clamp(48px, 6vw, 80px) clamp(24px, 4vw, 64px);
  border-radius: 24px;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(53, 187, 154, 0.04) 50%, rgba(230, 173, 101, 0.03) 100%);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
}

.cta-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.cta-logo {
  margin-bottom: 24px;
}

.cta-logo img {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 24px;
  object-fit: cover;
}

.is-visible .cta-box {
  animation: fade-up 0.7s var(--ease-out) 0.15s forwards;
}

.cta-box h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.cta-box p {
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Footer --- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 60px 0 40px;
  overflow: hidden;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

.footer-left {
  min-width: 0;
}

.footer-brand {
  margin-bottom: 40px;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 12px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 80px;
  margin-bottom: 48px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--text-primary);
}

/* Footer radar canvas */
.footer-right {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.footer-radar {
  width: 240px;
  height: 240px;
  opacity: 0.7;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.footer-bottom p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   SVG Icon Animations
   ============================================================ */

@keyframes anim-orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes anim-orbit-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes anim-pendulum {
  from { transform: rotate(-15deg); }
  to { transform: rotate(15deg); }
}

@keyframes anim-pulse {
  from { opacity: 0.2; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.1); }
}

@keyframes anim-scan-h {
  from { transform: translateX(-4px); }
  to { transform: translateX(4px); }
}

@keyframes anim-scan-v {
  from { transform: translateY(-4px); }
  to { transform: translateY(4px); }
}

.anim-orbit {
  animation: anim-orbit 14s linear infinite;
  transform-origin: 50% 50%;
}

.anim-orbit-fast {
  animation: anim-orbit 8s linear infinite;
  transform-origin: 50% 50%;
}

.anim-orbit-reverse {
  animation: anim-orbit-reverse 20s linear infinite;
  transform-origin: 50% 50%;
}

.anim-pendulum {
  animation: anim-pendulum 4s ease-in-out infinite alternate;
  transform-origin: 50% 50%;
}

.anim-pulse {
  animation: anim-pulse 3s ease-in-out infinite alternate;
  transform-origin: 50% 50%;
}

.anim-pulse-fast {
  animation: anim-pulse 1.5s ease-in-out infinite alternate;
  transform-origin: 50% 50%;
}

.anim-scan-h {
  animation: anim-scan-h 3s ease-in-out infinite alternate;
}

.anim-scan-v {
  animation: anim-scan-v 3s ease-in-out infinite alternate;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 100px;
    min-height: auto;
  }

  .hero-content {
    align-items: center;
  }

  .hero-subtitle {
    max-width: 600px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

  .globe-container {
    max-width: 320px;
  }

  .theory-grid {
    grid-template-columns: 1fr;
    max-width: 540px;
    margin: 0 auto;
  }

  .frontier-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-grid {
    grid-template-columns: 1fr;
    max-width: 540px;
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 200px;
  }

  .footer-radar {
    width: 180px;
    height: 180px;
  }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    inset: 0;
    background: rgba(5, 11, 10, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out);
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: all;
  }

  .nav-links .nav-link {
    font-size: 20px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:first-child {
    transform: rotate(45deg) translate(4px, 4px);
  }

  .nav-toggle.active span:last-child {
    transform: rotate(-45deg) translate(3px, -3px);
  }

  .frontier-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }

  .footer-links {
    flex-direction: column;
    gap: 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-right {
    display: none;
  }
}

/* ============================================================
   "THE DESCENT" — Space Story Layer
   Immersive narrative effects layered on Nebula Design System
   ============================================================ */

/* --- Deep Space Canvas (stars + data beam) --- */
.space-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* --- Shooting Stars --- */
.shooting-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.shooting-star {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, rgba(243, 237, 211, 0.85), rgba(230, 173, 101, 0.4), transparent);
  opacity: 0;
  transform: rotate(-35deg);
  filter: drop-shadow(0 0 4px rgba(230, 173, 101, 0.5));
  border-radius: 1px;
}

.ss-1 {
  width: 140px;
  top: 8%;
  right: -140px;
  animation: shoot 9s ease-in 1.5s infinite;
}

.ss-2 {
  width: 90px;
  top: 32%;
  right: -90px;
  animation: shoot 13s ease-in 5s infinite;
  transform: rotate(-42deg);
}

.ss-3 {
  width: 180px;
  top: 58%;
  right: -180px;
  animation: shoot 16s ease-in 9s infinite;
  filter: drop-shadow(0 0 6px rgba(53, 187, 154, 0.4));
  background: linear-gradient(90deg, rgba(53, 187, 154, 0.8), rgba(30, 171, 146, 0.3), transparent);
  transform: rotate(-30deg);
}

@keyframes shoot {
  0%   { opacity: 0; transform: rotate(-35deg) translateX(0); }
  1%   { opacity: 1; }
  6%   { opacity: 0; transform: rotate(-35deg) translateX(-1600px); }
  100% { opacity: 0; }
}

/* --- Atmospheric Layer Transitions --- */
.atmo-layer {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 40px;
  pointer-events: none;
  margin: -20px 0;
}

.atmo-1 {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(30, 171, 146, 0.02) 30%,
    rgba(53, 187, 154, 0.04) 50%,
    rgba(30, 171, 146, 0.02) 70%,
    transparent 100%
  );
}

.atmo-2 {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(230, 173, 101, 0.02) 30%,
    rgba(230, 173, 101, 0.04) 50%,
    rgba(230, 173, 101, 0.02) 70%,
    transparent 100%
  );
}

/* --- HUD Section Labels --- */
.hud-bracket {
  color: var(--accent);
  opacity: 0.5;
  font-weight: 400;
  margin: 0 2px;
}

/* --- Hero Scan Sweep (satellite pass) --- */
.hero {
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    transparent 44%,
    rgba(53, 187, 154, 0.025) 47%,
    rgba(53, 187, 154, 0.05) 50%,
    rgba(53, 187, 154, 0.025) 53%,
    transparent 56%,
    transparent 100%
  );
  animation: scan-sweep 14s ease-in-out 3s infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes scan-sweep {
  0%   { left: -100%; opacity: 0; }
  5%   { opacity: 1; }
  45%  { left: 100%; opacity: 1; }
  50%  { opacity: 0; }
  100% { left: 100%; opacity: 0; }
}

/* --- Theory Card HUD Overlay (scan line + corner brackets) --- */
.theory-card {
  overflow: hidden;
}

/* Animated scan line sweeping down the card on hover */
.theory-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 2;
  animation: none;
}

.theory-card:hover::before {
  opacity: 0.7;
  animation: card-scan 2s ease-in-out infinite;
}

@keyframes card-scan {
  0%   { top: -2px; opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.7; }
  100% { top: calc(100% + 2px); opacity: 0; }
}

/* Enhanced hover glow — deep space luminance */
.theory-card:hover {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 80px rgba(53, 187, 154, 0.06),
    inset 0 1px 0 rgba(53, 187, 154, 0.1);
}

/* Corner bracket accents — always visible, intensify on hover */
.theory-card::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid transparent;
  clip-path: polygon(
    0 0, 12px 0, 12px 1px, 1px 1px, 1px 12px, 0 12px,
    0 0,
    100% 0, 100% 12px, calc(100% - 1px) 12px, calc(100% - 1px) 1px, calc(100% - 12px) 1px, calc(100% - 12px) 0,
    100% 0,
    100% 100%, calc(100% - 12px) 100%, calc(100% - 12px) calc(100% - 1px), calc(100% - 1px) calc(100% - 1px), calc(100% - 1px) calc(100% - 12px), 100% calc(100% - 12px),
    100% 100%,
    0 100%, 0 calc(100% - 12px), 1px calc(100% - 12px), 1px calc(100% - 1px), 12px calc(100% - 1px), 12px 100%,
    0 100%
  );
  border-color: var(--accent);
  opacity: 0.12;
  transition: opacity 0.5s var(--ease-out);
  pointer-events: none;
  z-index: 1;
}

.theory-card:hover::after {
  opacity: 0.5;
}

/* --- Frontier Card HUD Style --- */
.frontier-card {
  overflow: hidden;
}

.frontier-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 20%, var(--emerald) 50%, transparent 80%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 2;
}

.frontier-card:hover::before {
  opacity: 0.6;
}

.frontier-card:hover {
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.35),
    0 0 60px rgba(30, 171, 146, 0.05),
    inset 0 1px 0 rgba(30, 171, 146, 0.08);
}

/* Frontier card corner brackets */
.frontier-card::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid var(--accent);
  clip-path: polygon(
    0 0, 8px 0, 8px 1px, 1px 1px, 1px 8px, 0 8px,
    0 0,
    100% 0, 100% 8px, calc(100% - 1px) 8px, calc(100% - 1px) 1px, calc(100% - 8px) 1px, calc(100% - 8px) 0,
    100% 0,
    100% 100%, calc(100% - 8px) 100%, calc(100% - 8px) calc(100% - 1px), calc(100% - 1px) calc(100% - 1px), calc(100% - 1px) calc(100% - 8px), 100% calc(100% - 8px),
    100% 100%,
    0 100%, 0 calc(100% - 8px), 1px calc(100% - 8px), 1px calc(100% - 1px), 8px calc(100% - 1px), 8px 100%,
    0 100%
  );
  opacity: 0.08;
  transition: opacity 0.5s var(--ease-out);
  pointer-events: none;
  z-index: 1;
}

.frontier-card:hover::after {
  opacity: 0.35;
}

/* --- Product Step — Transmission Style --- */
.product-step {
  overflow: hidden;
}

.product-step::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 2;
}

.product-step:hover::before {
  opacity: 0.6;
  animation: card-scan-gold 2.5s ease-in-out infinite;
}

@keyframes card-scan-gold {
  0%   { top: -2px; opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { top: calc(100% + 2px); opacity: 0; }
}

.product-step:hover {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 60px rgba(230, 173, 101, 0.05),
    inset 0 1px 0 rgba(230, 173, 101, 0.1);
}

/* --- CTA Beacon Transmission --- */
.cta-box {
  overflow: hidden;
}

.cta-box::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid rgba(53, 187, 154, 0.1);
  animation: beacon-ring 5s ease-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes beacon-ring {
  0%   { width: 140px; height: 140px; opacity: 0.35; border-color: rgba(53, 187, 154, 0.15); }
  100% { width: 600px; height: 600px; opacity: 0; border-color: rgba(53, 187, 154, 0); }
}

/* Second beacon ring with offset timing */
.cta-logo::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid rgba(230, 173, 101, 0.08);
  animation: beacon-ring-gold 5s ease-out 2.5s infinite;
  pointer-events: none;
}

.cta-logo {
  position: relative;
}

@keyframes beacon-ring-gold {
  0%   { width: 140px; height: 140px; opacity: 0.25; border-color: rgba(230, 173, 101, 0.12); }
  100% { width: 500px; height: 500px; opacity: 0; border-color: rgba(230, 173, 101, 0); }
}

/* --- Hero Title Glow --- */
.hero-title {
  text-shadow: 0 0 120px rgba(53, 187, 154, 0.04);
}

.hero-accent {
  filter: drop-shadow(0 0 40px rgba(30, 171, 146, 0.15));
}

/* --- Badge Signal Dot Enhancement --- */
.badge-dot {
  box-shadow: 0 0 10px var(--gold-glow), 0 0 20px rgba(230, 173, 101, 0.1);
}

/* --- Constellation Connectors (section dividers) --- */
.thesis::before,
.frontier::before,
.product::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 0;
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: 0;
  transition: height 0.8s var(--ease-out), opacity 0.8s var(--ease-out);
}

.is-visible.thesis::before,
.is-visible.frontier::before,
.is-visible.product::before {
  height: 60px;
  opacity: 0.2;
  top: -60px;
}

/* Constellation node dot */
.thesis::after,
.frontier::after,
.product::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow), 0 0 30px rgba(53, 187, 154, 0.1);
  transition: transform 0.6s var(--ease-spring);
  z-index: 2;
}

.is-visible.thesis::after,
.is-visible.frontier::after,
.is-visible.product::after {
  transform: translateX(-50%) scale(1);
}

/* --- Nav Scrolled — deeper glass --- */
.nav.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25), 0 0 60px rgba(53, 187, 154, 0.02);
}

/* ============================================================
   ADAPTIVE CARDS & TEXT — Living, breathing elements
   ============================================================ */

/* --- 3D Tilt Container (JS sets --mx, --my custom props) --- */
.theory-card,
.frontier-card,
.product-step {
  transform-style: preserve-3d;
  transition:
    transform 0.4s var(--ease-out),
    background 0.4s var(--ease-out),
    border-color 0.4s var(--ease-out),
    box-shadow 0.5s var(--ease-out);
}

/* Cursor-following inner glow (JS sets --glow-x, --glow-y) */
.theory-card .card-glow,
.frontier-card .card-glow,
.product-step .card-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  background: radial-gradient(
    400px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(53, 187, 154, 0.1) 0%,
    transparent 60%
  );
}

.theory-card:hover .card-glow,
.frontier-card:hover .card-glow,
.product-step:hover .card-glow {
  opacity: 1;
}

/* Product steps get a gold glow instead */
.product-step .card-glow {
  background: radial-gradient(
    400px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(230, 173, 101, 0.08) 0%,
    transparent 60%
  );
}

/* --- Subtle Floating / Breathing Animation (idle) --- */
.theory-card {
  animation: card-breathe 6s ease-in-out infinite;
}
.theory-card:nth-child(2) { animation-delay: -2s; }
.theory-card:nth-child(3) { animation-delay: -4s; }

.frontier-card {
  animation: card-breathe-sm 7s ease-in-out infinite;
}
.frontier-card:nth-child(2) { animation-delay: -1s; }
.frontier-card:nth-child(3) { animation-delay: -2s; }
.frontier-card:nth-child(4) { animation-delay: -3s; }
.frontier-card:nth-child(5) { animation-delay: -4s; }
.frontier-card:nth-child(6) { animation-delay: -5s; }
.frontier-card:nth-child(7) { animation-delay: -6s; }
.frontier-card:nth-child(8) { animation-delay: -6.5s; }

.product-step {
  animation: card-breathe 8s ease-in-out infinite;
}
.product-step:nth-child(2) { animation-delay: -2.5s; }
.product-step:nth-child(3) { animation-delay: -5s; }

@keyframes card-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes card-breathe-sm {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* --- Animated Gradient Border (nebula flow) --- */
.theory-card,
.product-step {
  position: relative;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.theory-card > .gradient-border,
.product-step > .gradient-border {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    var(--border-angle, 0deg),
    rgba(53, 187, 154, 0.15),
    transparent 40%,
    transparent 60%,
    rgba(230, 173, 101, 0.1)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}

.theory-card:hover > .gradient-border,
.product-step:hover > .gradient-border {
  opacity: 1;
  animation: rotate-border 4s linear infinite;
}

@keyframes rotate-border {
  to { --border-angle: 360deg; }
}

/* Register the custom property for animation */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* --- Section Title Shimmer Gradient --- */
.section-title {
  background: linear-gradient(
    90deg,
    var(--text-primary) 0%,
    var(--text-primary) 40%,
    var(--accent) 50%,
    var(--text-primary) 60%,
    var(--text-primary) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.is-visible .section-title {
  animation:
    fade-up 0.7s var(--ease-out) 0.1s forwards,
    title-shimmer 3s var(--ease-out) 0.8s forwards;
}

@keyframes title-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Hero Accent Animated Gradient --- */
.hero-accent {
  background: linear-gradient(135deg, var(--emerald) 0%, var(--gold) 50%, var(--emerald) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hero-gradient-drift 6s ease-in-out infinite;
  filter: drop-shadow(0 0 40px rgba(30, 171, 146, 0.15));
}

@keyframes hero-gradient-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* --- Thesis Text — Staggered Paragraph Reveals --- */
.thesis-statement p {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.is-visible .thesis-statement p:nth-child(1) {
  opacity: 1; transform: translateY(0);
  transition-delay: 0.3s;
}
.is-visible .thesis-statement p:nth-child(2) {
  opacity: 1; transform: translateY(0);
  transition-delay: 0.5s;
}
.is-visible .thesis-statement p:nth-child(3) {
  opacity: 1; transform: translateY(0);
  transition-delay: 0.7s;
}

/* --- Section Desc — Subtle glow on reveal --- */
.is-visible .section-desc {
  text-shadow: 0 0 60px rgba(53, 187, 154, 0.03);
}

/* --- Emphasized text glow (em tags) --- */
.thesis-statement em,
.theory-card em {
  text-shadow: 0 0 20px rgba(53, 187, 154, 0.2);
}

/* --- Hero Subtitle — Word emphasis glow --- */
.hero-subtitle strong {
  text-shadow: 0 0 20px rgba(243, 237, 211, 0.08);
}

/* --- Step Numbers — Glow pulse --- */
.step-number {
  text-shadow: 0 0 30px rgba(53, 187, 154, 0.15);
  transition: text-shadow 0.4s var(--ease-out);
}

.product-step:hover .step-number {
  text-shadow: 0 0 40px rgba(53, 187, 154, 0.3), 0 0 80px rgba(53, 187, 154, 0.1);
}

/* --- Theory Icon — Enhanced glow on card hover --- */
.theory-card:hover .theory-icon {
  box-shadow: 0 0 20px var(--accent-dim), 0 0 40px rgba(53, 187, 154, 0.05);
  transition: box-shadow 0.4s var(--ease-out);
}

/* --- Frontier Icon — Glow response --- */
.frontier-card:hover .frontier-icon {
  box-shadow: 0 0 16px var(--accent-dim), 0 0 30px rgba(30, 171, 146, 0.04);
  transition: box-shadow 0.4s var(--ease-out);
}

/* --- CTA heading glow --- */
.cta-box h2 {
  text-shadow: 0 0 60px rgba(53, 187, 154, 0.06);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .shooting-star,
  .hero::after,
  .cta-box::after,
  .cta-logo::after {
    animation: none !important;
    display: none;
  }
  .theory-card:hover::before,
  .product-step:hover::before {
    animation: none !important;
  }
}

