/* ==========================================================================
   CENTRALIX — 3D Design Version
   A cinematic single-scene experience: one WebGL universe behind glass UI.
   Palette:  ink #060D1A · navy #004878 · glow #1E6BA8 · plum #A85490 · ice #E8EEF6
   Type:     Archivo (variable width) + IBM Plex Mono
   ========================================================================== */

:root {
  --ink: #060d1a;
  --ink-2: #0a1830;
  --navy: #004878;
  --glow: #1e6ba8;
  --cyan: #39a0d8;
  --plum: #a85490;
  --plum-soft: #c878b0;
  --ice: #e8eef6;
  --muted: #8fa3bd;
  --ok: #3ddc97;
  --glass-bg: rgba(232, 238, 246, 0.055);
  --glass-line: rgba(232, 238, 246, 0.14);
  --font-sans: "Archivo", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --container: 1180px;
  --radius: 18px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
/* NOTE: no `scroll-behavior: smooth` here — it fights Lenis (browser re-smooths
   Lenis's scroll writes → feedback loop). Lenis provides the smoothness. */
html.lenis, html.lenis body { height: auto; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ice);
  background: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--plum-soft); outline-offset: 3px; border-radius: 4px; }

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

/* ---- scroll progress ---- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  background: rgba(232, 238, 246, 0.06);
}
.progress span {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--glow), var(--plum));
  box-shadow: 0 0 12px rgba(168, 84, 144, 0.6);
}

/* ---- WebGL layer + fallback ---- */
#scene3d { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#scene3d canvas { width: 100%; height: 100%; display: block; }

/* Low-power devices: the scene never mounts; an ambient gradient breathes instead */
body.no-scene #scene3d {
  background:
    radial-gradient(60% 50% at 20% 15%, rgba(0, 72, 120, 0.5), transparent 70%),
    radial-gradient(50% 45% at 85% 25%, rgba(168, 84, 144, 0.22), transparent 70%),
    radial-gradient(70% 60% at 50% 90%, rgba(30, 107, 168, 0.28), transparent 70%),
    var(--ink);
  animation: breathe 14s ease-in-out infinite alternate;
}
@keyframes breathe {
  from { filter: hue-rotate(0deg) brightness(1); }
  to   { filter: hue-rotate(-14deg) brightness(1.18); }
}

.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(3, 8, 18, 0.55) 100%);
}

main, .footer { position: relative; z-index: 2; }

