/* 1. Base & Variables */
:root {
  --bg-color: #000000; /* MODIFIED: Set to solid black for simplicity */
  --text-primary: #eaeaec;
  --text-secondary: #a0a0a8;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.25);
  --accent-color: #ffffff;
  --card-bg: radial-gradient(
    circle at 10% 10%,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.01) 50%
  );
  --card-bg-hover: radial-gradient(
    circle at 10% 10%,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.02) 70%
  );
  --card-shadow: 0px 8px 32px rgba(0, 0, 0, 0.3);
  --font-primary: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

/* Keyframes */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes float-ball-1 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(20vw, -10vh) scale(1.1);
  }
}
@keyframes float-ball-2 {
  0%,
  100% {
    transform: translate(0, 0) scale(1.1);
  }
  50% {
    transform: translate(-15vw, 15vh) scale(0.9);
  }
}
@keyframes float-ball-3 {
  0%,
  100% {
    transform: translate(0, 0) scale(0.9);
  }
  50% {
    transform: translate(10vw, 10vh) scale(1);
  }
}
/* NEW: Keyframe for rotating text */
@keyframes spin-words {
  0% {
    transform: translateY(0);
  }
  18% {
    transform: translateY(0);
  } /* Pause on word 1 */
  25% {
    transform: translateY(-1.6em);
  } /* Animate to word 2 */
  43% {
    transform: translateY(-1.6em);
  } /* Pause on word 2 */
  50% {
    transform: translateY(-3.2em);
  } /* Animate to word 3 */
  68% {
    transform: translateY(-3.2em);
  } /* Pause on word 3 */
  75% {
    transform: translateY(-4.8em);
  } /* Animate to word 4 */
  93% {
    transform: translateY(-4.8em);
  } /* Pause on word 4 */
  100% {
    transform: translateY(-6.4em);
  } /* Animate to loop back */
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  /* MODIFIED: Prevents snapped/linked content from hiding under the fixed header */
  scroll-padding-top: 80px;
}

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

/* NEW: Prevents scrolling while the pre-loader is visible */
body.loading {
  overflow: hidden;
}

/* NEW: Pre-loader Styles */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loading-screen.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* Allows clicking through the faded-out loader */
}

.spinner {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--accent-color);
  animation: spin 1s linear infinite;
}
/* END NEW */

/* 2. Layout & Global Styles */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

main > section {
  /* MODIFIED: Changed vh to dvh for better mobile compatibility */
  min-height: 100dvh;
  width: 100%;
  padding: 80px 20px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  scroll-snap-align: start;
}

.section-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 60px;
  letter-spacing: -0.04em;
}

/* MODIFIED: Glows are now positioned absolutely to be contained in the hero section */
.background-glows {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}
.glow-ball {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  filter: blur(150px);
}
/* MODIFIED: Changed glow colors to be monochromatic */
.ball-1 {
  top: 10%;
  left: 10%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.07);
  animation: float-ball-1 30s infinite ease-in-out;
}
.ball-2 {
  bottom: 5%;
  right: 15%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.05);
  animation: float-ball-2 35s infinite ease-in-out;
}
.ball-3 {
  top: 40%;
  left: 50%;
  width: 250px;
  height: 250px;
  background: rgba(255, 255, 255, 0.04);
  animation: float-ball-3 25s infinite ease-in-out;
}

/* 3. Animation Classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1),
    transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 4. Header & Navigation */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 1000;
  transition: padding 0.4s ease;
}

.site-header.scrolled {
  position: fixed;
  background-color: transparent;
  backdrop-filter: none;
  padding: 10px 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.4s ease;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.2s forwards;
}

.site-header.scrolled .header-container {
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 10px 30px;
  animation: none;
  opacity: 1;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.05em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 15px;
  transition: color 0.3s ease, transform 0.3s ease;
  font-size: 0.95rem;
}
.nav-link:hover {
  color: var(--text-primary);
  transform: translateY(-2px);
}

