@import url("https://fonts.googleapis.com/css2?family=Boldonse&family=EB+Garamond:ital,wght@0,400..800;1,400..800&family=Inter:wght@100..900&display=swap");

:root {
  --color-primary: #0a0a0a;
  --color-secondary: #161616;
  --color-accent: #ff2c2c;
  --color-text: #f5f5f5;
  --color-text-muted: rgba(245, 245, 245, 0.7);
  --color-border: rgba(255, 255, 255, 0.05);
  --color-overlay: rgba(0, 0, 0, 0.5);

  --font-primary: "Inter", sans-serif;
  --font-display: "Boldonse", serif;
  --font-serif: "EB Garamond", serif;

  --text-xs: 0.7rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.2rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 3rem;
  --text-mega: clamp(7rem, 15vw, 12rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;

  --panel-padding: 5%;

  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* ⭐️ ADDED: This enables the full-page snap scrolling */
  scroll-snap-type: y mandatory;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-primary);
  color: var(--color-text);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.spaced-text {
    line-height: 1.6;
  }

/* Canvas is set to z-index: 1 in CSS.
  Your app.js file *must* be edited to also use z-index: 1.
  This ensures the canvas is BEHIND the content.
*/
canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Base styles for both images */
.desktop-logo,
.mobile-logo {
  max-width: 100%; 
  height: auto;   
  display: block;  
  margin: 0 auto;
  border-radius: 12px; /* Added for softer edges */
}

/* Base styles for the tagline */
.tagline {
  color: #6A0572;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: #FFDDC1;
  padding: 10px 20px;
  border-radius: 25px;
  display: inline-block; /* Makes background wrap text */
}

/* Styles specific to desktop tagline */
.desktop-tagline {
  font-size: 1.1em;
  max-width: 40%;
  margin: 15px 0 15px auto; /* Push it to the right */
  text-align: center; /* Align text inside the box */
  display: block; /* Ensures margin works correctly */
}

/* Styles specific to mobile tagline */
.mobile-tagline {
  font-size: 1em;
  padding: 8px 15px;
  border-radius: 20px;
  max-width: 100%;
  margin: 20px auto; /* Simplified margin */
}

/* Styles specific to desktop content */
.desktop-content {
  font-size: 1.1em;
  max-width: 100%; /* Allow flexbox to control width */
  margin: 15px 0; 
  text-align: justify;
  line-height: 1.6;
  
}
/* Styles specific to mobile content */
.mobile-content {
  font-size: 1em;
  padding: 8px 15px;
  border-radius: 20px;
  max-width: 100%;
  margin: 20px auto; 
  text-align: center;
}

/* Desktop: Hide mobile elements */
@media (min-width: 769px) { 
  .mobile-tagline,
  .mobile-content,
  .mobile-logo {
    display: none !important;
  }
}

/* Mobile: Hide desktop elements */
@media (max-width: 768px) { 
  .desktop-tagline,
  .desktop-content,
  .desktop-logo {
    display: none !important;
  }
  .mobile-tagline,
  .mobile-content,
  .mobile-logo {
    display: block !important;
  }
  .mobile-tagline,
  .mobile-content {
    display: inline-block !important; /* Keep text background tight */
  }
   .section {
        /* This is the mandatory fix: height MUST be dynamic */
        height: auto !important; 
        
        /* Ensures section still takes up at least a full screen */
        min-height: 100vh; 
        
        /* Adds guaranteed spacing between sections */
        margin-bottom: 40px !important;
        padding-top: 40px; 
    }
    
    /* Safety containment specifically for the mission content */
    #mission .split-layout {
        /* Modern technique to ensure the flex container encompasses all items */
        display: flow-root;
    }
}

 /* Popup image styling */
  #popup {
    display: none;            /* Hidden by default */
    position: fixed;          /* Stay in place */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center */
    z-index: 1000;
    opacity: 0;               /* For fade effect */
    transition: opacity 0.5s ease; /* Fade in/out */
  }

  #popup img {
    max-width: 600px;         /* Resize image as needed */
    height: auto;
    display: block;
  }
  
  /* Small screens: limit image to 300px */
  @media (max-width: 600px) {
    #popup img {
      max-width: 300px;
    }
  }

