/*
This page defines the styling for the launch page
*/

/*-------------------------- Fonts -------------------------*/
@font-face {
    font-family: "Fira Sans Compressed";
    src: url("FiraSansCompressed-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Fira Sans Compressed";
    src: url("FiraSansCompressed-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Fira Sans Compressed";
    src: url("FiraSansCompressed-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Fira Sans Compressed";
    src: url("FiraSansCompressed-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/*--------------------- Global styling ---------------------*/

* {
    box-sizing: border-box;
}

:root {
    --navy: #061735;
    --deep-space: #020817;
    --blue: #0b3d91;
    --bright-blue: #68aaff;
    --white: #ffffff;
    --muted: #c8d8f0;
    --cyan: #8af0e4;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.launch-page {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse at 80% 20%,
            rgba(11, 61, 145, .4),
            transparent 45%),
        linear-gradient(120deg, #020817, #061735 65%, #081c3e);
    color: var(--white);
    font-family: "Fira Sans Compressed", "Arial Narrow", sans-serif;
}

/*----------------------- Navigation -----------------------*/

nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 25px;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
}

.brand {
    font-weight: 850;
    letter-spacing: .15em;
    font-size: .95rem;
}

.brand span {
    color: var(--blue);
}

/* Dropdown menu */

.nav-dropdown {
    position: absolute;
    z-index: 50;
    top: 22px;
    right: 25px;
}

.nav-dropdown summary {
    list-style: none;
    cursor: pointer;
    width: 52px;
    height: 48px;
    border: 1px solid rgba(138, 240, 228, .45);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: rgba(138, 240, 228, .07);
    box-shadow: 0 0 18px rgba(138, 240, 228, .08);
    transition: .3s ease;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown summary:hover,
.nav-dropdown[open] summary {
    background: rgba(138, 240, 228, .18);
    box-shadow: 0 0 25px rgba(138, 240, 228, .25);
    border-color: var(--cyan);
}

.nav-dropdown summary span {
    display: block;
    width: 21px;
    height: 2px;
    border-radius: 5px;
    background: var(--cyan);
    transition: .3s ease;
    box-shadow: 0 0 8px var(--cyan);
}

.nav-dropdown[open] summary span:first-child {
    transform: translateY(8px) rotate(45deg);
}

.nav-dropdown[open] summary span:nth-child(2) {
    opacity: 0;
}

.nav-dropdown[open] summary span:last-child {
    transform: translateY(-8px) rotate(-45deg);
}

.dropdown-links {
    position: absolute;
    top: 57px;
    right: 0;
    width: 210px;
    padding: 12px;
    background: rgba(12, 24, 40, .97);
    border: 1px solid rgba(138, 240, 228, .25);
    border-radius: 15px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .4);
    display: grid;
    gap: 4px;
}

.dropdown-links a {
    padding: 11px 13px;
    color: var(--muted);
    font-size: .9rem;
    border-radius: 8px;
    transition: .25s ease;
    text-decoration: none;
}

.dropdown-links a:hover {
    color: var(--cyan);
    background: rgba(138, 240, 228, .09);
    padding-left: 19px;
}

/*------------------- Animated starfield -------------------*/

#starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/*--------------------- Mission control --------------------*/

.launch-shell {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 100vh;
    align-items: center;
    width: min(100%, 1200px);
    margin: auto;
    padding: clamp(20px, 5vw, 60px);
}

.launch-card {
    width: min(100%, 850px);
}

.launch-content {
    max-width: 720px;
    padding: clamp(25px, 6vw, 65px);
    background: linear-gradient(90deg,
            rgba(3, 12, 31, .76),
            rgba(3, 12, 31, .25),
            transparent);
    transition: opacity 1s ease, transform 1s ease;
}

.launch-brand {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 850;
    letter-spacing: .16em;
}

.launch-brand span {
    color: var(--bright-blue);
}

.launch-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 55px;
    color: var(--bright-blue);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.launch-kicker::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bright-blue);
    box-shadow: 0 0 15px var(--bright-blue);
    content: "";
}

.launch-content h1 {
    max-width: 560px;
    margin: 20px 0 15px;
    font-size: clamp(2.6rem, 7vw, 5rem);
    line-height: .96;
    letter-spacing: 0;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .7);
}

.launch-content h1 em {
    color: var(--bright-blue);
    font-style: normal;
}

.launch-copy {
    max-width: 460px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.mission-objective {
    display: grid;
    gap: 7px;
    margin-top: 25px;
    padding: 14px;
    border-left: 2px solid var(--bright-blue);
    background: rgba(104, 170, 255, .09);
}

.mission-objective strong {
    color: var(--bright-blue);
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mission-objective span {
    font-size: .9rem;
    line-height: 1.5;
    font-weight: 650;
}

/*------------------------ Name form -----------------------*/

.agent-form {
    display: grid;
    gap: 13px;
    margin-top: 32px;
}

.agent-form label {
    font-size: .85rem;
    font-weight: 750;
}

.agent-form input {
    width: 100%;
    min-height: 54px;
    padding: 14px;
    border: 1px solid rgba(104, 170, 255, .4);
    border-radius: 10px;
    outline: none;
    background: rgba(3, 12, 31, .85);
    color: white;
    font: inherit;
}

.agent-form input::placeholder {
    color: #9eb4d4;
}

.agent-form input:focus {
    border-color: var(--bright-blue);
    box-shadow: 0 0 0 3px rgba(104, 170, 255, .2);
}

.launch-button {
    display: flex;
    min-height: 54px;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    border: 0;
    border-radius: 50px;
    background: linear-gradient(110deg, #0b3d91, #2476d8);
    color: white;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 850;
    letter-spacing: .1em;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(11, 61, 145, .4);
    transition: transform .25s ease, box-shadow .25s ease;
}

.launch-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(11, 61, 145, .7);
}

.launch-button:focus-visible {
    outline: 3px solid white;
    outline-offset: 4px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 28px;
    color: #8daed8;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #52e6a2;
    box-shadow: 0 0 12px #52e6a2;
}

/*-------------------- Screen transition -------------------*/

body.launching .launch-content {
    opacity: 0;
    transform: scale(.95);
}

[hidden] {
    display: none !important;
}

/*---------------- Full screen warp overlay ----------------*/

.warp-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at center,
            rgba(10, 43, 100, .35),
            transparent 65%),
        #020817;
    isolation: isolate;
}

/*----------------- Full screen warp video -----------------*/

.warp-video {
    position: absolute;
    inset: 0;
    z-index: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    opacity: 0;
    transition: opacity 1.2s ease;

    pointer-events: none;
}

.warp-overlay.warp-active .warp-video {
    opacity: 1;
}

/* Disable old canvas warp effect */

#warpCanvas {
    display: none;
}


