/* For the glassmorphism effect on cards */
.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Scrolling Words Animation --- */
.scrolling-words-container {
  position: relative;
  overflow: hidden;
  height: 100%;
}

.scrolling-words-box {
  display: flex;
  position: absolute;
  white-space: nowrap;
  animation: scroll-words 10s linear infinite;
}

.scrolling-words-box > span {
  margin: 0 1.5rem; /* spacing between items */
  position: relative;
  display: flex;
  align-items: center;
}

/* Adds the vertical line separator */
.scrolling-words-box > span::after {
  content: ''; /* Empty content, we style the element itself */
  position: absolute;
  right: -1.5rem; /* Positions it exactly in the middle of the 3rem gap */
  top: 50%;
  transform: translateY(-50%);
  
  width: 2px; /* Thickness of the line */
  height: 60%; /* Height of the line relative to the text */
  background-color: #8B5CF6; /* Purple color */
  border-radius: 2px;
}

@keyframes scroll-words {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%); /* Ends at the start of the duplicated content */
  }
}

/* --- Flip Card Styles --- */
/* This container creates the stable 3D space */
.scene {
  perspective: 1000px;
}

.flip-card {
  background-color: transparent;
  /* perspective property was moved to the .scene parent */
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

/* This class is added with JavaScript to trigger the flip */
.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden; /* Safari */
  backface-visibility: hidden;
  border-radius: 0.5rem; /* rounded-lg */
}

.flip-card-back {
  transform: rotateY(180deg);
  overflow: hidden; /* Ensures the image respects the border radius */
}

/* --- Preloader Styles --- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #020617; /* Very dark blue */
  display: grid;
  place-content: center;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.glitch {
  font-weight: bold;
  color: white;
  position: relative;
  animation: clean-glitch 2.5s forwards;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #020617;
  overflow: hidden;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 #8B5CF6; /* Purple */
  animation: glitch-anim-1 2s infinite linear reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 #3B82F6; /* Blue */
  animation: glitch-anim-2 2s infinite linear reverse;
}

@keyframes glitch-anim-1 {
  0%, 100% { clip-path: inset(45% 0 50% 0); }
  20% { clip-path: inset(10% 0 85% 0); }
  40% { clip-path: inset(55% 0 20% 0); }
  60% { clip-path: inset(20% 0 50% 0); }
  80% { clip-path: inset(80% 0 5% 0); }
}

@keyframes glitch-anim-2 {
  0%, 100% { clip-path: inset(60% 0 35% 0); }
  20% { clip-path: inset(80% 0 5% 0); }
  40% { clip-path: inset(25% 0 70% 0); }
  60% { clip-path: inset(40% 0 45% 0); }
  80% { clip-path: inset(15% 0 80% 0); }
}

@keyframes clean-glitch {
  0% { text-shadow: -5px 0 #8B5CF6, 5px 0 #3B82F6; }
  99% { text-shadow: -5px 0 #8B5CF6, 5px 0 #3B82F6; }
  100% { text-shadow: none; }
}
/* --- Floating Binary Background Styles --- */
#binary-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1; /* Places it behind the glitch text */
}

#binary-background span {
  position: absolute;
  bottom: -50px; /* Start below the screen */
  color: rgba(255, 255, 255, 0.3);
  font-family: 'Courier New', Courier, monospace;
  animation: floatUp 10s linear infinite;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

@keyframes floatUp {
  from {
      transform: translateY(0);
  }
  to {
      transform: translateY(-100vh); /* Move up the full screen height */
      opacity: 0;
  }
}
/* --- Connecting Node Network Background --- */
#node-network-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
}

/* --- Flip Card Indicator --- */
.flip-indicator {
  position: absolute;
  bottom: 1rem;
  right: 1.25rem;
  color: rgba(192, 132, 252, 0.6);
  animation: float-arrow 2.5s ease-in-out infinite;
}

@keyframes float-arrow {
  0% {
    transform: translateX(-10px);
    opacity: 0;
  }
  50% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(10px);
    opacity: 0;
  }
}

/* --- Glass Shine Effect on Headings --- */
.shine-effect {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.shine-effect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -200%;
  width: 75%;
  height: 200%;
  opacity: 0;
  background: linear-gradient(
    to right,
    rgba(192, 132, 252, 0) 0%,
    rgba(192, 132, 252, 0.4) 50%,
    rgba(192, 132, 252, 0) 100%
  );
  transform: rotate(25deg);
  animation: shine 5s ease-in-out infinite;
  animation-delay: 1s;
}

@keyframes shine {
  0% {
    left: -200%;
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.7;
  }
  100% {
    left: 200%;
    opacity: 0;
  }
}
/* --- Layout Collapse Fix --- */
section {
  position: relative;
  width: 100%;
}
/* --- Responsive Fix for Leadership Card Layout --- */
@media (max-width: 767px) { /* Targets screens smaller than 768px (Tailwind's 'md' breakpoint) */

  /* Allow the main card container to have automatic height on mobile */
  #leadership .flip-card {
    height: auto;
  }

  /* Reset the inner container, disabling the 3D space */
  .flip-card-inner {
    position: static;
    transform: none;
    transition: none;
  }

  /* * This is the key: Bring the front of the card into the normal layout flow.
   * The parent container will now correctly resize to fit this content.
  */
  .flip-card-front {
    position: static;
    height: auto;
    padding-bottom: 2rem; /* Add some extra space at the bottom */
    cursor: default;
  }

  /* We don't need the back of the card or the flip icon on mobile */
  .flip-card-back, .flip-indicator {
    display: none;
  }
}