/* ==========================================================================
   Homepage — hero, capabilities, scroll reveal
   ========================================================================== */

.homepage {
  padding: 2.5rem 1rem 3.5rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .homepage {
    padding: 2.5rem 2rem 3.5rem;
  }
}

/* Hero */
.hero {
  position: relative;
  text-align: center;
  padding: 6rem 2rem 5rem;
  border-bottom: 1px solid #30363D;
  overflow: hidden;
  color: #ffffff;
  background: radial-gradient(circle at 50% -20%, #1e3a5f 0%, #0f172a 40%, #020617 75%, #000000 100%);
  margin: 0 -1.25rem 0;
  width: calc(100% + 2.5rem);
}

.hero-bg-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-quantum-field {
  position: absolute;
  inset: 0;
  will-change: transform;
  transition: transform 0.2s ease-out;
}

.hero-lattice {
  position: absolute;
  inset: -20%;
  background-image: radial-gradient(circle, rgba(56, 189, 248, 0.22) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 45%, black 15%, transparent 72%);
  animation: latticePulse 10s ease-in-out infinite;
}

.hero-lattice::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(129, 140, 248, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: 14px 14px;
  animation: latticePulse 10s ease-in-out infinite reverse;
}

@keyframes latticePulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

.hero-aurora {
  position: absolute;
  inset: 5%;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, rgba(56, 189, 248, 0.2), transparent 70%),
    radial-gradient(ellipse 45% 35% at 80% 60%, rgba(129, 140, 248, 0.15), transparent 70%);
  filter: blur(32px);
  opacity: 0.8;
  animation: auroraShift 18s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0% { transform: translate(0, 0) scale(1); opacity: 0.65; }
  50% { transform: translate(2%, -1.5%) scale(1.04); opacity: 0.85; }
  100% { transform: translate(-1.5%, 2%) scale(0.98); opacity: 0.7; }
}

.hero-qmesh {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.75;
  animation: qmeshFade 12s ease-in-out infinite;
}

@keyframes qmeshFade {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.9; }
}

.hero-qmesh-nodes circle {
  animation: nodeGlow 4s ease-in-out infinite;
}

.hero-qmesh-nodes circle:nth-child(2),
.hero-qmesh-nodes circle:nth-child(5),
.hero-qmesh-nodes circle:nth-child(7) {
  animation-delay: 1.2s;
}

.hero-qmesh-nodes circle:nth-child(4),
.hero-qmesh-nodes circle:nth-child(6) {
  animation-delay: 2.4s;
}

@keyframes nodeGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.hero-qwaves {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 35%;
  opacity: 0.7;
}

.hero-qwave--1 {
  animation: qwaveDrift 14s ease-in-out infinite;
}

.hero-qwave--2 {
  animation: qwaveDrift 18s ease-in-out infinite reverse;
  animation-delay: -4s;
}

@keyframes qwaveDrift {
  0%, 100% { transform: translateX(0); opacity: 0.6; }
  50% { transform: translateX(-2%); opacity: 1; }
}

.hero-orbit-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.2s ease-out;
}

.qubit-core {
  position: relative;
  width: 26px;
  height: 26px;
  background: #58A6FF;
  border-radius: 50%;
  box-shadow: 0 0 22px #58A6FF, 0 0 44px #58A6FF;
  animation: corePulse 6s ease-in-out infinite;
}

.qubit-core::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 0 30px rgba(148, 163, 184, 0.4);
  opacity: 0.6;
}

@keyframes corePulse {
  0%, 100% { box-shadow: 0 0 22px #58A6FF, 0 0 44px #58A6FF; }
  50% { box-shadow: 0 0 32px #79B8FF, 0 0 64px #79B8FF; }
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 0 18px rgba(15, 23, 42, 0.9);
  animation: orbitSpin 40s linear infinite;
}

.orbit:nth-child(1) { width: 180px; height: 180px; animation-duration: 34s; }
.orbit:nth-child(2) { width: 260px; height: 260px; animation-duration: 46s; animation-direction: reverse; }
.orbit:nth-child(3) { width: 340px; height: 340px; animation-duration: 60s; animation-direction: reverse; }

@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.orbit-node {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38BDF8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.9);
  animation: nodePulse 3s ease-in-out infinite;
}

@keyframes nodePulse {
  0%, 100% { opacity: 0.85; box-shadow: 0 0 12px rgba(56, 189, 248, 0.9); }
  50% { opacity: 1; box-shadow: 0 0 22px rgba(56, 189, 248, 1), 0 0 36px rgba(56, 189, 248, 0.4); }
}

.orbit-node:nth-child(1) { top: -3px; left: 50%; transform: translateX(-50%); animation-delay: 0s; }
.orbit-node:nth-child(2) { bottom: -3px; left: 18%; animation-delay: 0.8s; }
.orbit-node:nth-child(3) { top: 22%; right: -3px; animation-delay: 1.6s; }

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(148, 163, 184, 0.9);
  border-radius: 50%;
  animation: particleDrift 16s ease-in-out infinite;
  opacity: 0.6;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.particle--sm {
  width: 4px;
  height: 4px;
  opacity: 0.45;
}

.particle--lg {
  width: 8px;
  height: 8px;
  opacity: 0.75;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.7);
}