/* ---- glassmorphism ---- */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(232, 238, 246, 0.08),
    0 24px 60px rgba(2, 8, 20, 0.45);
}
/* cursor-following glow — JS feeds --gx/--gy */
.card3d::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(220px circle at var(--gx, 50%) var(--gy, 50%),
              rgba(120, 180, 230, 0.10), transparent 65%);
  opacity: 0; transition: opacity 0.35s; pointer-events: none;
}
.card3d:hover::after { opacity: 1; }
.card3d {
  transform: perspective(900px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)) translateZ(0);
  transition: transform 0.22s var(--ease-out), border-color 0.35s, box-shadow 0.35s;
  will-change: transform;
}
.card3d:hover {
  border-color: rgba(120, 180, 230, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(232, 238, 246, 0.1),
    0 24px 60px rgba(2, 8, 20, 0.5),
    0 0 32px rgba(30, 107, 168, 0.22);
}

/* ---- type voices ---- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600; letter-spacing: 0.22em;
  color: var(--plum-soft);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.eyebrow__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--plum);
  box-shadow: 0 0 0 4px rgba(168, 84, 144, 0.18);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(168, 84, 144, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(168, 84, 144, 0.05); }
}

.section__title {
  font-size: clamp(34px, 5.2vw, 62px);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin-bottom: 22px;
}
.section__lead {
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 56px;
}

/* ---- buttons ---- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 26px; border-radius: 999px;
  font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  transition: box-shadow 0.35s, border-color 0.35s, background 0.35s;
  will-change: transform;
}
.btn--lg { padding: 16px 34px; font-size: 16px; }
.btn--solid {
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--glow) 60%, var(--cyan));
  background-size: 160% 160%; background-position: 0% 50%;
  box-shadow: 0 8px 30px rgba(30, 107, 168, 0.35);
}
.btn--solid:hover {
  background-position: 100% 50%;
  box-shadow: 0 10px 40px rgba(30, 107, 168, 0.55), 0 0 24px rgba(168, 84, 144, 0.25);
}
.btn--ghost {
  color: var(--ice);
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.btn--ghost:hover { border-color: rgba(120, 180, 230, 0.45); box-shadow: 0 0 24px rgba(30, 107, 168, 0.2); }
.btn .ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(232, 238, 246, 0.35);
  transform: scale(0); animation: ripple 0.65s var(--ease-out) forwards;
}
@keyframes ripple { to { transform: scale(3); opacity: 0; } }

/* ---- nav ---- */
.nav {
  position: fixed; top: 14px; left: 0; right: 0; z-index: 50;
  padding-inline: 18px;
  transition: transform 0.45s var(--ease-out);
}
.nav.is-hidden { transform: translateY(-120%); }
.nav__inner {
  max-width: var(--container); margin-inline: auto;
  display: flex; align-items: center; gap: 28px;
  padding: 10px 12px 10px 22px;
  border-radius: 999px;
}
.nav__brand { display: flex; align-items: center; }
.nav__logo { height: 26px; width: auto; }
.nav__logo--footer { height: 30px; margin-bottom: 14px; }
.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a {
  font-size: 14.5px; font-weight: 500; color: var(--muted);
  transition: color 0.25s;
}
.nav__links a:hover { color: var(--ice); }
.nav__cta { white-space: nowrap; }
.nav__burger { display: none; flex-direction: column; gap: 5px; padding: 10px; margin-left: auto; }
.nav__burger span { width: 22px; height: 2px; background: var(--ice); transition: transform 0.3s, opacity 0.3s; }
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.nav__mobile {
  display: none; flex-direction: column; gap: 4px;
  margin: 10px auto 0; max-width: var(--container);
  padding: 18px; border-radius: 22px;
}
.nav__mobile a { padding: 10px 12px; font-weight: 500; }
.nav__mobile.is-open { display: flex; }

/* ---- hero ---- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; position: relative;
  padding: 120px 24px 80px;
}
.hero__inner { max-width: 1100px; }
.hero .eyebrow { justify-content: center; }
.hero__title {
  font-size: clamp(44px, 7vw, 92px);
  font-weight: 850;
  font-stretch: 115%;
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
  text-shadow: 0 8px 60px rgba(3, 10, 24, 0.8);
}
.hero__title em {
  font-style: italic; font-weight: 700;
  background: linear-gradient(100deg, var(--plum-soft), var(--plum) 55%, var(--glow));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead {
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.6vw, 14.5px);
  letter-spacing: 0.14em;
  color: var(--cyan);
  margin-bottom: 18px;
}
.hero__sub {
  max-width: 620px; margin: 0 auto 40px;
  color: var(--muted); font-size: 18px;
}
.hero__actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero__more {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1.5px solid rgba(232, 238, 246, 0.3);
  border-radius: 999px; display: flex; justify-content: center;
}
.hero__more span {
  width: 3px; height: 8px; border-radius: 2px; margin-top: 7px;
  background: var(--plum-soft); animation: drop 1.8s var(--ease-out) infinite;
}
@keyframes drop { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ---- sections ---- */
.section { padding: 18vh 0; position: relative; }

/* ---- intro panels ---- */
.panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.panel { padding: 34px 30px; }
.panel__code {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.18em;
  color: var(--cyan); margin-bottom: 40px;
}
.panel h3 { font-size: 21px; font-weight: 700; margin-bottom: 12px; }
.panel p { color: var(--muted); font-size: 15.5px; }

/* ---- modules ---- */
.modgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.mod { overflow: hidden; }
.mod--wide { grid-column: 1 / -1; }
.mod__head {
  display: block; width: 100%; text-align: left; padding: 30px 28px;
  cursor: pointer; -webkit-user-select: none; user-select: none;
}
.mod__code {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.18em;
  color: var(--cyan); margin-bottom: 26px;
  display: flex; align-items: center; gap: 10px;
}
.mod__tag {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: rgba(168, 84, 144, 0.2); color: var(--plum-soft);
  border: 1px solid rgba(168, 84, 144, 0.4);
}
.mod__icon { width: 30px; height: 30px; color: var(--plum-soft); margin-bottom: 18px; }
.mod h3 { font-size: 19.5px; font-weight: 700; margin-bottom: 10px; }
.mod__head > p:last-child { color: var(--muted); font-size: 15px; }
.mod__detail {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease-out);
}
.mod__detail > div { overflow: hidden; }
.mod.is-open .mod__detail { grid-template-rows: 1fr; }
.mod.is-open { border-color: rgba(200, 120, 176, 0.4); }
.mod__detail ul { padding: 0 28px 28px; display: grid; gap: 10px; }
.mod__detail li {
  position: relative; padding-left: 20px;
  color: var(--muted); font-size: 14.5px;
}
.mod__detail li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 8px; height: 2px; background: var(--plum);
}
.mod--wide .mod__head { display: grid; grid-template-columns: auto 1fr; gap: 0 24px; align-items: start; padding: 32px; }
.mod--wide .mod__icon { grid-row: 1 / 4; width: 40px; height: 40px; margin-top: 4px; }
.mod--wide .mod__code, .mod--wide h3, .mod--wide .mod__head > p { grid-column: 2; }

