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

html,
body {
    height: 100%;
}

body {
    /* Night sky over the landscape; .sky-space fades in on top of it as the logo climbs. */
    background: linear-gradient(to bottom, #0a1726 0%, #12294a 55%, #1d3a5c 100%);
    background-color: #0b1a2b;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
}

.logo-container {
    /* Fills the screen so the sparkle trail works anywhere, not only on the small logo on a phone. */
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 24px;
    /* Lets a finger drag draw the sparkle trail instead of scrolling the page. */
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.logo-img {
    display: block;
    width: min(560px, 88vw, 80vh);
    height: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 0 0 rgba(212, 175, 55, 0));
    transition: filter 0.6s ease;
}

/* A soft golden glow instead of a zoom, only on devices that really hover. */
@media (hover: hover) {
    .logo-img:hover {
        filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.25));
    }
}

/* Sparkle trail particles */
.star {
    position: fixed;
    left: 0;
    top: 0;
    pointer-events: none;
    border-radius: 50%;
    will-change: transform, opacity;
    animation: fall-fade 0.8s ease-out forwards;
}

@keyframes fall-fade {
    0% {
        transform: translate(var(--x), var(--y)) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(calc(var(--x) + var(--dx)), calc(var(--y) + var(--dy))) scale(0.1) rotate(180deg);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .logo-img {
        transition: none;
    }
}

/* ---------- Kick it up a notch: the scenery ---------- */

.world {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.world > * {
    position: absolute;
    transition: transform 1.6s cubic-bezier(0.22, 0.8, 0.3, 1), opacity 1.6s ease;
}

.sky-space {
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, #0d1b33 0%, #050a14 70%, #02040a 100%);
    opacity: 0;
}

.stars {
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    border-radius: 50%;
    opacity: 0.35;
}

.land {
    left: 0;
    bottom: 0;
    width: 100%;
    height: 40vh;
}

.clouds {
    inset: 0;
    transform: translateY(-110vh);
}

.cloud {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(220, 230, 245, 0.32), rgba(220, 230, 245, 0) 70%);
}

.c1 { left: -5%; top: 10%; width: 55vw; height: 18vh; }
.c2 { left: 45%; top: 30%; width: 60vw; height: 22vh; }
.c3 { left: 5%;  top: 55%; width: 50vw; height: 16vh; }
.c4 { left: 50%; top: 72%; width: 45vw; height: 15vh; }
.c5 { left: 20%; top: 88%; width: 70vw; height: 20vh; }

/* The curve of the earth, rising into view once in space */
.earth {
    left: 50%;
    bottom: 0;
    width: 260vmax;
    height: 260vmax;
    margin-left: -130vmax;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, #1b4f8a 0%, #12355f 45%, #0b2240 49%);
    box-shadow: 0 0 60px 18px rgba(100, 180, 255, 0.35);
    /* Starts fully below the screen, glow included */
    transform: translateY(calc(100% + 120px));
}

/* Satellites drifting across low orbit, shown on the first notches in space */
.satellites {
    inset: 0;
    opacity: 0;
    overflow: hidden;
}

.sat {
    position: absolute;
    left: 0;
    width: 46px;
    height: 22px;
    animation: sat-drift linear infinite;
}

.sat .sat-light {
    animation: sat-blink 1.6s steps(1) infinite;
}

@keyframes sat-drift {
    from { transform: translateX(-12vw) rotate(var(--tilt)); }
    to   { transform: translateX(112vw) rotate(var(--tilt)); }
}

@keyframes sat-blink {
    50% { opacity: 0.15; }
}

@media (prefers-reduced-motion: reduce) {
    .sat, .sat .sat-light { animation: none; }
    .sat { transform: translateX(var(--rest)) rotate(var(--tilt)); }
}

/* Each notch's positions are set from notch.js; this is how fast the scenery moves. */
body.landing .world > * {
    transition-duration: 3.2s;
    transition-timing-function: cubic-bezier(0.45, 0, 0.2, 1);
}

/* ---------- The button ---------- */

.notch-button {
    /* Extra room between the logo and the button, scaling with screen height */
    margin-top: clamp(16px, 6vh, 56px);
    font: 800 clamp(16px, 2.4vw, 20px) / 1 system-ui, -apple-system, sans-serif;
    letter-spacing: 0.02em;
    color: #0b1a2b;
    background: linear-gradient(180deg, #f6dc96 0%, #d1aa55 55%, #a8822f 100%);
    border: 2px solid #f3e5ab;
    border-radius: 999px;
    padding: 14px 28px;
    cursor: pointer;
    box-shadow: 0 4px 0 #6e5320, 0 8px 24px rgba(212, 175, 55, 0.25);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    -webkit-tap-highlight-color: transparent;
}

.notch-button:hover {
    filter: brightness(1.06);
}

.notch-button:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #6e5320, 0 4px 14px rgba(212, 175, 55, 0.25);
}

.notch-button:focus-visible {
    outline: 3px solid #64ffda;
    outline-offset: 4px;
}

.land-button {
    font: 600 14px / 1 system-ui, -apple-system, sans-serif;
    letter-spacing: 0.04em;
    color: #f3e5ab;
    background: rgba(11, 26, 43, 0.55);
    border: 1px solid rgba(243, 229, 171, 0.5);
    border-radius: 999px;
    padding: 9px 18px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.land-button:hover {
    background: rgba(243, 229, 171, 0.12);
}

.land-button:focus-visible {
    outline: 3px solid #64ffda;
    outline-offset: 4px;
}

.notch-level {
    min-height: 1.2em;
    color: #f3e5ab;
    font-weight: 600;
    letter-spacing: 0.08em;
    font-size: 14px;
    opacity: 0.9;
    text-shadow: 0 1px 3px #050a14, 0 0 8px #050a14;
}

/* ---------- Effects: BAM!, warp streaks, passing planets ---------- */

.fx {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.bam {
    position: absolute;
    width: 190px;
    height: 150px;
    margin: -75px 0 0 -95px;
    transform: rotate(var(--r)) scale(0);
    animation: bam 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
}

.bam svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.bam text {
    font: 900 46px Impact, "Arial Black", "Helvetica Neue", sans-serif;
    letter-spacing: 1px;
}

@keyframes bam {
    0% { transform: rotate(var(--r)) scale(0); opacity: 1; }
    30% { transform: rotate(var(--r)) scale(1.15); }
    45% { transform: rotate(var(--r)) scale(1); }
    80% { opacity: 1; }
    100% { transform: rotate(var(--r)) scale(1.05); opacity: 0; }
}

.streak {
    position: absolute;
    left: 50%;
    top: 45%;
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, rgba(243, 229, 171, 0), rgba(243, 229, 171, 0.9));
    transform-origin: 50% 0;
    transform: rotate(var(--a)) translateY(var(--d0));
    animation: streak 0.7s ease-in forwards;
}

@keyframes streak {
    from { height: 0; opacity: 1; }
    to { height: 45vmax; transform: rotate(var(--a)) translateY(var(--d1)); opacity: 0; }
}

.planet {
    position: absolute;
    border-radius: 50%;
    animation: flyby var(--t) linear forwards;
}

.planet.ringed::after {
    content: "";
    position: absolute;
    left: -45%;
    top: 38%;
    width: 190%;
    height: 24%;
    border: 3px solid rgba(243, 229, 171, 0.55);
    border-radius: 50%;
    transform: rotate(-18deg);
}

@keyframes flyby {
    from { transform: translateY(-30vh); }
    to { transform: translateY(140vh); }
}

@media (prefers-reduced-motion: reduce) {
    .world > * {
        transition: none;
        animation: none;
    }
}
