/* -----------------------------
   Base Reset + Font Settings
------------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  width: 100%;
  max-width: 100%;
  
  /* Custom property for viewport height */
  --vh: 1vh;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background: #0a0f1f;
  color: #d3dfff;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  overflow-x: hidden;
  position: relative;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
}

/* -----------------------------
   Canvas Background (Starfield)
------------------------------ */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: #0a0f1f;
}

/* -----------------------------
   Sticky Header Styling
------------------------------ */
.sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 15px 20px;
  z-index: 100;
  background: rgba(10, 15, 31, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(77, 208, 255, 0.2);
}

.glow {
  font-size: 2.8em;
  font-weight: 600;
  color: #4dd0ff;
  text-shadow: 0 0 8px #4dd0ff, 0 0 20px #1b9be0;
  animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% {
    text-shadow: 0 0 8px #4dd0ff, 0 0 20px #1b9be0;
  }
  50% {
    text-shadow: 0 0 16px #4dd0ff, 0 0 30px #1b9be0;
  }
}

/* -----------------------------
   Snap Scrolling Container
------------------------------ */
.snap-container {
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile */
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.snap-section {
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile */
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 70px; /* Space for fixed header */
  overflow: hidden; /* Prevent content overflow */
}

/* -----------------------------
   Welcome Section
------------------------------ */
.welcome-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.welcome-card {
  max-width: 900px;
  width: 90%;
  margin: 0 auto;
  text-align: center;
}

/* Scroll Down Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 10;
}

.chevron {
  width: 30px;
  height: 8px;
  opacity: 0;
  transform: scale(0.3);
  animation: move-chevron 3s ease-out infinite;
}

.chevron:first-child {
  animation-delay: 0s;
}

.chevron:nth-child(2) {
  animation-delay: 0.3s;
}

.chevron:nth-child(3) {
  animation-delay: 0.6s;
}

.chevron:before,
.chevron:after {
  content: '';
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  background: #4dd0ff;
}

.chevron:before {
  left: 0;
  transform: skewY(30deg);
}

.chevron:after {
  right: 0;
  width: 50%;
  transform: skewY(-30deg);
}

@keyframes move-chevron {
  25% {
    opacity: 1;
  }
  33.3% {
    opacity: 1;
    transform: translateY(10px) scale(0.5);
  }
  66.6% {
    opacity: 1;
    transform: translateY(20px) scale(0.7);
  }
  100% {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
}

.scroll-text {
  color: #4dd0ff;
  font-size: 0.9em;
  margin-top: 10px;
  opacity: 0.8;
}

/* -----------------------------
   Carousel Section Layout
------------------------------ */
.carousel-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.carousel-title {
  text-align: center;
  margin-bottom: 30px;
  color: #4dd0ff;
}

.carousel-title h2 {
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  margin-bottom: 20px;
}

.carousel-wrapper {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  margin: 20px auto;
  padding: 0 clamp(1rem, 5vw, 2rem);
  width: 100%;
  z-index: 1;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
  touch-action: pan-x; /* Optimize for horizontal touch gestures */
}

.carousel {
  display: flex;
  transition: transform 0.5s ease-in-out;
  touch-action: pan-x;
  width: 100%;
  will-change: transform;  
}

.carousel-item {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
}

.carousel-card {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2rem);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(77, 208, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(77, 208, 255, 0.05);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  animation: fadeIn 1.5s ease forwards;
  opacity: 0;
}

.icon-header {
  font-size: 2.5em;
  margin-bottom: 15px;
  color: #4dd0ff;
}

.carousel-card h3 {
  color: #4dd0ff;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  margin-bottom: 20px;
}

.carousel-card p {
  font-size: clamp(1rem, 3.5vw, 1.1rem);
  line-height: 1.6;
}

/* Carousel Arrows */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 10px 15px;
  border-radius: 50%;
  z-index: 2;
  transition: background 0.3s ease;
}

.carousel-nav.left {
  left: 10px;
}

.carousel-nav.right {
  right: 10px;
}

