/*—— HERO VIDEO (FULL-SCREEN) ——*/
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    /* full viewport height */
    overflow: hidden;
}

.hero video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*—— OVERLAY TEXT ON HERO ——*/
.hero-overlay-text {
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 4rem;
    text-align: center;
    padding: 0 1rem;
    z-index: 1;
    pointer-events: none;
    /* Optional: add a slight text-shadow for readability */
    font-family: "Source Serif 4", serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    text-shadow:
        0 0 5px rgba(0, 0, 0, 1),
        0 0 10px rgba(0, 0, 0, 1),
        0 0 20px rgba(0, 0, 0, 1),
        0 0 30px rgba(0, 0, 0, 1);
}

/* FadeIn keyframes for overlay text */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* When .fade-in-text is added, run the 1s fadeIn */
.hero-overlay-text.fade-in-text {
    animation: fadeIn 2s ease-in-out forwards;
}

/*———————————————————————
TEXT (static → glitch → fade)
————————————————————————*/
#intro-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 4rem;
  font-family: "Source Serif 4", serif;
  pointer-events: none;
  z-index: 2;
  opacity: 1;              /* start visible */
  text-shadow: 0 0 5px rgba(0, 0, 0, 1),
        0 0 10px rgba(0, 0, 0, 1),
        0 0 20px rgba(0, 0, 0, 1),
        0 0 30px rgba(0, 0, 0, 1);
}

/* Once .glitch is added, apply the CodePen glitch rules */
#intro-text.glitch {
    animation: glitch 1s linear infinite;
}

@keyframes glitch {
  /* start and end at centre */
  0%, 100% { transform: translate(-50%, -50%); }
  /* tiny nudge right */
  2%, 64%   { transform: translate(-50%, -50%) translate(2px, 0) skew(0deg); }
  /* tiny nudge left */
  4%, 60%   { transform: translate(-50%, -50%) translate(-2px, 0) skew(0deg); }
  /* slight skew at centre */
  62%       { transform: translate(-50%, -50%)            skew(5deg); }
}

/* Top slice */
#intro-text.glitch::before {
    content: attr(title);
    position: absolute;
  /* place the slice at the centre of the parent: */
  top: 50%;
  left: 50%;
  /* pivot & jitter around its own centre: */
  transform-origin: center center;
    color: #fff;
    animation: glitchTop 1s linear infinite;
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    width: 100%;
}

@keyframes glitchTop {
  0%, 100% {
    transform: translate(-50%, -50%);
  }
  2%, 64% {
    transform: translate(-50%, -50%) translate(2px, -2px);
  }
  4%, 60% {
    transform: translate(-50%, -50%) translate(-2px, 2px);
  }
  62% {
    transform: translate(-50%, -50%) translate(2px, -1px) skew(-13deg);
  }
}

/* Bottom slice */
#intro-text.glitch::after {
    content: attr(title);
    position: absolute;
  /* place the slice at the centre of the parent: */
  top: 50%;
  left: 50%;
  /* pivot & jitter around its own centre: */
  transform-origin: center center;    color: #fff;
    animation: glitchBottom 1.5s linear infinite;
    -webkit-clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
    width: 100%;
}

@keyframes glitchBottom {
  0%, 100% {
    transform: translate(-50%, -50%);
  }
  2%, 64% {
    transform: translate(-50%, -50%) translate(-2px, 0);
  }
  4%, 60% {
    transform: translate(-50%, -50%) translate(-2px, 0);
  }
  62% {
    transform: translate(-50%, -50%) translate(-2px, 2px) skew(21deg);
  }
}


/* FADE-OUT keyframes for that text */
@keyframes textFadeOut {
  to { opacity: 0; }
}
#intro-text.fade {
  animation: textFadeOut 1s ease-in-out forwards;
}

/* —————————————————————————
   HERO OVERLAY TEXT
   (unchanged)
   ————————————————————————— */
.hero-overlay-text {
  opacity: 0;
  /* …your existing centering + styling… */
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.hero-overlay-text.fade-in-text {
  animation: fadeIn 2s ease-in-out forwards;
}

/* Closing animation for hero section (from bottom upwards) */
@keyframes heroCloseUp {
  0% {
    height: 100vh;
    opacity: 1;
  }
  /*80% {
    opacity: 1;
  }*/
  100% {
    height: 0;
    /*opacity: 0;*/
  }
}
.hero.closing-up {
  animation: heroCloseUp 1.2s cubic-bezier(.77,0,.18,1) forwards;
  overflow: hidden;
  height: 100vh;
  position: relative;
}
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: height 1.2s cubic-bezier(.77,0,.18,1), opacity 1.2s cubic-bezier(.77,0,.18,1);
}
.hero.closing-up .hero-video {
  height: 100% !important;
  /* opacity: 0;*/
}