/* Story Page Specific Styles */

/* Home Dot Button */
.home-dot {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #066619 0%, #082500 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.home-dot:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(240, 147, 251, 0.6);
}

.dot-pulse {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: relative;
}

.dot-pulse::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 50%;
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Import Lacture font */
@font-face {
  font-family: 'quick-gaseous'; /* Name you'll use to reference the font */
  src: url('../fonts/GC-Quick-Gaseous-Demo-BF68c3dfca8e2e0.ttf') format('truetype'); /* Path relative to CSS file */
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Improves performance */
}

/* Reset body background and override main page styles for story page */
html {
    scroll-behavior: smooth !important;
}

body {
  font-family: 'quick-gaseous', sans-serif;
  background: radial-gradient( #3e7b4a 0%, #072000 80%);
    scroll-behavior: smooth !important;
}

/* Reset section backgrounds to prevent blue bleeding */
section {
    background-color: transparent !important;
    background: none !important;
}

/* Reset section backgrounds to prevent blue bleeding */
section {
    background-color: transparent !important;
    background: none !important;
}

/* Global font family override for entire story page */
*, *::before, *::after {
    font-family: 'quick-gaseous', monospace !important;
    /* Remove text shadow from everything by default */
}

/* Bright white text for all chapter content (not hero) */
.story-chapter *,
.story-conclusion * {
    color: #ffffff !important;
    text-shadow: none !important;
}

/* Specific overrides for chapter elements */
.chapter-number,
.chapter-title,
.chapter-timeline,
.chapter-text,
.chapter-intro,
.chapter-text p,
.chapter-content *,
.conclusion-title,
.conclusion-text,
.conclusion-final {
    color: #ffffff !important;
    text-shadow: none !important;
}

/* Keep text shadow only for hero section */
.story-hero * {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7) !important;
}

/* Override chapter navigation dots to be visible against any background */
.chapter-dot {
    background: rgba(255, 0, 0, 0.8) !important;
    border: 2px solid rgb(71, 158, 187) !important;
    box-shadow: 0 2px 8px rgb(247, 0, 255) !important;
}

.chapter-dot:hover {
    background: rgba(255, 215, 0, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4) !important;
}

.chapter-dot.active {
    background: #ffd700 !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5) !important;
}

/* Global font family for all story page text */
.story-hero *,
.story-chapter *,
.story-conclusion * {
  font-family: 'quick-gaseous', monospace !important;
}

/* Story Hero Section */
.story-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: transparent;
}

/* Story Chapters */
.story-chapter {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: transparent;
  padding: 4rem 2rem;
}

/* Story Conclusion */
.story-conclusion {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: transparent;
  padding: 4rem 2rem;
}

/* Active section */
.section-active {
  opacity: 1 !important;
  z-index: 2;
}

/* Fade animation classes for scroll trigger */
.fade-out {
  opacity: 0 !important;
}

.fade-in {
  opacity: 1 !important;
}

/* Fade animation classes for scroll trigger */
.fade-out {
  opacity: 0 !important;
}

.fade-in {
  opacity: 1 !important;
}

.story-hero-container {
  text-align: center;
  max-width: 800px;
  padding: 2rem;
  z-index: 2;
  position: relative;
}

.story-main-title {
  font-family: 'quick-gaseous', monospace;
  font-size: 7rem;
  color: #ffaa00 !important; 
  /* Removed gradient effect to allow color changes */
  /* -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite; */
  margin-bottom: 1rem;
  line-height: 100px;
}

.story-subtitle {
  font-family: 'quick-gaseous', monospace;
  font-size: 1.8rem;
  color: #ff0000;
  opacity: 0.9;
  margin-bottom: 4rem;
  letter-spacing: 0.01em;
}

.story-intro {
  max-width: 600px;
  margin: 0 auto;
}

.story-intro p {
  font-family: 'quick-gaseous', monospace;
  font-size: 1.4rem;
  color: #0000ff;
  line-height: 1.;
  opacity: 0.8;
  text-shadow: 0 0 5px rgb(0, 0, 0);
}

/* Chapter Styling */
.story-chapter {
  min-height: 100vh;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.chapter-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  opacity: 0;
  transform: translateY(50px);
}
  
.chapter-header {
  text-align: center;
  margin-bottom: 3rem;
}

.chapter-number {
  display: block;
  font-family: 'quick-gaseous', monospace;
  font-size: 1rem;
  color: #0000ff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 5px rgb(0, 0, 0);
}

.chapter-title {
  font-family: 'quick-gaseous', monospace;
  font-size: 3rem;
  color: #fff;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, #ffd700, #fff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 
    0 0 10px rgba(255, 215, 0, 0.4),
    0 0 20px rgba(255, 215, 0, 0.2);
}

.chapter-timeline {
  font-family: 'quick-gaseous', monospace;
  font-size: 1.1rem;
  color: #a0a0ff;
  font-style: italic;
}

.chapter-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.chapter-text {
  font-family: 'quick-gaseous', monospace;
  color: #006122;
  line-height: 1.8;
}

.chapter-intro {
  font-family: 'quick-gaseous', monospace;
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 2rem;
  color: #0f5a00;
  line-height: 1.6;
}

.chapter-text h3 {
  font-family: 'quick-gaseous', monospace;
  font-size: 1.8rem;
  color: #000000 !important;
  text-decoration: underline;
  margin: 2rem 0 1rem 0;
}

.chapter-text p {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: #cb4700;
  line-height: 1.2;
}