/* ---- process pathway ---- */
.process__pin { padding: 12vh 0; }
.process__track { position: relative; margin-top: 40px; }
.process__line {
  position: absolute; top: 0; left: 4%; right: 4%; height: 2px;
  background: rgba(232, 238, 246, 0.1); border-radius: 2px;
}
.process__line span {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--glow), var(--plum));
  box-shadow: 0 0 16px rgba(168, 84, 144, 0.7);
}
.process__steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  padding-top: 44px; counter-reset: step;
}
.pstep {
  padding: 26px 24px;
  opacity: 0.35; transform: translateY(18px) scale(0.97);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out),
              border-color 0.6s, box-shadow 0.6s;
}
.pstep.is-on {
  opacity: 1; transform: none;
  border-color: rgba(120, 180, 230, 0.4);
  box-shadow: inset 0 1px 0 rgba(232, 238, 246, 0.1), 0 0 34px rgba(30, 107, 168, 0.25);
}
.pstep__num {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em;
  color: var(--plum-soft); margin-bottom: 16px;
}
.pstep h3 { font-size: 20px; font-weight: 750; margin-bottom: 10px; }
.pstep p { color: var(--muted); font-size: 14.5px; }

/* ---- sectors ---- */
.secgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.seccard { padding: 36px 32px; }
.seccard h3 { font-size: 22px; font-weight: 750; margin-bottom: 10px; }
.seccard > p { color: var(--muted); font-size: 15.5px; margin-bottom: 22px; }
.seccard__stats { display: flex; flex-wrap: wrap; gap: 8px; }
.seccard__stats span {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--glass-line); color: var(--cyan);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.seccard:hover .seccard__stats span { opacity: 1; transform: none; }
.seccard__stats span:nth-child(2) { transition-delay: 0.06s; }
.seccard__stats span:nth-child(3) { transition-delay: 0.12s; }
@media (hover: none) { .seccard__stats span { opacity: 1; transform: none; } }

/* ---- technology orbit ---- */
.orbit {
  position: relative; height: 380px; margin-top: -20px;
  display: flex; align-items: center; justify-content: center;
}
.orbit__core {
  width: 110px; height: 110px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 26px; font-weight: 600;
  color: var(--ice); letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(232, 238, 246, 0.1),
              0 0 60px rgba(30, 107, 168, 0.4), 0 0 120px rgba(168, 84, 144, 0.18);
}
.orbit__ring { position: absolute; inset: 0; }
.orbit .chip {
  position: absolute; top: 50%; left: 50%;
  padding: 9px 18px; border-radius: 999px;
  background: var(--glass-bg); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-family: var(--font-mono); font-size: 13px; color: var(--ice);
  white-space: nowrap; will-change: transform;
  box-shadow: 0 6px 24px rgba(2, 8, 20, 0.45);
}

