/**
 * Base CSS - Global Styles, Variables, and Utilities
 * 
 * This file contains:
 * - CSS custom properties (variables)
 * - Reset and normalization styles
 * - Global layout and typography
 * - Common utility classes
 * - Overrides for third-party components
 * 
 * Extracted from index.php during section compartmentalization refactoring
 */

/* ============================================
   CSS Custom Properties (Variables)
   ============================================ */
:root {
  --bg: #131a22;
  --accent: #3fe0f9;
  --btn-bg: #1e2327;
  --btn-hover: #2a3035;
  --text: #ececec;
  --credit: #ffe154;
}

/* ============================================
   Reset & Basic Styles
   ============================================ */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html { 
  overflow-x: hidden; /* Prevent horizontal scrolling */
  max-width: 100vw; /* Ensure HTML doesn't exceed viewport width */
  width: 100%;
}

body {
  min-height: 100vh;
  font-family: "Exo 2", sans-serif;
  font-optical-sizing: auto;
  background-color: #1b2027 !important;
  box-shadow: none !important;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  max-width: 100vw; /* Ensure body doesn't exceed viewport width */
  width: 100%;

  /* animated sheen overlay for depth (see body::before) */
  --sheen-opacity: 0.08;
  color: #ececec;
  line-height: 1.5;
  font-size: clamp(14px, 1.5vw, 16px);
}

/* Disable previous sheen overlay */
body::before { 
  content: none !important; 
}

/* Removed bg-morph keyframes; not needed for black background */

@keyframes sheen-move {
  0% { transform: translate(0,0) scale(1); }
  50% { transform: translate(3%, -2%) scale(1.02); }
  100% { transform: translate(0,0) scale(1); }
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  body { 
    animation: none !important; 
    filter: none !important; 
  }
  body::before { 
    animation: none !important; 
  }
}

a { 
  text-decoration: none; 
  color: inherit; 
}

/* ============================================
   Custom Scrollbar - Brand Styled
   ============================================ */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(19, 26, 34, 0.8);
  border-left: 1px solid rgba(63, 224, 249, 0.1);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, 
    rgba(63, 224, 249, 0.6) 0%,
    rgba(56, 219, 239, 0.8) 50%,
    rgba(63, 224, 249, 0.6) 100%
  );
  border: 1px solid rgba(63, 224, 249, 0.3);
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(63, 224, 249, 0.4);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, 
    rgba(63, 224, 249, 0.8) 0%,
    rgba(56, 219, 239, 1) 50%,
    rgba(63, 224, 249, 0.8) 100%
  );
  box-shadow: 0 0 12px rgba(63, 224, 249, 0.6);
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, 
    rgba(63, 224, 249, 1) 0%,
    rgba(56, 219, 239, 1) 50%,
    rgba(63, 224, 249, 1) 100%
  );
  box-shadow: 0 0 16px rgba(63, 224, 249, 0.8);
}

::-webkit-scrollbar-corner {
  background: rgba(19, 26, 34, 0.8);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 224, 249, 0.8) rgba(19, 26, 34, 0.8);
}

/* ============================================
   Layout
   ============================================ */
header, main { 
  width: 100%; 
  max-width: 100%; /* Prevent horizontal overflow */
  margin: 0 auto; 
  padding: clamp(12px, 2vw, 20px);
  box-sizing: border-box;
  overflow-x: hidden; /* Prevent horizontal overflow */
}

/* Footer should be full-width, no padding */
footer {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Content containers - readable width but responsive */
main {
  max-width: 100%;
}

@media (min-width: 1200px) {
  main {
    max-width: min(1200px, 100%);
  }
}

/* Ensure sections don't overflow viewport horizontally */
section {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  width: 100%;
}

main { 
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Responsive layout adjustments */
@media (max-width: 768px) {
  body {
    font-size: clamp(18px, 1.5vw, 20px);
  }
  
  header, main, footer {
    padding: clamp(10px, 3vw, 16px);
  }
}

@media (max-width: 480px) {
  body {
    font-size: clamp(18px, 1.5vw, 20px);
  }
  
  header, main, footer {
    padding: 12px;
  }
}

footer a { 
  color: var(--accent); 
}

/* ============================================
   Utility Classes
   ============================================ */

/* Section Title - Used across multiple sections */
/* Option 1: Minimal Underline - Clean*/
.section-title {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0 auto clamp(25px, 4vw, 40px);
  text-align: center;
  display: block;
  width: fit-content;
  max-width: 95%;
  color: var(--accent);
  font-size: clamp(1.8em, 4vw, 2.5em);
  font-weight: 600;
  position: relative;
  box-shadow: none;
  backdrop-filter: none;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, 90vw); /* Responsive width to prevent overflow */
  height: 2px;
  background: #38dbef;
  border-radius: 1px;
  box-shadow: 0 0 12px rgba(56, 219, 239, 0.6),
              0 0 6px rgba(56, 219, 239, 0.4),
              0 0 3px rgba(56, 219, 239, 0.3);
}

@media (max-width: 768px) {
  .section-title {
    font-size: clamp(1.5em, 4vw, 2em);
    margin-bottom: clamp(25px, 4vw, 35px);
  }
  
  .section-title::after {
    width: min(300px, 85vw); /* Responsive width to prevent overflow */
    height: 2px;
    bottom: -10px;
  }
}

/* ============================================
   Overrides for Neon Hex Background
   ============================================ */

/* Ensure text and headings are visible above neon hex background */
header h1,
header p,
.feature h3,
.fractional-section h2 {
  z-index: 2 !important;
  position: relative !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7) !important;
  background: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

.gif-wrapper .credit-text {
  z-index: 1000 !important;
  color: #ffe154 !important;
  font-size: 18px !important;
  text-shadow: 0 2px 8px #000 !important;
  background: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: inline-block !important;
}

