/* ============================================
   SCROLLYTELLING TEMPLATE - STYLES
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #0a0a0a;
  --color-text: #f5f5f5;
  --color-text-muted: #888;
  --color-accent: #3b82f6;
  --color-card-bg: rgba(20, 20, 20, 0.95);
  --font-heading: 'Georgia', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
}

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

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  z-index: -1;
}

.hero-content {
  text-align: center;
  z-index: 1;
  padding: 2rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(30px);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: var(--color-text-muted);
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(20px);
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  opacity: 0;
}

.scroll-indicator span {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
}

.arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: rotate(45deg) translateY(0); }
  40% { transform: rotate(45deg) translateY(10px); }
  60% { transform: rotate(45deg) translateY(5px); }
}

/* ============================================
   SCROLLYTELLING SECTIONS
   ============================================ */
.scrolly-section {
  position: relative;
  display: flex;
  min-height: 100vh;
}

/* Sticky container for pinned media */
.sticky-container {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1;
}

.sticky-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

.media-image.transitioning {
  position: absolute;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.media-image.transitioning.active {
  opacity: 0.7;
}

/* Text cards that scroll over pinned content */
.scroll-content {
  position: relative;
  z-index: 10;
  width: 100%;
  pointer-events: none;
}

.text-card {
  background: var(--color-card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 2rem;
  margin: 40vh 2rem;
  max-width: 450px;
  pointer-events: auto;
  opacity: 0.3;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.text-card.active {
  opacity: 1;
  transform: translateY(0);
}

.text-card h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  margin-bottom: 1rem;
  font-weight: 400;
}

.text-card p {
  color: var(--color-text-muted);
  line-height: 1.8;
}

/* Right-aligned cards (alternate layout) */
.text-card:nth-child(even) {
  margin-left: auto;
}

/* ============================================
   PARALLAX DIVIDER
   ============================================ */
.parallax-divider {
  height: 80vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.parallax-bg {
  position: absolute;
  inset: -20%;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.4;
}

.parallax-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  max-width: 800px;
}

.parallax-content blockquote {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-style: italic;
  line-height: 1.5;
  color: var(--color-text);
}

/* ============================================
   FEATURE SECTION
   ============================================ */
.feature-section {
  padding: 10rem 2rem;
  background: linear-gradient(180deg, var(--color-bg) 0%, #111 100%);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-item {
  text-align: center;
  padding: 2rem;
  opacity: 0;
  transform: translateY(40px);
}

.feature-number {
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-accent);
  opacity: 0.3;
  margin-bottom: 1rem;
}

.feature-item h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.feature-item p {
  color: var(--color-text-muted);
}

/* ============================================
   CHART SECTION
   ============================================ */
.chart-container {
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

#chart {
  width: 100%;
  max-width: 800px;
  height: auto;
}

.bar {
  transform-origin: bottom;
}

/* ============================================
   CLOSING SECTION
   ============================================ */
.closing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  background: linear-gradient(180deg, #111 0%, var(--color-bg) 100%);
}

.closing-content {
  text-align: center;
  max-width: 600px;
}

.closing-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.closing-content > p {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin-bottom: 3rem;
}

.credits {
  padding-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.credits p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .text-card {
    margin: 30vh 1rem;
    max-width: calc(100% - 2rem);
  }

  .text-card:nth-child(even) {
    margin-left: 1rem;
  }

  .parallax-bg {
    background-attachment: scroll;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
