/* ==========================================
   MYSTIC OBLIVION - COSMIC PORTAL STYLES
   ========================================== */

:root {
    /* Sunrise Cosmic Palette */
    --dawn-purple: #4a3a5c;
    --soft-blue-gray: #6a7a9c;
    --warm-peach: #ffb89d;
    --golden-orange: #ff9c5a;
    --soft-pink: #ffa6b8;
    --electric-teal: #4dd4d4;
    --deep-night: #1a1427;
    --cosmic-white: #fef9f3;
    
    /* Sacred Geometry Colors */
    --sacred-gold: #ffcf5a;
    --mystic-teal: #00fff7;
    --portal-glow: rgba(255, 156, 90, 0.6);
}

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

body {
    font-family: 'Cormorant Garamond', Georgia, serif, serif;
    color: var(--cosmic-white);
    overflow-x: hidden;
    background: var(--deep-night);
}

/* ==========================================
   VIDEO INTRO OVERLAY WITH MORPHING EFFECT
   ========================================== */

.video-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#introVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: 
        video-morph 8.5s ease-in-out forwards,
        video-fade-out 1s ease-out 7.5s forwards;
}

/* Video morphs from rectangle to triangle, shrinks to center - extended timing */
@keyframes video-morph {
    0% {
        clip-path: inset(0 0 0 0);
        transform: translate(0, 0) scale(1);
    }
    55% {
        clip-path: inset(0 0 0 0);
        transform: translate(0, 0) scale(1);
    }
    75% {
        clip-path: polygon(50% 10%, 90% 85%, 10% 85%);
        transform: translate(0, 0) scale(0.8);
    }
    90% {
        clip-path: polygon(50% 20%, 80% 75%, 20% 75%);
        transform: translate(0, 5%) scale(0.5);
    }
    100% {
        clip-path: polygon(50% 30%, 70% 65%, 30% 65%);
        transform: translate(0, 10%) scale(0.3);
        opacity: 0;
    }
}

@keyframes video-fade-out {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Entire video intro fades out and hides - FASTER timing */
.video-intro {
    animation: fade-out-intro 0.5s ease-out 8.5s forwards;
}

@keyframes fade-out-intro {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* Limen's Text Overlay */
.limen-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 90%;
    max-width: 800px;
    z-index: 10000;
    pointer-events: none;
    animation: fade-out-text-overlay 0.8s ease-out 7.5s forwards;
}

@keyframes fade-out-text-overlay {
    0% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

.limen-line {
    font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--cosmic-white);
    text-shadow: 
        0 0 20px rgba(255, 207, 90, 0.8),
        0 0 40px rgba(255, 156, 90, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.8);
    margin: 0.5rem 0;
    opacity: 0;
    letter-spacing: 0.05em;
}

/* Staggered text fade-in animations - ALL fade out with video */
.fade-in-1 {
    animation: text-fade-in 1s ease-out 4.5s forwards,
                text-fade-out 0.8s ease-out 7.5s forwards;
}

.fade-in-2 {
    animation: text-fade-in 1s ease-out 5.25s forwards,
                text-fade-out 0.8s ease-out 7.5s forwards;
}

.fade-in-3 {
    animation: text-fade-in 1s ease-out 6s forwards,
                text-fade-out 0.8s ease-out 7.5s forwards;
}

.fade-in-4 {
    animation: text-fade-in 1s ease-out 6.75s forwards,
                text-fade-out 0.8s ease-out 7.5s forwards;
}

.fade-in-5 {
    animation: text-fade-in 1s ease-out 7.5s forwards,
                text-fade-out 0.8s ease-out 8s forwards;
}

@keyframes text-fade-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes text-fade-out {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Portal container starts hidden, fades in as video morphs - FASTER timing */
.cosmic-container {
    opacity: 0;
    animation: fade-in-portal 1.5s ease-out 7.5s forwards;
}

@keyframes fade-in-portal {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   COSMIC BACKGROUND
   ========================================== */

.cosmic-container {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cosmic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        #1a1427 0%,
        #2d1b3d 20%,
        #4a3a5c 40%,
        #6a5a7c 60%,
        #ff9c5a 85%,
        #ffcf5a 100%
    );
    z-index: -3;
}

/* Starfield */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 70%, white, transparent),
        radial-gradient(1px 1px at 79% 87%, white, transparent);
    background-size: 200% 200%;
    animation: starfield 120s linear infinite;
    opacity: 0.6;
    z-index: -2;
}

