/* ============================================================
   VERBOLTA — GLOBAL DESIGN SYSTEM
   Foundation: variables, reset, typography, keyframes, utilities
   ============================================================ */

/* ── GOOGLE FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&family=JetBrains+Mono:wght@300;400&display=swap');

/* ── COLOR & DESIGN TOKENS ───────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-void:        #05050a;       /* deepest background — near black with blue-black tint */
  --bg-surface:     #08080f;       /* page background */
  --bg-elevated:    #0d0d18;       /* cards, panels */
  --bg-overlay:     #12121f;       /* modals, dropdowns */

  /* Accent System */
  --accent-primary:   #4fc3f7;     /* electric sky blue — pulled from lightning bolt energy */
  --accent-secondary: #7c83ff;     /* deep violet-blue for depth */
  --accent-glow:      #4fc3f740;   /* accent at 25% — for glow effects */
  --accent-glow-soft: #4fc3f715;   /* accent at 8% — for subtle fills */

  /* Text */
  --text-primary:   #ffffff;        /* pure white — maximum legibility */
  --text-secondary: #a0a8c0;        /* brighter muted — was too dark */
  --text-tertiary:  #4a5070;        /* slightly brighter */
  --text-accent:    #4fc3f7;

  /* Borders */
  --border-subtle:  #ffffff08;     /* barely visible — structural */
  --border-dim:     #ffffff14;     /* default border */
  --border-active:  #4fc3f740;     /* hovered/focused border */
  --border-bright:  #4fc3f7;       /* fully lit border */

  /* Gradients */
  --grad-primary:   linear-gradient(135deg, #4fc3f7 0%, #7c83ff 100%);
  --grad-dark:      linear-gradient(180deg, #05050a 0%, #08080f 100%);
  --grad-card:      linear-gradient(135deg, #0d0d18 0%, #0a0a14 100%);
  --grad-hero:      linear-gradient(135deg, #05050a 0%, #070714 50%, #09091a 100%);
  --grad-glow:      radial-gradient(ellipse at center, #4fc3f720 0%, transparent 70%);

  /* Typography */
  --font-display:   'Outfit', sans-serif;
  --font-body:      'DM Sans', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;

  /* Type Scale */
  --text-xs:    0.7rem;
  --text-sm:    0.85rem;
  --text-base:  1rem;
  --text-md:    1.15rem;
  --text-lg:    1.35rem;
  --text-xl:    1.65rem;
  --text-2xl:   2.1rem;
  --text-3xl:   2.8rem;
  --text-4xl:   3.8rem;
  --text-5xl:   5.5rem;
  --text-6xl:   7rem;

  /* Spacing */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;
  --space-32:  8rem;

  /* Layout */
  --max-width:      1280px;
  --max-width-text: 720px;
  --nav-height:     72px;

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.87, 0, 0.13, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:   150ms;
  --duration-base:   300ms;
  --duration-slow:   600ms;
  --duration-slower: 900ms;

  /* Shadows */
  --shadow-sm:   0 1px 3px #00000060;
  --shadow-md:   0 4px 20px #00000080;
  --shadow-lg:   0 8px 40px #000000a0;
  --shadow-glow: 0 0 40px #4fc3f720, 0 0 80px #4fc3f710;
  --shadow-glow-sm: 0 0 20px #4fc3f730;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── CUSTOM SCROLLBAR ────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: var(--bg-void);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-secondary);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ── SELECTION ───────────────────────────────────────────── */
::selection {
  background: var(--accent-glow);
  color: var(--accent-primary);
}

/* ── TYPOGRAPHY ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }

p {
  color: var(--text-secondary);
  line-height: 1.75;
  font-weight: 300;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
}

strong, b {
  font-weight: 600;
  color: var(--text-primary);
}

/* Mono text utility */
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  letter-spacing: 0.06em;
  color: #8a96b8;
}

/* ── LAYOUT UTILITIES ────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.container--narrow {
  max-width: var(--max-width-text);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.section {
  padding: var(--space-32) 0;
  position: relative;
  z-index: 1;
}

.section--lg {
  padding: calc(var(--space-32) * 1.5) 0;
}


/* ── KEYFRAME ANIMATIONS ─────────────────────────────────── */

/* Fade up — primary entrance animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in — pure opacity */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Glow pulse — for logo and accent elements */
@keyframes glowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px #4fc3f740) drop-shadow(0 0 24px #4fc3f720);
  }
  50% {
    filter: drop-shadow(0 0 16px #4fc3f780) drop-shadow(0 0 48px #4fc3f740);
  }
}

/* Border shimmer — for cards */
@keyframes borderShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Scan line — futuristic effect */
@keyframes scanLine {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* Counter — for numbers */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Subtle float — for hero logo */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

/* Line draw — for decorative lines */
@keyframes lineDraw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Text reveal — clip path entrance */
@keyframes revealClip {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

/* Spin slow — for decorative rings */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── SCROLL-TRIGGERED ANIMATION CLASSES ──────────────────── */
/* Elements start invisible; JS adds .is-visible to trigger */

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

.reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger delays for child elements */
.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 100ms; }
.stagger > *:nth-child(3) { transition-delay: 200ms; }
.stagger > *:nth-child(4) { transition-delay: 300ms; }
.stagger > *:nth-child(5) { transition-delay: 400ms; }
.stagger > *:nth-child(6) { transition-delay: 500ms; }

/* ── GRADIENT TEXT UTILITY ───────────────────────────────── */
.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── LABEL / TAG UTILITY ─────────────────────────────────── */
.label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-primary);
  filter: brightness(1.15);
}

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-dim);
  position: relative;
  overflow: hidden;
}

