/* ========================================
   HHASSL.com - Frosted Pop-Art Dreamscape
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cosmic-indigo: #0d0b2e;
    --pop-magenta: #ff2d7b;
    --electric-cyan: #00e5ff;
    --starlight-yellow: #ffe246;
    --frost-white: #f0f0ff;
    --muted-lavender: #a8a3d6;
    --warm-star: #fff8dc;
    --frost-surface: rgba(255, 255, 255, 0.08);
    --frost-border: rgba(255, 255, 255, 0.15);
    --frost-fallback: rgba(13, 11, 46, 0.85);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--frost-white);
    background-color: var(--cosmic-indigo);
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   STAR FIELD BACKGROUND
   ======================================== */
#star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========================================
   FLOATING PILL NAVIGATION
   ======================================== */
#floating-pill {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--frost-surface);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid var(--frost-border);
    border-radius: 50px;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pill-title {
    font-family: 'Dela Gothic One', cursive;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--frost-white);
}

.pill-dots {
    display: flex;
    gap: 8px;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#floating-pill.scrolled .pill-dots {
    opacity: 1;
    max-width: 120px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted-lavender);
    opacity: 0.4;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--electric-cyan);
    opacity: 1;
    transform: scale(1.3);
}

.dot:hover {
    opacity: 0.8;
    transform: scale(1.2);
}

/* ========================================
   FROST PANE (Base)
   ======================================== */
.frost-pane {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 60px;
    border-radius: 24px;
    background: var(--frost-surface);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid var(--frost-border);
    margin-bottom: 120px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
    /* Ben-Day dots overlay */
    background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 8px 8px;
    /* Frost crystal hex pattern - subtle */
    overflow: hidden;
}

.frost-pane.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Frost crystal overlay */
.frost-pane::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.02) 0%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.02) 0%, transparent 60%);
    pointer-events: none;
    border-radius: 24px;
    z-index: 0;
}

.frost-pane > * {
    position: relative;
    z-index: 1;
}

/* ========================================
   SECTION TITLES
   ======================================== */
.section-title {
    font-family: 'Dela Gothic One', cursive;
    font-size: clamp(2rem, 5vw, 4.5rem);
    text-align: center;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--frost-white), var(--muted-lavender));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    text-align: center;
    color: var(--muted-lavender);
    margin-bottom: 48px;
}

/* ========================================
   1. HERO PANE
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 0;
    margin-bottom: 120px;
    border-radius: 0 0 24px 24px;
    max-width: 100%;
    padding-top: 100px;
}

.starburst-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    pointer-events: none;
}

.starburst {
    width: 100%;
    height: 100%;
    animation: starburstRotate 60s linear infinite;
}

@keyframes starburstRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-title {
    font-family: 'Dela Gothic One', cursive;
    font-size: clamp(3rem, 8vw, 9rem);
    line-height: 1.05;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--frost-white) 0%, var(--electric-cyan) 50%, var(--pop-magenta) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.hero-subtitle {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: 0.04em;
    color: var(--muted-lavender);
    margin-bottom: 60px;
}

/* Scroll hint */
.scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

.scroll-dot {
    animation: scrollDotMove 2s ease-in-out infinite;
}

@keyframes scrollDotMove {
    0%, 100% { cy: 12; opacity: 1; }
    50% { cy: 28; opacity: 0.3; }
}

.scroll-text {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: var(--muted-lavender);
}

/* ========================================
   SPEECH BUBBLES
   ======================================== */
.speech-bubble {
    position: absolute;
    background: var(--frost-white);
    padding: 10px 18px;
    border-radius: 8px;
    border: 3px solid var(--pop-magenta);
    box-shadow: 4px 4px 0 var(--electric-cyan);
    transform: rotate(-8deg);
    pointer-events: none;
    z-index: 2;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid var(--pop-magenta);
}

.bubble-text {
    font-family: 'Dela Gothic One', cursive;
    font-size: 1.4rem;
    color: var(--pop-magenta);
    display: block;
}

.hero-bubble-1 {
    top: 18%;
    right: 8%;
    transform: rotate(12deg);
}

.story-bubble {
    bottom: 60px;
    right: 40px;
    transform: rotate(-5deg);
}