.nav-button {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}
.nav-button:hover {
  background-color: var(--accent-color);
  color: var(--bg-color);
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 5. Hero Section (REDESIGNED) */
.hero {
  background-image: linear-gradient(
      rgba(10, 10, 11, 0.6),
      rgba(10, 10, 11, 0.6)
    ),
    url("images/kl.jpg"); /* You can change this to a placeholder if you wish */
  background-size: cover;
  background-position: bottom;
  background-repeat: no-repeat;
  position: relative;
}

.hero-content {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative; /* Ensure it's on top of the glows */
  z-index: 2;
}

/* MODIFIED: Animate hero text, but not the button container to prevent transparency change on load. */
.hero-content h1 > span,
.hero-content .hero-subtitle {
  opacity: 0;
  animation-name: fadeInUp;
  animation-duration: 1s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}
.hero-content h1 > span:nth-child(1) {
  animation-delay: 0.5s;
}
.hero-content h1 > span:nth-child(2) {
  animation-delay: 0.65s;
}
.hero-content .hero-subtitle {
  animation-delay: 0.8s;
}
/* The .cta-container is now visible on load, removing the unwanted transparency effect. */
.hero-content .cta-container {
  /* Animation and delay removed from this element */
  /* Added a subtle fade-in for the container itself to avoid it just "popping" in */
  opacity: 0;
  animation: fadeInUp 1s ease-out 1s forwards;
}

.hero h1 {
  font-size: clamp(3.2rem, 9vw, 6.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.06em;
  white-space: normal;
  display: flex;
  flex-direction: column;
}

.hero-title-line {
  display: block;
}

.hero-title-line--outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--text-primary);
  text-stroke: 1.5px var(--text-primary);
}

.hero-subtitle {
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  margin-top: 1.5rem;
  /* MODIFIED: Margin-bottom is now handled by the .cta-container */
  margin-bottom: 0;
  color: var(--text-secondary);
  max-width: 650px;
  line-height: 1.6;
}

.rotating-words-container {
  display: inline-block;
  color: var(--text-primary);
  font-weight: 500;
  height: 1.6em;
  overflow: hidden;
  vertical-align: bottom;
}

.rotating-words-container > span {
  display: block;
  animation: spin-words 10s infinite cubic-bezier(0.23, 1, 0.32, 1);
}

/* NEW: Container for hero buttons */
.cta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem; /* Space between the two buttons */
  margin-top: 2.5rem;
}

/* NEW: Styles for the secondary login link in hero */
.hero-login-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.hero-login-link:hover {
  color: var(--text-primary);
}

.hero-login-link i {
  margin-left: 8px;
  font-size: 0.8em;
  position: relative;
  top: -1px;
  transition: transform 0.3s ease;
}

.hero-login-link:hover i {
  transform: translateX(4px);
}

/* General Button Styles */
.glass-button {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}
.glass-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* MODIFIED: Primary CTA button with enhanced glassmorphism and hover effect */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: var(--text-primary);
  /* NEW: Add relative positioning and overflow for the new effect */
  position: relative;
  overflow: hidden;
  z-index: 1;
  transform: translateZ(
    0
  ); /* Promote to own rendering layer for smooth animation */
  transition: all 0.4s ease;
}

/* NEW: Pseudo-element for the hover glow effect */
.cta-button::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: 150%;
  padding-bottom: 150%; /* Creates a square aspect ratio */
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

/* MODIFIED: Removed the purple halo from the hover state */
.cta-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.75);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3); /* Black shadow for depth */
}

/* NEW: Trigger the pseudo-element animation on hover */
.cta-button:hover::before {
  transform: translate(-50%, -50%) scale(1.2);
}

/* NEW: Style for Discord button icon */
.cta-button .fab.fa-discord {
  margin-right: 12px;
  font-size: 1.2em;
}

