
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Montserrat:wght@300;400;500;600&display=swap');

:root {
    --moon-white: #f2f5ff;
    --ice-blue: #b9d8ff;
    --soft-blue: #83aee8;
    --deep-blue: #07152d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100%;
    overflow: hidden;
}

body {
    background: #07152d;
    color: var(--moon-white);
    font-family: 'Montserrat', sans-serif;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: 1px solid rgba(210, 230, 255, 0.65);
    color: white;
    background: rgba(160, 195, 245, 0.10);
    padding: 15px 30px;
    border-radius: 40px;
    letter-spacing: 3px;
    font-size: 11px;
    font-weight: 500;
    transition: 0.4s ease;
    backdrop-filter: blur(12px);
}

button:hover {
    background: rgba(180, 215, 255, 0.24);
    box-shadow: 0 0 30px rgba(150, 195, 255, 0.35);
    transform: translateY(-3px);
}

#app {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    isolation: isolate;
    background: #07152d;
}

.cosmic-background {
    position: absolute;
    inset: 0;
    z-index: -3;
    background:
        linear-gradient(
            180deg,
            rgba(5, 16, 38, 0.12),
            rgba(8, 24, 51, 0.32),
            rgba(5, 14, 34, 0.55)
        ),
        url("assets/moon-background.jpg") center center / cover no-repeat;
    animation: backgroundDrift 35s ease-in-out infinite alternate;
}

#app::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: radial-gradient(
        circle at 50% 42%,
        transparent 5%,
        rgba(3, 12, 30, 0.12) 75%,
        rgba(3, 10, 25, 0.48) 100%
    );
}

#app::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        120deg,
        rgba(160, 195, 255, 0.06),
        transparent 40%,
        rgba(140, 180, 255, 0.08)
    );
    animation: atmosphere 8s ease-in-out infinite alternate;
}

@keyframes backgroundDrift {
    from { transform: scale(1); }
    to { transform: scale(1.09); }
}

@keyframes atmosphere {
    from { opacity: 0.35; }
    to { opacity: 0.9; }
}

/* STARS */

.stars-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 10px 2px rgba(200, 225, 255, 0.8);
    animation: twinkle 3s ease-in-out infinite alternate;
}

