/* ============================================================
   MAKE IT EASY — Design System "The Luminous Engine"
   globals.css — CSS Variables + Utilities + Animations
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--surface);
  color: var(--on-surface);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* Skip to content (accessibility) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ---- 2. CSS CUSTOM PROPERTIES ---- */
:root {
  /* Surfaces */
  --surface:                   #0a0e16;
  --surface-container-lowest:  #080c13;
  --surface-container-low:     #0f131c;
  --surface-container:         #151a23;
  --surface-container-high:    #1a202a;
  --surface-container-highest: #202632;
  --surface-bright:            #262c39;

  /* Accents */
  --primary:           #8ff5ff;
  --primary-container: #00eefc;
  --on-primary:        #003f43;
  --secondary:         #af88ff;
  --secondary-container: rgba(175, 136, 255, 0.15);
  --tertiary:          #47c4ff;

  /* States */
  --error:    #ff716c;
  --error-dim: #d7383b;
  --success:  #4ade80;
  --warning:  #fbbf24;

  /* Text */
  --on-surface:         #eef0fc;
  --on-surface-variant: #9ba3b8;
  --outline:            rgba(139, 148, 178, 0.3);
  --outline-variant:    rgba(139, 148, 178, 0.15);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #8ff5ff 0%, #00eefc 100%);
  --gradient-hero:    radial-gradient(ellipse at 60% 40%, rgba(143, 245, 255, 0.08) 0%, transparent 60%),
                      radial-gradient(ellipse at 20% 80%, rgba(175, 136, 255, 0.06) 0%, transparent 50%);
  --gradient-mesh:    radial-gradient(ellipse at 80% 20%, rgba(143, 245, 255, 0.05) 0%, transparent 50%),
                      radial-gradient(ellipse at 10% 90%, rgba(175, 136, 255, 0.04) 0%, transparent 40%);

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
  --glow-primary:   0 0 30px rgba(143, 245, 255, 0.25);
  --glow-secondary: 0 0 30px rgba(175, 136, 255, 0.2);

  /* Radii */
  --radius-sm:   0.5rem;
  --radius-md:   1rem;
  --radius-lg:   1.5rem;
  --radius-xl:   2rem;
  --radius-full: 9999px;

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

  /* Typography scale */
  --text-display-lg: 3.5rem;
  --text-display-md: 2.75rem;
  --text-headline:   1.75rem;
  --text-title-lg:   1.25rem;
  --text-title-md:   1.1rem;
  --text-body-lg:    1rem;
  --text-body-md:    0.9rem;
  --text-label-md:   0.75rem;
  --text-label-sm:   0.7rem;

  /* Layout */
  --max-width: 1280px;
  --nav-height: 80px;
}

/* ---- 3. TYPOGRAPHY ---- */
.display-lg {
  font-size: clamp(2.5rem, 6vw, var(--text-display-lg));
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.display-md {
  font-size: clamp(2rem, 4vw, var(--text-display-md));
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.headline {
  font-size: var(--text-headline);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.overline {
  font-size: var(--text-label-md);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary);
}
.body-lg { font-size: var(--text-body-lg); line-height: 1.7; }
.body-muted { color: var(--on-surface-variant); }

/* ---- 4. LAYOUT ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-8);
}
@media (max-width: 768px) {
  .container { padding-inline: var(--space-6); }
}
@media (max-width: 480px) {
  .container { padding-inline: var(--space-4); }
}

.section {
  padding-block: var(--space-24);
}
@media (max-width: 768px) {
  .section { padding-block: var(--space-16); }
}

/* ---- 5. COMPONENT CLASSES ---- */

/* Glassmorphism */
.glass {
  background: rgba(21, 26, 35, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--outline-variant);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.75rem 2rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--text-body-lg);
  letter-spacing: 0.01em;
  border: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(21, 26, 35, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid var(--outline-variant);
  color: var(--primary);
}
.btn-secondary:hover {
  border-color: var(--primary);
  background: rgba(143, 245, 255, 0.06);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--outline-variant);
  color: var(--on-surface);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: var(--text-body-md);
}

/* Bento Card */
.bento-card {
  background: var(--surface-container-high);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: transform 250ms ease, background 250ms ease, box-shadow 250ms ease;
}
.bento-card:hover {
  transform: translateY(-4px);
  background: var(--surface-bright);
  box-shadow: var(--shadow-md);
}

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--secondary-container);
  color: var(--secondary);
  border: 1px solid rgba(175, 136, 255, 0.25);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.875rem;
  font-size: var(--text-label-md);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* Primary chip */
.chip-primary {
  background: rgba(143, 245, 255, 0.1);
  color: var(--primary);
  border-color: rgba(143, 245, 255, 0.25);
}