/* --- NAVBAR STYLES (Original) --- */
#main-navbar {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  background-color: transparent; 
  box-shadow: none; 
  z-index: 1000; 
  padding: 10px 0; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
}
.navbar-container {
  display: flex;
  justify-content: center; 
  width: 100%;
  max-width: 1200px; 
  position: relative; 
}
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex; 
  gap: 30px; 
}
.nav-links li a {
  text-decoration: none;
  color: #FFFFFF; 
  font-weight: bold;
  font-size: 1.1em;
  padding: 5px 10px; 
  border-radius: 5px; 
  transition: color 0.3s ease, background-color 0.3s ease, text-shadow 0.3s ease; 
}
.nav-links li a:hover {
  color: #FFA500; 
  background-color: transparent; 
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8); 
}
.hamburger {
  display: none; 
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001; 
}
.hamburger .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #FFFFFF; 
  margin: 5px auto;
  transition: all 0.3s ease-in-out;
}
@media (max-width: 768px) { 
  .navbar-container {
    justify-content: space-between; 
    padding: 0 20px; 
  }
  .hamburger {
    display: block; 
  }
  .nav-links {
    position: fixed; 
    top: 0; 
    left: 100%; 
    width: 70%; 
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    transition: left 0.3s ease-in-out; 
    z-index: 999; 
  }
  .nav-links.active {
    left: 30%; 
  }
  .nav-links li {
    margin: 15px 0; 
  }
  .nav-links li a {
    color: #FFFFFF; 
    font-size: 1.5em; 
  }
  .hamburger.active .bar:nth-child(2) {
    opacity: 0; 
  }
  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg); 
  }
  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg); 
  }
}
/* --- END NAVBAR --- */


/* --- SECTION STYLING (CLEANED UP) --- */
.content {
  position: relative;
  /* This content MUST be on top of the z-index: 1 canvas */
  z-index: 2;
}

.section {
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  position: relative;
  /* ⭐️ ADDED: This enables the full-page snap scrolling */
  scroll-snap-align: start;
}

.section-inner {
  width: 100%;
  padding: 0 var(--panel-padding);
  max-width: 1600px;
  margin: 0 auto;
  pointer-events: auto;
}

/* ⭐️ REMOVED: .section-inner1 and .section-inner2 (they caused spacing issues) */
/* ⭐️ REMOVED: .logo-and-tagline-wrapper (replaced by .split-layout) */


/* ---------------------------------------------------- */
/* ⭐️ NEW RESPONSIVE LAYOUT FOR CONTENT SECTIONS     */
/* ---------------------------------------------------- */
.split-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-8);
  width: 100%;
  flex-direction: row; /* Default for desktop (side-by-side) */
}

/* This class reverses the order for the alternating layout */
.split-layout.reverse-layout {
  flex-direction: row-reverse;
}

.split-left,
.split-right {
  flex-basis: 48%; /* Give each side roughly half the space */
  max-width: 48%;
}

/* Mobile responsive styles for the new layout */
@media (max-width: 768px) {
  .split-layout,
  .split-layout.reverse-layout {
    flex-direction: column; /* Stack vertically on mobile */
    text-align: center;
  }

  .split-left,
  .split-right {
    flex-basis: 100%; /* Each side takes full width on mobile */
    max-width: 100%;
  }

  /* Ensure content text is centered on mobile */
  .desktop-content,
  .mobile-content {
    text-align: center;
  }
}
/* --- END NEW RESPONSIVE LAYOUT --- */