/* 6. Text Sections (#join) */
.text-section {
  max-width: 700px;
  text-align: center;
}
.text-section p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}
.text-section p strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* 6.5. NEW: Two-Column Layout (Content with Images) */
.content-with-images {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5rem;
  max-width: 1200px; /* Wider container for two columns */
}

.content-with-images.content-reversed {
  flex-direction: row-reverse;
}

.content-with-images .text-content {
  flex: 1 1 50%;
  min-width: 0;
  text-align: left;
}

.content-with-images .section-title {
  text-align: left;
  margin-bottom: 30px;
}

/* MODIFIED: Added cursor pointer to indicate interactivity */
.content-with-images .image-showcase {
  flex: 1 1 45%;
  position: relative;
  cursor: pointer;
}

.image-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

/* MODIFIED: Optimized for smooth animations with hardware acceleration */
.showcase-img {
  position: absolute;
  width: 80%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4);
  border: 3px solid #1a1a1c;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.showcase-img.img-1 {
  top: 0;
  left: 0;
  transform: translate3d(0, 0, 0) rotate(-7deg);
  z-index: 1;
}

.showcase-img.img-2 {
  bottom: 0;
  right: 0;
  transform: translate3d(0, 0, 0) rotate(5deg);
  z-index: 2;
}

/* NEW: Click-to-swap (works on touch devices by toggling the 'is-swapped' class) */
.image-showcase.is-swapped .showcase-img.img-1 {
  transform: translate3d(0, 0, 1px) rotate(5deg) scale(1.05);
  z-index: 2;
}

.image-showcase.is-swapped .showcase-img.img-2 {
  transform: translate3d(0, 0, 0) rotate(-7deg) scale(0.95);
  z-index: 1;
}

/* NEW: Hover-to-swap (desktop only, using a media query) */
@media (hover: hover) and (pointer: fine) {
  .image-showcase:hover .showcase-img.img-1 {
    transform: translate3d(0, 0, 1px) rotate(5deg) scale(1.05);
    z-index: 2;
  }

  .image-showcase:hover .showcase-img.img-2 {
    transform: translate3d(0, 0, 0) rotate(-7deg) scale(0.95);
    z-index: 1;
  }
}

/* 7. Values Section (REDESIGNED) */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.value-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px;
  text-align: left;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease,
    box-shadow 0.3s ease;
  transform: translateZ(0);
}

.value-card:hover {
  transform: translateY(-10px);
  border-color: var(--border-hover);
  background: var(--card-bg-hover);
  box-shadow: var(--card-shadow);
}

.value-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.value-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-primary);
  font-size: 20px;
}

.value-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0;
  color: var(--text-primary);
}

.value-card p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
}

.animate-on-scroll.is-visible .value-card {
  opacity: 1;
}
.animate-on-scroll.is-visible .value-card:nth-child(1) {
  transition-delay: 0.1s;
}
.animate-on-scroll.is-visible .value-card:nth-child(2) {
  transition-delay: 0.25s;
}
.animate-on-scroll.is-visible .value-card:nth-child(3) {
  transition-delay: 0.4s;
}

/* 8. Benefits Grid Section (MODIFIED) */
#inside-obsdn .section-title {
  margin-bottom: 30px; /* Reduced from 60px */
}

