/**
 * welcome.css
 * SSR Welcome Grid — card component styles
 * Source: TOGO-dev/library-states.html + welcome-screen.html
 * Architecture: Server sends complete HTML, browser just renders (dumb browser)
 */

/* ═══ WELCOME LAYOUT ═══ */
.hero {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 30px;
    overflow: hidden;
}

.video-grid {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.hollow-space {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

/* ═══ CARD BASE ═══ */
.vcard {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    flex-direction: column;
}

.vcard .thumb {
    position: relative;
    overflow: hidden;
    background: #1a1a1e;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* LANDSCAPE — base dimension = height */
.vcard.card-L .thumb {
    aspect-ratio: 16/9;
    height: min(45vh, 238px);
}

/* PORTRAIT — base dimension = width (same value, rotated) */
.vcard.card-P .thumb {
    aspect-ratio: 9/16;
    width: min(45vh, 238px);
    height: auto;
}

/* Content inside thumb */
.vcard .thumb video,
.vcard .thumb img.cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.vcard .thumb img.product {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.vcard .thumb img.first-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* ═══ READY OVERLAY (dim on ready-state cards) ═══ */
.ready-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.30);
    z-index: 4;
    pointer-events: none;
}

/* ═══ TAGS ═══ */
.vcard .tags {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
    display: flex;
    gap: 4px;
    z-index: 12;
}

.vcard .tag {
    padding: 3px 7px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    font-size: 8px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}



/* ═══ META ROW ═══ */
.vcard .meta {
    padding: 8px 10px 6px;
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta .pname {
    font-weight: 600;
}

.meta .sep {
    margin: 0 5px;
    color: #444;
}

.meta .date {
    font-weight: 700;
    color: #aaa;
}

/* ═══ GENERATION ANIMATION (orbs) ═══ */
.gen-anim {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(20, 20, 24, 0.35);
    pointer-events: none;
}

.gen-anim .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(45px);
    mix-blend-mode: screen;
}

.gen-anim .orb-1 {
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(180, 180, 210, 1) 0%, transparent 70%);
    animation: drift1 8s ease-in-out infinite;
}

.gen-anim .orb-2 {
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(160, 160, 195, 1) 0%, transparent 70%);
    animation: drift2 10s ease-in-out infinite;
}

.gen-anim .orb-3 {
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(190, 190, 220, 1) 0%, transparent 70%);
    animation: drift3 12s ease-in-out infinite;
}

.gen-anim .grain {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px;
}

@keyframes drift1 {
    0% {
        top: -10%;
        left: -10%;
        opacity: .8
    }

    25% {
        top: 20%;
        left: 50%;
        opacity: .5
    }

    50% {
        top: 50%;
        left: 30%;
        opacity: .9
    }

    75% {
        top: 10%;
        left: 60%;
        opacity: .6
    }

    100% {
        top: -10%;
        left: -10%;
        opacity: .8
    }
}

@keyframes drift2 {
    0% {
        bottom: -15%;
        right: -10%;
        opacity: .7
    }

    33% {
        bottom: 30%;
        right: 40%;
        opacity: .9
    }

    66% {
        bottom: 10%;
        right: 20%;
        opacity: .5
    }

    100% {
        bottom: -15%;
        right: -10%;
        opacity: .7
    }
}

@keyframes drift3 {
    0% {
        top: 40%;
        left: 20%;
        opacity: .5
    }

    50% {
        top: 20%;
        left: 60%;
        opacity: .8
    }

    100% {
        top: 40%;
        left: 20%;
        opacity: .5
    }
}

/* ═══ STATUS TEXT ═══ */
.status-text {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
    z-index: 8;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 1px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    animation: fadeInOut 2.5s ease-in-out infinite;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: .2
    }

    50% {
        opacity: 1
    }
}



/* ═══ CONTINUAR BUTTON ═══ */
.btn-continuar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    padding: 10px 30px;
    border-radius: 28px;
    background: linear-gradient(180deg, #FFFFFF 0%, #B0B0B0 100%);
    color: #000;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.btn-continuar:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

/* card-P inherits base .btn-continuar (no override) */

/* ═══ PLAY OVERLAY (done) ═══ */
.play-ov {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 8;
}

.vcard.state-done:hover .play-ov {
    opacity: 1;
}

.play-ov svg {
    width: 36px;
    height: 36px;
    fill: rgba(255, 255, 255, 0.85);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}



/* ═══ BROKEN IMAGE ═══ */
.broken-img-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    gap: 12px;
}

.broken-img-container svg {
    width: 48px;
    height: 48px;
    fill: #555;
}

.broken-img-container .broken-text {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    line-height: 1.5;
    max-width: 80%;
}

/* ═══ SPLIT (Scene Director A/B) ═══ */
.split-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.split-half {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.split-half img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.split-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 10;
}

.split-label {
    position: absolute;
    bottom: 6px;
    font-size: 8px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.6);
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 6;
}

.split-half:first-child .split-label {
    left: 6px;
}

.split-half:last-child .split-label {
    right: 6px;
}

.split-half .gen-anim {
    background: rgba(20, 20, 25, 0.5);
}

.split-half .gen-anim .orb-1 {
    background: radial-gradient(circle, rgba(200, 200, 230, 1) 0%, transparent 70%);
}

.split-half .gen-anim .orb-2 {
    background: radial-gradient(circle, rgba(180, 180, 215, 1) 0%, transparent 70%);
}

.split-half .status-text {
    font-size: 12px;
    top: auto;
    bottom: 20px;
    transform: none;
}



/* ═══ HOLLOW CTA (+ Nuevo Proyecto) ═══ */
.btn-start {
    position: relative;
    overflow: hidden;
    padding: 0;
    width: 176px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.btn-start::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 10%, rgba(130, 190, 255, 0.7) 40%, rgba(255, 150, 190, 0.7) 60%, transparent 90%);
    background-size: 200% 200%;
    animation: pastelFlow 4s ease-in-out infinite;
    pointer-events: none;
}

.btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 3px 10px rgba(0, 0, 0, 0.4);
}

.btn-start span {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
    text-align: center;
}

.levitate-shadow {
    width: 80px;
    height: 5px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    filter: blur(6px);
    animation: shadowPulse 3s ease-in-out infinite;
}

@keyframes pastelFlow {
    0% {
        background-position: 0% 50%
    }

    50% {
        background-position: 100% 50%
    }

    100% {
        background-position: 0% 50%
    }
}

@keyframes shadowPulse {

    0%,
    100% {
        transform: scaleX(1);
        opacity: 0.5
    }

    50% {
        transform: scaleX(0.5);
        opacity: 0.15
    }
}

/* ═══ MOBILE ═══ */
@media(max-width:768px) {

    /* Mobile container overrides — needed for all views */
    .fm-main {
        overflow-y: auto;
        align-items: flex-start;
    }

    .view-section {
        position: relative;
        min-height: 100%;
    }

    .hero {
        padding: 10px;
        height: auto;
        min-height: 100%;
        justify-content: space-evenly;
    }

    .video-grid {
        flex-direction: column;
        gap: 8px;
    }

    .hollow-space {
        margin: 10px 0;
    }

    /* Mobile: smaller cards so 2 cards + hollow fit without scroll */
    .vcard.card-L .thumb {
        height: min(22vh, 140px);
    }

    .vcard.card-P .thumb {
        width: min(22vh, 120px);
        height: auto;
    }

    .btn-start {
        width: 150px;
        height: 50px;
        font-size: 9px;
    }

    .btn-continuar {
        padding: 8px 22px;
        font-size: 9px;
    }
}