/* ========================================
   RelaxSweet Dream Portal Intro CSS
   Psychedelic Dream Entry Experience
   ======================================== */

/* Intro Container */
.intro-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: #000011;
    overflow: hidden;
}

#intro-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Body when intro is active */
body.intro-active {
    overflow: hidden;
    cursor: default !important;
}

/* Hide custom cursor during intro */
body.intro-active .custom-cursor {
    display: none !important;
}

body.intro-active * {
    cursor: default !important;
}

/* But allow pointer cursor on interactive elements */
body.intro-active button,
body.intro-active a,
body.intro-active .enter-btn {
    cursor: pointer !important;
}

/* Intro Overlay UI */
.intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.intro-content {
    text-align: center;
    pointer-events: auto;
    padding: 2rem;
}

/* Logo */
.intro-logo {
    margin-bottom: 2rem;
    animation: logoFloat 4s ease-in-out infinite;
}

.intro-logo img {
    height: 90px;
    width: auto;
    filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.5));
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Title */
.intro-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: white;
}

.title-word {
    display: inline-block;
    opacity: 0;
    animation: wordReveal 1s ease forwards;
    margin: 0 0.2em;
}

.title-word:nth-child(1) { animation-delay: 0.5s; }
.title-word:nth-child(2) { animation-delay: 0.7s; }
.title-word:nth-child(3) { animation-delay: 0.9s; }

.title-word.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 500;
    animation: wordReveal 1s ease forwards, shimmer 3s ease-in-out infinite;
    animation-delay: 0.9s, 1.9s;
}

@keyframes wordReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) rotateX(-90deg);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
        filter: blur(0);
    }
}

@keyframes shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Intro Text */
.intro-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.1em;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 1.2s;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enter Button */
.enter-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2.5rem;
    background: transparent;
    border: 2px solid rgba(139, 92, 246, 0.5);
    border-radius: 50px;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    cursor: pointer;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 1s ease forwards, buttonPulse 2s ease-in-out infinite;
    animation-delay: 1.5s, 2.5s;
    transition: all 0.4s ease;
}

.enter-btn:hover {
    border-color: rgba(139, 92, 246, 1);
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.5);
}

.enter-btn:active {
    transform: scale(0.98);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-icon {
    position: relative;
    z-index: 2;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    width: 100%;
    height: 100%;
    animation: iconPulse 1.5s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.btn-glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.enter-btn:hover .btn-glow-effect {
    opacity: 1;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.7; }
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.4);
    }
}

/* Hint */
.intro-hint {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 1.8s;
    transition: color 0.3s ease;
}

.intro-hint kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: monospace;
    font-size: 0.75rem;
}

/* Scroll indicator */
.scroll-indicator {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 2s;
}

.scroll-indicator .mouse {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    position: relative;
}

.scroll-indicator .wheel {
    width: 4px;
    height: 8px;
    background: rgba(139, 92, 246, 0.8);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheelAnim 2s ease-in-out infinite;
}

@keyframes scrollWheelAnim {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(12px); opacity: 0.3; }
}

.scroll-indicator span {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.1em;
}

/* Floating Particles in UI */
.intro-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(139, 92, 246, 0.6);
    border-radius: 50%;
    animation: particleFloat 15s linear infinite;
}

.particle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
}

.p1 { left: 10%; animation-delay: 0s; animation-duration: 20s; }
.p2 { left: 25%; animation-delay: -3s; animation-duration: 18s; }
.p3 { left: 45%; animation-delay: -6s; animation-duration: 22s; }
.p4 { left: 65%; animation-delay: -9s; animation-duration: 19s; }
.p5 { left: 80%; animation-delay: -12s; animation-duration: 21s; }
.p6 { left: 90%; animation-delay: -15s; animation-duration: 17s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) scale(0.5);
        opacity: 0;
    }
}

/* Journey Progress Indicator */
.journey-progress {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.journey-progress.active {
    opacity: 1;
    visibility: visible;
}

.progress-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(139, 92, 246, 0.5); }
    50% { text-shadow: 0 0 30px rgba(139, 92, 246, 0.8); }
}

.progress-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2, #f472b6);
    border-radius: 3px;
    transition: width 0.1s linear;
    animation: progressGlow 1s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(139, 92, 246, 0.5); }
    50% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.8); }
}

