/* ==========================================================================
   NCO ALPINE SKI TEAM - BRIGHT ALPINE DESIGN SYSTEM & FOUNDATION
   National Capital Outaouais Ski Team / Équipe de ski alpin NCO
   ========================================================================== */

/* Google Fonts (Outfit, Plus Jakarta Sans, JetBrains Mono) are loaded with a
   <link> in each page <head> (static pages) or enqueued as 'nco-google-fonts'
   in functions.php (WordPress). A CSS @import here would be render-blocking
   and, in WordPress, load the same font stylesheet twice. */

:root {
  /* Bright Alpine Color Palette */
  --color-alpine-darkest: #F8FAFC;       /* Pristine Glacial Snow Canvas */
  --color-alpine-dark: #F1F5F9;          /* Fresh Powder Tone */
  --color-alpine-surface: #FFFFFF;       /* Pure Alpine White */
  --color-alpine-surface-hover: #F8FAFC;
  --color-alpine-card: rgba(255, 255, 255, 0.95);
  --color-alpine-card-solid: #FFFFFF;
  --color-alpine-card-border: rgba(15, 23, 42, 0.08);
  --color-alpine-card-border-hover: rgba(225, 29, 72, 0.4);
  
  /* High-Performance Accents */
  --color-race-crimson: #E11D48;
  --color-race-crimson-hover: #BE123C;
  --color-race-crimson-light: #FFF1F2;
  --color-race-crimson-glow: rgba(225, 29, 72, 0.25);
  
  /* Podium & Speed Accents */
  --color-podium-gold: #D97706;          /* Deep rich gold for high contrast on light */
  --color-podium-gold-glow: rgba(217, 119, 6, 0.2);
  --color-alpine-azure: #0284C7;
  --color-alpine-cyan: #0891B2;
  
  /* High-Contrast Typography & Slate Neutrals */
  --color-snow-white: #0A1124;           /* Deep Midnight Navy for primary titles */
  --color-snow-ice: #1E293B;             /* Primary text */
  --color-snow-muted: #334155;           /* Secondary text */
  --color-slate-light: #475569;          /* Subtitles & Descriptions */
  --color-slate-mid: #64748B;
  --color-slate-dark: #94A3B8;
  
  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Elevation & Shadows */
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px -8px rgba(15, 23, 42, 0.12);
  --shadow-crimson: 0 12px 28px -4px rgba(225, 29, 72, 0.35);
  --shadow-gold: 0 12px 28px -4px rgba(217, 119, 6, 0.25);
  --shadow-glow: 0 0 50px -10px rgba(225, 29, 72, 0.2);
  
  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 9999px;
  
  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Layout Spacing */
  --container-max: 1280px;
  --container-pad: 24px;
  --section-pad-y: 100px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--color-alpine-darkest);
  color: var(--color-snow-ice);
  font-family: var(--font-body);
}

body {
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: clip;
  position: relative;
  background-color: #F8FAFC;
  background-image: 
    radial-gradient(ellipse 90% 45% at 50% -10%, rgba(225, 29, 72, 0.05), transparent 70%),
    radial-gradient(circle 900px at 95% 15%, rgba(2, 132, 199, 0.04), transparent 60%),
    radial-gradient(circle 800px at 5% 85%, rgba(245, 158, 11, 0.04), transparent 60%);
}

/* Selection */
::selection {
  background-color: var(--color-race-crimson);
  color: #FFFFFF;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-snow-white);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw + 1rem, 4.75rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(2rem, 3.2vw + 0.5rem, 3.25rem);
}

h3 {
  font-size: clamp(1.4rem, 2vw + 0.25rem, 2rem);
  font-weight: 700;
}

h4 {
  font-size: 1.25rem;
  font-weight: 700;
}

p {
  color: var(--color-slate-light);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  font-weight: 400;
}

p.lead {
  font-size: clamp(1.15rem, 1.2vw + 0.5rem, 1.35rem);
  color: var(--color-snow-muted);
  line-height: 1.6;
  font-weight: 400;
}

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

img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
}

/* Container & Layout */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.container-narrow {
  max-width: 960px;
}

.section {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
  position: relative;
}

/* Below-the-fold layout & paint containment for 60fps scrolling */
#events,
#team-sponsors,
#sponsorship,
#fundraising,
#about {
  content-visibility: auto;
  contain-intrinsic-size: auto 650px;
}

/* View Transitions API smooth cross-fade */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.section-head {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 56px;
}

.section-head.text-left {
  text-align: left;
  margin-left: 0;
}

/* Overline & Category Badges */
.overline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.825rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #BE123C;
  margin-bottom: 14px;
  padding: 6px 14px;
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.2);
  border-radius: var(--radius-pill);
}

.overline.gold {
  color: #B45309;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
}

.overline.blue {
  color: #0369A1;
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.25);
}

/* Gradient Text Highlights */
.text-gradient-crimson {
  background: linear-gradient(135deg, #0A1124 20%, #E11D48 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
  background: linear-gradient(135deg, #0A1124 20%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Utility Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.animate-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Skip to Main Content Link (Keyboard Accessibility) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 12px 22px;
  background: #0A1124;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  border: 2px solid var(--color-race-crimson);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
  color: #FFFFFF;
  outline: 3px solid var(--color-race-crimson);
  outline-offset: 2px;
}

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

/* Respect Reduced Motion Preferences (WCAG 2.2 AA 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .beacon-dot,
  .animate-fade-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-backdrop {
    transform: none !important;
    transition: none !important;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}
