/* ============================================
   THE CARRYING — Stylesheet
   Dark exhibition. Cream text. Teal accents.
   Serif for stories, sans for UI.
   ============================================ */

:root {
  --bg: #111111;
  --bg-soft: #1a1a1a;
  --text: #EDE8D5;
  --text-dim: #8a8578;
  --teal: #2D6A6A;
  --teal-bright: #3d8a8a;
  --teal-glow: rgba(45, 106, 106, 0.15);
  --brick: #8F1402;
  --gold: #D4A84B;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --max-width: 680px;
  --max-width-wide: 900px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   CONSTELLATION OVERLAY
   The map that accumulates in the periphery.
   Barely visible until the reveal.
   ============================================ */

#constellation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.12;
  transition: opacity 2s ease;
}

#constellation.revealed {
  opacity: 0.6;
  transition: opacity 3s ease;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--teal);
  z-index: 100;
  transition: width 0.1s linear;
}

/* ============================================
   TITLE SCREEN
   ============================================ */

.title-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.title-content {
  max-width: 600px;
  padding: 2rem;
}

.collection-title {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.collection-subtitle {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  line-height: 1.6;
  margin-bottom: 4rem;
}

.scroll-prompt {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  animation: gentle-pulse 3s ease-in-out infinite;
}

@keyframes gentle-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.scroll-arrow {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--teal), transparent);
}

/* ============================================
   STORY SECTIONS
   ============================================ */

.story-section {
  min-height: 100vh;
  padding: 6rem 2rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.story-meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.story-meta .writer-tag {
  color: var(--teal);
}

.story-meta .writer-tag.doxa {
  color: var(--brick);
}

.story-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 500;
  font-style: italic;
  color: var(--text);
  margin-bottom: 2.5rem;
  text-align: center;
  line-height: 1.2;
}

.story-illustration {
  width: 100%;
  max-width: var(--max-width);
  margin: 2rem 0;
  border-radius: 2px;
  overflow: hidden;
}

.story-illustration img {
  width: 100%;
  height: auto;
  display: block;
}

.story-illustration.doxa-drawing img {
  border: 1px solid rgba(237, 232, 213, 0.08);
}

.story-text {
  max-width: var(--max-width);
  width: 100%;
}

.story-text p {
  margin-bottom: 1.4rem;
  text-align: left;
}

.story-text p:first-child::first-letter {
  font-family: var(--serif);
  font-size: 3.2em;
  font-weight: 500;
  float: left;
  line-height: 0.85;
  margin-right: 0.08em;
  margin-top: 0.05em;
  color: var(--teal);
}

.story-text.doxa-text p:first-child::first-letter {
  color: var(--brick);
}

/* Italic passages within stories */
.story-text em {
  font-style: italic;
  color: var(--text);
  opacity: 0.85;
}

/* ============================================
   AUDIO PLAYER
   ============================================ */

.audio-player {
  max-width: var(--max-width);
  width: 100%;
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-soft);
  border: 1px solid rgba(45, 106, 106, 0.2);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 0.8rem;
}

.audio-player audio {
  width: 100%;
  height: 32px;
}

.audio-player audio::-webkit-media-controls-panel {
  background-color: var(--bg-soft);
}

.audio-player .audio-label {
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.7rem;
  white-space: nowrap;
}

/* ============================================
   STORY DIVIDER
   ============================================ */

.story-divider {
  width: 40px;
  height: 1px;
  background: var(--teal);
  opacity: 0.3;
  margin: 3rem auto;
}

/* ============================================
   REVEAL SECTION
   ============================================ */

.reveal-section {
  min-height: 100vh;
  padding: 8rem 2rem 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  background: var(--bg);
}

.reveal-content {
  max-width: var(--max-width-wide);
  width: 100%;
  text-align: center;
}

.reveal-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  font-style: italic;
  color: var(--text);
  margin-bottom: 1rem;
}

.reveal-intro {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-dim);
  margin-bottom: 3rem;
  letter-spacing: 0.03em;
}

.reveal-map-container {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0 auto 2rem;
  position: relative;
}

#reveal-map {
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.reveal-info {
  min-height: 80px;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.reveal-info .connection-label {
  color: var(--teal);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
}

.reveal-info .connection-text {
  color: var(--text);
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  body {
    font-size: 17px;
  }

  .story-section {
    padding: 4rem 1.25rem 3rem;
  }

  .story-text p:first-child::first-letter {
    font-size: 2.8em;
  }

  .story-meta {
    font-size: 0.65rem;
    gap: 1rem;
  }

  .audio-player {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .audio-player audio {
    height: 36px;
  }

  #constellation {
    opacity: 0.08;
  }
}

/* ============================================
   FADE-IN ON SCROLL
   ============================================ */

.story-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.story-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.5s ease, transform 1.5s ease;
}

.reveal-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .story-section, .reveal-section {
    opacity: 1;
    transform: none;
  }
}
