/* Scroll intro for litil.tech
   The page opens zoomed deep inside the crossbar of the "T", so it looks like a normal
   full-screen video. While you scroll, the whole video frame shrinks down into the
   wordmark, until it plays only inside the letters on black. Then the content slides
   up over it like a sheet.

   intro.js sets these while you scroll:
   clip-path      (on .video-clip) the letters, moved and scaled each frame
   transform      (on .video-layer) shrinks the whole video into the word
   --nav          opacity of the small logo in the menu
   --hint         opacity of the scroll hint
   --depth        0 -> 1 while the content slides over the logo */

.intro {
    position: relative;
    height: 400vh; /* 100vh screen + 200vh animation + 100vh for the content to slide over */
    background: #050505;
}

.intro .hero {
    --depth: 0;

    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background: #050505;

    transform: scale(calc(1 - var(--depth) * 0.06));
    transform-origin: 50% 40%;
}

.video-clip {
    position: absolute;
    inset: 0;
    z-index: 0;
    clip-path: inset(0 0 0 0); /* intro.js replaces this with the letters */
}

.video-layer {
    position: absolute;
    inset: 0;
    transform-origin: 50% 50%;
    will-change: transform;
}

/* While the content covers the logo, darken the whole hero a little */
.intro .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    background: #050505;
    opacity: calc(var(--depth) * 0.6);
    pointer-events: none;
}

.intro .menu {
    z-index: 2;
    opacity: var(--nav, 1);
}

.intro .hero-text {
    z-index: 2;
}

.intro .hero-text h1 {
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}

/* The content is a sheet that slides up over the pinned logo */
.after-intro {
    position: relative;
    z-index: 5;
    margin-top: -100vh;
    background: #050505;
    min-height: 100vh; /* always covers the logo completely at the end */
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -40px 80px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.after-intro .partners {
    border-top: 0;
}

.scroll-hint {
    position: absolute;
    right: clamp(24px, 6vw, 88px);
    bottom: clamp(30px, 7vw, 86px);
    z-index: 2;
    opacity: var(--hint, 1);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.scroll-hint::after {
    content: "";
    display: block;
    width: 1px;
    height: 28px;
    margin: 8px auto 0;
    background: rgba(255, 255, 255, 0.6);
    animation: hint 1.8s ease-in-out infinite;
    transform-origin: top;
}

@keyframes hint {
    0%   { transform: scaleY(0); opacity: 1; }
    60%  { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(1); opacity: 0; }
}

@media (min-width: 721px) {
    .after-intro {
        display: flex;
        flex-direction: column;
    }

    .after-intro footer {
        margin-top: auto;
    }
}

@media (max-width: 720px) {
    .hero-video {
        height: var(--video-height, 62%);
        -webkit-mask-image: linear-gradient(to bottom, black 58%, transparent 100%);
        mask-image: linear-gradient(to bottom, black 58%, transparent 100%);
    }

    .hero-overlay {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.28), transparent 40%);
    }

    .scroll-hint { display: none; }
    .after-intro { border-radius: 20px 20px 0 0; }
}

/* People who turn off motion get the normal full-screen video, no animation */
@media (prefers-reduced-motion: reduce) {
    .intro { height: auto; }
    .intro .hero { position: relative; transform: none; }
    .intro .hero::after { display: none; }
    .video-clip, .video-layer { clip-path: none; transform: none; }
    .after-intro { margin-top: 0; }
    .scroll-hint::after { animation: none; }
}