/* Vignette effect */
.intro-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 17, 0.4) 100%);
    pointer-events: none;
    z-index: 5;
}

/* Scanlines effect (subtle) */
.intro-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 6;
    opacity: 0.3;
}

/* Chromatic aberration effect on hover */
.intro-container:hover .intro-title {
    animation: chromaticShift 0.1s ease;
}

@keyframes chromaticShift {
    0% {
        text-shadow:
            -2px 0 rgba(255, 0, 0, 0.3),
            2px 0 rgba(0, 255, 255, 0.3);
    }
    100% {
        text-shadow: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .intro-title {
        font-size: clamp(2rem, 12vw, 4rem);
    }

    .intro-text {
        font-size: 0.9rem;
        padding: 0 1rem;
    }

    .enter-btn {
        padding: 1rem 2rem;
        font-size: 0.9rem;
    }

    .intro-logo img {
        height: 75px;
    }

    .title-word {
        display: block;
        margin: 0.1em 0;
    }
}

@media (max-width: 480px) {
    .intro-content {
        padding: 1rem;
    }

    .intro-hint {
        flex-direction: column;
        gap: 0.25rem;
    }

    .progress-bar {
        width: 150px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .enter-btn {
        border-color: white;
    }

    .intro-text {
        color: rgba(255, 255, 255, 0.9);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .intro-logo,
    .title-word,
    .intro-text,
    .enter-btn,
    .intro-hint,
    .particle,
    .btn-icon svg {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .enter-btn {
        animation: none;
    }
}

/* Additional psychedelic effects */

/* Glitch effect for title on load */
.intro-title.glitch {
    animation: glitchText 0.3s ease infinite;
}

@keyframes glitchText {
    0%, 100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    20% {
        transform: translate(-2px, 2px);
        filter: hue-rotate(90deg);
    }
    40% {
        transform: translate(2px, -2px);
        filter: hue-rotate(180deg);
    }
    60% {
        transform: translate(-1px, -1px);
        filter: hue-rotate(270deg);
    }
    80% {
        transform: translate(1px, 1px);
        filter: hue-rotate(360deg);
    }
}

/* Breathing background glow */
.intro-container {
    animation: breathingBg 8s ease-in-out infinite;
}

@keyframes breathingBg {
    0%, 100% {
        background: radial-gradient(ellipse at center, #0a0a2e 0%, #000011 100%);
    }
    50% {
        background: radial-gradient(ellipse at center, #0f0f3a 0%, #000011 100%);
    }
}

/* Portal entry animation classes */
.intro-container.entering {
    animation: portalEntry 2s ease-in-out forwards;
}

@keyframes portalEntry {
    0% {
        filter: brightness(1) blur(0);
    }
    50% {
        filter: brightness(2) blur(5px);
    }
    100% {
        filter: brightness(10) blur(20px);
        opacity: 0;
    }
}

/* Star burst on click */
.star-burst {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    animation: starBurst 1s ease-out forwards;
}

@keyframes starBurst {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(20);
        opacity: 0;
    }
}

/* ========================================
   Progress Indicator - Scroll Navigation
   ======================================== */
.dream-progress {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: opacity 0.5s ease;
}

.progress-track {
    width: 4px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, #667eea, #764ba2, #8b5cf6);
    border-radius: 4px;
    transition: height 0.1s ease;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.progress-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: right;
}

.progress-label {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1rem;
    color: white;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    white-space: nowrap;
}

.progress-hint {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

@media (max-width: 768px) {
    .dream-progress {
        right: 15px;
        gap: 10px;
    }

    .progress-track {
        height: 100px;
    }

    .progress-label {
        font-size: 0.85rem;
    }

    .progress-hint {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .dream-progress {
        right: 10px;
        bottom: 20px;
        top: auto;
        transform: none;
        flex-direction: column-reverse;
        align-items: flex-end;
    }

    .progress-track {
        width: 100px;
        height: 4px;
    }

    .progress-fill {
        width: 0%;
        height: 100%;
        bottom: auto;
        left: 0;
        background: linear-gradient(to right, #667eea, #764ba2, #8b5cf6);
    }

    .progress-text {
        text-align: center;
    }
}