.divider::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  animation: shimmerLine 4s ease-in-out infinite;
}

@keyframes shimmerLine {
  0%   { left: -60%; }
  100% { left: 160%; }
}

/* ── FOCUS STYLES ────────────────────────────────────────── */
:focus-visible {
  outline: 1.5px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── IMAGE DEFAULTS ──────────────────────────────────────── */
img, video {
  max-width: 100%;
  display: block;
}

/* ── LIST RESET ──────────────────────────────────────────── */
ul, ol {
  list-style: none;
}

/* ── RESPONSIVE BREAKPOINTS ──────────────────────────────── */
/* 
  Usage: @media (max-width: 1024px) { ... }
  Breakpoints:
    lg:  1024px
    md:  768px
    sm:  480px
*/

@media (max-width: 1024px) {
  :root {
    --text-6xl: 5.5rem;
    --text-5xl: 4.2rem;
    --text-4xl: 3.2rem;
    --text-3xl: 2.4rem;
  }
}

@media (max-width: 768px) {
  :root {
    --text-6xl: 4rem;
    --text-5xl: 3rem;
    --text-4xl: 2.4rem;
    --text-3xl: 2rem;
    --text-2xl: 1.6rem;
  }

  .container {
    padding: 0 var(--space-6);
  }

  .section {
    padding: var(--space-20) 0;
  }

  .section-header,
  .page-hero__content {
    text-align: center;
    align-items: center;
  }

  .section-heading,
  .page-hero__heading,
  .page-hero__sub {
    text-align: center;
  }

  .label {
    display: block;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --text-5xl: 2.2rem;
    --text-3xl: 1.5rem;
  }

  .container {
    padding: 0 var(--space-4);
  }
}

/* ── MOBILE PERFORMANCE ──────────────────────────────────────
   Kill expensive GPU effects on phones to ensure smooth load
   and instant touch response.
─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Kill backdrop-filter blur — single biggest perf killer on iOS */
  .nav,
  .nav.scrolled {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(5, 5, 10, 0.97) !important;
  }

  /* Kill continuous float animations on orbs */
  .hero__orb--1,
  .hero__orb--2 {
    animation: none !important;
  }

  /* Kill filter blur on orbs — expensive on mobile GPU */
  .hero__orb {
    filter: none !important;
    opacity: 0.5;
  }

  /* Simplify glow pulse on logo */
  .hero__logo-mark {
    animation: none !important;
  }

  /* Reduce reveal transition duration for snappier feel */
  .reveal,
  .reveal-left,
  .reveal-right {
    transition-duration: 0.4s !important;
  }

  /* Remove stagger delays on mobile — too slow feeling */
  .stagger > * {
    transition-delay: 0ms !important;
  }

  /* Restore divider shimmer — CSS only, safe on mobile */
  .divider::after {
    animation: shimmerLine 4s ease-in-out infinite;
    display: block;
  }

  /* Kill dot grid backgrounds — saves paint */
  .services-process,
  .why-section,
  .what-we-do,
  .about-story {
    background-image: none !important;
  }

  /* Remove text-shadow on hero heading */
  .hero__heading {
    text-shadow: none !important;
  }

  /* Remove box-shadow on scrolled nav */
  .nav.scrolled {
    box-shadow: none !important;
  }

  /* Ensure all interactive elements have no tap delay */
  a, button, [role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

/* ── PAGE LOADER ─────────────────────────────────────────────── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s var(--ease-out),
              transform 0.5s var(--ease-out);
}

.loader.hide {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.loader.done {
  display: none;
}

.loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  position: relative;
}

/* Rotating rings */
.loader__rings {
  position: absolute;
  width: 140px;
  height: 140px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.loader__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
}

.loader__ring--1 {
  inset: 0;
  border-top-color: var(--accent-primary);
  border-right-color: var(--accent-primary);
  opacity: 0.5;
  animation: loaderSpin 1.4s linear infinite;
}

.loader__ring--2 {
  inset: 12px;
  border-bottom-color: var(--accent-secondary);
  border-left-color: var(--accent-secondary);
  opacity: 0.35;
  animation: loaderSpin 2s linear infinite reverse;
}

.loader__ring--3 {
  inset: 24px;
  border-top-color: var(--accent-primary);
  opacity: 0.2;
  animation: loaderSpin 3s linear infinite;
}

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

/* Logo */
.loader__logo-wrap {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: loaderLogoPulse 1.5s ease-in-out infinite;
}

.loader__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 16px var(--accent-glow));
}

@keyframes loaderLogoPulse {
  0%, 100% { filter: drop-shadow(0 0 12px #4fc3f740); }
  50%       { filter: drop-shadow(0 0 28px #4fc3f7a0); }
}

/* Wordmark */
.loader__wordmark {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-secondary);
  height: 1em;
  min-width: 80px;
  text-align: center;
}

/* Progress bar */
.loader__bar-wrap {
  width: 120px;
  height: 1px;
  background: var(--border-dim);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-2);
}

.loader__bar {
  height: 100%;
  width: 0%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  transition: width 0.08s linear;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ── SCROLL PROGRESS BAR ─────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 2px;
  background: var(--grad-primary);
  z-index: 2000;
  box-shadow: 0 0 8px var(--accent-glow);
  pointer-events: none;
  will-change: width;
}

/* ── SCROLL TO TOP ───────────────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-dim);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.scroll-top:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Scroll-to-top: phones only */
@media (min-width: 769px) {
  .scroll-top {
    display: none;
  }
}