.title {
  font-family: var(--font-display);
  font-size: calc(var(--text-mega) / 4);
  line-height: 1.2;
  margin-bottom: var(--space-6);
  font-weight: 700;
  opacity: 0;
  transform: translateY(50px);
  text-transform: uppercase;
  color: var(--color-text);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8),
               0 4px 8px rgba(0, 0, 0, 0.6),
               0 8px 16px rgba(0, 0, 0, 0.4);
}

.description {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  max-width: 600px;
  margin-bottom: var(--space-8);
  opacity: 0;
  transform: translateY(30px);
  color: var(--color-text-muted);
  font-weight: 300;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8),
               0 2px 6px rgba(0, 0, 0, 0.6);
}

.footer {
  position: fixed;
  bottom: var(--space-4);
  left: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  z-index: 3;
  opacity: 0.5;
  pointer-events: none;
}

/* Scroll Bar Progress Animation */
.scroll-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 1000;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.scroll-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, 
    #4a00e0,
    #8e2de2,
    #da22ff
  );
  transition: none;
  box-shadow: 0 0 20px rgba(138, 43, 226, 0.8),
              0 0 40px rgba(138, 43, 226, 0.4);
}

.scroll-cursor-ghost {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.3),
    rgba(200, 200, 255, 0.2),
    transparent
  );
  opacity: 0.5;
  transition: width 0.5s ease-out;
  filter: blur(8px);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
}

.nebula-button {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, 
    rgba(138, 43, 226, 0.8),
    rgba(75, 0, 130, 0.6),
    rgba(25, 25, 112, 0.4),
    rgba(0, 0, 0, 0.2)
  );
  box-shadow: 
    0 0 20px rgba(138, 43, 226, 0.5),
    0 0 40px rgba(75, 0, 130, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  animation: nebulaPulse 3s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nebula-button::before {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 40%,
    transparent 50%
  );
  animation: nebulaRotate 10s linear infinite;
}

.nebula-button::after {
  content: '';
  position: absolute;
  
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 70% 70%,
    rgba(255, 255, 255, 0.3),
    transparent 40%
  );
  opacity: 0.5;
}

.nebula-text {
  position: relative;
  z-index: 1;
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes nebulaPulse {
  0%, 100% {
    box-shadow: 
      0 0 20px rgba(138, 43, 226, 0.5),
      0 0 40px rgba(75, 0, 130, 0.3),
      inset 0 0 20px rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 
      0 0 30px rgba(138, 43, 226, 0.7),
      0 0 60px rgba(75, 0, 130, 0.5),
      inset 0 0 30px rgba(255, 255, 255, 0.2);
  }
}

@keyframes nebulaRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Mobile overrides from original file */
@media (max-width: 768px) {
  .title {
    font-size: clamp(3rem, 10vw, 6rem);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 1),
                 0 4px 8px rgba(0, 0, 0, 0.9),
                 0 8px 16px rgba(0, 0, 0, 0.8),
                 0 0 30px rgba(0, 0, 0, 0.7);
    position: relative;
    z-index: 10;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.5);
  }

  .description {
    font-size: var(--text-base);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 1),
                 0 2px 4px rgba(0, 0, 0, 0.9),
                 0 4px 8px rgba(0, 0, 0, 0.8);
    background: rgba(10, 10, 10, 0.9);
    padding: var(--space-4);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.8);
  }

  .section-inner {
    padding: 0 var(--space-4);
    position: relative;
    z-index: 10;
  }

  .footer {
    width: 100%;
    text-align: center;
    left: 0;
    background: rgba(10, 10, 10, 0.9);
    padding: var(--space-3);
    position: relative;
    z-index: 10;
  }

  canvas {
    opacity: 0.4 !important;
  }

  .scroll-bar {
    height: 4px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }

  .nebula-text {
    font-size: 20px;
  }
}

.visitor-counter {
    width: fit-content;
    padding: 12px 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-family: Arial, sans-serif;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}
.visitor-counter span.number {
    font-weight: bold;
    font-size: 22px;
    color: #007BFF;
}
.visitor-counter .icon {
    font-size: 24px;
}