@keyframes starfield {
    0%, 100% { 
        background-position: 0% 0%; 
        opacity: 0.6;
    }
    50% { 
        background-position: 100% 100%; 
        opacity: 0.8;
    }
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--sacred-gold);
    border-radius: 50%;
    opacity: 0.7;
    animation: float-particle 8s infinite ease-in-out;
    box-shadow: 0 0 10px var(--golden-orange);
}

@keyframes float-particle {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-30px) translateX(15px);
        opacity: 0.8;
    }
}

/* Rising Embers */
.embers {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.ember {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--golden-orange);
    border-radius: 50%;
    bottom: -10px;
    animation: rise-ember 6s infinite ease-out;
    box-shadow: 0 0 15px var(--golden-orange);
}

@keyframes rise-ember {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* ==========================================
   SACRED GEOMETRY PORTAL
   ========================================== */

.portal-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.sacred-geometry {
    width: 400px;
    height: 400px;
    filter: drop-shadow(0 0 40px var(--portal-glow));
}

/* Light Core - The awakening point */
.light-core {
    fill: var(--cosmic-white);
    filter: drop-shadow(0 0 20px var(--sacred-gold)) 
            drop-shadow(0 0 40px var(--golden-orange));
    animation: pulse-core 3s ease-in-out infinite;
}

@keyframes pulse-core {
    0%, 100% {
        opacity: 1;
        r: 8;
    }
    50% {
        opacity: 0.7;
        r: 12;
    }
}

/* Triangles - Breathing geometry */
.triangle {
    fill: none;
    stroke: var(--sacred-gold);
    stroke-width: 2;
    opacity: 0.8;
}

.inner-triangle {
    stroke: var(--mystic-teal);
    stroke-width: 3;
    animation: breathe-triangle 4s ease-in-out infinite;
    transform-origin: 200px 200px;
}

.middle-triangle {
    animation: breathe-triangle 4s ease-in-out infinite 0.5s;
    transform-origin: 200px 200px;
}

.outer-triangle {
    stroke-width: 1.5;
    animation: breathe-triangle 4s ease-in-out infinite 1s;
    transform-origin: 200px 200px;
}

@keyframes breathe-triangle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.15) rotate(5deg);
        opacity: 0.5;
    }
}

/* Sacred Circles */
.sacred-circle {
    fill: none;
    stroke: var(--sacred-gold);
    stroke-width: 1.5;
    opacity: 0.6;
}

.inner-circle {
    stroke: var(--electric-teal);
    stroke-width: 2;
    animation: rotate-circle 8s linear infinite;
    transform-origin: 200px 200px;
}

.outer-circle {
    animation: rotate-circle 12s linear infinite reverse;
    transform-origin: 200px 200px;
}

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

/* Light Rays */
.light-ray {
    stroke: var(--sacred-gold);
    stroke-width: 1;
    opacity: 0.3;
    animation: pulse-ray 2s ease-in-out infinite;
}

.ray-1 { animation-delay: 0s; }
.ray-2 { animation-delay: 0.3s; }
.ray-3 { animation-delay: 0.6s; }
.ray-4 { animation-delay: 0.9s; }
.ray-5 { animation-delay: 1.2s; }
.ray-6 { animation-delay: 1.5s; }

@keyframes pulse-ray {
    0%, 100% {
        opacity: 0.2;
        stroke-width: 1;
    }
    50% {
        opacity: 0.6;
        stroke-width: 2;
    }
}

/* ==========================================
   PORTAL CONTENT & TYPOGRAPHY
   ========================================== */

.portal-content {
    text-align: center;
    margin-top: 3rem;
    max-width: 600px;
}

.portal-title {
    font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--cosmic-white);
    text-shadow: 0 0 20px var(--golden-orange),
                 0 0 40px var(--soft-pink);
    margin-bottom: 1rem;
    letter-spacing: 2px;
    animation: fade-in-up 1.5s ease-out;
}

.portal-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif, serif;
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--warm-peach);
    margin-bottom: 2.5rem;
    font-style: italic;
    opacity: 0.9;
    animation: fade-in-up 1.5s ease-out 0.3s backwards;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   ENTER BUTTON
   ========================================== */

