/* ============ RESET & BASE ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #04040c;
  --cyan: #00e5ff;
  --purple: #8b5cf6;
  --magenta: #e14eff;
  --text: #e8eaf6;
  --text-dim: #9ba1ba;
  --card-bg: rgba(14, 16, 34, 0.55);
  --card-border: rgba(0, 229, 255, 0.14);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .nav-logo, .btn, .eyebrow, .stat-value, .stat-suffix {
  font-family: 'Space Grotesk', sans-serif;
}

/* ============ CANVAS ============ */
#webgl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ============ LOADER ============ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-core { text-align: center; }
.loader-core span {
  display: block;
  margin-top: 24px;
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--cyan);
  font-family: 'Space Grotesk', sans-serif;
}
.loader-ring {
  width: 64px; height: 64px;
  margin: 0 auto;
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ VIGNETTE ============ */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse 115% 115% at 50% 45%, transparent 52%, rgba(2, 2, 8, 0.58) 100%);
}

/* ============ PROGRESS BAR ============ */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--magenta));
  z-index: 60;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.8);
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  background: linear-gradient(to bottom, rgba(4, 4, 12, 0.85), transparent);
  backdrop-filter: blur(2px);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.02em;
}
.nav-logo b { font-weight: 700; color: var(--cyan); }
.logo-mark {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--cyan), var(--purple));
  box-shadow: 0 0 14px var(--cyan);
  animation: pulse-mark 2.4s ease-in-out infinite;
}
@keyframes pulse-mark {
  0%, 100% { box-shadow: 0 0 8px var(--cyan); }
  50% { box-shadow: 0 0 22px var(--cyan); }
}
.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.06em;
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--cyan); }
.nav-cta {
  padding: 10px 22px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--text) !important;
  background: rgba(0, 229, 255, 0.06);
  transition: all 0.25s;
}
.nav-cta:hover {
  background: rgba(0, 229, 255, 0.14);
  border-color: var(--cyan);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.25);
}

/* ============ SECTIONS ============ */
main { position: relative; z-index: 10; }

.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 48px;
  position: relative;
}
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.section-inner.center { text-align: center; }

/* Legibility halo: a soft dark pool behind the content so text stays
   readable over the densest parts of the fibre network */
.section-inner, .hero-content {
  position: relative;
}
.section-inner::before, .hero-content::before {
  content: '';
  position: absolute;
  inset: -10% -14%;
  background: radial-gradient(58% 58% at 50% 50%, rgba(4, 4, 12, 0.8), rgba(4, 4, 12, 0.45) 55%, transparent 78%);
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3, p, .eyebrow {
  text-shadow: 0 1px 16px rgba(4, 4, 12, 0.9), 0 0 40px rgba(4, 4, 12, 0.55);
}
/* Gradient-clipped words must not inherit the shadow (it would show
   through the transparent fill) */
.hero-title em, .section-title em { text-shadow: none; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.45em;
  color: var(--cyan);
  margin-bottom: 24px;
}

.section-title {
  font-size: clamp(38px, 5.5vw, 68px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 56px;
}
.section-title.big { font-size: clamp(44px, 6.5vw, 84px); }
.section-title em, .hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--cyan) 10%, var(--purple) 55%, var(--magenta) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ HERO ============ */
.hero { justify-content: center; text-align: center; }
.hero-content { max-width: 940px; }
.hero-title {
  font-size: clamp(44px, 7vw, 92px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span { display: inline-block; }
.hero-sub {
  font-size: clamp(16px, 1.6vw, 20px);
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 44px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 16px 36px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: all 0.3s;
}
.btn-lg { padding: 20px 48px; font-size: 17px; }
.btn-primary {
  color: #02020a;
  background: linear-gradient(100deg, var(--cyan), var(--purple));
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.55);
}
.btn-ghost {
  color: var(--text);
  border: 1px solid rgba(232, 234, 246, 0.2);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.35em;
  font-family: 'Space Grotesk', sans-serif;
}
.scroll-line {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, transparent, var(--cyan));
  animation: scroll-drop 1.8s ease-in-out infinite;
}
@keyframes scroll-drop {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============ CARDS ============ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.card {
  padding: 36px 30px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  transition: transform 0.35s ease, border-color 0.35s, box-shadow 0.35s;
}
.card:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 20px 60px rgba(0, 229, 255, 0.12);
}
.card-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  color: var(--cyan);
  letter-spacing: 0.3em;
  margin-bottom: 22px;
}
.card h3 { font-size: 21px; font-weight: 600; margin-bottom: 14px; }
.card p { font-size: 15px; line-height: 1.7; color: var(--text-dim); }

/* ============ STEPS ============ */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 40px;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  top: 9px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.35), rgba(139, 92, 246, 0.35), transparent);
}
.step {
  padding: 40px 20px 26px;
  position: relative;
  background: rgba(10, 12, 28, 0.55);
  border: 1px solid rgba(0, 229, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}
.step-node {
  position: absolute;
  top: 0; left: 20px;
  width: 19px; height: 19px;
  border-radius: 50%;
  border: 1px solid var(--cyan);
  background: var(--bg);
}
.step-node::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse-mark 2.4s ease-in-out infinite;
}
.step h3 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.step p { font-size: 14.5px; line-height: 1.7; color: var(--text-dim); }

/* ============ STATS ============ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 22px;
}
.stat {
  padding: 40px 30px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  text-align: center;
}
.stat-value, .stat-suffix {
  font-size: clamp(40px, 4.5vw, 60px);
  font-weight: 700;
  background: linear-gradient(100deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat p { margin-top: 14px; font-size: 14px; color: var(--text-dim); line-height: 1.6; }

/* ============ CONTACT ============ */
.contact { min-height: 90vh; }

.contact-form {
  max-width: 560px;
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 15px 18px;
  background: rgba(10, 12, 28, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.14);
  border-radius: 12px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  backdrop-filter: blur(8px);
  resize: vertical;
  transition: border-color 0.25s;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--cyan);
}
.contact-form ::placeholder { color: rgba(155, 161, 186, 0.7); }
.contact-form .btn {
  align-self: center;
  margin-top: 8px;
  border: none;
  cursor: pointer;
}
.form-note {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}
.form-note a { color: var(--cyan); text-decoration: none; }
.form-status { text-align: center; font-size: 15px; }
.form-status.success { color: #6ee7b7; }
.form-status.error { color: #f38ba8; }
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}
.contact .hero-sub {
  background: rgba(10, 12, 28, 0.55);
  border: 1px solid rgba(0, 229, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  padding: 22px 32px;
}
.hero-actions.center { justify-content: center; margin-top: 12px; }

/* ============ FOOTER ============ */
.footer {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 28px 48px;
  font-size: 13px;
  color: var(--text-dim);
  border-top: 1px solid rgba(232, 234, 246, 0.07);
}

/* ============ REVEAL (IntersectionObserver-driven) ============ */
.reveal {
  opacity: 0;
  transform: translateY(46px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; }
  .scroll-line, .logo-mark, .step-node::after, .loader-ring { animation: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 720px) {
  .nav { padding: 18px 22px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .section { padding: 100px 22px; }
  .footer { padding: 24px 22px; }
}
