/* ==========================================================================
   Quantaris Group — Production Design System
   Palette sourced from imgs/logo.jpg: navy #2E57B3 → royal #167FDB
   ========================================================================== */

:root {
  --bg: #0a0e17;
  --bg-soft: #0d1424;
  --surface: #0f1729;
  --border: rgba(148, 163, 184, 0.12);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --brand: #167fdb;
  --brand-2: #2e57b3;
  --brand-light: #7cb0f7;
  --brand-soft: rgba(22, 127, 219, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-family: 'Sora', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

a { color: inherit; }

::selection {
  background: rgba(22, 127, 219, 0.35);
  color: #fff;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1d2a45; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--brand), var(--brand-2)); }

/* ---------- Ambient background ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 85% 55% at 50% -5%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 85% 55% at 50% -5%, #000 35%, transparent 100%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 50% -8%, rgba(22, 127, 219, 0.14), transparent 70%),
    radial-gradient(ellipse 35% 30% at 95% 12%, rgba(46, 87, 179, 0.12), transparent 70%),
    radial-gradient(ellipse 40% 30% at 0% 70%, rgba(22, 127, 219, 0.05), transparent 70%);
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  background: rgba(10, 14, 23, 0.92);
  border-bottom-color: var(--border);
  box-shadow: 0 10px 34px -16px rgba(0, 0, 0, 0.7);
}

.nav-link {
  position: relative;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  padding: 0.35rem 0;
  transition: color 0.2s ease;
}

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

.nav-link.active { color: var(--brand-light); }

.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 999px;
  padding: 0.8rem 1.7rem;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease, filter 0.22s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 12px 28px -12px rgba(22, 127, 219, 0.7);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 18px 40px -14px rgba(22, 127, 219, 0.8);
}

.btn-outline {
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text);
  background: transparent;
}

.btn-outline:hover {
  border-color: rgba(22, 127, 219, 0.65);
  background: rgba(22, 127, 219, 0.08);
  transform: translateY(-2px);
}

.btn-ghost { color: var(--muted); background: transparent; }
.btn-ghost:hover { color: var(--brand-light); background: rgba(22, 127, 219, 0.08); }

.btn-sm { padding: 0.55rem 1.15rem; font-size: 0.85rem; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 1.1rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(22, 127, 219, 0.4);
  box-shadow: 0 20px 45px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(22, 127, 219, 0.06);
}

/* Hero stats cards — clearly visible, branded background */
section:first-of-type .grid {
  opacity: 1 !important;
  transform: none !important;
}
section:first-of-type .grid .card {
  background: rgba(22, 127, 219, 0.12);
  border: 1.5px solid rgba(22, 127, 219, 0.4);
  border-radius: 1rem;
  box-shadow: 0 0 24px -6px rgba(22, 127, 219, 0.3), inset 0 1px 0 rgba(124, 176, 247, 0.12);
}
section:first-of-type .grid .card:hover {
  background: rgba(22, 127, 219, 0.2);
  border-color: rgba(22, 127, 219, 0.6);
  box-shadow: 0 0 40px -4px rgba(22, 127, 219, 0.45), inset 0 1px 0 rgba(124, 176, 247, 0.18);
  transform: translateY(-3px);
}
section:first-of-type .grid .card .stat-value {
  font-size: 2rem;
  color: #7cb0f7;
  text-shadow: 0 0 24px rgba(124, 176, 247, 0.55);
}
section:first-of-type .grid .card p:last-child {
  color: #b0bfda;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
  background: var(--brand-soft);
  color: var(--brand-light);
  border: 1px solid rgba(22, 127, 219, 0.25);
}

.icon-box-lg { width: 3.75rem; height: 3.75rem; border-radius: 1rem; font-size: 1.4rem; }

/* ---------- Section helpers ---------- */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-light);
  background: rgba(22, 127, 219, 0.1);
  border: 1px solid rgba(22, 127, 219, 0.25);
}

.glow-line {
  width: 64px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.section-pad { padding: 5.5rem 1.25rem; }

@media (min-width: 768px) {
  .section-pad { padding: 7rem 2rem; }
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.in { opacity: 1; transform: none; }

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* ---------- Feature list / checkmarks ---------- */
.check-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.check-item i {
  color: var(--brand-light);
  flex-shrink: 0;
}

/* ---------- Chips / tags ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--brand-light);
  background: rgba(22, 127, 219, 0.08);
  border: 1px solid rgba(22, 127, 219, 0.22);
}

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  padding: 0.8rem 1.1rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder { color: #64748b; }

.input:focus {
  border-color: rgba(22, 127, 219, 0.7);
  box-shadow: 0 0 0 3px rgba(22, 127, 219, 0.15);
}

/* ---------- Ticker (subtle, professional) ---------- */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.ticker-track {
  display: inline-flex;
  animation: ticker 36s linear infinite;
}

.ticker-track span {
  padding: 0.9rem 1.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.ticker-track .dot { color: rgba(22, 127, 219, 0.5); padding: 0; margin: 0 0.2rem; }

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---------- Avatar ---------- */
.avatar-ring {
  box-shadow: 0 0 0 3px rgba(22, 127, 219, 0.35), 0 10px 30px -12px rgba(0, 0, 0, 0.8);
}

/* ---------- Misc ---------- */
.text-gradient {
  background: linear-gradient(92deg, #fff 20%, var(--brand-light) 55%, #5ea7f2 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-value {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  color: var(--brand-light);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.2), transparent);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track { animation: none; }
}

/* ==========================================================================
   Premium 3D + Motion Layer  (UI-only enhancement — no content changes)
   ========================================================================== */

/* Smooth anchor offset under the fixed navbar */
html { scroll-padding-top: 92px; }

/* ---------- Scroll progress bar ---------- */
#scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 60;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Preloader ---------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 100003;
  display: grid;
  place-items: center;
  background: #0a0e17;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.hide { opacity: 0; visibility: hidden; }
#preloader .pre-ring {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 2px solid rgba(22, 127, 219, 0.18);
  border-top-color: var(--brand);
  display: grid;
  place-items: center;
  animation: preSpin 0.9s linear infinite;
  box-shadow: 0 0 30px -6px rgba(22, 127, 219, 0.35);
}
#preloader .pre-logo {
  width: 56px; height: 56px;
  border-radius: 16px;
  object-fit: cover;
  animation: prePulse 1.2s ease-in-out infinite;
}
@keyframes preSpin { to { transform: rotate(360deg); } }
@keyframes prePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ---------- Cinematic page-transition curtain ---------- */
#page-transition {
  position: fixed;
  inset: 0;
  z-index: 100002;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 0%, #0d1424 0%, #0a0e17 55%);
  transform: translateY(-101%);
  transition: transform 0.38s cubic-bezier(0.7, 0, 0.3, 1);
}
#page-transition.active { transform: translateY(0); }

/* ---------- Cursor glow (fine pointers) ---------- */
#cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 520px; height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  z-index: 35;
  pointer-events: none;
  background: radial-gradient(circle, rgba(22, 127, 219, 0.12), rgba(22, 127, 219, 0.04) 40%, transparent 70%);
  mix-blend-mode: screen;
  opacity: 0;
  will-change: transform;
}
#cursor-glow.on { opacity: 1; }

/* ---------- Starfield universe canvas (homepage) ---------- */
#universe {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
}