#inside-obsdn .text-section {
  margin-bottom: 30px; /* Reduced from 40px */
}
#inside-obsdn .text-section:last-of-type {
  margin-top: 30px; /* Reduced from 40px */
  margin-bottom: 0;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.benefit-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 25px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  text-align: left;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease,
    box-shadow 0.3s ease;
}
.benefit-item:hover {
  background: var(--card-bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-5px);
  box-shadow: var(--card-shadow);
}
.benefit-icon {
  flex-shrink: 0;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  margin-top: 3px;
}
.benefit-item p {
  margin-bottom: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 9. Checklist Section (#community) */
#community {
  padding-top: 140px;
  padding-bottom: 100px;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 40px auto 50px;
  max-width: 580px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  transition: color 0.3s ease;
}

.checklist li:hover {
  color: var(--text-primary);
}

/* MODIFIED: Changed bullet points to be white & glassmorphic */
.checklist li::before {
  content: "";
  flex-shrink: 0;
  position: relative;
  top: 6px;
  width: 22px;
  height: 22px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 10px;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 0.3s ease;
}
/* MODIFIED: Hover state for new bullet points */
.checklist li:hover::before {
  transform: scale(1.1);
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.animate-on-scroll.is-visible .checklist li {
  transition-property: opacity, transform;
  transition-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
  transition-duration: 0.6s;
  opacity: 1;
  transform: translateX(0);
}
.animate-on-scroll.is-visible .checklist li:nth-child(1) {
  transition-delay: 0.1s;
}
.animate-on-scroll.is-visible .checklist li:nth-child(2) {
  transition-delay: 0.2s;
}
.animate-on-scroll.is-visible .checklist li:nth-child(3) {
  transition-delay: 0.3s;
}
.animate-on-scroll.is-visible .checklist li:nth-child(4) {
  transition-delay: 0.4s;
}
.animate-on-scroll.is-visible .checklist li:nth-child(5) {
  transition-delay: 0.5s;
}
.animate-on-scroll.is-visible .checklist li:nth-child(6) {
  transition-delay: 0.6s;
}
.animate-on-scroll.is-visible .checklist li:nth-child(7) {
  transition-delay: 0.7s;
}

/* 10. Join / Signup Section */
.signup-form {
  display: flex;
  justify-content: center;
  gap: 15px;
  max-width: 600px;
  margin: 40px auto 15px auto;
}
.signup-form input[type="email"] {
  flex-grow: 1;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: #111112;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-primary);
  transition: all 0.3s ease;
}
.signup-form input[type="email"]::placeholder {
  color: var(--text-secondary);
}
/* MODIFIED: Changed form focus state to be monochromatic */
.signup-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}
.signup-form button {
  padding: 16px 30px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.form-disclaimer {
  font-size: 0.9rem;
  color: #666;
}

/* 11. Footer */
footer {
  text-align: center;
  padding: 60px 20px;
  border-top: 1px solid var(--border-color);
}
.footer-logo {
  max-width: 250px;
  width: 100%;
  height: auto;
  opacity: 0.6;
}
.footer-text {
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* 
 * FIX: On shorter screens, the content in the #community section can overflow the
 * viewport. This media query reduces spacing and font sizes to make it fit,
 * preserving the scroll-snap experience on laptop-sized screens.
*/
@media (max-height: 850px) and (min-width: 769px) {
  #community .section-title {
    margin-bottom: 30px;
    font-size: 2.25rem;
  }
  #community .checklist {
    gap: 0.75rem;
    margin-top: 20px;
  }
  #community .checklist li {
    font-size: 1rem;
    line-height: 1.5;
  }
  #community p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }
  #community .cta-button {
    margin-top: 1rem;
  }
}

