/* ========================================
   ROOT VARIABLES - Design System
   ======================================== */
:root {
    /* Colors - Yang (Light/Dragon) */
    --yang-bg: #f5f2e8;
    --yang-text: #1a1a1a;
    --yang-accent: #2c2416;

    /* Colors - Yin (Dark/Lotus) */
    --yin-bg: #0a0a0a;
    --yin-text: #e8e5dc;
    --yin-accent: #4a3f5c;
    --yin-jewel: #6b5b95;

    /* Gold accents */
    --gold: #d4af37;
    --gold-dark: #b8941f;
    --gold-glow: rgba(212, 175, 55, 0.3);

    /* Transitions */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Typography */
    --font-display: 'Cinzel', serif;
    --font-body: 'Cormorant Garamond', serif;
}

/* ========================================
   GLOBAL RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   GATEWAY CONTAINER - Split Screen
   ======================================== */
.gateway-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    overflow: hidden;
}

/* ========================================
   SPLIT SIDES - Dragon & Lotus
   ======================================== */
.side {
    position: relative;
    flex: 1;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: flex 0.8s var(--transition-smooth);
}

/* Dragon Side (Left - Yang - Marble/Skin) */
.dragon-side {
    background-image: url('white_snake_skin.png');
    background-color: var(--yang-bg);
}

/* Lotus Side (Right - Yin - Silk) */
.lotus-side {
    background-image: url('black_lotus_element.png');
    background-color: var(--yin-bg);
}

/* ========================================
   PRELOADER - THE VOID
   ======================================== */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 9999;
    pointer-events: none;
    /* Let clicks pass if needed, but mainly for masking */
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-void {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    /* Elements inside will handle the background look */
}

.loader-symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    z-index: 10001;
    filter: drop-shadow(0 0 15px var(--gold-glow));
}

.split-curtain {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: #0a0a0a;
    /* The Void Color */
    z-index: 10000;
}

.curtain-left {
    left: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.curtain-right {
    right: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

/* Initially hidden portal elements for the reveal */
.portal-center {
    opacity: 0;
    transform: translate(-50%, -30%);
}

.energy-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    z-index: 10005;
    /* Above curtains initially for the flash */
    pointer-events: none;
}

.manifestation-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10002;
    /* Above loader symbol */
    pointer-events: none;
}

.stream-container {
    position: absolute;
    width: 50%;
    height: 100%;
    top: 0;
    overflow: hidden;
}

.dragon-stream-container {
    left: 0;
    width: 100%;
    /* Override default 50% since it's now inside the side container */
}

.lotus-stream-container {
    right: 0;
}

.manifested-asset {
    position: absolute;
    opacity: 0;
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    pointer-events: none;
    /* Ensure clicks pass through to side/button */
}

.asset-dragon {
    top: 0;
    left: 0;
    /* Using v4 (User choice). Render with 100% opacity to cover background layer. */
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 35%;
    mix-blend-mode: normal;

    filter: none;
    mask-image: none;
    -webkit-mask-image: none;

    transform-origin: center center;
}

.asset-lotus {
    bottom: 10%;
    right: 10%;
    width: 500px;
    filter: drop-shadow(0 0 30px rgba(107, 91, 149, 0.6));
    transform-origin: center bottom;
}

.white-ink-trail {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.8), transparent 70%);
    transform: scale(0);
    transform-origin: bottom right;
    display: none;
    /* User requested removal of white banner/effect */
    opacity: 0;
}

.dark-energy-drop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(10, 10, 20, 0.9), transparent 70%);
    transform: scale(0);
    transform-origin: top left;
    opacity: 0;
}

.loader-ring {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
}



.visibility-hidden .portal-center {
    /* Helper to ensure it starts hidden in JS logic */
    opacity: 0;
}


/* Overlay for depth */
.side-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.side:hover .side-overlay {
    opacity: 1;
}

/* Remove dark overlay on Dragon/Light side to avoid "grey banner" look */
.dragon-side .side-overlay {
    background: none;
}

/* Hover expansion effect */
.side:hover {
    flex: 1.15;
}

/* ========================================
   SIDE CONTENT - Element Titles
   ======================================== */
.side-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 4rem 2rem;
    z-index: 2;
}

.element-title {
    text-align: center;
    opacity: 1;
    transition: all 0.5s var(--transition-smooth);
    transform: translateY(20px);
}

.side:hover .element-title {
    opacity: 1;
    transform: translateY(0);
}