/* ---------- Hero background video (homepage) ---------- */
.hero-video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.hero-video-bg.ready { opacity: 1; }
.hero-video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-video-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 14, 23, 0.6), rgba(10, 14, 23, 0.3) 42%, rgba(10, 14, 23, 0.5) 78%, rgba(10, 14, 23, 0.8));
}
.hero-video-bg + div { position: relative; z-index: 1; }

/* ---------- Hero typewriter caret ---------- */
.hero-caret {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  margin-left: 5px;
  vertical-align: -0.1em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-light), var(--brand));
  box-shadow: 0 0 10px rgba(124, 176, 247, 0.7);
  animation: caretBlink 0.9s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

/* ---------- Blue cursor trail canvas (fine pointers) ---------- */
#cursor-trail {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

/* ---------- Aurora ambient background ---------- */
.aurora { position: fixed; inset: 0; z-index: -3; pointer-events: none; overflow: hidden; }
.aurora::before, .aurora::after {
  content: '';
  position: absolute;
  width: 55vmax; height: 55vmax;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}
.aurora::before {
  top: -18vmax; left: -12vmax;
  background: radial-gradient(circle, rgba(22, 127, 219, 0.26), transparent 62%);
  animation: auroraDrift 26s ease-in-out infinite alternate;
}
.aurora::after {
  bottom: -20vmax; right: -14vmax;
  background: radial-gradient(circle, rgba(46, 87, 179, 0.22), transparent 62%);
  animation: auroraDrift 34s ease-in-out infinite alternate-reverse;
}
@keyframes auroraDrift {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to { transform: translate3d(6vmax, 4vmax, 0) rotate(14deg); }
}

