/* ══════════════════════════════════════════
   Journey storyboard — scroll-driven scenes
   Warm paper aesthetic, full-viewport layout
   ══════════════════════════════════════════ */

/* Hide Quarto auto-generated title block */
#title-block-header,
.quarto-title-block,
header#title-block-header {
  display: none !important;
}

/* Remove default Quarto content padding */
#quarto-content > .page-columns > .content {
  padding: 0 !important;
  max-width: 100% !important;
}
main.content {
  padding: 0 !important;
  max-width: 100% !important;
}

/* ── Tap-to-begin gate ── */
.journey-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(20, 18, 14, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gate-fade-in 0.4s ease;
}
.journey-gate.hidden {
  animation: gate-fade-out 0.4s ease forwards;
  pointer-events: none;
}
@keyframes gate-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes gate-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
.journey-gate-content {
  text-align: center;
  max-width: 480px;
  padding: 2rem;
}
.journey-gate-icon {
  font-size: 3rem;
  color: #d4a74a;
  margin-bottom: 1rem;
  opacity: 0.9;
}
.journey-gate-content h2 {
  color: #f0ebe1;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.journey-gate-content p {
  color: rgba(240, 235, 225, 0.8);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0 0 2rem;
}
.journey-gate-btn {
  background: #d4a74a;
  color: #1a1510;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.85rem 2.5rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(212, 167, 74, 0.3);
}
.journey-gate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 167, 74, 0.4);
}

/* ── Progress bar (side rail) ── */
.journey-progress {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.journey-progress.visible {
  opacity: 1;
}
.journey-progress-track {
  width: 3px;
  height: 180px;
  background: rgba(180, 168, 138, 0.3);
  border-radius: 2px;
  position: relative;
  margin-bottom: 0.75rem;
}
.journey-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: #d4a74a;
  border-radius: 2px;
  transition: height 0.4s ease;
  height: 0%;
}
.journey-progress-steps {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.journey-progress-dot {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid rgba(180, 168, 138, 0.4);
  background: rgba(240, 235, 225, 0.9);
  color: #5a4e3e;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.journey-progress-dot.active {
  border-color: #d4a74a;
  background: #d4a74a;
  color: #1a1510;
  box-shadow: 0 0 8px rgba(212, 167, 74, 0.4);
}
.journey-progress-dot:hover {
  border-color: #7a5518;
  transform: scale(1.15);
}

/* ── Sticky mini-player ── */
.journey-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #1a1510;
  border-top: 2px solid #d4a74a;
  transform: translateY(100%);
  transition: transform 0.4s ease;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  padding: 0;
}
.journey-player.visible {
  transform: translateY(0);
}

/* ── Row 1: Seek bar ── */
.player-seek-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem 0.25rem;
  max-width: 960px;
  margin: 0 auto;
}
.player-time {
  color: rgba(240, 235, 225, 0.6);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 2.5rem;
  flex-shrink: 0;
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}
.player-seek-track {
  position: relative;
  flex: 1;
  height: 8px;
  background: rgba(240, 235, 225, 0.12);
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: height 0.15s ease;
}
.player-seek-track:hover {
  height: 12px;
}
.player-seek-filled {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #d4a74a, #e0b960);
  border-radius: 4px;
  pointer-events: none;
  transition: width 0.1s linear;
}
.player-seek-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: #f0ebe1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.player-seek-track:hover .player-seek-thumb,
.player-seek-track.dragging .player-seek-thumb {
  opacity: 1;
}
.player-seek-markers {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  pointer-events: none;
}
.seek-marker {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: rgba(240, 235, 225, 0.35);
  border-radius: 1px;
  transform: translateX(-1px);
}

/* ── Row 2: Controls ── */
.player-controls-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.25rem 1.25rem 0.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  min-width: 0;
}
.player-scene-label {
  color: #d4a74a;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.player-scene-title {
  color: #f0ebe1;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.player-btn {
  background: none !important;
  border: none !important;
  color: #f0ebe1;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s, transform 0.15s;
  line-height: 1;
}
.player-btn:hover {
  color: #d4a74a;
}
.player-btn:active {
  transform: scale(0.92);
}
.player-play-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: rgba(212, 167, 74, 0.15) !important;
  border-radius: 50% !important;
  border: 2px solid rgba(212, 167, 74, 0.4) !important;
}
.player-play-btn:hover {
  background: rgba(212, 167, 74, 0.25) !important;
  border-color: #d4a74a !important;
}
.player-skip-btn {
  font-size: 0.7rem;
  font-weight: 700;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  color: rgba(240, 235, 225, 0.6);
  border: 1px solid rgba(240, 235, 225, 0.15) !important;
}
.player-skip-btn:hover {
  color: #d4a74a;
  border-color: rgba(212, 167, 74, 0.4) !important;
}

