:root {
  --neon-color: #da0f0f;
  --neon-glow: 0 0 10px rgba(218, 15, 15, 0.8),
               0 0 20px rgba(218, 15, 15, 0.6),
               0 0 30px rgba(218, 15, 15, 0.4),
               0 0 40px rgba(218, 15, 15, 0.2);
}

body {
  margin: 0;
  padding: 0;
  background-color: #000;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  font-family: 'ITC Benguiat W01', serif;
}

.title-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.stranger-things-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Original intro zooms in very slowly over approx 30-40 seconds */
  transform: scale(0.85);
  animation: slowZoom 35s linear forwards;
}

.word-stranger {
  display: flex;
  align-items: flex-start;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--neon-color);
  text-shadow: var(--neon-glow);
  font-size: 8rem;
  font-weight: bold;
  letter-spacing: 5px;
  line-height: 0.8;
  position: relative;
}

.letter-s, .letter-r {
  font-size: 11.5rem; /* The outer S and R are noticeably larger */
}
.letter-s { margin-right: -10px; }
.letter-r { margin-left: 5px; }

.word-middle {
  display: flex;
  padding-top: 8px; /* Offset the middle letters down slightly relative to S and R */
  letter-spacing: 12px;
}
.word-middle span { display: inline-block; }

.top-bar-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 25px;
  margin-bottom: 25px;
}
.top-bar {
  width: 78%;
  height: 2.5px;
  background-color: var(--neon-color);
  box-shadow: var(--neon-glow);
  position: relative;
  left: 2%;
  opacity: 0;
  transform-origin: center;
  /* Bars snap in place violently and then flicker */
  animation: assemble-bar 0.1s ease-out forwards, flicker 4s infinite alternate 18s;
  animation-delay: 17s;
}

.bottom-group {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 15px;
}

.word-things {
  display: flex;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--neon-color);
  text-shadow: var(--neon-glow);
  font-size: 5rem;
  font-weight: bold;
  letter-spacing: 28px;
  margin-right: -28px; 
}

.side-bar {
  flex-grow: 1;
  height: 2.5px;
  background-color: var(--neon-color);
  box-shadow: var(--neon-glow);
  max-width: 120px;
  opacity: 0;
  transform-origin: center;
  animation: assemble-bar 0.1s ease-out forwards, flicker 4s infinite alternate 18s;
}
.side-bar-left { animation-delay: 17.2s; }
.side-bar-right { animation-delay: 17.4s; }

/* In the authentic intro:
   1. The first visual is distinct pieces floating in space.
   2. They cross paths, pan extremely slowly, and eventually lock together.
   3. Letters "arrive" individually into position, creating a tense atmosphere.
*/
.letter-s, .word-middle span, .letter-r, .word-things span {
  opacity: 0;
  /* Smooth, drawn out assembling animation. 
     Flicker starts after 18 seconds, when lock-in is near complete */
  animation: 
    assemble 15s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, 
    flicker 3s infinite alternate 18s;
}

/* Precise pathing to emulate 1:1 camera depth and parallax sorting:
   S: comes from top left
   T: comes from top right, crossing over
   R: comes from bottom left
   A: comes from top right
   N: comes from bottom left
   G: comes from bottom center
   E: comes from top left
   R: comes from top right
   
   T: comes from bottom right
   H: comes from bottom left
   I: comes from top left
   N: comes from top right
   G: comes from bottom right
   S: comes from bottom left
*/

/* --- WORD STRANGER --- */
/* S */
.letter-s { 
  --startX: -120vw; --startY: -60vh; --startScale: 8; 
  animation-delay: 0s; 
}
/* T */
.word-middle span:nth-child(1) { 
  --startX: 100vw; --startY: -50vh; --startScale: 12; 
  animation-delay: 1.5s; 
}
/* R */
.word-middle span:nth-child(2) { 
  --startX: -80vw; --startY: 80vh; --startScale: 10; 
  animation-delay: 3s; 
}
/* A */
.word-middle span:nth-child(3) { 
  --startX: 120vw; --startY: 40vh; --startScale: 9; 
  animation-delay: 4.5s; 
}
/* N */
.word-middle span:nth-child(4) { 
  --startX: -100vw; --startY: -80vh; --startScale: 14; 
  animation-delay: 6s; 
}
/* G */
.word-middle span:nth-child(5) { 
  --startX: 30vw; --startY: 120vh; --startScale: 11; 
  animation-delay: 7.5s; 
}
/* E */
.word-middle span:nth-child(6) { 
  --startX: -50vw; --startY: -100vh; --startScale: 13; 
  animation-delay: 2s; 
}
/* R */
.letter-r { 
  --startX: 130vw; --startY: -20vh; --startScale: 7; 
  animation-delay: 10s; 
}

/* --- WORD THINGS --- */
/* T */
.word-things span:nth-child(1) { 
  --startX: 80vw; --startY: 100vh; --startScale: 9; 
  animation-delay: 5s; 
}
/* H */
.word-things span:nth-child(2) { 
  --startX: -120vw; --startY: 90vh; --startScale: 12; 
  animation-delay: 6.5s; 
}
/* I */
.word-things span:nth-child(3) { 
  --startX: -60vw; --startY: -120vh; --startScale: 10; 
  animation-delay: 8s; 
}
/* N */
.word-things span:nth-child(4) { 
  --startX: 110vw; --startY: -70vh; --startScale: 15; 
  animation-delay: 9.5s; 
}
/* G */
.word-things span:nth-child(5) { 
  --startX: 60vw; --startY: 120vh; --startScale: 8; 
  animation-delay: 11s; 
}
/* S */
.word-things span:nth-child(6) { 
  --startX: -90vw; --startY: 110vh; --startScale: 11; 
  animation-delay: 12.5s; 
}

@keyframes assemble {
  0% {
    opacity: 0;
    transform: translate(var(--startX), var(--startY)) scale(var(--startScale));
    text-shadow: none;
    /* Simulate deep depth of field / cinematic camera focus */
    filter: blur(25px) brightness(0.2); 
  }
  15% {
    opacity: 1;
    filter: blur(15px) brightness(4); /* Blowout highlight as it crosses the focal plane */
  }
  75% {
    /* Almost in position, settling down */
    text-shadow: 0 0 10px rgba(218, 15, 15, 0.4);
    filter: blur(2px) brightness(1.5);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    text-shadow: var(--neon-glow);
    filter: blur(0px) brightness(1);
  }
}

@keyframes assemble-bar {
  0% { opacity: 0; filter: blur(10px); }
  100% { opacity: 1; filter: blur(0px); }
}

@keyframes slowZoom {
  0% { transform: scale(1.1); }
  100% { transform: scale(0.85); } /* Ends slightly smaller to keep all letters fully on screen with kerning */
}

@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    text-shadow: var(--neon-glow);
    opacity: 1;
  }
  20%, 24%, 55% {
    text-shadow: 0 0 5px rgba(218, 15, 15, 0.2);
    opacity: 0.8;
  }
}