.element-title .element-symbol {
    display: block;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.dragon-side .element-title {
    color: var(--yang-text);
    /* text-shadow: 0 2px 10px rgba(255, 255, 255, 0.5); REMOVED per user request "nechci bilej" */
}

.lotus-side .element-title {
    color: var(--yin-text);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.element-title h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.element-subtitle {
    display: block;
    font-size: 1rem;
    font-style: italic;
    opacity: 0.8;
    letter-spacing: 0.15em;
}

/* ========================================
   CENTER PORTAL - Main Content
   ======================================== */
.portal-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90vw;
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.portal-center .cta-button {
    pointer-events: auto;
}

/* ========================================
   TAIJITU SYMBOL - Animated Yin Yang
   ======================================== */
.taijitu-container {
    width: 150px;
    height: 150px;
    margin: 0 auto 2rem;
    filter: drop-shadow(0 0 20px var(--gold-glow));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(180deg);
    }
}

.taijitu {
    width: 100%;
    height: 100%;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.yang-path,
.yin-path {
    transition: all 0.3s ease;
}

.taijitu:hover .yang-path {
    fill: #ffffff;
}

.taijitu:hover .yin-path {
    fill: #000000;
}

/* ========================================
   ALCHEMICAL EMBLEM
   ======================================== */
.emblem {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    opacity: 0.4;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1.05);
    }
}

.alchemical-symbol {
    width: 100%;
    height: 100%;
    color: var(--gold);
    filter: drop-shadow(0 0 10px var(--gold-glow));
}

/* ========================================
   MAIN TITLE
   ======================================== */
.main-title {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
    /* Moved gradient to spans for flexible positioning */
}

/* Apply gradient to spans so they carry style when separated */
.main-title span {
    background: linear-gradient(135deg, var(--yang-text) 0%, var(--gold) 50%, var(--yin-jewel) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
    animation: shimmer 5s ease-in-out infinite;
    display: block;
    /* Ensure they remain blocks */
}

@keyframes shimmer {

    0%,
    100% {
        filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3)) brightness(1);
    }

    50% {
        filter: drop-shadow(0 4px 20px var(--gold-glow)) brightness(1.2);
    }
}

.title-alchymie {
    font-size: 0.6em;
    font-weight: 400;
    letter-spacing: 0.3em;
}

/* ========================================
   SUBTITLE
   ======================================== */
.subtitle {
    font-size: 1.2rem;
    color: var(--gold);
    font-style: italic;
    letter-spacing: 0.2em;
    margin-bottom: 3rem;
    opacity: 0.9;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ========================================
   CTA BUTTONS
   ======================================== */
.cta-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
}

.cta-button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1.5rem 2.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.4s var(--transition-smooth);
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    border-radius: 50%;
    z-index: 0;
}

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button>* {
    position: relative;
    z-index: 1;
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--gold);
}

.button-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.button-text {
    font-weight: 600;
    font-size: 1.1rem;
}

.button-subtitle {
    font-size: 0.75rem;
    font-weight: 300;
    font-style: italic;
    opacity: 0.7;
    letter-spacing: 0.15em;
}

/* Dragon Button specific */
.dragon-button:hover {
    background: rgba(245, 242, 232, 0.1);
    color: var(--yang-bg);
}

/* Lotus Button specific */
.lotus-button:hover {
    background: rgba(107, 91, 149, 0.2);
    color: var(--yin-jewel);
}

/* Button Divider */
.button-divider {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom,
            transparent 0%,
            var(--gold) 50%,
            transparent 100%);
    opacity: 0.5;
}

/* ========================================
   PARTICLES CANVAS
   ======================================== */
.particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
    .main-title {
        font-size: 3rem;
    }

    .element-title h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .gateway-container {
        flex-direction: column;
    }

    .side:hover {
        flex: 1.1;
    }

    .main-title {
        font-size: 2.5rem;
        display: contents;
        /* Break out h1 for reordering */
    }

    /* Mobile Reordering: Sandwich the Taijitu */
    .portal-center {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 90%;
        gap: 0.8rem;
        /* Reduced gap */
        /* Add spacing between elements */
    }

    .title-alchymie {
        order: 1;
        margin-bottom: 0;
        font-size: 0.8em;
        /* Slightly larger on mobile relative to h1 logic */
    }

    .taijitu-container {
        order: 2;
        margin: 0;
        /* Reset margins */
        width: 120px;
        height: 120px;
    }

    .title-energie {
        order: 3;
    }

    .subtitle {
        order: 4;
        margin-bottom: 0.8rem;
        /* Reduced margin */
        margin-top: 0.2rem;
        font-size: 0.9rem;
        /* Slightly smaller */
    }

    .cta-container {
        order: 5;
        flex-direction: column;
        gap: 0.6rem;
        /* Reduced gap */
        margin-top: 0;
    }

    .emblem {
        /* Keep emblem relative to layout or hide if messy */
        display: none;
        /* Hide alchemical circles on mobile to reduce clutter/overlap */
    }

    .button-divider {
        width: 60px;
        height: 1px;
    }

    /* Adjust portal centering for mobile visual balance */
    .portal-center {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -42%);
        /* Fine-tuned to center Taijitu on the boundary */
        width: 100%;
        padding-top: 0;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
    }

    .taijitu-container {
        width: 100px;
        height: 100px;
    }

    .cta-button {
        padding: 1.2rem 2rem;
        font-size: 0.9rem;
    }
}