/**
 * Critical CSS for Modern Warrior School
 * =======================================
 * Above-the-fold styles for immediate render
 * This file contains only the essential CSS needed for initial page render
 * to improve First Contentful Paint (FCP) and Largest Contentful Paint (LCP)
 * 
 * Inline this CSS in the <head> for production builds
 * Remaining styles should be loaded asynchronously
 */

/* ===== Base Reset & Typography ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: 'Playfair Display', serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  color: #ccc;
  background: linear-gradient(to bottom, #252525, #151515);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== Skip Link (Accessibility) ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 10000;
}

.skip-link:focus {
  top: 0;
}

/* ===== Header (Above-the-fold) ===== */
#mws-header-container {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #333;
  min-height: 85px;
}

/* ===== Hero Section (Critical - Above-the-fold) ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(50,50,50,0.75), rgba(5,5,5,0.95) 80%);
}

.hero-logo-wrapper {
  position: relative;
  width: 300px;
  height: 300px;
  margin-bottom: 2rem;
  transform-style: preserve-3d;
  animation: heroLogoFadeIn 0.8s ease-out;
}

@keyframes heroLogoFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-overlay {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 900px;
  animation: heroOverlayFadeIn 1s ease-out 0.3s both;
}

@keyframes heroOverlayFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-overlay h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.hero-overlay h1 span {
  display: inline-block;
}

.hero-overlay p {
  font-size: clamp(1rem, 2vw, 1.5rem);
  margin-bottom: 2rem;
  color: #ccc;
  min-height: 2em;
}

/* ===== Hero Buttons ===== */
.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: #fff;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #357abd, #2868a8);
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, #333, #1a1a1a);
  color: #fff;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #444, #2a2a2a);
  border-color: #666;
  transform: translateY(-2px);
}

/* ===== Lazy Loading States ===== */
.lazy-load {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.lazy-loading {
  opacity: 0.5;
  background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.lazy-loaded {
  opacity: 1;
}

.blur-up {
  filter: blur(10px);
  transition: filter 0.3s ease-in-out;
}

.blur-up.lazy-loaded {
  filter: blur(0);
}

/* ===== Hidden Utility ===== */
.hidden {
  display: none !important;
}

/* ===== Responsive Breakpoints ===== */
@media (max-width: 768px) {
  .hero {
    min-height: 80vh;
    padding: 1rem;
  }
  .hero-logo-wrapper {
    width: 200px;
    height: 200px;
  }
  .hero-overlay {
    max-width: 98vw;
    padding: 1rem;
  }
  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }
  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-overlay {
    max-width: 99vw;
    padding: 0.75rem 0.5rem;
    font-size: 0.98rem;
  }
  .hero-overlay h1 {
    font-size: 1.3rem !important;
    flex-direction: column;
    gap: 0.2rem;
    word-break: break-word;
  }
  .hero-overlay p {
    font-size: 1rem !important;
    margin-bottom: 1rem;
  }
  .hero-buttons {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    align-items: stretch;
  }
  .btn {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
    padding: 0.7rem 0.5rem;
  }
}

/* ===== Font Loading Optimization ===== */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Playfair Display'), local('PlayfairDisplay-Regular');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Playfair Display Bold'), local('PlayfairDisplay-Bold');
}
