/* ==========================================================================
   VANT DESIGN - Core Design System & Tokens
   Refined for Maximum Readability, Crystal-Clear Typography & Fluid Scalability
   ========================================================================== */

/* Unified Self-Hosted Variable Fonts (Latin + Polish Diacritics, all weights 100-900 in 2 files) */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
  src: url('/assets/fonts/outfit.woff2') format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
  src: url('/assets/fonts/plus-jakarta-sans.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: optional;
  src: url('/assets/fonts/space-grotesk-latin.woff2') format('woff2');
}

:root {

  /* Apple Dark Mode Spectrum & Depth */
  --color-bg-base: #000000;
  --color-bg-subtle: #08080a;
  --color-bg-surface: #121215;
  --color-bg-elevated: #1c1c1f;
  --color-bg-glass: rgba(22, 22, 26, 0.75);
  
  /* Apple Pro Accent Tokens (Cupertino Blue & Electric Cyan) */
  --color-apple-blue: #0071e3;
  --color-apple-blue-hover: #147ce5;
  --color-apple-blue-active: #0062c4;
  --color-apple-blue-glow: rgba(0, 113, 227, 0.35);
  
  --color-brand-violet: #0071e3;
  --color-brand-violet-deep: #0056b3;
  --color-brand-indigo: #2997ff;
  --color-brand-cobalt: #0071e3;
  --color-brand-cyan: #2997ff; /* Apple iOS Electric Accent Blue */
  --color-brand-gradient: linear-gradient(135deg, #2997ff 0%, #0071e3 50%, #5e5ce6 100%);
  --color-brand-gradient-glow: linear-gradient(135deg, rgba(41, 151, 255, 0.35) 0%, rgba(0, 113, 227, 0.25) 100%);
  --gradient-cupertino-primary: linear-gradient(180deg, #0077ed 0%, #0062c4 100%);
  
  /* High Readability & Contrast Text Tokens (WCAG 2.2 AAA Compliant) */
  --color-text-primary: #f5f5f7;
  --color-text-secondary: #a1a1a6;
  --color-text-muted: #9e9ea3; /* Upgraded from #6e6e73 to pass 7:1 AAA contrast */
  --color-text-inverse: #000000;
  
  /* Apple Borders & Surface Separators */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.28);
  --border-accent: rgba(41, 151, 255, 0.45);
  --border-accent-glow: rgba(0, 113, 227, 0.55);

  /* Status Colors (Apple HIG System Green) */
  --color-status-success: #30d158;
  --color-status-success-bg: rgba(48, 209, 88, 0.12);

  /* Clean, Ultra-Legible Modern Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro', sans-serif;
  --font-mono: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', Menlo, Monaco, Consolas, monospace;

  /* Emil Kowalski / Apple Animation Physics & Curves */
  --ease-snappy: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --duration-fast: 150ms;
  --duration-normal: 240ms;
  --duration-slow: 380ms;

  /* Spatial Scales */
  --space-unit: 8px;
  --container-max: 1380px;
  --container-narrow: 1060px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 9999px;

  /* Ambient Glass & Depth */
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-elevated: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 50px -10px rgba(0, 113, 227, 0.25);
  --backdrop-blur: blur(20px) saturate(180%);
}

/* Base Reset & Foundations */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography Classes with Maximum Readability */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.font-mono {
  font-family: var(--font-mono);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

::selection {
  background-color: var(--color-brand-violet);
  color: #ffffff;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 60px);
  position: relative;
  z-index: 10;
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section-padding {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center; /* center vertically */
  padding-top: 80px; /* clear nav */
  padding-bottom: 20px;
}

/* Precise Section Snap Alignment (0ms input lag, 120 FPS) */
.hero-section,
.section-padding,
section.snap-section {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

/* Focus States for Accessibility (WCAG AAA) */
:focus-visible {
  outline: 2px solid var(--color-brand-cyan);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Skip to main content link for screen readers */
.skip-link {
  position: fixed;
  top: -60px;
  left: 20px;
  background: var(--color-brand-violet);
  color: #fff;
  padding: 12px 20px;
  z-index: 10000;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 20px;
}


/* --------------------------------------------------------------------------
   Ambient Atmospheric Glowing Background (Rich Apple Pro Blue -> Darkening Decay)
   -------------------------------------------------------------------------- */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  z-index: 0; /* Positioned directly behind content layers */
  pointer-events: none;
  background-color: #030408;
  contain: strict;
}



/* Primary Majestic Cupertino Blue Aurora */
/* Ambient Background Glows: Optimized Gaussian Blur Radius for 120 FPS Rendering */
.glow-primary {
  position: absolute;
  top: -15vh;
  left: 8vw;
  width: 80vw;
  height: 75vh;
  max-width: 1100px;
  max-height: 850px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.75) 0%, rgba(0, 86, 179, 0.45) 45%, transparent 75%);
  filter: blur(45px);
  animation: floatPrimary 20s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
  opacity: var(--ambient-glow-opacity, 1);
  transition: opacity 0.2s ease-out;
  z-index: 1;
}

/* Electric Cyan Accent Aurora */
.glow-cyan {
  position: absolute;
  top: -5vh;
  right: -8vw;
  width: 65vw;
  height: 65vh;
  max-width: 900px;
  max-height: 750px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41, 151, 255, 0.65) 0%, rgba(0, 113, 227, 0.35) 45%, transparent 70%);
  filter: blur(40px);
  animation: floatCyan 26s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
  opacity: var(--ambient-glow-opacity, 1);
  transition: opacity 0.2s ease-out;
  z-index: 1;
}

