/**
 * BASE STYLES
 *
 * Core foundation styles including:
 * - CSS custom properties (design tokens)
 * - Reset and normalize styles
 * - Base typography and global styles
 * - Core animations and keyframes
 */

/* CSS Custom Properties (Variables) */
:root {
  /* Brand Colors */
  --primary-blue: #0d77a9;
  --primary-purple: #6366f1;
  --secondary-blue: #206380;
  --secondary-purple: #5c5dd9;

  /* Brand Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-blue) 50%, var(--primary-purple) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--secondary-blue) 50%, var(--secondary-purple) 100%);
  --gradient-brand: linear-gradient(135deg, #000000, #000000, #228d69, #34d399);

  /* Glassmorphic Colors */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-bg-strong: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-border-strong: rgba(255, 255, 255, 0.25);

  /* Backdrop Blur Effects */
  --blur-light: blur(3px);
  --blur-medium: blur(6px);
  --blur-strong: blur(10px);
  --blur-intense: blur(15px);

  /* Common Transitions */
  --transition-smooth: all 0.3s ease;
  --transition-fast: all 0.2s ease;
}

/* Base Reset and Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  overflow-x: hidden;
  touch-action: pan-y;
  color: black;
  position: relative;
}

/* Smooth scroll behavior disabled to avoid animated history scroll restoration */
html {
  scroll-behavior: auto;
  overflow-x: hidden;
}

/* Subtle grid overlay (30px) */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  background-repeat: repeat;
  pointer-events: none;
  z-index: 3;
}

/* Typography */
.territory-title {
  font-size: 4rem;
  font-weight: bold;
  background: var(--gradient-brand);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.tutorial-title {
  font-size: 1.875rem;
  font-weight: bold;
  background: var(--gradient-brand);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 1.25rem auto 0.75rem !important;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.tutorial-subtitle {
  font-size: 1.25rem;
  background: var(--gradient-secondary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  font-weight: 700;
  line-height: 1.4;
}

/* Global Animations */
@keyframes lightStreak {
  0% { transform: translate(0, 0); }
  100% { transform: translate(300px, 300px); }
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes logoPulse {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1.1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes phoneFloat {
  0%, 100% {
    transform: translateY(0px) rotate(-2deg) scale(1);
  }
  25% {
    transform: translateY(-10px) rotate(1deg) scale(1.02);
  }
  50% {
    transform: translateY(-5px) rotate(-1deg) scale(1.01);
  }
  75% {
    transform: translateY(-10px) rotate(2deg) scale(1.02);
  }
}

@keyframes scrollFade {
  0%   { transform: translate(-50%, 0);       opacity: 0;   }
  10%  { opacity: .25; }
  100% { transform: translate(-50%, 120px);   opacity: 0;   }
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(20px, 20px) rotate(5deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes gentle-float { /* retained for reference but unused */
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Header fade-in on load (no movement, opacity only) */
.title-fade {
  opacity: 0;
  transition: opacity 1400ms ease;
}
.title-fade.visible {
  opacity: 1;
}

/* Soft Fade-in for Sections */
section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Logo styles */
.logo-container {
  margin-bottom: 2rem;
  text-align: center;
  width: 100%;
}

.app-logo {
  width: 80px;
  height: 80px;
  margin: 2rem auto 1.5rem;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  animation: logoPulse 4s ease-in-out infinite;
}

/* App store icon styles */
.app-store-icon {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.5rem;
}

/* Hash navigation redirects - prevent flash from Card 1 */
html[data-hash="tutorial-videos"] body,
html[data-hash="support"] body {
  visibility: hidden;
}

/* Show content after positioning is complete */
html[data-hash="tutorial-videos"].positioned body,
html[data-hash="support"].positioned body {
  visibility: visible;
}