/* ==========================================================================
   Initiate Launch — the countdown (assets/js/shared/launch.js), shared by
   every page. Pressing the nav's "Initiate Launch" plays a mission-control
   countdown, 03 to 00, over the page while it flies down to the contact
   form. The overlay is built by the script; without it (or with reduced
   motion) the button is the plain link to #contact it always was.
   ========================================================================== */

@font-face {
    font-family: "Conthrax";
    src: url("../../fonts/conthrax-semibold.otf") format("opentype");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

.lx {
    --lx-purple: #7c3aed;
    --lx-cyan: #0ea5e9;
    --lx-pink: #f472b6;
    --lx-ease: cubic-bezier(0.22, 1, 0.36, 1);
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    font-family: "Space Grotesk", sans-serif;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
    -webkit-tap-highlight-color: transparent;
}

.lx.is-on {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease, visibility 0s;
}

.lx.is-leaving {
    opacity: 0;
    transition: opacity 0.7s ease 0.15s, visibility 0s linear 0.85s;
}

/* The page stays visible behind, dimmed toward the edges like a cockpit
   window. */
.lx-veil {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(70% 60% at 50% 50%, rgba(2, 6, 23, 0.52), rgba(2, 6, 23, 0.9) 100%);
}

/* Speed streaks rush past while the page moves fastest (--lx-v, 0 to 1). */
.lx-streaks {
    position: absolute;
    inset: -50% 0;
    opacity: calc(var(--lx-v, 0) * 0.9);
    background:
        repeating-linear-gradient(90deg, transparent 0 7.3%, rgba(196, 181, 253, 0.55) 7.3% 7.38%, transparent 7.38% 13.1%),
        repeating-linear-gradient(90deg, transparent 0 4.1%, rgba(125, 211, 252, 0.4) 4.1% 4.16%, transparent 4.16% 10.7%);
    -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 6%, transparent 6% 19%, #000 19% 22%, transparent 22% 37%);
    mask-image: repeating-linear-gradient(180deg, #000 0 6%, transparent 6% 19%, #000 19% 22%, transparent 22% 37%);
    animation: lx-rush 0.45s linear infinite;
}

@keyframes lx-rush {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(0, -37%, 0); }
}

/* ---------- The instrument ---------- */

.lx-hud {
    position: relative;
    display: grid;
    justify-items: center;
    gap: clamp(1rem, 2.6vh, 1.6rem);
    padding: 1rem;
    text-align: center;
}

.lx-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.lx-kicker i {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--lx-pink);
    box-shadow: 0 0 12px var(--lx-pink);
    animation: lx-blink 0.9s steps(2, jump-none) infinite;
}

@keyframes lx-blink {
    50% { opacity: 0.25; }
}

.lx-dial {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(15rem, 58vmin, 30rem);
    aspect-ratio: 1;
}

/* The ring: a faint track, then an arc drawn around it once a second. */
.lx-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.lx-ring circle {
    fill: none;
    stroke-width: 1.4;
}

.lx-track {
    stroke: rgba(255, 255, 255, 0.12);
}

.lx-ticks {
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 3.5 !important;
    stroke-dasharray: 0.4 5.85;
}

.lx-arc {
    stroke: url(#lx-grad);
    stroke-width: 2.4 !important;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.9));
}

.lx.is-tick .lx-arc {
    animation: lx-arc var(--lx-step, 900ms) linear forwards;
}

@keyframes lx-arc {
    to { stroke-dashoffset: 0; }
}

/* A ripple leaves the dial on every count. */
.lx-pulse {
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    border: 1px solid rgba(196, 181, 253, 0.7);
    opacity: 0;
}

.lx.is-tick .lx-pulse {
    animation: lx-pulse 0.9s var(--lx-ease) forwards;
}

@keyframes lx-pulse {
    from { opacity: 0.9; transform: scale(0.82); }
    to { opacity: 0; transform: scale(1.32); }
}

/* The numerals: each punches in out of a soft blur and spins away as the
   next arrives. */