/* 12. Responsiveness - MOBILE FIXES */
@media (max-width: 768px) {
  html {
    scroll-snap-type: none;
    scroll-padding-top: 70px;
  }

  main > section {
    min-height: auto;
    padding: 60px 20px;
  }

  main > section:not(:last-child) {
    margin-bottom: 6rem;
  }

  .section-title {
    margin-bottom: 40px;
    font-size: 2rem;
  }

  /* HEADER & NAVIGATION (MODIFIED FOR MOBILE) */
  .header-container {
    justify-content: center;
  }

  /* FIX: On members page, space out the title and logout button for a proper layout */
  body.members-page .header-container {
    justify-content: space-between;
    align-items: center;
  }

  /* On mobile, allow the members page header to show */
  body.members-page .site-header.scrolled {
    display: block;
  }
  .site-header.scrolled {
    display: none;
  }

  .logo {
    font-size: 1.3rem;
  }

  /* FIX: Improve wrapping and spacing for the long members page title */
  body.members-page .logo {
    line-height: 1.25;
    margin-right: 15px; /* Add space between text and logout button */
  }

  .main-nav {
    display: none;
  }

  /* On mobile, allow the members page nav to show */
  body.members-page .main-nav {
    display: flex;
  }

  /* HERO SECTION (REDESIGNED FOR MOBILE) */
  .hero {
    /* MODIFIED: Changed vh to dvh for better mobile compatibility */
    min-height: 100dvh;
    padding-top: 0;
    padding-bottom: 0;
  }

  .hero .hero-content {
    padding-top: 70px;
  }

  .hero h1 {
    font-size: clamp(3rem, 15vw, 4.5rem);
    letter-spacing: -0.05em;
  }

  .hero-title-line--outline {
    -webkit-text-stroke-width: 1px;
    text-stroke-width: 1px;
  }

  .hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.15rem);
    line-height: 1.5;
  }

  /* NEW: Adjust CTA container gap for mobile */
  .cta-container {
    gap: 1rem;
  }

  .rotating-words-container {
    height: 1.5em;
  }

  .rotating-words-container > span {
    animation-name: spin-words-mobile;
  }

  @keyframes spin-words-mobile {
    0% {
      transform: translateY(0);
    }
    18% {
      transform: translateY(0);
    }
    25% {
      transform: translateY(-1.5em);
    }
    43% {
      transform: translateY(-1.5em);
    }
    50% {
      transform: translateY(-3em);
    }
    68% {
      transform: translateY(-3em);
    }
    75% {
      transform: translateY(-4.5em);
    }
    93% {
      transform: translateY(-4.5em);
    }
    100% {
      transform: translateY(-6em);
    }
  }

  .cta-button {
    padding: 14px 32px;
    font-size: 1rem;
    border-width: 1.5px;
  }

  /* MODIFIED: Responsive styles for two-column layout */
  .content-with-images {
    flex-direction: column;
    gap: 3rem;
  }

  .content-with-images.content-reversed {
    flex-direction: column-reverse; /* Reverses order on mobile */
  }

  .content-with-images .text-content {
    text-align: center;
  }

  .content-with-images .section-title {
    text-align: center;
  }

  .content-with-images .checklist {
    margin-left: auto;
    margin-right: auto;
    text-align: left; /* Keep checklist items aligned left */
    max-width: 400px;
  }

  /* NEW: Add space above the button in the #community section on mobile */
  #community .cta-button {
    margin-top: 2rem;
  }

  .content-with-images .image-showcase {
    width: 100%;
    max-width: 400px;
    margin-bottom: 1rem;
  }

  /* GRIDS & CARDS */
  .values-grid,
  .benefits-grid {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: 1fr;
  }

  .value-card {
    padding: 30px 25px;
  }

  /* FORM */
  .signup-form {
    flex-direction: column;
  }

  /* BACKGROUND ANIMATIONS */
  .glow-ball {
    filter: blur(120px);
    will-change: transform;
  }
  .ball-1 {
    top: 5%;
    left: -40%;
    width: 350px;
    height: 350px;
  }
  .ball-2 {
    bottom: -15%;
    right: -45%;
    width: 300px;
    height: 300px;
  }
  .ball-3 {
    top: 40%;
    left: 30%;
    width: 250px;
    height: 250px;
    opacity: 0.15;
  }
}

@media (max-width: 480px) {
  .text-section p,
  .checklist li,
  .value-card p,
  .benefit-item p {
    font-size: 1rem;
    line-height: 1.7;
  }

  main > section {
    padding-left: 15px;
    padding-right: 15px;
  }

  main > section:not(:last-child) {
    margin-bottom: 4rem;
  }

  body.members-page .header-container {
    padding-left: 15px;
    padding-right: 15px;
  }

  body.members-page .logo {
    font-size: 1rem;
  }

  /* Make modal padding smaller on small screens */
  .modal-content {
    padding: 30px 25px;
  }
}