.player-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  min-width: 120px;
  flex-shrink: 0;
}
.player-chapter-title {
  color: rgba(212, 167, 74, 0.85);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.player-chapters-toggle {
  font-size: 0.72rem !important;
  color: rgba(240, 235, 225, 0.5);
  white-space: nowrap;
  padding: 0.25rem 0.6rem !important;
  border-radius: 0.25rem !important;
  border: 1px solid rgba(240, 235, 225, 0.12) !important;
  transition: all 0.2s;
}
.player-chapters-toggle:hover,
.player-chapters-toggle.active {
  color: #d4a74a;
  border-color: rgba(212, 167, 74, 0.3) !important;
  background: rgba(212, 167, 74, 0.08) !important;
}

/* ── Chapter list dropdown ── */
.player-chapter-list {
  display: none;
  background: #1e1912;
  border-top: 1px solid rgba(212, 167, 74, 0.25);
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
}
.player-chapter-list.visible {
  display: block;
}
.player-chapter-list .chapter-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 1.5rem;
  background: none !important;
  border: none !important;
  border-bottom: 1px solid rgba(240, 235, 225, 0.05) !important;
  border-radius: 0 !important;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  color: #f0ebe1;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
}
.player-chapter-list .chapter-item:hover {
  background: rgba(212, 167, 74, 0.08) !important;
}
.player-chapter-list .chapter-item.active {
  background: rgba(212, 167, 74, 0.14) !important;
}
.player-chapter-list .chapter-item.active .chapter-name {
  color: #d4a74a;
}
.chapter-time {
  color: rgba(240, 235, 225, 0.4);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  white-space: nowrap;
  min-width: 2.5rem;
  flex-shrink: 0;
}
.chapter-name {
  color: #f0ebe1;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── Buffered range indicator ── */
.player-seek-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(240, 235, 225, 0.08);
  border-radius: 4px;
  pointer-events: none;
  transition: width 0.3s linear;
}

/* ── Interactive transcript panel ── */
.scene-transcript-wrap {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(180, 168, 138, 0.3);
}
.transcript-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #7a5518;
  background: rgba(122, 85, 24, 0.06);
  border: 1px solid rgba(122, 85, 24, 0.2);
  border-radius: 2rem;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.transcript-toggle:hover {
  background: rgba(122, 85, 24, 0.12);
  border-color: rgba(122, 85, 24, 0.4);
}
.transcript-toggle.active {
  background: #7a5518;
  color: #faf6ee;
  border-color: #7a5518;
}
.scene-transcript {
  display: none;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(44, 36, 23, 0.03);
  border: 1px solid rgba(180, 168, 138, 0.2);
  border-radius: 0.5rem;
  scroll-behavior: smooth;
}
.scene-transcript.visible {
  display: block;
}
.transcript-seg {
  display: flex;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border-left: 3px solid transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.15rem;
}
.transcript-seg:hover {
  background: rgba(122, 85, 24, 0.06);
}
.transcript-seg.active {
  background: rgba(212, 167, 74, 0.12);
  border-left-color: #d4a74a;
}
.transcript-seg.speaker-0 {
  border-left-color: rgba(122, 85, 24, 0.25);
}
.transcript-seg.speaker-1 {
  border-left-color: rgba(90, 78, 62, 0.25);
}
.transcript-seg.active.speaker-0,
.transcript-seg.active.speaker-1 {
  border-left-color: #d4a74a;
}
.transcript-speaker {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7a5518;
  white-space: nowrap;
  min-width: 1.5rem;
  padding-top: 0.15rem;
  flex-shrink: 0;
}
.transcript-seg.speaker-1 .transcript-speaker {
  color: #5a4e3e;
}
.transcript-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #1e1a14;
}
.transcript-time {
  font-size: 0.6rem;
  color: rgba(90, 78, 62, 0.4);
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 0.2rem;
}