.carousel-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Dot Indicators */
.carousel-dots {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.carousel-dots .dot {
  height: 10px;
  width: 10px;
  margin: 0 5px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.carousel-dots .dot.active {
  background-color: #4dd0ff;
}

/* -----------------------------
   Card Styling (shared)
------------------------------ */
.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(77, 208, 255, 0.2);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 0 20px rgba(77, 208, 255, 0.05);
  backdrop-filter: blur(10px);
  animation: fadeIn 1.5s ease forwards;
  opacity: 0;
  text-align: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  display: flex;
  justify-content: center;
  padding: 0 20px;
  width: 100%;
  z-index: 1;
  position: relative;
}

/* Typing animation - UPDATED */
.typing {
  display: inline-block;
  color: #a0aee0;
  font-style: italic;
  font-size: 1.1em;
  border-right: 2px solid #4dd0ff;
  white-space: nowrap;
  overflow: hidden;
  animation: blink 0.75s step-end infinite;
  max-width: fit-content; /* This ensures the container only takes the width it needs */
  padding-right: 4px;
  width: 0; /* Start with zero width */
}

/* Add this class to enable the typing animation */
.typing.animate {
  animation: typing 5s steps(40, end) forwards, blink 0.75s step-end infinite;
  width: 0;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; } /* Use percentage instead of fixed ch width */
}

@keyframes blink {
  50% { border-color: transparent; }
}

/* -----------------------------
   Responsive Design
------------------------------ */
@media (max-width: 992px) {
  .sticky-header {
    padding: 12px;
  }
  
  .glow {
    font-size: 2.4em;
  }
  
  .carousel-wrapper {
    padding: 0 50px;
    width: 95%;
  }
  
  .welcome-card {
    width: 95%;
  }
  
  .carousel-card {
    padding: 25px;
  }
  
  .carousel-title h2 {
    font-size: 2.2em;
  }
}

@media (max-width: 768px) {
  .sticky-header {
    padding: 10px;
  }
  
  .glow {
    font-size: 2em;
  }
  
  .carousel-wrapper {
    padding: 0 40px;
  }
  
  .carousel-card {
    height: auto;
    min-height: 320px;
    padding: 20px;
  }
  
  .typing {
    font-size: 0.9em;
  }
  
  .snap-section {
    height: 100svh; /* Use small viewport height for better mobile experience */
  }
  
  .welcome-card {
    padding: 30px;
  }
  
  /* Adjust chevron size */
  .chevron {
    width: 25px;
    height: 6px;
  }
  
  .scroll-indicator {
    bottom: 30px;
  }
}

@media (max-width: 576px) {
  .sticky-header {
    padding: 8px;
  }
  
  .glow {
    font-size: 1.8em;
  }
  
  .carousel-wrapper {
    padding: 0 30px;
    width: 100%;
  }
  
  .carousel-nav {
    font-size: 1.5rem;
    padding: 8px 12px;
  }
  
  .carousel-nav.left {
    left: 5px;
  }
  
  .carousel-nav.right {
    right: 5px;
  }
  
  .carousel-card {
    padding: 20px 15px;
  }
  
  .icon-header {
    font-size: 2em;
    margin-bottom: 10px;
  }
  
  .carousel-card h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
  }
  
  .carousel-card p {
    font-size: 1em;
    line-height: 1.5;
  }
  
  .carousel-title h2 {
    font-size: 1.6em;
    margin-bottom: 15px;
  }
  
  .welcome-card {
    padding: 25px 20px;
  }
  
  .welcome-card h2 {
    font-size: 1.6em;
  }
  
  .welcome-card p {
    font-size: 1em;
  }
  
  /* Fix for small devices */
  .typing {
    font-size: 0.85em;
  }
}

/* iPhone SE / extremely small screens */
@media (max-width: 375px) {
  .sticky-header {
    padding: 6px;
  }
  
  .glow {
    font-size: 1.6em;
  }
  
  .carousel-title h2 {
    font-size: 1.4em;
  }
  
  .carousel-card h3 {
    font-size: 1.2em;
  }
  
  .carousel-card {
    padding: 15px 12px;
  }
  
  .welcome-card h2 {
    font-size: 1.4em;
  }
}