.closing-bubble {
    top: 30px;
    left: 40px;
    transform: rotate(-12deg);
}

.closing-bubble .bubble-text {
    color: var(--electric-cyan);
}

.closing-bubble {
    border-color: var(--electric-cyan);
    box-shadow: 4px 4px 0 var(--pop-magenta);
}

/* ========================================
   2. REVEAL PANE - Frosted Cards
   ======================================== */
.reveal-cards {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.reveal-card {
    position: relative;
    width: 280px;
    min-height: 320px;
    padding: 40px 28px;
    border-radius: 16px;
    border: 3px solid var(--pop-magenta);
    box-shadow: 4px 4px 0 var(--electric-cyan);
    background: rgba(13, 11, 46, 0.4);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: box-shadow 200ms ease, transform 200ms ease;
}

.reveal-card:nth-child(2) {
    border-color: var(--electric-cyan);
    box-shadow: 4px 4px 0 var(--starlight-yellow);
}

.reveal-card:nth-child(3) {
    border-color: var(--starlight-yellow);
    box-shadow: 4px 4px 0 var(--pop-magenta);
}

.reveal-card:hover {
    box-shadow: 6px 2px 0 var(--electric-cyan);
    transform: translate(-1px, 1px);
}

.reveal-card:nth-child(2):hover {
    box-shadow: 6px 2px 0 var(--starlight-yellow);
}

.reveal-card:nth-child(3):hover {
    box-shadow: 6px 2px 0 var(--pop-magenta);
}

.card-frost-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(13, 11, 46, 0.3);
    transition: backdrop-filter 400ms ease-out, opacity 400ms ease-out, background 400ms ease-out;
    z-index: 1;
    border-radius: 13px;
    pointer-events: none;
}

.reveal-card:hover .card-frost-overlay,
.reveal-card.tapped .card-frost-overlay {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    background: rgba(13, 11, 46, 0.05);
    opacity: 0.3;
}

.card-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.card-title {
    font-family: 'Dela Gothic One', cursive;
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: var(--frost-white);
    position: relative;
    z-index: 2;
}

.card-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.reveal-card:hover .card-content,
.reveal-card.tapped .card-content {
    opacity: 1;
    transform: translateY(0);
}

.card-content p {
    font-size: 0.95rem;
    color: rgba(240, 240, 255, 0.9);
    line-height: 1.6;
}

/* ========================================
   3. STORY PANE
   ======================================== */
.story-content {
    display: flex;
    flex-direction: column;
    gap: 48px;
    margin-top: 40px;
}

.story-line {
    display: flex;
    align-items: center;
    gap: 32px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.story-line.revealed {
    opacity: 1;
    transform: translateY(0);
}

.story-line:nth-child(even) {
    flex-direction: row-reverse;
}

.story-illustration {
    flex-shrink: 0;
    width: 120px;
    height: 60px;
}

.story-line p {
    font-size: 1.1rem;
    color: rgba(240, 240, 255, 0.9);
    line-height: 1.7;
    max-width: 600px;
}

/* ========================================
   4. CONSTELLATION PANE
   ======================================== */
.constellation-map {
    position: relative;
    width: 100%;
    margin-top: 40px;
}

#constellation-svg {
    width: 100%;
    height: auto;
    display: block;
}

.constellation-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease;
}

.constellation-pane-visible .constellation-line {
    stroke-dashoffset: 0;
}