@keyframes particleDrift {
  0% { transform: translate(0, 0); opacity: 0.25; }
  25% { transform: translate(12px, -28px); opacity: 0.9; }
  50% { transform: translate(-8px, -48px); opacity: 1; }
  75% { transform: translate(16px, -22px); opacity: 0.7; }
  100% { transform: translate(0, 0); opacity: 0.25; }
}

.hero-inner {
  position: relative;
  z-index: 3;
}

.hero-logo-wrap {
  margin-bottom: 1.5rem;
  animation: heroFadeIn 1.1s ease forwards;
  line-height: 0;
}

.hero-logo-wrap .brand-logo--on-light {
  display: none;
}

body.light-mode .hero-logo-wrap .brand-logo--on-dark {
  display: none;
}

body.light-mode .hero-logo-wrap .brand-logo--on-light {
  display: inline-block;
}

.hero-logo {
  width: 140px;
  height: 140px;
  object-fit: contain;
}

.hero-badge-row {
  display: inline-flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #E5E7EB;
  background: rgba(15, 23, 42, 0.7);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  position: relative;
  animation: fadeInUp 1.2s ease forwards;
}

.hero h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.6rem;
  width: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38BDF8, #60A5FA, #38BDF8);
  transform: translateX(-50%);
  animation: titleUnderline 1.8s ease 0.8s forwards;
}

@keyframes titleUnderline {
  0% { width: 0; opacity: 0; }
  40% { width: 40%; opacity: 1; }
  100% { width: 26%; opacity: 1; }
}

.hero p {
  font-size: 1.25rem;
  color: #D0D7DE;
  max-width: 720px;
  margin: 0 auto 2rem;
  animation: fadeInUp 1.6s ease forwards;
}

.hero-cta-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 2s ease forwards;
}

.hero-button {
  background: #38BDF8;
  color: #0F172A !important;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 1.05rem;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.6);
  transition: 0.25s ease;
}

.hero-button:hover {
  background: #60A5FA;
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.9);
  transform: translateY(-2px);
}

.hero-secondary {
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #E5E7EB;
  text-decoration: none;
  font-size: 0.98rem;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  transition: 0.25s ease;
}

.hero-secondary:hover {
  border-color: #38BDF8;
  color: #F9FAFB;
  transform: translateY(-2px);
}

.hero-stats {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: #9CA3AF;
}

.hero-stat {
  min-width: 150px;
}

.hero-stat strong {
  display: block;
  font-size: 1.1rem;
  color: #E5E7EB;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section titles */
.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
  text-align: center;
  color: #F9FAFB;
  position: relative;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190px;
  height: 60px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18), transparent 70%);
  opacity: 0.7;
  z-index: -1;
}

.section-subtitle {
  text-align: center;
  color: #9CA3AF;
  margin-bottom: 2rem;
}

body.light-mode .section-title {
  color: #0F172A;
}

body.light-mode .section-title::before {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12), transparent 70%);
}

body.light-mode .section-subtitle {
  color: #4B5563;
}

body.light-mode .homepage p,
body.light-mode .homepage ul {
  color: #374151;
}

/* Capability cards */
.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.cap-card {
  position: relative;
  background: #020617;
  border: 1px solid #1F2937;
  padding: 1.8rem;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
  transition: 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  transform: translateY(18px);
  opacity: 0;
}

.cap-card h3 {
  color: #E5E7EB;
  margin-bottom: 0.8rem;
}

.cap-card ul {
  color: #CBD5F5;
  line-height: 1.55;
  font-size: 0.97rem;
}

.cap-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.4), transparent, rgba(129, 140, 248, 0.4));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.cap-card:hover::before {
  opacity: 1;
}

.cap-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
  border-color: #38BDF8;
}

body.light-mode .cap-card {
  background: #FFFFFF;
  border-color: #E5E7EB;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

body.light-mode .cap-card h3 {
  color: #111827;
}

body.light-mode .cap-card ul {
  color: #374151;
}

/* Partner strip */
.partner-strip {
  margin-top: 3rem;
  padding: 1.2rem 1.5rem;
  border-radius: 999px;
  border: 1px solid #1F2937;
  background: radial-gradient(circle at left, rgba(56, 189, 248, 0.18), transparent 60%);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #9CA3AF;
}

.partner-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: #E5E7EB;
}

.partner-pill {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

body.light-mode .partner-strip {
  border-color: #E5E7EB;
  background: radial-gradient(circle at left, rgba(59, 130, 246, 0.12), transparent 60%);
  color: #4B5563;
}

body.light-mode .partner-label {
  color: #111827;
}

/* Scroll reveal — base rules live in animations.css; homepage overrides timing only */
.homepage .reveal-active {
  transition-duration: 0.8s;
}

@media (max-width: 768px) {
  .hero {
    padding: 4rem 1.2rem 3.5rem;
    margin: 0 -1.25rem;
    width: calc(100% + 2.5rem);
  }

  .hero h1 {
    font-size: 2rem;
    line-height: 1.25;
  }

  .hero p {
    font-size: 1rem;
    max-width: 95%;
  }

  .hero-cta-row {
    flex-direction: column;
  }

  .hero-button,
  .hero-secondary {
    width: 100%;
    text-align: center;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .cap-card {
    padding: 1.3rem;
  }

  .cap-card h3 {
    font-size: 1.15rem;
  }

  .cap-card ul {
    font-size: 0.95rem;
  }

  .partner-strip {
    border-radius: 1.25rem;
  }
}
