:root {
  background-color: #050505;
  color: white;
  font-family: system-ui, sans-serif;
  margin: 0;
}

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

body.is-locked {
  overflow: hidden;
}

.preloader {
  position: fixed;
  inset: 0; /* Shorthand for top: 0, left: 0, right: 0, bottom: 0 */
  z-index: 9999;
  background-color: #050505;
  display: grid;
  place-items: center;
  color: white;
  transition:
    opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    visibility 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* We will add this class via JS when loading hits 100% */
.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader__content {
  text-align: center;
}

.preloader__title {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 4rem;
  letter-spacing: 0.5rem;
  margin: 0 0 1rem 0;
  font-weight: 900;
  /* A nice metallic/silver gradient for the Nokia vibe */
  background: linear-gradient(135deg, #fff, #888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulse 2s infinite alternate ease-in-out;
}

.preloader__subtitle {
  font-family: monospace;
  font-size: 1rem;
  color: #888;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}

/* Animating the ellipsis for that "loading" feel */
.dots::after {
  content: "";
  animation: ellipsis 1.5s infinite steps(4);
}

/* --- The Progress Bar --- */
.preloader__progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
}

.preloader__progress-fill {
  height: 100%;
  width: 0%; /* JS will control this */
  background-color: white;
  transition: width 0.1s ease-out; /* Smooths out the jumps between image loads */
}

/* --- Keyframes --- */
@keyframes pulse {
  0% {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
    opacity: 0.8;
  }
  100% {
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.6));
    opacity: 1;
  }
}

@keyframes ellipsis {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
  100% {
    content: "";
  }
}

/* The invisible track that creates the scrollable area */
.scroll-track {
  position: relative;
  height: 500vh; /* Adjust this to make the scroll faster or slower */
}

/* The sticky container that holds the canvas */
.sticky-wrapper {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

/* Ensure the canvas covers the screen like background-size: cover */
#video-canvas {
  width: 100vw;
  height: 100vh;
  object-fit: cover; /* Modern CSS magic for canvas! */
  display: block;
}

.next-content {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #111;
}

.credits {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 0.5em 1em;
  background-color: rgba(100, 234, 220, 0.5);
  backdrop-filter: blur(5px);
  a {
    color: white;
    text-decoration: none;
    &:hover {
      color: rgb(31, 38, 59);
    }
  }
}