@keyframes twinkle {
    from {
        opacity: 0.2;
        transform: scale(0.65);
    }
    to {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* EXPERIENCE SCREENS */

#experience {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 25px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(25px) scale(0.98);
    transition: opacity 1s ease,
                transform 1s ease,
                visibility 1s;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* TYPOGRAPHY */

.eyebrow {
    color: var(--ice-blue);
    font-size: 10px;
    letter-spacing: 5px;
    font-weight: 500;
    margin-bottom: 28px;
    animation: fadeUp 1.2s both;
}

h1, h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    text-shadow: 0 0 35px rgba(190, 220, 255, 0.32);
}

h1 {
    font-size: clamp(42px, 8vw, 90px);
    line-height: 0.99;
    letter-spacing: 5px;
    margin-bottom: 38px;
    animation: titleReveal 1.8s both;
}

h2 {
    font-size: clamp(38px, 6vw, 65px);
    margin-bottom: 18px;
    animation: fadeUp 1.2s both;
}

.screen > p:not(.eyebrow):not(.final-line) {
    color: rgba(235, 243, 255, 0.83);
    font-size: 13px;
    letter-spacing: 1px;
    line-height: 1.9;
    margin-bottom: 30px;
    animation: fadeUp 1.5s both;
}

@keyframes titleReveal {
    from {
        opacity: 0;
        transform: translateY(35px);
        filter: blur(12px);
        letter-spacing: 12px;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
        letter-spacing: 5px;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ENERGY ORB */

.orb-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.orb-button:hover {
    background: transparent;
    box-shadow: none;
    transform: scale(1.06);
}

.orb {
    width: 105px;
    height: 105px;
    display: block;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 30%,
        #ffffff,
        #b8dcff 20%,
        #6298db 48%,
        #193c78 72%,
        transparent 75%
    );
    box-shadow:
        0 0 25px #9acbff,
        0 0 65px rgba(110, 170, 255, 0.8),
        0 0 110px rgba(90, 150, 255, 0.35);
    animation: orbPulse 3s ease-in-out infinite;
}

@keyframes orbPulse {
    0%, 100% {
        transform: scale(0.94);
        box-shadow: 0 0 25px #9acbff,
                    0 0 65px rgba(110, 170, 255, 0.6);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 45px #d2eaff,
                    0 0 100px rgba(110, 170, 255, 0.9);
    }
}

/* COUNTDOWN */

#countNumber {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(100px, 25vw, 210px);
    color: white;
    text-shadow: 0 0 25px #b9d8ff,
                 0 0 65px #6da7ef;
    animation: countdownPop 0.8s ease both;
}

@keyframes countdownPop {
    from {
        transform: scale(1.8);
        opacity: 0;
        filter: blur(15px);
    }
    to {
        transform: scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

/* PARTICLE PHOTO */

#memory {
    background: radial-gradient(
        ellipse at center,
        rgba(15, 39, 77, 0.12),
        transparent 75%
    );
}

#particleCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.memory-caption {
    position: absolute;
    bottom: 9%;
    z-index: 3;
    color: #d8eaff;
    font-size: 10px;
    letter-spacing: 4px;
    text-shadow: 0 0 18px #9acbff;
    animation: captionGlow 3s ease-in-out infinite alternate;
}

@keyframes captionGlow {
    from { opacity: 0.55; }
    to { opacity: 1; }
}

/* SLIDESHOW */

.slide-frame {
    width: min(78vw, 440px);
    height: min(65vh, 590px);
    overflow: hidden;
    border: 1px solid rgba(210, 230, 255, 0.55);
    border-radius: 8px;
    padding: 7px;
    background: rgba(210, 230, 255, 0.08);
    box-shadow:
        0 0 35px rgba(125, 180, 255, 0.2),
        0 0 90px rgba(100, 155, 255, 0.15);
    animation: frameAppear 1.5s both;
}

#slideImage {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 4px;
    transition: opacity 0.8s ease;
}

@keyframes frameAppear {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(30px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

#slideCaption {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(22px, 4vw, 32px);
    margin: 22px 0;
    color: #e4efff;
    letter-spacing: 1px;
}

/* ENDING */

#ending h2 {
    max-width: 850px;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.1;
    margin-bottom: 35px;
}

.final-line {
    font-size: 11px;
    line-height: 2.3;
    letter-spacing: 4px;
    color: #c6dfff;
    text-shadow: 0 0 20px rgba(170, 210, 255, 0.45);
    margin-bottom: 35px;
    animation: fadeUp 2s both;
}

/* SOUND CONTROL */

.sound-controls {
    position: absolute;
    z-index: 10;
    right: 22px;
    bottom: 22px;
}

.sound-controls button {
    padding: 10px 17px;
    font-size: 9px;
    letter-spacing: 2px;
    background: rgba(10, 25, 50, 0.45);
}

/* MOBILE */

@media (max-width: 600px) {
    .screen {
        padding: 20px;
    }

    .eyebrow {
        font-size: 8px;
        letter-spacing: 3px;
    }

    h1 {
        font-size: clamp(38px, 12vw, 60px);
        letter-spacing: 3px;
    }

    h2 {
        font-size: 42px;
    }

    button {
        padding: 14px 22px;
        font-size: 9px;
    }

    .orb {
        width: 85px;
        height: 85px;
    }

    .slide-frame {
        width: min(82vw, 360px);
        height: min(57vh, 480px);
    }

    .final-line {
        font-size: 9px;
        letter-spacing: 2px;
    }

    .sound-controls {
        right: 12px;
        bottom: 12px;
    }
}

/* ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* BUTTON HINTS + ARROW */

#enterButton,
#energyButton,
#gatherButton,
#portalButton,
#nextSlide,
#replayButton {
    position: relative;
}

#enterButton::after,
#energyButton::after,
#gatherButton::after,
#portalButton::after,
#nextSlide::after,
#replayButton::after {
    content: "↑";
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    font-size: 26px;
    line-height: 1;
    letter-spacing: 0;
    color: var(--ice-blue);
    text-shadow: 0 0 14px #9acbff;
    pointer-events: none;
    animation: arrowBounce 1.2s ease-in-out infinite;
}

#enterButton::before,
#energyButton::before,
#gatherButton::before,
#portalButton::before,
#nextSlide::before,
#replayButton::before {
    position: absolute;
    left: 50%;
    top: calc(100% + 44px);
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--ice-blue);
    text-shadow: 0 0 14px rgba(154, 203, 255, 0.7);
    pointer-events: none;
    animation: hintPulse 2s ease-in-out infinite;
}

#enterButton::before   { content: "PRESS HERE TO ENTER THE GALAXY"; }
#energyButton::before  { content: "TAP THE ORB TO ACTIVATE"; }
#gatherButton::before  { content: "TAP HERE TO GATHER THE STARS"; }
#portalButton::before  { content: "TAP HERE TO UNLOCK THE MOMENT"; }
#nextSlide::before     { content: "TAP HERE TO CONTINUE"; }
#replayButton::before  { content: "TAP HERE TO EXPERIENCE AGAIN"; }

/* Glow pulse on the normal buttons (orb already pulses) */
#enterButton,
#gatherButton,
#portalButton,
#nextSlide,
#replayButton {
    animation: buttonGlow 2.4s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-9px); }
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}

@keyframes buttonGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(150, 195, 255, 0.15); }
    50%      { box-shadow: 0 0 34px rgba(150, 195, 255, 0.55); }
}

@media (max-width: 600px) {
    #enterButton::before,
    #energyButton::before,
    #gatherButton::before,
    #portalButton::before,
    #nextSlide::before,
    #replayButton::before {
        font-size: 9px;
        letter-spacing: 2px;
    }
}
/* COUNTDOWN FONT FIX (1 ab "I" jaisa nahi dikhega) */

#countNumber {
    font-family: 'Montserrat', sans-serif;
    font-weight: 200;
    font-variant-numeric: lining-nums;
    letter-spacing: 0;
}
/* NAME REVEAL (Alina Saheba) */

#nameReveal::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(90vw, 700px);
    height: min(90vw, 700px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(160, 205, 255, 0.35),
        rgba(120, 160, 240, 0.12) 45%,
        transparent 70%
    );
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

#nameReveal.active::before {
    animation: nameHalo 4s ease-in-out infinite alternate;
}

.name-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(44px, 13vw, 130px);
    line-height: 1.1;
    letter-spacing: 4px;
    padding: 0 10px;
    background: linear-gradient(
        100deg,
        #b9d8ff 0%,
        #ffffff 25%,
        #d9c9ff 50%,
        #ffffff 75%,
        #b9d8ff 100%
    );
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    opacity: 0;
    filter: drop-shadow(0 0 22px rgba(160, 205, 255, 0.65));
}

#nameReveal.active .name-title {
    animation:
        nameIn 2.2s cubic-bezier(0.2, 0.7, 0.2, 1) both,
        nameShimmer 5s linear 2.2s infinite;
}

#nameReveal .name-sub {
    margin-top: 26px;
    margin-bottom: 0;
    font-size: 12px;
    letter-spacing: 4px;
    color: var(--ice-blue);
    text-shadow: 0 0 18px rgba(154, 203, 255, 0.6);
    opacity: 0;
    animation: none;
}

#nameReveal.active .name-sub {
    animation: fadeUp 1.8s ease 1.6s both;
}