/* ---- stats ---- */
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { padding: 32px 26px; text-align: center; }
.stat__num {
  font-size: clamp(34px, 4vw, 52px); font-weight: 850; font-stretch: 112%;
  letter-spacing: -0.02em; line-height: 1;
  background: linear-gradient(120deg, var(--ice), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label {
  margin-top: 12px; color: var(--muted);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---- testimonial deck ---- */
.deck {
  position: relative; max-width: 720px; height: 300px;
  margin: 0 auto; perspective: 1200px;
}
.voice {
  position: absolute; inset: 0;
  padding: 40px 44px;
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
  transition: transform 0.8s var(--ease-out), opacity 0.8s, filter 0.8s;
  will-change: transform, filter;
}
.voice blockquote { font-size: clamp(17px, 2.2vw, 21px); line-height: 1.55; font-weight: 500; }
.voice figcaption {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.1em;
  color: var(--plum-soft);
}
.voice.is-front { transform: translateZ(0); opacity: 1; filter: blur(0); z-index: 3; }
.voice.is-mid   { transform: translate3d(0, -26px, -120px) scale(0.94); opacity: 0.45; filter: blur(2px); z-index: 2; }
.voice.is-back  { transform: translate3d(0, -48px, -240px) scale(0.88); opacity: 0.2; filter: blur(4px); z-index: 1; }
.deck__dots { display: flex; gap: 10px; justify-content: center; margin-top: 34px; }
.deck__dots button {
  width: 26px; height: 4px; border-radius: 2px; padding: 0;
  background: rgba(232, 238, 246, 0.15); transition: background 0.3s;
}
.deck__dots button[aria-selected="true"] { background: var(--plum); box-shadow: 0 0 10px rgba(168, 84, 144, 0.6); }

/* ---- CTA ---- */
.cta { padding-bottom: 22vh; text-align: center; }
.cta .eyebrow { justify-content: center; }
.cta .section__lead { margin-inline: auto; }
.ctaform {
  max-width: 640px; margin: 0 auto; padding: 38px 36px;
  display: grid; gap: 18px; text-align: left;
}
.ctaform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ctaform label {
  display: grid; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.ctaform input, .ctaform textarea {
  font: 15.5px/1.5 var(--font-sans); color: var(--ice);
  background: rgba(6, 13, 26, 0.5);
  border: 1px solid var(--glass-line); border-radius: 10px;
  padding: 12px 14px; resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.ctaform input:focus, .ctaform textarea:focus {
  outline: none; border-color: rgba(120, 180, 230, 0.5);
  box-shadow: 0 0 0 3px rgba(30, 107, 168, 0.18);
}
.ctaform__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }

/* ---- footer ---- */
.footer {
  border-top: 1px solid var(--glass-line);
  background: rgba(4, 9, 19, 0.7);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  padding: 64px 0 34px;
}
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer__tag { color: var(--muted); font-size: 14.5px; max-width: 300px; }
.footer__col { display: grid; gap: 10px; align-content: start; }
.footer__col h4 {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.footer__col a { font-size: 14.5px; color: var(--ice); opacity: 0.85; }
.footer__col a:hover { opacity: 1; color: var(--plum-soft); }
.footer__base {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding-top: 26px; border-top: 1px solid rgba(232, 238, 246, 0.08);
  color: var(--muted); font-size: 13px;
}
.footer__mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; }
.ok { color: var(--ok); }

/* ---- responsive ---- */
@media (max-width: 980px) {
  .panels, .modgrid { grid-template-columns: repeat(2, 1fr); }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: flex; }
  .section { padding: 12vh 0; }
  .panels, .modgrid, .secgrid { grid-template-columns: 1fr; }
  .process__steps { grid-template-columns: 1fr; gap: 16px; padding-top: 0; padding-left: 34px; }
  .process__line {
    top: 0; bottom: 0; left: 10px; right: auto; width: 2px; height: auto;
  }
  .process__line span { transform-origin: 50% 0; transform: scaleY(var(--p, 0)); }
  .orbit { height: 300px; }
  .deck { height: 340px; }
  .voice { padding: 30px 26px; }
  .ctaform__row { grid-template-columns: 1fr; }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .pstep { opacity: 1; transform: none; }
  .seccard__stats span { opacity: 1; transform: none; }
  .hero__more { display: none; }
}
