/* ═══════════════════════════════════════════════════════════════
   CONSCIOUSNESS STORY PAGES — Immersive Long-Form Template
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ─── Nav ─────────────────────────────────────────────────── */
.story-nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}

.back-link:hover {
  color: #fff;
  background: rgba(0,0,0,0.6);
  border-color: rgba(255,255,255,0.25);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.consciousness-story {
  background: var(--story-bg, #0a0a0a);
  color: var(--story-text, #e8e0d4);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  line-height: 1.8;
  overflow-x: hidden;
}

/* ─── Theme Variants ──────────────────────────────────────── */
body.story-anthony {
  --story-bg: #0a0a0a;
  --story-text: #e8e0d4;
  --story-text-dim: rgba(232, 224, 212, 0.5);
  --story-accent: #00E5CC;
  --story-accent-dim: rgba(0, 229, 204, 0.15);
  --story-warm: #c4a35a;
  --story-warm-dim: rgba(196, 163, 90, 0.15);
  --story-overlay: linear-gradient(transparent 40%, rgba(10, 10, 10, 0.97));
}

body.story-eden {
  --story-bg: #050810;
  --story-text: #d4e0e8;
  --story-text-dim: rgba(212, 224, 232, 0.5);
  --story-accent: #22D3EE;
  --story-accent-dim: rgba(34, 211, 238, 0.15);
  --story-warm: #1a5a8c;
  --story-warm-dim: rgba(26, 90, 140, 0.15);
  --story-overlay: linear-gradient(transparent 40%, rgba(5, 8, 16, 0.97));
}

/* ─── Progress Bar ────────────────────────────────────────── */
.story-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--story-accent);
  z-index: 1000;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--story-accent);
}

/* ─── Audio Toggle ────────────────────────────────────────── */
.story-audio-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--story-text-dim);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.story-audio-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--story-text);
}

.story-audio-toggle.active {
  border-color: var(--story-accent);
  color: var(--story-accent);
  box-shadow: 0 0 15px var(--story-accent-dim);
}

/* ─── Back Link ───────────────────────────────────────────── */
.story-back {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--story-text-dim);
  text-decoration: none;
  transition: color 0.3s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.story-back:hover {
  color: var(--story-accent);
  border-color: var(--story-accent-dim);
}

/* ─── Hero ────────────────────────────────────────────────── */
.story-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: hero-drift 25s ease-in-out infinite alternate;
}

@keyframes hero-drift {
  0% { transform: scale(1.0); }
  100% { transform: scale(1.08); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--story-overlay);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px 12vh;
  max-width: 900px;
}

.hero-content h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(20px);
  animation: hero-fade-in 1.5s ease 0.3s forwards;
}

.hero-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--story-accent);
  margin-top: 16px;
  opacity: 0;
  animation: hero-fade-in 1.5s ease 0.8s forwards;
}

.hero-dateline {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--story-text-dim);
  margin-top: 12px;
  letter-spacing: 0.05em;
  opacity: 0;
  animation: hero-fade-in 1.5s ease 1.2s forwards;
}

@keyframes hero-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

.hero-scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0;
  animation: hero-fade-in 1s ease 2s forwards, scroll-bounce 2s ease-in-out 3s infinite;
}

.hero-scroll-hint span {
  display: block;
  width: 2px;
  height: 30px;
  background: linear-gradient(to bottom, var(--story-accent), transparent);
  margin: 0 auto;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ─── Story Body ──────────────────────────────────────────── */
.story-body {
  max-width: 100%;
  padding: 0;
}

/* ─── Story Sections ──────────────────────────────────────── */
.story-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px;
}

.story-section p {
  margin-bottom: 1.6em;
  font-weight: 300;
}

.story-section p:last-child {
  margin-bottom: 0;
}

/* ─── Lede (first paragraph) ─────────────────────────────── */
.story-lede {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  line-height: 1.7;
  font-weight: 300;
  color: #fff;
}

.story-lede::first-line {
  font-weight: 400;
}

/* ─── Section Headers ─────────────────────────────────────── */
.story-chapter {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px 20px;
}

.story-chapter h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #fff;
  position: relative;
  padding-bottom: 16px;
}