/* Icon box */
.icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
}
.icon-box-primary { background: rgba(143, 245, 255, 0.1); color: var(--primary); }
.icon-box-secondary { background: rgba(175, 136, 255, 0.1); color: var(--secondary); }
.icon-box-tertiary { background: rgba(71, 196, 255, 0.1); color: var(--tertiary); }

/* Input */
.input {
  width: 100%;
  background: var(--surface-container-low);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.875rem 1.25rem;
  color: var(--on-surface);
  font-size: var(--text-body-lg);
  outline: none;
  transition: border-color 150ms ease;
}
.input:focus { border-color: var(--primary); }
.input::placeholder { color: var(--on-surface-variant); }
.input.error { border-color: var(--error); }

select.input { appearance: none; cursor: pointer; }

/* Label for forms */
.form-label {
  display: block;
  font-size: var(--text-body-md);
  font-weight: 600;
  color: var(--on-surface-variant);
  margin-bottom: var(--space-2);
}

/* Material Symbols Outlined config */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 1.5rem;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}

/* ---- 6. ANIMATIONS ---- */

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* Fade in up (keyframe) */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.7s ease both; }
.fade-in-up-1 { animation-delay: 0.1s; }
.fade-in-up-2 { animation-delay: 0.25s; }
.fade-in-up-3 { animation-delay: 0.4s; }
.fade-in-up-4 { animation-delay: 0.55s; }
.fade-in-up-5 { animation-delay: 0.7s; }

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  background: #FFFFFF; /* Premium White for the new logo */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

body.loading {
  overflow: hidden;
}

.loader-content {
  position: relative;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.loader-logo {
  margin-bottom: 3rem;
  opacity: 0;
  transform: scale(0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible; /* Ensure glow isn't clipped */
}

.loader-logo img {
  max-width: 320px; /* Increased for premium feel */
  width: 90%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.08)); /* Soft dark shadow for white BG */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Navbar Logo visibility on dark background */
.nav-logo-img {
  filter: brightness(0) invert(1); /* Makes the dark logo white for the dark navbar */
  transition: filter 0.3s ease;
}



.loader-logo.text-mode {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--on-surface);
  letter-spacing: -0.02em;
}

.loader-progress-wrap {
  position: fixed;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  height: 200px;
  width: 2px;
  background: rgba(143, 245, 255, 0.1);
}

.loader-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: #00B8D4; /* Slightly darker cyan for contrast on white */
  box-shadow: 0 0 10px rgba(0, 184, 212, 0.3);
}

@media (max-width: 768px) {
  .loader-logo img {
    max-width: 160px;
  }
  .loader-progress-wrap {
    right: 20px;
    height: 150px;
  }
}

/* Text Reveal */
.reveal-text {
  overflow: hidden;
  display: block;
}

.reveal-text > * {
  display: block;
  transform: translateY(100%);
}

/* Glow pulse */
@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.04); }
}
.glow-pulse { animation: glowPulse 3s ease-in-out infinite; }

/* Marquee */
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-track { animation: marquee 30s linear infinite; }
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }

/* Scan line overlay */
@keyframes scanLine {
  0%   { opacity: 0.03; background-position: 0 0; }
  100% { opacity: 0.03; background-position: 0 100%; }
}

/* Float particle */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-12px) rotate(2deg); }
  66%       { transform: translateY(6px) rotate(-1deg); }
}

/* Typing cursor */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 1.25rem; height: 1.25rem;
  border: 2px solid var(--on-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* Number counter */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- 7. NOISE TEXTURE OVERLAY ---- */
.noise-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.04;
  border-radius: inherit;
}

/* ---- 8. UTILITY ---- */
.text-primary    { color: var(--primary); }
.text-secondary  { color: var(--secondary); }
.text-tertiary   { color: var(--tertiary); }
.text-muted      { color: var(--on-surface-variant); }
.text-error      { color: var(--error); }
.text-success    { color: var(--success); }

.bg-surface           { background-color: var(--surface); }
.bg-surface-low       { background-color: var(--surface-container-low); }
.bg-surface-container { background-color: var(--surface-container); }
.bg-surface-high      { background-color: var(--surface-container-high); }
.bg-surface-bright    { background-color: var(--surface-bright); }

.glow-text-primary   { text-shadow: 0 0 20px rgba(143, 245, 255, 0.5); }
.glow-text-secondary { text-shadow: 0 0 20px rgba(175, 136, 255, 0.5); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.hidden { display: none !important; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Selection */
::selection {
  background: var(--primary);
  color: var(--on-primary);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface-container-low); }
::-webkit-scrollbar-thumb { background: var(--outline); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---- 9. RESPONSIVE HELPERS ---- */
@media (max-width: 1024px) {
  .hide-mobile { display: none !important; }
  .display-lg { font-size: clamp(2rem, 8vw, 3rem); }
  .nav-links { display: none !important; }
}
@media (min-width: 1025px) {
  .show-mobile { display: none !important; }
}