.lx-num {
    position: absolute;
    font-family: "Conthrax", "Space Grotesk", sans-serif;
    font-size: clamp(5.5rem, 24vmin, 13rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, #fff 30%, #c4b5fd 75%, #7dd3fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 28px rgba(124, 58, 237, 0.65));
    animation: lx-num-in 0.55s var(--lx-ease) both;
}

.lx-num.is-out {
    animation: lx-num-out 0.45s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes lx-num-in {
    from { opacity: 0; transform: scale(1.6); filter: blur(14px) drop-shadow(0 0 28px rgba(124, 58, 237, 0.65)); }
    to { opacity: 1; transform: none; filter: blur(0) drop-shadow(0 0 28px rgba(124, 58, 237, 0.65)); }
}

@keyframes lx-num-out {
    to { opacity: 0; transform: translate3d(0, -18%, 0) scale(0.55) rotate(-8deg); filter: blur(6px); }
}

/* LIFTOFF: the word flares over the dial with a shockwave and a flash. */
.lx-liftoff {
    position: absolute;
    font-family: "Conthrax", "Space Grotesk", sans-serif;
    font-size: clamp(1.6rem, 7vmin, 3.4rem);
    font-weight: 600;
    letter-spacing: 0.18em;
    color: #fff;
    text-shadow: 0 0 24px rgba(167, 139, 250, 0.9), 0 0 60px rgba(124, 58, 237, 0.8);
    opacity: 0;
}

.lx.is-liftoff .lx-liftoff {
    animation: lx-liftoff 0.9s var(--lx-ease) forwards;
}

@keyframes lx-liftoff {
    0% { opacity: 0; transform: scale(0.6); letter-spacing: 0.6em; }
    35% { opacity: 1; transform: scale(1.06); letter-spacing: 0.2em; }
    100% { opacity: 1; transform: scale(1); letter-spacing: 0.18em; }
}

.lx-shock {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40vmin;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 40px rgba(196, 181, 253, 0.8), inset 0 0 40px rgba(125, 211, 252, 0.5);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.lx.is-liftoff .lx-shock {
    animation: lx-shock 1s var(--lx-ease) forwards;
}

@keyframes lx-shock {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(4.2); }
}

.lx-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 60% at 50% 50%, rgba(255, 255, 255, 0.85), rgba(196, 181, 253, 0.35) 45%, transparent 75%);
    opacity: 0;
    pointer-events: none;
}

.lx.is-liftoff .lx-flash {
    animation: lx-flash 0.6s ease-out forwards;
}

@keyframes lx-flash {
    0% { opacity: 0; }
    15% { opacity: 1; }
    100% { opacity: 0; }
}

/* Readouts along the bottom: status, altitude and velocity climbing as the
   page moves, and the descent's progress. */
.lx-status {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.lx-telemetry {
    position: absolute;
    left: 50%;
    bottom: clamp(1.5rem, 6vh, 3.5rem);
    display: grid;
    grid-template-columns: auto minmax(8rem, 22rem) auto;
    align-items: center;
    gap: clamp(0.9rem, 3vw, 2rem);
    width: min(92vw, 44rem);
    transform: translateX(-50%);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
}

.lx-telemetry b {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: #fff;
}

.lx-telemetry > div:last-child {
    text-align: right;
}

.lx-bar {
    position: relative;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

.lx-bar span {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--lx-purple), var(--lx-pink) 55%, var(--lx-cyan));
    transform: scaleX(var(--lx-p, 0));
    transform-origin: 0 50%;
}

.lx-skip {
    position: absolute;
    top: clamp(1rem, 4vh, 2rem);
    right: clamp(1rem, 4vw, 2rem);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 599px) {
    .lx-telemetry {
        grid-template-columns: 1fr 1fr;
        row-gap: 0.9rem;
    }

    .lx-bar {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

/* The launch control lights while its sequence runs: the primary purple
   brightens, edged in light violet. */
.hxn-cta.is-launching {
    border-color: rgba(196, 181, 253, 0.8);
    background: #8b5cf6;
}
