/* ============================================
   RAVES FOR THE BRAVE - Global Stylesheet
   Military precision meets rave energy
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Dark military base */
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;

  /* Text */
  --text-primary: #e8e8f0;
  --text-secondary: #9a9ab0;
  --text-muted: #6a6a80;

  /* Neon accents */
  --neon-purple: #b44aff;
  --neon-magenta: #ff2d95;
  --neon-cyan: #00e5ff;
  --neon-green: #39ff14;

  /* Military accents */
  --military-green: #4a5e3a;
  --military-olive: #6b7a3d;
  --military-gold: #c9a227;
  --military-tan: #d2b48c;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #0a0a0f 0%, #1a0a2e 50%, #0a0a0f 100%);
  --gradient-neon: linear-gradient(135deg, var(--neon-purple), var(--neon-magenta));
  --gradient-cyan: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  --gradient-card: linear-gradient(145deg, var(--bg-card) 0%, #1a1a2a 100%);

  /* Glow effects */
  --glow-purple: 0 0 20px rgba(180, 74, 255, 0.3);
  --glow-magenta: 0 0 20px rgba(255, 45, 149, 0.3);
  --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.3);

  /* Spacing */
  --section-padding: 100px 0;
  --container-max: 1200px;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Oswald', 'Impact', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Borders */
  --border-subtle: 1px solid rgba(255, 255, 255, 0.06);
  --border-glow: 1px solid rgba(180, 74, 255, 0.3);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-med: 0.4s ease;
  --transition-slow: 0.6s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--neon-purple);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Graceful fallback for missing/broken images */
img[alt]::after {
  content: attr(alt);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.5rem;
}

.nav-logo img {
  position: relative;
}

.gallery-item img,
.masonry-item img {
  position: relative;
  min-height: 100px;
  background: var(--bg-card);
}

ul, ol {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
}

p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 720px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--neon-cyan);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '//';
  color: var(--neon-purple);
}

/* --- Utility --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

.text-gradient {
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-cyan {
  background: var(--gradient-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center {
  text-align: center;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header .section-label {
  justify-content: center;
}

.section-header p {
  margin: 1rem auto 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-neon);
  color: #fff;
  box-shadow: var(--glow-purple);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(180, 74, 255, 0.5), 0 0 60px rgba(255, 45, 149, 0.2);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--neon-cyan);
  border: 2px solid var(--neon-cyan);
}

.btn-secondary:hover {
  background: rgba(0, 229, 255, 0.1);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
  color: var(--neon-cyan);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--neon-purple);
  color: var(--text-primary);
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: all var(--transition-med);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: var(--border-subtle);
  padding: 0.6rem 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-logo img {
  height: 45px;
  width: auto;
}

.nav-logo span {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--neon-cyan);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-neon);
  border-radius: 1px;
}

.nav-cta {
  padding: 0.6rem 1.5rem !important;
  font-size: 0.8rem !important;
  color: #fff !important;
  background: var(--gradient-neon);
  border-radius: 4px;
}

.nav-cta:hover {
  box-shadow: var(--glow-purple);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  background: none;
  border: none;
}

.nav-toggle span {
  width: 25px;
  height: 2px;
  background: var(--text-primary);
  transition: all var(--transition-fast);
  border-radius: 1px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background: var(--gradient-hero);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(180, 74, 255, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(0, 229, 255, 0.05) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-2%, 2%) rotate(1deg); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(180, 74, 255, 0.1);
  border: 1px solid rgba(180, 74, 255, 0.3);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--neon-purple);
  margin-bottom: 2rem;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--neon-green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

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

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Scrolling indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: bobDown 2s ease-in-out infinite;
}

@keyframes bobDown {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

.scroll-indicator svg {
  width: 20px;
  height: 20px;
  stroke: var(--neon-cyan);
}

/* --- Card Styles --- */
.card {
  background: var(--gradient-card);
  border: var(--border-subtle);
  border-radius: 12px;
  padding: 2rem;
  transition: all var(--transition-med);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-neon);
  opacity: 0;
  transition: opacity var(--transition-med);
}

.card:hover {
  border-color: rgba(180, 74, 255, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.card-icon.purple {
  background: rgba(180, 74, 255, 0.1);
  border: 1px solid rgba(180, 74, 255, 0.2);
}

.card-icon.cyan {
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.card-icon.magenta {
  background: rgba(255, 45, 149, 0.1);
  border: 1px solid rgba(255, 45, 149, 0.2);
}

.card-icon.green {
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.2);
}

.card h3 {
  margin-bottom: 0.75rem;
}

/* --- Stats Section --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.stat-item {
  text-align: center;
  padding: 2rem;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

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

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

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

/* --- Section Divider --- */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(180, 74, 255, 0.3), transparent);
  margin: 0;
  border: none;
}

/* --- Footer --- */
.footer {
  background: var(--bg-secondary);
  border-top: var(--border-subtle);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: rgba(180, 74, 255, 0.15);
  border-color: var(--neon-purple);
  color: var(--neon-purple);
}

.footer h4 {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.footer-links a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.3rem 0;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--neon-cyan);
}

.footer-bottom {
  border-top: var(--border-subtle);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Page Hero (interior pages) --- */
.page-hero {
  padding: 10rem 0 5rem;
  position: relative;
  background: var(--gradient-hero);
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 80%, rgba(180, 74, 255, 0.1) 0%, transparent 60%);
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  margin-bottom: 1rem;
}

.page-hero p {
  font-size: 1.2rem;
}

/* --- Sections --- */
section {
  padding: var(--section-padding);
}

/* --- Scroll Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* --- Form Styles --- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.9rem 1.2rem;
  font-family: var(--font-primary);
  font-size: 1rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: all var(--transition-fast);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--neon-purple);
  box-shadow: 0 0 0 3px rgba(180, 74, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

/* --- Gallery Grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-card);
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-med);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.8), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.gallery-item:hover .overlay {
  opacity: 1;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.lightbox-close:hover {
  background: rgba(255, 45, 149, 0.3);
}

/* --- Waveform Animation (Science page) --- */
.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 40px;
}

.waveform-bar {
  width: 4px;
  background: var(--gradient-neon);
  border-radius: 2px;
  animation: waveformBounce 1.2s ease-in-out infinite;
}

.waveform-bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.waveform-bar:nth-child(2) { height: 70%; animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { height: 50%; animation-delay: 0.2s; }
.waveform-bar:nth-child(4) { height: 90%; animation-delay: 0.3s; }
.waveform-bar:nth-child(5) { height: 60%; animation-delay: 0.4s; }
.waveform-bar:nth-child(6) { height: 80%; animation-delay: 0.5s; }
.waveform-bar:nth-child(7) { height: 45%; animation-delay: 0.6s; }
.waveform-bar:nth-child(8) { height: 65%; animation-delay: 0.7s; }

@keyframes waveformBounce {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 60px 0;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    transition: right var(--transition-med);
    border-left: var(--border-subtle);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    text-align: center;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 1rem;
  }
}