/* ---------- Word-by-word heading reveal ---------- */
.words-animated .wv-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.words-animated .wv-inner {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i, 0) * 45ms);
  will-change: transform;
}
.words-animated.ws-in .wv-inner { transform: translateY(0); }

/* ---------- Shimmering gradient text ---------- */
.text-gradient {
  background-size: 200% auto;
  animation: gradientShift 8s ease-in-out infinite alternate;
}

/* Word-split safe gradient: once a heading is split into word spans, keep the
   gradient clip on each word itself so `background-clip: text` keeps working
   (prevents gradient words from rendering invisible / headings looking incomplete). */
.words-animated .text-gradient {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: inherit;
  animation: none;
}
.words-animated .text-gradient .wv-inner {
  background: linear-gradient(92deg, #fff 20%, var(--brand-light) 55%, #5ea7f2 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradientShift 8s ease-in-out infinite alternate;
}
@keyframes gradientShift {
  from { background-position: 0% center; }
  to { background-position: 100% center; }
}

/* ---------- Premium buttons: shine sweep ---------- */
.btn { position: relative; overflow: hidden; }
.btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 55%;
  height: 100%;
  transform: skewX(-22deg) translateX(-180%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transition: transform 0.65s ease;
  pointer-events: none;
}
.btn:hover::before { transform: skewX(-22deg) translateX(300%); }

/* ---------- Nav link hover underline ---------- */
.nav-link::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-link:hover::before { transform: scaleX(1); }

/* ---------- 3D tilt cards ---------- */
.tilt-card { position: relative; }
.tilt-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(22, 127, 219, 0.16), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.tilt-card:hover::after { opacity: 1; }
.tilt-card:hover {
  transition: transform 0.12s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

/* ---------- Icon boxes: depth micro-interaction ---------- */
.icon-box { transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease; }
.card:hover .icon-box {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -14px rgba(22, 127, 219, 0.55);
}

/* ---------- Chips micro-interaction ---------- */
.chip { transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease; }
.chip:hover { transform: translateY(-2px); border-color: rgba(22, 127, 219, 0.5); }

/* ---------- Stat values glow ---------- */
.stat-value { text-shadow: 0 0 24px rgba(22, 127, 219, 0.4); }

/* ---------- Section badge subtle glow ---------- */
.section-badge { box-shadow: 0 0 20px -8px rgba(22, 127, 219, 0.45); }

/* ---------- Ticker edge fade ---------- */
.ticker { position: relative; }
.ticker::before, .ticker::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 70px;
  z-index: 2;
  pointer-events: none;
}
.ticker::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.ticker::after { right: 0; background: linear-gradient(-90deg, var(--bg), transparent); }

/* ---------- Back to top ---------- */
#backToTop {
  position: fixed;
  left: 20px; bottom: 20px;
  z-index: 90;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(22, 127, 219, 0.4);
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(22, 127, 219, 0.6);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
#backToTop.show { opacity: 1; transform: none; pointer-events: auto; }
#backToTop:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -10px rgba(22, 127, 219, 0.8); }

/* ---------- Check items pop ---------- */
.check-item i { transition: transform 0.2s ease; }
.check-item:hover i { transform: scale(1.3); }

/* ---------- Avatar float on card hover ---------- */
.avatar-ring { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover .avatar-ring { transform: translateY(-3px); }

/* ---------- Motion & pointer guards ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track, .aurora::before, .aurora::after, #preloader .pre-ring, #preloader .pre-logo,
  .text-gradient { animation: none !important; }
  .words-animated .wv-inner { transform: none !important; transition: none !important; }
  .hero-caret { animation: none; }
  #cursor-glow, #preloader, #page-transition, #scroll-progress, #universe, #cursor-trail { display: none; }
  .btn::before, .tilt-card::after { display: none; }
}

@media (pointer: coarse) {
  #cursor-glow, #cursor-trail { display: none; }
}