/* ── Scene layout ── */
.journey-scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.journey-scene.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scene background layers */
.scene-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.scene-bg-1 {
  background: linear-gradient(135deg, #f0ebe1 0%, #e8dcc8 50%, #f5efe4 100%);
}
.scene-bg-2 {
  background: linear-gradient(135deg, #e8dcc8 0%, #ddd0b8 50%, #f0ebe1 100%);
}
.scene-bg-3 {
  background: linear-gradient(135deg, #ddd0b8 0%, #d4c4a6 50%, #e8dcc8 100%);
}
.scene-bg-4 {
  background: linear-gradient(135deg, #d4c4a6 0%, #c8b690 50%, #ddd0b8 100%);
}
.scene-bg-5 {
  background: linear-gradient(135deg, #c8b690 0%, #b8a476 50%, #d4c4a6 100%);
}
.scene-bg-6 {
  background: linear-gradient(135deg, #b8a476 0%, #a08a58 50%, #c8b690 100%);
}

/* Scene content card */
.scene-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 2.5rem;
  background: rgba(250, 246, 238, 0.92);
  border-radius: 1rem;
  border: 1px solid rgba(180, 168, 138, 0.3);
  box-shadow: 0 8px 40px rgba(44, 36, 23, 0.1);
}

.scene-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #faf6ee;
  background: #7a5518;
  padding: 0.3rem 0.75rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
}

.scene-title {
  font-size: 2rem;
  font-weight: 800;
  color: #1a1510;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.scene-subtitle {
  font-size: 1.05rem;
  color: #7a5518;
  font-weight: 500;
  font-style: italic;
  margin: 0 0 1.5rem;
}

.scene-narrative {
  margin-bottom: 1.5rem;
}
.scene-narrative p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #1e1a14;
  margin: 0 0 1rem;
}
.scene-narrative p:last-child {
  margin-bottom: 0;
}
.scene-narrative strong {
  color: #1a1510;
}
.scene-narrative em {
  color: #5a4e3e;
}

/* Scene links */
.scene-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(180, 168, 138, 0.3);
}
.scene-links-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5a4e3e;
  margin-right: 0.25rem;
}
.scene-links a {
  font-size: 0.85rem;
  color: #7a5518;
  font-weight: 600;
  text-decoration: none;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(122, 85, 24, 0.25);
  border-radius: 0.35rem;
  transition: all 0.2s ease;
}
.scene-links a:hover {
  background: rgba(122, 85, 24, 0.08);
  border-color: rgba(122, 85, 24, 0.5);
  text-decoration: none;
}

/* Upcoming scenes */
.journey-scene-upcoming .scene-content {
  background: rgba(250, 246, 238, 0.75);
  border-style: dashed;
}
.journey-scene-upcoming .scene-badge {
  background: #5a4e3e;
}

/* ── Disclaimer ── */
.journey-disclaimer {
  margin-top: 1.25rem;
  font-size: 0.72rem;
  color: rgba(240, 235, 225, 0.45);
  line-height: 1.5;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}
.journey-disclaimer strong {
  color: rgba(240, 235, 225, 0.6);
}
.journey-footer-disclaimer {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  text-align: center;
  background: rgba(44, 36, 23, 0.04);
  border-top: 1px solid rgba(180, 168, 138, 0.2);
}
.journey-footer-disclaimer p {
  font-size: 0.78rem;
  color: #5a4e3e;
  line-height: 1.6;
  margin: 0;
}
.journey-footer-disclaimer strong {
  color: #1a1510;
}

/* ── End card ── */
.journey-end {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2c2417;
  padding: 3rem 1.5rem;
}
.journey-end-content {
  text-align: center;
  max-width: 560px;
}
.journey-end-content h2 {
  color: #f0ebe1;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
}
.journey-end-content p {
  color: rgba(240, 235, 225, 0.8);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 2rem;
}
.journey-end-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.journey-cta-btn {
  display: inline-block;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.journey-cta-primary {
  background: #d4a74a;
  color: #1a1510;
  box-shadow: 0 4px 16px rgba(212, 167, 74, 0.3);
}
.journey-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 167, 74, 0.4);
  color: #1a1510;
  text-decoration: none;
}
.journey-cta-secondary {
  background: transparent;
  color: #f0ebe1;
  border: 2px solid rgba(240, 235, 225, 0.3);
}
.journey-cta-secondary:hover {
  border-color: rgba(240, 235, 225, 0.6);
  transform: translateY(-2px);
  color: #f0ebe1;
  text-decoration: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .journey-progress {
    right: 0.5rem;
  }
  .journey-progress-track {
    height: 120px;
  }
  .journey-progress-dot {
    width: 1.4rem;
    height: 1.4rem;
    font-size: 0.6rem;
  }

  .scene-content {
    margin: 0 1rem;
    padding: 2rem 1.5rem;
  }
  .scene-title {
    font-size: 1.5rem;
  }
  .scene-subtitle {
    font-size: 0.95rem;
  }
  .scene-narrative p {
    font-size: 0.95rem;
  }

  .player-seek-row {
    padding: 0.5rem 0.75rem 0.15rem;
  }
  .player-controls-row {
    padding: 0.15rem 0.75rem 0.4rem;
    gap: 0.5rem;
  }
  .player-info {
    display: none;
  }
  .player-chapter-title {
    max-width: 120px;
    font-size: 0.65rem;
  }

  .journey-end-content h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .journey-progress {
    display: none;
  }

  .scene-content {
    margin: 0 0.5rem;
    padding: 1.5rem 1rem;
    border-radius: 0.75rem;
  }
  .scene-title {
    font-size: 1.3rem;
  }
  .scene-links {
    flex-direction: column;
    align-items: flex-start;
  }
}