.warp-overlay[hidden] {
    display: none;
}

/* Dark cinematic edges */

.warp-vignette {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center,
            transparent 20%,
            rgba(0, 0, 0, .2) 55%,
            rgba(0, 0, 0, .85) 100%);
}

/*----------------------- Side lights ----------------------*/

.warp-side-light {
    position: absolute;
    z-index: 2;
    top: -20%;
    width: 12%;
    height: 140%;
    opacity: 0;
    filter: blur(30px);
    background: linear-gradient(to bottom,
            transparent,
            rgba(104, 170, 255, .8),
            white,
            rgba(104, 170, 255, .7),
            transparent);
    transform: scaleY(.1);
    pointer-events: none;
}

.left-light {
    left: -8%;
}

.right-light {
    right: -8%;
}

.warp-overlay.warp-active .warp-side-light {
    animation: side-lights .7s ease-in-out infinite alternate;
}

@keyframes side-lights {
    from {
        opacity: .3;
        transform: scaleY(.55) scaleX(.7);
    }

    to {
        opacity: .9;
        transform: scaleY(1.2) scaleX(1.4);
    }
}

/*------------------------ Warp text -----------------------*/

.warp-content {
    position: relative;
    z-index: 5;
    width: 90%;
    max-width: 650px;
    text-align: center;
    text-shadow: 0 0 25px rgba(104, 170, 255, .65);
}

.warp-kicker {
    color: var(--bright-blue);
    font-size: .75rem;
    font-weight: 850;
    letter-spacing: .3em;
}

.warp-content h2 {
    margin: 22px 0;
    font-size: clamp(1.5rem, 5vw, 3.3rem);
    letter-spacing: .12em;
    font-weight: 900;
}