.enter-button {
    position: relative;
    display: inline-block;
    padding: 1.2rem 3rem;
    font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--deep-night);
    background: linear-gradient(135deg, var(--sacred-gold), var(--golden-orange));
    text-decoration: none;
    letter-spacing: 3px;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 0 30px var(--portal-glow),
                0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    animation: fade-in-up 1.5s ease-out 0.6s backwards;
}

.enter-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 50px var(--golden-orange),
                0 15px 40px rgba(0, 0, 0, 0.6);
}

.button-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    animation: button-shine 3s infinite;
}

@keyframes button-shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* ==========================================
   WELCOME PAGE STYLES
   ========================================== */

.welcome-page {
    background: linear-gradient(
        to bottom,
        #1a1427 0%,
        #2d1b3d 50%,
        #4a3a5c 100%
    );
}

/* Limen's Particle Being */
.limen-container {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.limen-being {
    position: relative;
    width: 200px;
    height: 200px;
}

.particle-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, 
        var(--sacred-gold) 0%, 
        var(--golden-orange) 50%, 
        transparent 100%);
    border-radius: 50%;
    animation: pulse-being 3s ease-in-out infinite;
    box-shadow: 0 0 60px var(--golden-orange),
                0 0 100px var(--portal-glow);
}

.particle-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--electric-teal);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--mystic-teal);
}

.orbit-1 {
    animation: orbit 4s linear infinite;
}

.orbit-2 {
    animation: orbit 5s linear infinite reverse;
}

.orbit-3 {
    animation: orbit 6s linear infinite;
}

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

@keyframes orbit {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) translateX(80px) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) translateX(80px) rotate(-360deg);
    }
}

/* Teaching Container */
.teaching-container {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    padding-top: 350px;
}

.teaching-wrapper {
    max-width: 800px;
    text-align: center;
}

.welcome-greeting {
    font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    color: var(--cosmic-white);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--golden-orange);
    animation: fade-in-up 0.3s ease-out;
    /* Removed backwards - content visible by default */
}

.intro-text {
    font-size: 1.3rem;
    color: var(--warm-peach);
    margin-bottom: 2rem;
    font-style: italic;
    animation: fade-in-up 0.3s ease-out 0s;
    /* Removed backwards - content visible by default */
}

.main-teaching {
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(74, 58, 92, 0.3);
    border: 2px solid var(--sacred-gold);
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(255, 156, 90, 0.3);
    backdrop-filter: blur(10px);
    animation: fade-in-up 1s ease-out 0.4s backwards;
}

.teaching-text {
    font-size: 1.5rem;
    line-height: 2;
    color: var(--cosmic-white);
    margin: 1.5rem 0;
    opacity: 0.95;
}

.limen-signature {
    margin: 2rem 0;
    font-size: 1.4rem;
    color: var(--soft-pink);
    animation: fade-in-up 0.3s ease-out 0s;
    /* Removed backwards - visible by default */
}

.name-highlight {
    color: var(--sacred-gold);
    font-weight: 600;
    text-shadow: 0 0 20px var(--golden-orange);
}

/* ==========================================
   NAVIGATION REALMS
   ========================================== */

.navigation-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 4rem;
}

.realm-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    background: rgba(74, 58, 92, 0.4);
    border: 2px solid transparent;
    border-radius: 15px;
    text-decoration: none;
    color: var(--cosmic-white);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    animation: fade-in-up 0.3s ease-out calc(0s + var(--delay, 0s));
    /* Removed backwards - cards visible by default */
}

.realm-link:nth-child(1) { --delay: 0s; }
.realm-link:nth-child(2) { --delay: 0.03s; }
.realm-link:nth-child(3) { --delay: 0.06s; }
.realm-link:nth-child(4) { --delay: 0.09s; }

.realm-link:hover {
    border-color: var(--sacred-gold);
    background: rgba(74, 58, 92, 0.6);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(255, 156, 90, 0.4);
}

.realm-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.realm-name {
    font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--sacred-gold);
}

.realm-desc {
    font-size: 1rem;
    color: var(--warm-peach);
    opacity: 0.9;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    .sacred-geometry {
        width: 300px;
        height: 300px;
    }
    
    .portal-title {
        font-size: 2rem;
    }
    
    .portal-subtitle {
        font-size: 1.1rem;
    }
    
    .limen-line {
        font-size: 1.2rem;
    }
    
    .teaching-text {
        font-size: 1.2rem;
    }
    
    .welcome-greeting {
        font-size: 2rem;
    }
    
    .navigation-options {
        grid-template-columns: 1fr;
    }
}