/* Visual Elements */
.chapter-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.visual-element {
  width: 300px;
  height: 300px;
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-element.primordial {
  background: radial-gradient(circle, #004d7a 0%, #002f4a 100%);
  animation: oceanPulse 4s ease-in-out infinite;
}

.visual-element.vertebrate {
  background: radial-gradient(circle, #1a4d3a 0%, #0d2a1a 100%);
  animation: vertebrateFlow 5s ease-in-out infinite;
}

.visual-element.terrestrial {
  background: radial-gradient(circle, #4d2a1a 0%, #2a1a0d 100%);
  animation: terrestrialShift 6s ease-in-out infinite;
}

.visual-element.mammalian {
  background: radial-gradient(circle, #4d1a3a 0%, #2a0d1a 100%);
  animation: mammalianPulse 3s ease-in-out infinite;
}

.visual-element.primate {
  background: radial-gradient(circle, #3a4d1a 0%, #1a2a0d 100%);
  animation: primateSocial 7s ease-in-out infinite;
}

.visual-element.human {
  background: radial-gradient(circle, #4d4d1a 0%, #2a2a0d 100%);
  animation: humanEvolution 4s ease-in-out infinite;
}

.visual-element.indian {
  background: radial-gradient(circle, #ff6b35 0%, #f7931e 50%, #ffd23f 100%);
  animation: spiceGlow 5s ease-in-out infinite;
}

/* Story Conclusion */
.story-conclusion {
  background: linear-gradient(135deg, #2d1b69 0%, #4a47a3 50%, #6a5acd 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.conclusion-container {
  max-width: 800px;
  text-align: center;
  padding: 2rem;
  opacity: 0;
  transform: translateY(50px);
}

.conclusion-title {
  font-family: 'quick-gaseous', monospace;
  font-size: 3rem;
  color: #ffd700;
  margin-bottom: 2rem;
 
}

.conclusion-text {
  font-family: 'quick-gaseous', monospace;
  font-size: 1.5rem;
  color: #530096;
  line-height: 1.8;
  margin-bottom: 2rem;
  text-shadow: black;
}

.conclusion-final {
  font-family: 'quick-gaseous', monospace;
  font-size: 1.8rem;
  color: #590071;
  font-weight: 900;
  line-height: 1.6;
  margin-bottom: 3rem;
  text-shadow: 0 0 5px rgb(0, 0, 0);
}

.back-to-platform {
  margin-top: 2rem;
}

/* Animations */
@keyframes oceanPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(0, 157, 255, 0.3); }
  50% { transform: scale(1.1); box-shadow: 0 0 40px rgba(0, 157, 255, 0.6); }
}

@keyframes vertebrateFlow {
  0%, 100% { transform: rotate(0deg) scale(1); }
  33% { transform: rotate(10deg) scale(1.05); }
  66% { transform: rotate(-10deg) scale(0.95); }
}

@keyframes terrestrialShift {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes mammalianPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.2); filter: brightness(1.3); }
}

@keyframes primateSocial {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(5deg); }
  75% { transform: rotate(-5deg); }
}

@keyframes humanEvolution {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(180deg); }
}

@keyframes spiceGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 107, 53, 0.4); }
  50% { box-shadow: 0 0 60px rgba(255, 210, 63, 0.8); }
}

@keyframes floating {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Make hero and chapter sections shorter on phones and remove large fixed heights */
  .story-hero,
  .story-chapter,
  .story-conclusion {
    min-height: auto;
    padding: 2rem 1rem;
  }

  /* Container sizing and spacing */
  .story-hero-container,
  .chapter-container,
  .conclusion-container {
    max-width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
  }

  /* Responsive, readable headings using clamp for flexibility */
  .story-main-title {
    font-size: clamp(2.4rem, 10vw, 4rem);
    line-height: 1.05;
    margin-bottom: 0.6rem;
  }

  .story-subtitle {
    font-size: clamp(1rem, 4.5vw, 1.4rem);
    margin-bottom: 1.5rem;
  }

  /* Stack chapter content into a single column and increase line-height for readability */
  .chapter-content {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .chapter-title {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
    margin-bottom: 0.6rem;
  }

  /* Reduce visual element sizes and disable heavy animations on mobile to save CPU and avoid overlap */
  .visual-element {
    width: 140px;
    height: 140px;
    min-height: 0;
    border-radius: 14px;
  }

  .visual-element.primordial,
  .visual-element.vertebrate,
  .visual-element.terrestrial,
  .visual-element.mammalian,
  .visual-element.primate,
  .visual-element.human,
  .visual-element.indian {
    animation: none !important;
  }

  /* Text blocks: improve legibility on small screens */
  .chapter-text,
  .chapter-intro,
  .conclusion-text,
  .conclusion-final {
    font-size: 1rem;
    line-height: 1.6;
    color: #ffffff !important;
  }

  .chapter-text p {
    font-size: 1rem;
    color: #ffffff !important;
    margin-bottom: 1rem;
  }

  /* Ensure H3s remain black and underlined (per earlier request) and are not oversized */
  .chapter-text h3 {
    font-size: 1.2rem;
    color: #000000 !important;
    text-decoration: underline;
    margin: 1rem 0 0.5rem 0;
  }

  /* Reduce large intro styling that used bright colors which hurt legibility on phones */
  .story-intro p {
    color: #ffffff;
    text-shadow: none;
    font-size: 1rem;
  }

  /* Conclusion tweaks */
  .conclusion-title {
    font-size: 1.8rem;
  }

  /* Reduce spacing for chapter containers so users can scroll content comfortably */
  .chapter-container { padding: 1rem 0; }

  /* Home dot: reduce size and move slightly to avoid covering content */
  .home-dot { top: 1rem; right: 1rem; width: 44px; height: 44px; }

  /* Ensure large shadows and neon-like effects don't overwhelm small screens */
  .chapter-title,
  .chapter-number,
  .story-main-title { text-shadow: none !important; }
}