/* 13. Login Modal Styles - REDESIGN V2 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--card-bg);
  padding: 40px 45px;
  border-radius: 24px; /* Slightly more rounded container */
  width: 90%;
  max-width: 420px;
  text-align: center; /* MODIFIED: Changed from left to center */
  position: relative;
  box-shadow: var(--card-shadow);
  /* MODIFIED: Animate opacity, transform for smooth entry */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  /* MODIFIED: Replaced border-image with a standard border to respect border-radius */
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-overlay.show .modal-content {
  /* MODIFIED: Final state of the entry animation */
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* NEW: Staggered animation for modal children */
.modal-content > * {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-overlay.show .modal-content > * {
  opacity: 1;
  transform: translateY(0);
}

/* NEW: Animation delays for each element */
.modal-overlay.show .modal-logo {
  transition-delay: 0.1s;
}
.modal-overlay.show h2 {
  transition-delay: 0.15s;
}
.modal-overlay.show p {
  transition-delay: 0.2s;
}
.modal-overlay.show .input-group:nth-of-type(1) {
  transition-delay: 0.25s;
}
.modal-overlay.show .input-group:nth-of-type(2) {
  transition-delay: 0.3s;
}
.modal-overlay.show .error-message {
  transition-delay: 0.35s;
}
.modal-overlay.show #login-form button {
  transition-delay: 0.4s;
}

.modal-logo {
  display: block;
  max-width: 180px;
  margin: 0 auto 30px auto;
  opacity: 0.5;
}

.modal-content h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 35px;
  font-size: 1rem;
}

.close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  /* Ensure close button is visible immediately */
  opacity: 1;
  transform: translateY(0);
}

.close-button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
  transform: rotate(90deg) scale(1.1);
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group {
  position: relative;
}

.input-group i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: color 0.3s ease;
}

#login-form input {
  width: 100%;
  padding: 16px 20px 16px 55px; /* Left padding for icon */
  border-radius: 999px; /* MODIFIED: Pill shape */
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-primary);
  transition: all 0.3s ease;
}

#login-form input::placeholder {
  color: var(--text-secondary);
}

#login-form input:focus {
  outline: none;
  border-color: var(--accent-color);
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

#login-form input:focus + i {
  color: var(--text-primary);
}

#login-form button {
  padding: 16px 30px;
  border-radius: 999px; /* MODIFIED: Pill shape */
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%; /* Full width button */
  margin-top: 10px;
}

.button-loader {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-color);
  animation: spin 0.8s linear infinite;
  display: none;
}

.cta-button.loading {
  cursor: wait;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.75);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.cta-button.loading .button-text {
  display: none;
}

.cta-button.loading .button-loader {
  display: inline-block;
}

.error-message {
  color: #ff6b6b;
  font-size: 0.9rem;
  text-align: left;
  margin-top: -5px !important;
  margin-bottom: 0 !important;
  min-height: 1.2em;
  display: none;
  padding-left: 10px;
}

/* 14. NEW: Member Page Specific Styles */
body.members-page {
  background-color: var(--bg-color);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  scroll-snap-type: none;
}

body.members-page main > section {
  padding-top: 150px;
  padding-bottom: 100px;
  min-height: 100vh;
  justify-content: flex-start;
}

body.members-page .section-title {
  margin-bottom: 20px;
}

body.members-page .text-section > p {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 40px;
}

.member-card-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  width: 100%;
  max-width: 650px;
  margin-top: 50px;
}

.member-card-stack .value-card {
  width: 100%;
  text-align: center;
}

.member-card-stack .value-card h3 {
  margin-bottom: 8px;
}

.hidden {
  display: none !important;
}
