/* ============ Base / Reset / Nav / Footer ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.02em; }
em { font-style: normal; }
::selection { background: var(--mint); color: #041024; }

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

/* ---------- parallax background layers ---------- */
.px-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.px-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4; will-change: transform; }
.px-orb--1 { width: 540px; height: 540px; background: radial-gradient(circle, rgba(77,141,255,0.55), transparent 70%); top: -8%; left: -10%; }
.px-orb--2 { width: 440px; height: 440px; background: radial-gradient(circle, rgba(34,211,238,0.42), transparent 70%); top: 44%; right: -12%; }
.px-orb--3 { width: 640px; height: 640px; background: radial-gradient(circle, rgba(29,78,216,0.5), transparent 70%); top: 108%; left: 18%; }

/* sharp scroll-driven shapes */
.px-shape { position: absolute; will-change: transform; pointer-events: none; }
.px-ring { border: 1.5px solid rgba(77,141,255,0.4); border-radius: 50%; }
.px-ring--a { width: 110px; height: 110px; top: 16%; left: 7%; }
.px-ring--b { width: 64px; height: 64px; top: 58%; right: 9%; border-color: rgba(34,211,238,0.45); }
.px-ring--c { width: 150px; height: 150px; top: 96%; left: 78%; border-color: rgba(127,181,255,0.3); }
.px-diamond { border: 1.5px solid rgba(77,141,255,0.45); }
.px-diamond--a { width: 46px; height: 46px; top: 34%; right: 16%; }
.px-diamond--b { width: 30px; height: 30px; top: 78%; left: 12%; border-color: rgba(34,211,238,0.5); }
.px-dot { border-radius: 50%; background: rgba(77,141,255,0.55); box-shadow: 0 0 18px rgba(77,141,255,0.7); }
.px-dot--a { width: 10px; height: 10px; top: 26%; right: 28%; }
.px-dot--b { width: 7px; height: 7px; top: 66%; left: 30%; background: rgba(34,211,238,0.6); box-shadow: 0 0 14px rgba(34,211,238,0.7); }
.px-cross { width: 26px; height: 26px; opacity: 0.5; }
.px-cross::before, .px-cross::after { content: ""; position: absolute; background: rgba(127,181,255,0.55); border-radius: 2px; }
.px-cross::before { left: 50%; top: 0; width: 2px; height: 100%; margin-left: -1px; }
.px-cross::after { top: 50%; left: 0; height: 2px; width: 100%; margin-top: -1px; }
.px-cross--a { top: 44%; left: 5%; }
.px-cross--b { top: 88%; right: 12%; }
.px-grid {
  position: absolute; inset: -30% 0; will-change: transform;
  background-image:
    linear-gradient(rgba(120,170,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,170,255,0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(65% 55% at 50% 38%, #000, transparent);
  mask-image: radial-gradient(65% 55% at 50% 38%, #000, transparent);
}
@media (max-width: 700px) { .px-orb { filter: blur(60px); opacity: 0.26; } }

/* cursor glow */
.cursor-glow {
  position: fixed; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 141, 255, 0.07) 0%, transparent 65%);
  pointer-events: none; z-index: 1;
  transform: translate(-50%, -50%);
  left: 50vw; top: 40vh;
  transition: opacity var(--duration-normal);
}

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 2.5rem;
  padding: 0 var(--space-gutter);
  transition: background var(--duration-normal), border-color var(--duration-normal), backdrop-filter var(--duration-normal);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(5, 11, 22, 0.82);
  backdrop-filter: blur(18px);
  border-bottom-color: var(--line);
}
.nav__logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  display: inline-flex; align-items: center; gap: 0.55rem; letter-spacing: -0.01em;
}
.nav__logo em { color: var(--mint); }
.nav__logo-mark {
  height: 36px; width: auto;
  filter: drop-shadow(0 0 14px rgba(77,141,255,0.45));
}
.nav__links { display: flex; gap: 2rem; }
.nav__links a {
  font-size: var(--text-sm); font-weight: 500; color: var(--text-dim);
  position: relative; padding: 0.4rem 0;
  transition: color var(--duration-fast);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--mint); border-radius: 2px;
  transition: width var(--duration-normal) var(--ease-out-expo);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.nav__links a.is-active { color: var(--mint); }
.nav__links a.is-active::after { width: 100%; }
.nav__cta { display: flex; gap: 0.75rem; align-items: center; }
.nav__burger { display: none; background: none; border: 0; cursor: pointer; width: 42px; height: 42px; flex-direction: column; justify-content: center; gap: 7px; align-items: center; }
.nav__burger span { display: block; width: 24px; height: 2px; background: var(--text); transition: transform var(--duration-normal), opacity var(--duration-normal); }
.nav__burger.is-open span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 99;
  background: rgba(5, 11, 22, 0.97); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  display: none; flex-direction: column; gap: 0.5rem; padding: 1.5rem var(--space-gutter) 2rem;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a { padding: 0.7rem 0; font-family: var(--font-display); font-size: 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.mobile-menu a.btn { justify-content: center; margin-top: 1rem; border-bottom: 0; }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); padding: 4.5rem var(--space-gutter) 2rem; background: var(--bg-raised); position: relative; z-index: 3; }
.footer__grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 3rem;
  max-width: 1200px; margin: 0 auto 3.5rem;
}
.footer__brand p { color: var(--text-dim); font-size: var(--text-sm); margin-top: 1rem; max-width: 30ch; }
.footer__social { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.footer__social a {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--line); font-size: 0.75rem; font-weight: 600; color: var(--text-dim);
  transition: all var(--duration-fast);
}
.footer__social a:hover { border-color: var(--mint); color: var(--mint); box-shadow: var(--glow-mint); transform: translateY(-2px); }
.footer h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); margin-bottom: 1.1rem; }
.footer__grid ul li { margin-bottom: 0.65rem; font-size: var(--text-sm); color: var(--text-dim); }
.footer__grid ul a:hover { color: var(--mint); }
.footer__bottom {
  max-width: 1200px; margin: 0 auto; padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: 0.8rem; color: var(--text-faint);
}
.footer__bottom nav { display: flex; gap: 1.5rem; }
.footer__bottom a:hover { color: var(--mint); }

@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: flex; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
