/* ============================================
   GLOBALS — Design Tokens, Reset, Typography, Glass System
   ============================================ */

/* --- CSS Custom Properties / Design Tokens --- */
:root {
  /* Colors (OKLCH). Neutrals tinted toward royal hue or warm yellow. */
  --ivory: oklch(0.992 0.013 100);
  --ivory-warm: oklch(0.973 0.011 95);
  --ivory-muted: oklch(0.926 0.014 90);
  --royal: oklch(0.395 0.205 264);
  --royal-deep: oklch(0.272 0.180 266);
  --royal-light: oklch(0.937 0.025 260);
  --volt: oklch(0.945 0.260 124);
  --volt-muted: oklch(0.860 0.235 125);
  --charcoal: oklch(0.180 0.005 265);
  --slate: oklch(0.448 0.014 268);
  --glass-white: oklch(0.992 0.013 100 / 0.55);
  --glass-border: oklch(1 0 0 / 0.3);
  --glass-blur: 20px;

  /* Event Category Colors */
  --cat-special: oklch(0.638 0.218 25);
  --cat-group: oklch(0.660 0.155 260);
  --cat-groups: oklch(0.681 0.155 165);
  --cat-youth: oklch(0.620 0.250 300);
  --cat-women: oklch(0.665 0.245 350);
  --cat-men: oklch(0.605 0.220 255);
  --cat-serve: oklch(0.700 0.190 50);

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;
  --space-2xl: 120px;
  --section-pad: 120px 0;
  --container: 1200px;
  --grid-gap: 24px;

  /* Typography */
  --font-sans: 'Geist Sans', 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
  --font-pixel: 'Geist Pixel Circle', 'Geist Sans', sans-serif;

  /* Transitions */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Font Face Declarations (self-hosted variable fonts) --- */
@font-face {
  font-family: 'Geist Sans';
  src: url('../fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Geist Pixel variants */
@font-face {
  font-family: 'Geist Pixel Square';
  src: url('../fonts/GeistPixel-Square.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Pixel Circle';
  src: url('../fonts/GeistPixel-Circle.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Pixel Grid';
  src: url('../fonts/GeistPixel-Grid.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Pixel Line';
  src: url('../fonts/GeistPixel-Line.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Pixel Triangle';
  src: url('../fonts/GeistPixel-Triangle.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--charcoal);
  background-color: var(--ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* --- Skip to Content (Accessibility) --- */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 12px 24px;
  background: var(--royal);
  color: var(--ivory);
  font-weight: 600;
  border-radius: 0 0 12px 12px;
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 0;
}

/* --- Container --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 600;
}

.display-h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 72px;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.pixel-accent {
  font-family: var(--font-pixel);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h2, .section-h2 {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 80px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 0.95;
}

/* --- Typewriter Animation --- */
.typewriter-word {
  color: var(--volt);
  display: inline-block;
  min-width: 4ch;
}

.typewriter-cursor {
  display: inline-block;
  color: var(--volt);
  font-weight: 300;
  animation: blink 0.7s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

h3, .card-h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.body-text {
  font-size: 17px;
  line-height: 1.7;
}

/* --- Section Layout --- */
.section {
  padding: var(--section-pad);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-header .label {
  color: var(--royal);
  margin-bottom: var(--space-sm);
  display: block;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.section-header h2 {
  color: var(--charcoal);
  margin-bottom: var(--space-md);
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: var(--volt);
  margin: var(--space-sm) auto 0;
  border-radius: 2px;
}

.section-header p {
  color: var(--slate);
  font-size: 17px;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Background Variants --- */
.bg-ivory {
  background-color: var(--ivory);
}

.bg-ivory-warm {
  background-color: var(--ivory-warm);
}

.bg-royal-gradient {
  background: linear-gradient(135deg, var(--royal-deep) 0%, var(--royal) 100%);
}

.bg-royal {
  background-color: var(--royal);
}

.bg-royal-deep {
  background-color: var(--royal-deep);
}

/* --- Surface Card (formerly Liquid Glass)
   Soft, mostly-opaque ivory surface. Heavy backdrop-blur is reserved
   for the navbar, dropdown, and popup overlays only. */
.glass-surface {
  position: relative;
  background: var(--ivory-warm);
  border: 1px solid var(--ivory-muted);
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(26, 63, 199, 0.05);
  transition: background 0.3s var(--ease-spring), transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring), border-color 0.3s var(--ease-spring);
}

.glass-surface:hover {
  border-color: rgba(26, 63, 199, 0.18);
  box-shadow: 0 10px 28px rgba(26, 63, 199, 0.09);
  transform: translateY(-2px);
}

.glass-pill {
  background: var(--ivory-warm);
  border: 1px solid var(--ivory-muted);
  border-radius: 100px;
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
}

/* --- Grid System --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
}

/* --- Scroll Animations --- */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-spring), transform 0.6s var(--ease-spring);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Focus Styles (Accessibility) --- */
:focus-visible {
  outline: 2px solid var(--royal);
  outline-offset: 2px;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-up {
    opacity: 1;
    transform: none;
  }

  .glass-surface:hover {
    transform: none;
  }
}

/* --- Responsive Typography --- */
@media (max-width: 768px) {
  :root {
    --section-pad: 64px 0;
  }

  .display-h1 {
    font-size: 40px;
  }

  h2, .section-h2 {
    font-size: 40px;
    letter-spacing: 0.03em;
  }

  h3, .card-h3 {
    font-size: 20px;
  }

  body {
    font-size: 16px;
  }

  .label {
    font-size: 11px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* --- Skeleton Loading States --- */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.15; }
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-img {
  width: 100%;
  height: 200px;
  background: var(--ivory-muted);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-line {
  height: 14px;
  background: var(--ivory-muted);
  border-radius: 6px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  margin-bottom: 10px;
}

.skeleton-line-sm { width: 30%; }
.skeleton-line-md { width: 60%; }
.skeleton-line-lg { width: 80%; }
.skeleton-line-full { width: 100%; }

/* --- Announcement Banner --- */
.announcement-banner {
  background: var(--royal);
  color: var(--ivory);
  text-align: center;
  padding: 12px 24px;
  font-size: 15px;
  line-height: 1.5;
  position: relative;
  z-index: 100;
}

.announcement-banner a {
  color: var(--volt);
  font-weight: 600;
  text-decoration: underline;
  margin-left: 8px;
}

.announcement-banner-close {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 4px;
}

.announcement-banner-close:hover {
  color: var(--ivory);
}
