/* Safari Splash Screen Styles */

.safari-splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1a1a1a;
    /* Solid background to prevent flash */
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: visibility 0s linear 2s;
    /* Delay visibility change */
}

.safari-splash-screen.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.safari-splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Hide portfolio container until splash is dismissed */
body:has(.safari-splash-screen.show) .portfolio-container {
    opacity: 0;
    visibility: hidden;
}

body:has(.safari-splash-screen.hidden) .portfolio-container,
body:not(:has(.safari-splash-screen.show)) .portfolio-container {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-in-out, visibility 0s;
}

.splash-content {
    text-align: center;
    padding: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.splash-title {
    font-family: 'EB Garamond', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 1rem 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.splash-subtitle {
    font-family: 'EB Garamond', serif;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: #a0a0a0;
    margin: 0 0 3rem 0;
    font-weight: 400;
}

.splash-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-family: 'EB Garamond', serif;
    font-size: 1.125rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
    /* Eliminar flash azul en Android/Chrome */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.splash-btn:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.splash-btn:active {
    transform: translateY(0);
    background: #e8e8e8;
}

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

.btn-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    position: relative;
    z-index: 1;
    transition: transform 0.4s ease;
    opacity: 0.8;
}

.splash-btn:hover .btn-icon {
    transform: translateX(3px);
    opacity: 1;
}

/* Dark mode support */
[data-theme="dark"] .safari-splash-screen {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

[data-theme="dark"] .splash-title {
    color: #ffffff;
}

[data-theme="dark"] .splash-subtitle {
    color: #a0a0a0;
}

/* Mobile styles */
@media (max-width: 768px) {
    .splash-content {
        padding: 1.5rem;
    }

    .splash-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .splash-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .splash-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

/* ========================================
   VERTICAL CURTAIN TRANSITION
   ======================================== */

/* Base curtain panels - cover the background seamlessly */
.curtain-panel {
    position: absolute;
    top: 0;
    width: 50.5%;
    /* Slightly overlap to avoid gap */
    height: 100%;
    /* Color oscuro uniforme */
    background: #1a1a1a;
    z-index: 0;
    /* Behind content but covering the portfolio */
    will-change: transform;
    transition: none;
}

.curtain-left {
    left: 0;
    transform: translateX(0);
}

.curtain-right {
    right: 0;
    transform: translateX(0);
}

/* Animación de apertura de cortinas - más lenta y suave */
.curtain-panel.opening {
    transition: transform 1.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.curtain-left.opening {
    transform: translateX(-100%);
}

.curtain-right.opening {
    transform: translateX(100%);
}

/* Contenido que se desvanece elegantemente */
.splash-content {
    position: relative;
    z-index: 2;
}

.splash-content.fading-out {
    animation: elegantFadeOut 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes elegantFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }

    100% {
        opacity: 0;
        transform: scale(0.96);
        filter: blur(3px);
    }
}

/* Línea central decorativa durante la transición */
.curtain-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 20%,
            rgba(255, 255, 255, 0.5) 50%,
            rgba(255, 255, 255, 0.3) 80%,
            transparent 100%);
    transform: translateX(-50%) scaleY(0);
    opacity: 0;
    z-index: 3;
}

.curtain-line.visible {
    animation: lineAppear 0.4s ease-out forwards, lineFade 0.6s ease-out 0.8s forwards;
}

@keyframes lineAppear {
    0% {
        transform: translateX(-50%) scaleY(0);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%) scaleY(1);
        opacity: 1;
    }
}

@keyframes lineFade {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Accessibility */
.splash-btn:focus {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

.splash-btn:focus:not(:focus-visible) {
    outline: none;
}

.splash-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}