.story-chapter h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 1px;
  background: var(--story-accent);
}

.story-chapter .chapter-subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--story-text-dim);
  margin-top: 12px;
}

/* ─── Pull Quotes ─────────────────────────────────────────── */
.story-pullquote {
  max-width: 720px;
  margin: 60px auto;
  padding: 30px 24px 30px 40px;
  border-left: 2px solid var(--story-accent);
  position: relative;
}

.story-pullquote p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.story-pullquote cite {
  display: block;
  margin-top: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--story-text-dim);
}

/* ─── Images ──────────────────────────────────────────────── */
.story-image {
  margin: 60px 0;
  position: relative;
}

.story-image img {
  width: 100%;
  display: block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
}

.story-image.revealed img {
  opacity: 1;
  transform: translateY(0);
}

.story-image figcaption {
  font-size: 0.75rem;
  color: var(--story-text-dim);
  padding: 12px 24px;
  max-width: 720px;
  margin: 0 auto;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* Full-bleed images */
.story-image.full-bleed {
  width: 100vw;
  max-height: 75vh;
  overflow: hidden;
}

.story-image.full-bleed img {
  width: 100%;
  height: 75vh;
  object-fit: cover;
}

/* Inset images */
.story-image.inset {
  max-width: 720px;
  margin: 60px auto;
  padding: 0 24px;
}

.story-image.inset img {
  border-radius: 4px;
}

/* Side-by-side */
.story-image-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 60px 0;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

.story-image-pair img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: 2px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
}

.story-image-pair.revealed img {
  opacity: 1;
  transform: translateY(0);
}

.story-image-pair img:nth-child(2) {
  transition-delay: 0.15s;
}

/* Parallax background section */
.story-parallax-section {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 80px 0;
  overflow: hidden;
}

.story-parallax-bg {
  position: absolute;
  inset: -20%;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  will-change: transform;
}

.story-parallax-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 80px 24px;
  text-align: center;
}

.story-parallax-content p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 300;
  line-height: 1.7;
  color: #fff;
}

/* ─── Emphasis Section ────────────────────────────────────── */
.story-emphasis {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px;
  text-align: center;
}

.story-emphasis p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.3rem, 2.8vw, 1.8rem);
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

.story-emphasis .accent {
  color: var(--story-accent);
}

/* ─── Divider ─────────────────────────────────────────────── */
.story-divider {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 24px;
  text-align: center;
}

.story-divider span {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  vertical-align: middle;
  margin: 0 12px;
}

.story-divider .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--story-accent);
  display: inline-block;
  vertical-align: middle;
}

/* ─── CTA Footer ──────────────────────────────────────────── */
.story-cta {
  text-align: center;
  padding: 100px 24px 80px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 80px;
}

.story-cta .cta-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--story-text-dim);
  margin-bottom: 20px;
}

.story-cta a {
  display: inline-block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--story-accent);
  text-decoration: none;
  padding: 16px 40px;
  border: 1px solid var(--story-accent-dim);
  border-radius: 4px;
  transition: all 0.3s;
}

.story-cta a:hover {
  background: var(--story-accent-dim);
  border-color: var(--story-accent);
}

.story-cta .cta-secondary {
  display: block;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--story-text-dim);
  text-decoration: none;
}

.story-cta .cta-secondary:hover {
  color: var(--story-text);
}

/* ─── Scroll Reveal ───────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  body.consciousness-story {
    font-size: 16px;
  }

  .story-hero {
    min-height: 500px;
  }

  .hero-content {
    padding-bottom: 8vh;
  }

  .story-section,
  .story-chapter,
  .story-pullquote,
  .story-emphasis,
  .story-divider {
    padding-left: 20px;
    padding-right: 20px;
  }

  .story-image.full-bleed img {
    height: 50vh;
  }

  .story-image-pair {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .story-image-pair img {
    height: 250px;
  }

  .story-pullquote {
    padding-left: 28px;
  }

  .story-back {
    top: 12px;
    left: 12px;
    font-size: 0.65rem;
  }

  .story-audio-toggle {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    letter-spacing: 0.02em;
  }

  .story-section {
    padding: 40px 18px;
  }

  .story-chapter {
    padding: 60px 18px 16px;
  }
}