#nameReveal .eyebrow {
    opacity: 0;
    animation: none;
}

#nameReveal.active .eyebrow {
    animation: fadeUp 1.4s ease 0.2s both;
}

@keyframes nameIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(25px);
        letter-spacing: 22px;
        filter: blur(16px) drop-shadow(0 0 22px rgba(160, 205, 255, 0.65));
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        letter-spacing: 4px;
        filter: blur(0) drop-shadow(0 0 22px rgba(160, 205, 255, 0.65));
    }
}

@keyframes nameShimmer {
    from { background-position: 0% 0; }
    to   { background-position: 250% 0; }
}

@keyframes nameHalo {
    from { opacity: 0.35; transform: translate(-50%, -50%) scale(0.9); }
    to   { opacity: 1;    transform: translate(-50%, -50%) scale(1.1); }
}

@media (max-width: 600px) {
    #nameReveal .name-sub {
        font-size: 9px;
        letter-spacing: 2px;
    }
}
/* NAME REVEAL: SLOW CINEMATIC VERSION */

.name-title {
    -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
    mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
    -webkit-mask-size: 250% 100%;
    mask-size: 250% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
}

#nameReveal.active .name-title {
    animation:
        nameInSlow 4.5s cubic-bezier(0.25, 0.6, 0.2, 1) both,
        nameSweep 4.5s ease-in-out both,
        nameShimmer 5s linear 4.5s infinite;
}

#nameReveal.active .eyebrow {
    animation: fadeUp 2s ease 0.4s both;
}

#nameReveal.active .name-sub {
    animation: fadeUp 2.2s ease 3.4s both;
}

@keyframes nameInSlow {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
        letter-spacing: 40px;
        filter: blur(22px) drop-shadow(0 0 22px rgba(160, 205, 255, 0.65));
    }
    60% {
        opacity: 1;
        filter: blur(6px) drop-shadow(0 0 30px rgba(160, 205, 255, 0.8));
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        letter-spacing: 4px;
        filter: blur(0) drop-shadow(0 0 22px rgba(160, 205, 255, 0.65));
    }
}

@keyframes nameSweep {
    from {
        -webkit-mask-position: 100% 0;
        mask-position: 100% 0;
    }
    to {
        -webkit-mask-position: 0% 0;
        mask-position: 0% 0;
    }
}
/* HIDE HELPER (button ko chhupane ke liye) */

.is-hidden {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
}

/* ENDING: FRIENDSHIP ANIMATED */

#ending::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(95vw, 760px);
    height: min(95vw, 760px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(160, 205, 255, 0.30),
        rgba(120, 160, 240, 0.10) 45%,
        transparent 70%
    );
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

#ending.active::before {
    animation: nameHalo 5s ease-in-out infinite alternate;
}

#endingMessage {
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(22px) scale(0.97);
    filter: blur(10px);
    animation: none;
    transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
}

#endingMessage.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

#ending .final-line {
    opacity: 0;
    transform: translateY(20px);
    letter-spacing: 14px;
    animation: none;
    transition: opacity 2s ease, transform 2s ease, letter-spacing 3s ease;
}

#ending .final-line.show {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 3px;
    animation: finalGlow 3s ease-in-out infinite alternate;
}

@keyframes finalGlow {
    from { text-shadow: 0 0 12px rgba(170, 210, 255, 0.35); }
    to   { text-shadow: 0 0 32px rgba(200, 228, 255, 0.95); }
}

.ending-spark {
    position: absolute;
    bottom: -20px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 12px 3px rgba(185, 216, 255, 0.8);
    opacity: 0;
    pointer-events: none;
    animation: sparkRise linear infinite;
}

@keyframes sparkRise {
    0% {
        transform: translate(0, 0) scale(0.6);
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--drift, 0px), -110vh) scale(1.2);
        opacity: 0;
    }
}