/* Portal launch ceremony page (launch.html) */

@font-face {
    font-family: 'Garet';
    src: url('../fonts/garet.book.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Garet';
    src: url('../fonts/garet.heavy.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}

:root {
    --launch-red: #dc1f26;
    --launch-gold: #f7ad1a;
    --launch-night: #05070f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Garet', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #ffffff;
    background: radial-gradient(ellipse at 50% 40%, #1a2240 0%, #0a0d1c 55%, var(--launch-night) 100%);
    overflow: hidden;
}

/* The forum photo, faint behind everything */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('../images/hero-event-image-2386433849.jpg') center / cover;
    opacity: 0.12;
    filter: blur(3px);
    z-index: 0;
}

.fireworks {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.launch {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: clamp(1rem, 3vw, 2rem) 16px;
    text-align: center;
}

.launch-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: clamp(0.9rem, 2.2vw, 1.15rem);
    letter-spacing: 0.04em;
    opacity: 0.9;
}

.launch-logo {
    height: clamp(44px, 7vw, 64px);
    width: auto;
}

.launch-stage {
    display: grid;
    place-items: center;
}

.launch-eyebrow {
    color: var(--launch-gold);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: clamp(0.75rem, 1.8vw, 0.95rem);
    margin-bottom: 0.75rem;
}

.launch-title {
    font-weight: 800;
    font-size: clamp(2rem, 6vw, 3.75rem);
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    margin-bottom: clamp(1.5rem, 5vh, 3rem);
}

.launch-title-big {
    font-size: clamp(2.2rem, 7.5vw, 5rem);
    background: linear-gradient(90deg, var(--launch-gold), #ffffff 50%, var(--launch-gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1.25rem;
}

/* Big launch button */
.launch-button {
    position: relative;
    width: clamp(180px, 38vmin, 300px);
    aspect-ratio: 1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #ffffff;
    font-family: inherit;
    font-weight: 800;
    font-size: clamp(1.6rem, 6vmin, 2.8rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: radial-gradient(circle at 35% 30%, #ff5a4f 0%, var(--launch-red) 45%, #b8151b 100%);
    box-shadow:
        0 0 0 6px rgba(247, 173, 26, 0.85),
        0 0 40px rgba(220, 31, 38, 0.8),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 -10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.launch-button::before,
.launch-button::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 3px solid var(--launch-gold);
    animation: launch-ring 2.4s ease-out infinite;
    pointer-events: none;
}

.launch-button::after {
    animation-delay: 1.2s;
}

.launch-button:hover {
    transform: scale(1.04);
}

.launch-button:active {
    transform: scale(0.96);
}

.launch-button:focus-visible {
    outline: 4px solid #ffffff;
    outline-offset: 10px;
}

.launch-button-label {
    position: relative;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

@keyframes launch-ring {
    from {
        transform: scale(1);
        opacity: 0.9;
    }
    to {
        transform: scale(1.55);
        opacity: 0;
    }
}

.launch-hint {
    margin-top: clamp(1.5rem, 5vh, 2.5rem);
    font-size: clamp(0.85rem, 2vw, 1rem);
    opacity: 0.7;
}

/* Countdown */
.launch-number {
    display: block;
    font-weight: 800;
    font-size: clamp(9rem, 45vmin, 24rem);
    line-height: 1;
    background: linear-gradient(180deg, #ffffff 0%, var(--launch-gold) 55%, var(--launch-red) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 40px rgba(247, 173, 26, 0.45));
}

.launch-number.is-ticking {
    animation: launch-tick 1s ease-out both;
}

@keyframes launch-tick {
    0% {
        transform: scale(2.2);
        opacity: 0;
    }
    18% {
        transform: scale(1);
        opacity: 1;
    }
    80% {
        transform: scale(0.95);
        opacity: 1;
    }
    100% {
        transform: scale(0.7);
        opacity: 0;
    }
}

/* Launched */
.launch-done {
    animation: launch-reveal 0.8s ease-out both;
}

@keyframes launch-reveal {
    from {
        transform: scale(0.85);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.launch-url {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(247, 173, 26, 0.6);
    font-size: clamp(1rem, 3vw, 1.5rem);
    letter-spacing: 0.04em;
    margin-bottom: 1.5rem;
}

.launch-redirect {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    opacity: 0.85;
}

.launch-redirect a {
    color: var(--launch-gold);
    font-weight: 800;
}

/* Corner controls, hidden once the launch starts */
.launch-controls {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.launch-control {
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    font: inherit;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
}

.launch-control:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.is-launching .launch-controls {
    visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .launch-button::before,
    .launch-button::after {
        animation: none;
        opacity: 0;
    }

    .launch-number.is-ticking,
    .launch-done {
        animation: none;
    }
}
