/* ============================================
   THE GREAT LAW OF PEACE — CINEMATIC STYLES
   ============================================ */

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

:root {
  --gold: #d4a853;
  --gold-bright: #f0c75e;
  --gold-dim: #a07830;
  --red-muted: #c0392b;
  --cream: #f5f0e8;
  --cream-dim: rgba(245, 240, 232, 0.7);
  --bg-dark: #0a0a0a;
  --transition-slide: 2.5s;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--cream);
  font-family: 'Lora', Georgia, serif;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  z-index: 1000;
  transition: width 0.3s ease-out;
}

/* ============================================
   CONTROLS
   ============================================ */
.controls {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.4s;
}

body:hover .controls,
.controls:focus-within {
  opacity: 1;
}

.control-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.slide-counter {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   START SCREEN
   ============================================ */
.start-screen {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  transition: opacity 1.5s ease, visibility 1.5s ease;
}

.start-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-content {
  text-align: center;
  animation: startFadeIn 2s ease forwards;
}

@keyframes startFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.start-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.35em;
  color: var(--gold);
  margin-bottom: 2rem;
}

.start-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: var(--cream);
  text-shadow: 0 0 60px rgba(212, 168, 83, 0.3);
}

.start-native {
  font-family: 'Lora', serif;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-top: 1rem;
}

.start-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--cream-dim);
  margin-top: 2rem;
}

.start-presented {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--gold-dim);
  margin-top: 3.5rem;
}

.start-presented strong {
  font-weight: 600;
  color: var(--gold);
  font-size: 1.15rem;
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 3rem;
  padding: 14px 36px;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  color: var(--gold);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  cursor: pointer;
  transition: all 0.4s;
}

.start-btn svg {
  fill: var(--gold);
  width: 16px;
  height: 16px;
}

.start-btn:hover {
  background: var(--gold);
  color: var(--bg-dark);
  border-color: var(--gold);
}

.start-btn:hover svg {
  fill: var(--bg-dark);
}

/* ============================================
   SLIDES
   ============================================ */
.slides-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(1);
  transition:
    opacity 3s ease-in-out,
    visibility 3s ease-in-out,
    transform 18s ease-in-out;
  background-size: cover;
  background-position: center;
  will-change: opacity, transform;
}

.slide.active {
  opacity: 1;
  visibility: visible;
}

/* Ken Burns via transitions — no animations = no blip */
.slide.active:nth-child(4n+1) {
  transform: scale(1.08);
}

.slide.active:nth-child(4n+2) {
  transform: scale(1.06) translateX(-1%);
}

.slide.active:nth-child(4n+3) {
  transform: scale(1.1);
}

.slide.active:nth-child(4n+4) {
  transform: scale(1.06) translateX(1%);
}

/* ============================================
   OVERLAYS
   ============================================ */
.slide-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.overlay-dark {
  background: rgba(0, 0, 0, 0.65);
}

.overlay-darker {
  background: rgba(0, 0, 0, 0.78);
}

.overlay-deep {
  background: rgba(5, 5, 20, 0.8);
}

.overlay-warm {
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0.7) 0%,
      rgba(40, 25, 10, 0.65) 100%);
}

.overlay-warm-light {
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(40, 25, 10, 0.45) 100%);
}

/* ============================================
   SLIDE CONTENT
   ============================================ */
.slide-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 2rem;
}

.center-content {
  text-align: center;
}

.slide-label {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  color: var(--gold);
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(15px);
}

.slide.active .slide-label {
  animation: textReveal 1s 0.3s ease forwards;
}

.slide-heading {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(25px);
}

.slide.active .slide-heading {
  animation: textReveal 1.2s 0.6s ease forwards;
}

.slide-heading.mega {
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  font-variant: normal;
  text-transform: uppercase;
}

.slide-heading.gold {
  color: var(--gold);
  text-shadow: 0 0 40px rgba(212, 168, 83, 0.25);
}

.slide-heading.red {
  color: var(--red-muted);
  text-shadow: 0 0 40px rgba(192, 57, 43, 0.3);
}

.slide-text {
  font-family: 'Lora', serif;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--cream);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(20px);
}

.slide.active .slide-text {
  animation: textReveal 1s ease forwards;
}

/* Stagger text animations */
.slide.active .slide-text:nth-child(1) {
  animation-delay: 0.5s;
}

.slide.active .slide-text:nth-child(2) {
  animation-delay: 1s;
}

.slide.active .slide-text:nth-child(3) {
  animation-delay: 1.5s;
}

.slide.active .slide-text:nth-child(4) {
  animation-delay: 2s;
}

.slide.active .slide-text:nth-child(5) {
  animation-delay: 2.5s;
}

.slide.active .slide-text:nth-child(6) {
  animation-delay: 3s;
}

.slide-text.large {
  font-size: clamp(1.4rem, 2.8vw, 1.8rem);
  font-weight: 600;
}

.slide-text.accent {
  color: var(--gold);
}

.slide-text.gold {
  color: var(--gold-bright);
}

.slide-text.subdued {
  color: var(--cream-dim);
  font-style: italic;
}

.slide-text strong {
  font-weight: 700;
  color: var(--gold-bright);
}

.slide-text em {
  font-style: italic;
  color: var(--cream);
}

/* ============================================
   QUOTES
   ============================================ */
.quote-block {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem;
  border-left: 3px solid var(--gold-dim);
  text-align: left;
  opacity: 0;
  transform: translateY(20px);
}

.slide.active .quote-block {
  animation: textReveal 1.2s 0.5s ease forwards;
}

.slide-text.quote {
  font-style: italic;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  line-height: 1.8;
  color: var(--cream);
  opacity: 1;
  transform: none;
}

.slide-text.attribution {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-top: 1.5rem;
  opacity: 1;
  transform: none;
}

/* ============================================
   NARRATION MODE — disable CSS text animations
   so WordReveal has sole control of visibility
   ============================================ */
body.narration-mode .slide.active .slide-text,
body.narration-mode .slide.active .slide-heading,
body.narration-mode .slide.active .slide-label,
body.narration-mode .slide.active .quote-block {
  animation: none !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes textReveal {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subtle grain overlay for cinematic texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .slide-content {
    padding: 1.5rem;
    max-width: 95%;
  }

  .slide-text {
    font-size: 1.1rem;
  }

  .slide-text.large {
    font-size: 1.2rem;
  }

  .quote-block {
    padding: 1.5rem;
  }

  .controls {
    bottom: 20px;
    right: 20px;
  }
}