/* Home page only: pinned WatchmanGo stage. Loaded from Home/Index via @section Head. */
html {
    scroll-behavior: auto;
}
/* ScrollTrigger owns scrolling on this page */
body {
    background: var(--night-950);
}

/* Stage is hidden until GSAP has set initial states, so nothing flashes */
html.js #stage {
    opacity: 0;
}

html.js.ready #stage {
    opacity: 1;
    transition: opacity .5s ease;
}

#stage {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    color: #fff;
}

.layer {
    position: absolute;
    inset: 0;
}

.bg-base {
    background: radial-gradient(120% 90% at 70% 8%, #16375f 0%, var(--night-900) 46%, var(--night-950) 100%);
}

.dotgrid {
    background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px);
    background-size: 28px 28px;
}

.glow {
    background: radial-gradient(closest-side, rgba(242,101,34,.32), transparent);
    width: 70vmax;
    height: 70vmax;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -35vmax 0 0 -35vmax;
}

.layer-light {
    background-color: #F7F5F1;
    background-image: radial-gradient(rgba(14,30,51,.1) 1px, transparent 1px);
    background-size: 28px 28px;
}

.layer-dark2 {
    background: radial-gradient(90% 80% at 75% 25%, #3366cc 0%, var(--night-900) 55%, var(--night-950) 100%);
}

/* Giant outline words that drift behind each scene */
.ghost {
    position: absolute;
    top: 50%;
    left: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(9rem, 30vw, 32rem);
    line-height: 1;
    white-space: nowrap;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255,255,255,.14);
    pointer-events: none;
    opacity: 0;
}

    .ghost.on-light {
        -webkit-text-stroke-color: rgba(14,30,51,.14);
    }

/* Masked line reveals */
.mask {
    display: block;
    overflow: hidden;
    padding-bottom: .1em;
    margin-bottom: -.1em;
}

.il, .cl {
    display: block;
    will-change: transform;
}

.display {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: .94;
}

/* Intro composition */
#introTitle {
    position: absolute;
    left: 5vw;
    right: 5vw;
    top: 15vh;
    z-index: 30;
    display: flex;
    flex-direction: column;
    font-size: clamp(2.6rem, 8.4vw, 9.25rem);
    pointer-events: none;
}

    #introTitle .mask:nth-child(2) {
        align-self: flex-end;
    }

#introExtras {
    position: absolute;
    inset: 0;
    z-index: 31;
    pointer-events: none;
}

#introSub {
    position: absolute;
    left: 5vw;
    bottom: 9vh;
    max-width: 22rem;
    color: #cbd5e1;
    font-size: 1.05rem;
    line-height: 1.55;
    margin-bottom: 20px;
}

#introCta {
    position: absolute;
    left: 5vw;
    bottom: 3.2vh;
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    pointer-events: auto;
}

#scrollHint {
    position: absolute;
    right: 5vw;
    bottom: 4vh;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .85rem;
    color: #94a3b8;
}

    #scrollHint i {
        display: block;
        width: 1px;
        height: 44px;
        background: linear-gradient(#94a3b8, transparent);
        transform-origin: top;
        animation: hint 2s ease-in-out infinite;
    }

@keyframes hint {
    0% {
        transform: scaleY(0);
    }

    50% {
        transform: scaleY(1);
    }

    100% {
        transform: scaleY(1);
        opacity: 0;
    }
}

/* Phone stack */
#phoneWrap {
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -265px 0 0 -130px;
    z-index: 20;
    perspective: 1400px;
    will-change: transform;
}

#phone {
    transform-style: preserve-3d;
    will-change: transform;
}

.scr {
    position: absolute;
    inset: 0;
    opacity: 0;
}

#scr0 {
    opacity: 1;
}

.ring {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 2px solid rgba(242,101,34,.55);
    animation: ring 2.4s ease-out infinite;
}

    .ring:nth-child(2) {
        animation-delay: .8s;
    }

    .ring:nth-child(3) {
        animation-delay: 1.6s;
    }

@keyframes ring {
    0% {
        transform: scale(.5);
        opacity: .9;
    }

    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

/* Copy blocks */
.copy {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    padding: 0 6vw;
    pointer-events: none;
    visibility: hidden;
}

    .copy.left {
        justify-content: flex-start;
    }

    .copy.right {
        justify-content: flex-end;
    }

    .copy > div {
        max-width: 36rem;
        pointer-events: auto;
    }

.ch {
    font-size: clamp(2.75rem, 7.2vw, 7.5rem);
}

/* Progress rail */
#rail {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
    align-items: flex-end;
    color: #fff;
}

    #rail .line {
        position: absolute;
        right: 6px;
        top: 7px;
        bottom: 7px;
        width: 2px;
        background: rgba(255,255,255,.2);
    }

#railFill {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--brand-orange);
    transform-origin: top;
    transform: scaleY(0);
}

#rail button {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .8rem;
    font-weight: 500;
}

#rail .lab {
    opacity: 0;
    transform: translateX(6px);
    transition: opacity .25s, transform .25s;
}

#rail button.active .lab, #rail button:hover .lab {
    opacity: 1;
    transform: none;
}

#rail .dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.5);
    background: var(--night-900);
    transition: all .25s;
}

#rail button.active .dot {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    transform: scale(1.2);
}

#rail.on-light {
    color: var(--night-900);
}

    #rail.on-light .line {
        background: rgba(14,30,51,.18);
    }

    #rail.on-light .dot {
        border-color: rgba(14,30,51,.4);
        background: #F7F5F1;
    }

#rail.on-orange #railFill {
    background: #fff;
}

#rail.on-orange .dot {
    background: #f26522;
    border-color: rgba(255,255,255,.7);
}

#rail.on-orange button.active .dot {
    background: #fff;
    border-color: #fff;
}

@media (max-width: 767px) {
    #introTitle {
        top: 13vh;
    }

    #introSub {
        display: none;
    }
    /* CTA sits directly under the headline (was bottom:9vh, which landed on top of the phone
               and made the white button text unreadable against the light phone screen) */
    #introCta {
        bottom: auto;
        top: calc(13vh + 2.9 * clamp(2.6rem, 8.4vw, 9.25rem) + 1rem);
    }

    #scrollHint {
        display: none;
    }

    .copy {
        align-items: flex-end;
        padding-bottom: 68px;
    }

        .copy.right, .copy.left {
            justify-content: flex-start;
        }

    .ch {
        font-size: clamp(2.4rem, 12vw, 4rem);
    }

    .cp {
        display: none;
    }

    #rail {
        right: auto;
        left: 50%;
        top: auto;
        bottom: 20px;
        transform: translateX(-50%);
        flex-direction: row;
        gap: .25rem;
    }

        #rail .line, #rail .lab {
            display: none;
        }

        #rail button {
            padding: 12px 10px;
        }
    /* 14px dots were a hard tap target on touch */
}

@media (max-width: 767px) and (max-height: 720px) {
    /* short phones (iPhone SE, small Androids): trim the copy so the phone still has room */
    .copy ul {
        display: none;
    }

    .ch {
        font-size: clamp(2rem, 10.5vw, 3.2rem);
    }

    .copy {
        padding-bottom: 60px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ring, #scrollHint i {
        animation: none;
    }
}