.star-node {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.star-node circle:first-child {
    transition: opacity 0.3s ease, r 0.3s ease;
}

.star-node:hover circle:first-child {
    opacity: 0.8;
}

.star-node circle:last-child {
    transition: r 0.3s ease;
}

/* Star twinkle on the constellation nodes */
.star-node circle:last-child {
    animation: starNodeTwinkle 3s ease-in-out infinite;
}

@keyframes starNodeTwinkle {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Star speech bubbles */
.star-bubble {
    position: absolute;
    background: var(--cosmic-indigo);
    border: 3px solid var(--pop-magenta);
    box-shadow: 4px 4px 0 var(--starlight-yellow);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 220px;
    opacity: 0;
    transform: scale(0.8) translateY(10px);
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
    z-index: 10;
}

.star-bubble.active {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.star-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid var(--pop-magenta);
}

.bubble-exclaim {
    font-family: 'Dela Gothic One', cursive;
    font-size: 1.2rem;
    color: var(--starlight-yellow);
    display: block;
    margin-bottom: 6px;
}

.star-bubble p {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: var(--frost-white);
    line-height: 1.4;
}

/* ========================================
   5. CLOSING PANE
   ======================================== */
.closing-text {
    text-align: center;
    font-size: 1.25rem;
    color: rgba(240, 240, 255, 0.9);
    max-width: 700px;
    margin: 0 auto 60px;
    line-height: 1.8;
}

.pulsing-star-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

#pulsing-star {
    width: 100px;
    height: 100px;
    cursor: pointer;
    position: relative;
    animation: pulseStar 2s ease-in-out infinite;
}

#pulsing-star svg {
    width: 100%;
    height: 100%;
}

@keyframes pulseStar {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(255,226,70,0.4)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 20px rgba(255,226,70,0.7)); }
}

.pulse-ring {
    animation: pulseRingExpand 2s ease-in-out infinite;
    transform-origin: center;
}

.ring-2 {
    animation-delay: 0.5s;
}

@keyframes pulseRingExpand {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

.star-hint {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Caveat', cursive;
    font-size: 0.9rem;
    color: var(--muted-lavender);
    white-space: nowrap;
    animation: hintFade 2s ease-in-out infinite;
}

@keyframes hintFade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

#star-message {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease, transform 600ms ease;
}

#star-message.shown {
    opacity: 1;
    transform: translateY(0);
}

#star-message.hidden {
    opacity: 0;
    transform: translateY(20px);
}

.message-text {
    font-family: 'Dela Gothic One', cursive;
    font-size: clamp(1.2rem, 3vw, 2rem);
    background: linear-gradient(135deg, var(--starlight-yellow), var(--electric-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.message-annotation {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    color: var(--muted-lavender);
    display: block;
}

/* ========================================
   ROCKET DIVIDER
   ======================================== */
.rocket-divider {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    opacity: 0.3;
    animation: rocketFloat 4s ease-in-out infinite;
}

.rocket-divider svg {
    width: 40px;
    height: 80px;
}

@keyframes rocketFloat {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-5px); }
}

/* ========================================
   STAR TWINKLE ANIMATIONS
   ======================================== */
@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* ========================================
   HALFTONE HOVER EFFECT
   ======================================== */
.reveal-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 6px 6px;
    opacity: 0;
    transition: opacity 300ms ease;
    z-index: 0;
    border-radius: 13px;
    pointer-events: none;
}

.reveal-card:hover::after,
.reveal-card.tapped::after {
    opacity: 1;
}

/* ========================================
   NEON GLOW EFFECTS
   ======================================== */
.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--pop-magenta), var(--electric-cyan));
    margin: 16px auto 0;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 45, 123, 0.4);
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 768px) {
    .frost-pane {
        padding: 50px 24px;
        margin-left: 12px;
        margin-right: 12px;
        margin-bottom: 80px;
    }

    .hero {
        padding: 80px 24px;
        margin-left: 0;
        margin-right: 0;
    }

    .reveal-cards {
        flex-direction: column;
        align-items: center;
    }

    .reveal-card {
        width: 100%;
        max-width: 320px;
    }

    .story-line {
        flex-direction: column !important;
        text-align: center;
    }

    .story-illustration {
        width: 100px;
    }

    .constellation-map {
        overflow-x: auto;
    }

    #constellation-svg {
        min-width: 600px;
    }

    .speech-bubble {
        display: none;
    }

    .hero-bubble-1 {
        display: block;
    }

    .rocket-divider {
        display: none;
    }

    .starburst-container {
        width: 300px;
        height: 300px;
    }

    #floating-pill {
        padding: 6px 16px;
    }

    .pill-title {
        font-size: 0.75rem;
    }

    .star-bubble {
        max-width: 180px;
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2.2rem, 10vw, 4rem);
    }

    .section-title {
        font-size: clamp(1.6rem, 6vw, 2.5rem);
    }

    .frost-pane {
        padding: 36px 18px;
    }
}