.warp-message {
    margin-top: 22px;
    color: #c8d8f0;
    font-size: .85rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.warp-coordinates {
    margin-top: 45px;
    color: rgba(180, 210, 255, .55);
    font-size: .65rem;
    letter-spacing: .18em;
}

/*------------------------ Countdown -----------------------*/

.countdown-container {
    display: grid;
    justify-items: center;
    gap: 7px;
    margin: 35px 0;
}

.countdown-label,
.countdown-unit {
    color: var(--bright-blue);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .35em;
}

#countdown {
    display: grid;
    place-items: center;
    width: clamp(150px, 25vw, 230px);
    aspect-ratio: 1;
    border: 2px solid rgba(104, 170, 255, .65);
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(104, 170, 255, .22),
            rgba(3, 12, 31, .25) 65%);
    box-shadow:
        0 0 25px rgba(104, 170, 255, .4),
        inset 0 0 35px rgba(104, 170, 255, .2);
    color: white;
    font-size: clamp(5rem, 15vw, 9rem);
    font-weight: 900;
    line-height: 1;
    animation: countdown-pulse .95s ease-in-out;
}

@keyframes countdown-pulse {
    0% {
        opacity: .3;
        transform: scale(1.3);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/*-------------------- Warp progress bar -------------------*/

.warp-percent {
    margin: 30px 0 0;
    color: white;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: .08em;
}

.warp-progress {
    width: min(100%, 400px);
    height: 8px;
    margin: 12px auto 0;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(104, 170, 255, .2);
}

.warp-progress-bar {
    width: 0;
    height: 100%;
    border-radius: 4px;
    background: white;
    box-shadow: 0 0 15px #68aaff;
    transition: width .2s linear;
}

/*---------------------- Arrival flash ---------------------*/

.arrival-flash {
    position: absolute;
    z-index: 10;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background: white;
}

.warp-overlay.arriving .arrival-flash {
    animation: arrival-flash .9s ease-out forwards;
}

@keyframes arrival-flash {
    0% {
        opacity: 0;
    }

    25% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/*------------------------- Mobile -------------------------*/

@media (max-width: 760px) {
    .launch-shell {
        padding: 14px;
    }

    .launch-content {
        padding: 25px;
        background: rgba(3, 12, 31, .55);
    }

    .launch-kicker {
        margin-top: 38px;
    }

    .warp-kicker {
        font-size: .65rem;
    }

    .warp-content h2 {
        font-size: 1.7rem;
    }

    .warp-side-light {
        width: 18%;
        filter: blur(20px);
    }
}

/*--------------------- Reduced motion ---------------------*/

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/*--------------- Cinematic hyperspace effect --------------*/

/* Main video background */

.warp-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.warp-overlay.warp-active .warp-video {
    opacity: 1;
}

/* Atmospheric blue glow */

.warp-overlay::before {
    position: absolute;
    z-index: 1;
    inset: -50%;
    content: "";
    pointer-events: none;

    background: conic-gradient(from 0deg,
            transparent,
            rgba(60, 145, 255, .12),
            transparent,
            rgba(160, 220, 255, .18),
            transparent);

    opacity: 0;
}

.warp-overlay.warp-active::before {
    opacity: 1;
    animation: tunnel-rotation 8s linear infinite;
}

@keyframes tunnel-rotation {
    from {
        transform: rotate(0deg) scale(1);
    }

    to {
        transform: rotate(360deg) scale(1.15);
    }
}

/* Dark cinematic edges */

.warp-vignette {
    z-index: 3;
    background: radial-gradient(ellipse at center,
            transparent 15%,
            rgba(0, 0, 0, .15) 55%,
            rgba(0, 0, 0, .75) 100%);
}

/* Blue spacecraft side lights */

.warp-side-light {
    z-index: 4;
    width: 15%;
    filter: blur(35px);
}

.warp-overlay.warp-active .warp-side-light {
    animation: side-lights .6s ease-in-out infinite alternate;
}

/* Countdown glow */

#countdown {
    box-shadow:
        0 0 20px rgba(104, 170, 255, .5),
        0 0 65px rgba(40, 120, 255, .35),
        inset 0 0 45px rgba(104, 170, 255, .3);
}

/* Subtle cockpit vibration */

.warp-overlay.warp-active .warp-content {
    animation: cockpit-vibration .15s linear infinite alternate;
}

@keyframes cockpit-vibration {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(.7px, -.7px);
    }
}

/* Mobile adjustments */

@media (max-width: 760px) {
    .warp-video {
        object-position: center;
    }

    .warp-side-light {
        width: 18%;
        filter: blur(22px);
    }
}

/* Reduced motion accessibility */

@media (prefers-reduced-motion: reduce) {

    .warp-overlay.warp-active::before,
    .warp-overlay.warp-active .warp-side-light,
    .warp-overlay.warp-active .warp-content {
        animation: none !important;
    }
}