/* Electric Indigo Deep Depth Aurora */
.glow-indigo {
  position: absolute;
  top: 30vh;
  left: -15vw;
  width: 70vw;
  height: 70vh;
  max-width: 850px;
  max-height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 92, 230, 0.5) 0%, rgba(0, 113, 227, 0.25) 50%, transparent 75%);
  filter: blur(45px);
  animation: floatIndigo 22s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
  opacity: var(--ambient-glow-opacity, 1);
  transition: opacity 0.2s ease-out;
  z-index: 1;
}

/* Center Radiant Core Bloom */
.glow-center {
  position: absolute;
  top: 8vh;
  left: 22vw;
  width: 55vw;
  height: 50vh;
  max-width: 750px;
  border-radius: 50%;
  background: radial-gradient(ellipse 60% 40% at 50% 50%, rgba(41, 151, 255, 0.4) 0%, transparent 70%);
  filter: blur(35px);
  animation: pulseCenter 14s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
  opacity: var(--ambient-glow-opacity, 1);
  transition: opacity 0.2s ease-out;
  z-index: 1;
}

/* Base Darkening Overlay: Soft vertical fade from top to bottom */
.ambient-darkness-gradient {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.15) 35%,
    rgba(0, 0, 0, 0.55) 70%,
    rgba(0, 0, 0, 0.95) 100%
  );
  z-index: 2;
}

/* Dynamic Scroll Darkening Veil (controlled dynamically via JS) */
.ambient-scroll-veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  opacity: 0;
  transition: opacity 0.15s ease-out;
  z-index: 3;
}

/* Cinema Subsurface Noise Texture */
.ambient-noise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 4;
}

/* Smooth Kinetic Floating Animations */
@keyframes floatPrimary {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(8vw, 6vh, 0) scale(1.1);
  }
  100% {
    transform: translate3d(-5vw, 10vh, 0) scale(0.95);
  }
}

@keyframes floatCyan {
  0% {
    transform: translate3d(0, 0, 0) scale(0.95);
  }
  50% {
    transform: translate3d(-10vw, 8vh, 0) scale(1.12);
  }
  100% {
    transform: translate3d(4vw, -4vh, 0) scale(1);
  }
}

@keyframes floatIndigo {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(6vw, -8vh, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-4vw, 4vh, 0) scale(0.92);
  }
}

@keyframes pulseCenter {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glow-primary,
  .glow-cyan,
  .glow-indigo,
  .glow-center {
    animation: none !important;
  }
}

main {
  position: relative;
  z-index: 2;
  background: transparent;
}


/* --------------------------------------------------------------------------
   Hide Native Scrollbars
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  display: none;
}
html, body {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* --------------------------------------------------------------------------
   Fixed Elements
   -------------------------------------------------------------------------- */
#slide-indicator {
  position: fixed;
  bottom: max(20px, calc(10px + env(safe-area-inset-bottom, 0px)));
  right: max(24px, calc(16px + env(safe-area-inset-right, 0px)));
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', var(--font-mono);
  font-variant-numeric: tabular-nums;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  background: rgba(4, 5, 8, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

#slide-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  #slide-indicator {
    bottom: max(14px, calc(6px + env(safe-area-inset-bottom, 0px)));
    right: max(16px, calc(10px + env(safe-area-inset-right, 0px)));
    font-size: 0.8rem;
  }
}
