/* ==========================================================================
   CINEMATIC INTRO — SABORATOR (HAUTE GASTRONOMIE & GESTIÓN)
   Orchestrated SVG Physics, Multilayer Lighting & Velvet Atmosphere
   ========================================================================== */

.cinematic-intro {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse 90% 80% at 50% 45%, #250A10 0%, #140508 60%, #0A0204 100%);
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transition: opacity 700ms cubic-bezier(0.23, 1, 0.32, 1),
                visibility 700ms cubic-bezier(0.23, 1, 0.32, 1),
                filter 700ms cubic-bezier(0.23, 1, 0.32, 1),
                transform 700ms cubic-bezier(0.23, 1, 0.32, 1);
    will-change: opacity, transform, filter;
    contain: strict;
}

.cinematic-intro.intro-hiding {
    opacity: 0;
    filter: blur(14px);
    transform: scale(1.03);
    pointer-events: none;
}

.cinematic-intro.intro-done {
    display: none !important;
}

/* Ambient Dust / Stardust particles */
.intro-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: 
        radial-gradient(1px 1px at 20% 30%, rgba(244, 168, 23, 0.35) 1px, transparent 0),
        radial-gradient(1px 1px at 40% 70%, rgba(255, 255, 255, 0.25) 1px, transparent 0),
        radial-gradient(1.5px 1.5px at 75% 25%, rgba(244, 168, 23, 0.4) 1px, transparent 0),
        radial-gradient(1px 1px at 85% 65%, rgba(255, 255, 255, 0.2) 1px, transparent 0),
        radial-gradient(1.5px 1.5px at 30% 85%, rgba(244, 168, 23, 0.3) 1px, transparent 0);
    background-size: 300px 300px;
    opacity: 0.6;
    animation: ambientFloat 20s linear infinite;
}

@keyframes ambientFloat {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-300px); }
}

/* Central Stage Glow */
.intro-spotlight {
    position: absolute;
    width: min(650px, 90vw);
    height: min(650px, 90vw);
    background: radial-gradient(circle, rgba(244, 168, 23, 0.16) 0%, rgba(107, 66, 38, 0.22) 45%, transparent 72%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    transform: scale(0.85);
    animation: spotlightBreathe 4s ease-in-out infinite alternate;
}

@keyframes spotlightBreathe {
    0%   { transform: scale(0.85); opacity: 0.7; }
    100% { transform: scale(1.05); opacity: 1; }
}

/* Stage Container */
.intro-stage {
    position: relative;
    width: min(520px, 92vw);
    height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    perspective: 1000px;
}

/* ── SVG THE CLOCHE SCENE ───────────────────────────────── */
.cloche-scene {
    position: relative;
    width: 280px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-stage {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Cloche Dome Group (Animates Upward with organic momentum) */
.cloche-dome-group {
    transform-origin: 140px 145px;
    animation: clocheLevitate 4.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

@keyframes clocheLevitate {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    12% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    30% {
        /* Anticipation settle */
        transform: translateY(2px) rotate(0deg);
        opacity: 1;
    }
    48% {
        /* Smooth, elegant lift */
        transform: translateY(-75px) rotate(-4.5deg);
        opacity: 1;
    }
    75% {
        /* Floating hold with subtle drift */
        transform: translateY(-90px) rotate(-3deg);
        opacity: 0.95;
    }
    90% {
        /* Dissolving gracefully */
        transform: translateY(-110px) rotate(-1.5deg) scale(1.04);
        opacity: 0;
    }
    100% {
        transform: translateY(-120px) scale(1.08);
        opacity: 0;
    }
}

/* Light beam sweep over metallic cloche */
.cloche-sheen {
    animation: sheenSweep 4.2s ease-in-out forwards;
}

@keyframes sheenSweep {
    0%, 20% { opacity: 0; transform: translateX(-40px); }
    32%     { opacity: 0.8; transform: translateX(10px); }
    45%     { opacity: 0.2; transform: translateX(50px); }
    100%    { opacity: 0; }
}

/* Base Platter Glow and Shadow */
.platter-shadow {
    animation: shadowDilate 4.2s ease forwards;
}

@keyframes shadowDilate {
    0%, 25% { transform: scale(1); opacity: 0.6; }
    50%     { transform: scale(0.9); opacity: 0.35; }
    85%     { transform: scale(1.1); opacity: 0; }
    100%    { opacity: 0; }
}

/* ── REVEALED GASTRONOMIC EMBLEM ───────────────────────── */
.emblem-reveal {
    position: absolute;
    top: 66px;   /* debajo de la tapa cuando sube, para que no se encimen */
    width: 74px;
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center;
    animation: emblemRise 4.2s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
    will-change: transform, opacity, filter;
}

@keyframes emblemRise {
    0%, 44% {
        opacity: 0;
        transform: translateY(22px) scale(0.65);
        filter: blur(10px) brightness(1.8);
    }
    58% {
        opacity: 1;
        transform: translateY(-2px) scale(1.05);
        filter: blur(0px) brightness(1.2);
    }
    68% {
        transform: translateY(0px) scale(1);
        filter: brightness(1);
    }
    85% {
        transform: translateY(-4px) scale(1.03);
        opacity: 1;
    }
    100% {
        transform: translateY(-12px) scale(1.1);
        opacity: 0;
    }
}

/* Radiant Aura behind Emblem */
.emblem-halo {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 168, 23, 0.5) 0%, rgba(244, 168, 23, 0.15) 45%, transparent 70%);
    animation: haloPulse 4.2s ease forwards;
    pointer-events: none;
}

@keyframes haloPulse {
    0%, 30% { opacity: 0; transform: scale(0.4); }
    50%     { opacity: 0.9; transform: scale(1.15); }
    70%     { opacity: 0.7; transform: scale(1); }
    90%     { opacity: 0; transform: scale(1.6); }
    100%    { opacity: 0; }
}

/* Shockwave Ring Expanding */
.shockwave-ring {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 1.5px solid rgba(244, 168, 23, 0.7);
    opacity: 0;
    pointer-events: none;
    animation: shockwaveExpand 4.2s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

@keyframes shockwaveExpand {
    0%, 42% {
        opacity: 0;
        transform: scale(0.6);
        border-color: rgba(255, 255, 255, 0.9);
    }
    48% {
        opacity: 0.85;
    }
    75% {
        opacity: 0;
        transform: scale(3.2);
        border-color: rgba(244, 168, 23, 0);
    }
    100% {
        opacity: 0;
        transform: scale(3.8);
    }
}

/* ── BRAND TYPOGRAPHY TITLE ────────────────────────────── */
.intro-brand-wrap {
    margin-top: 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.intro-brand-title {
    font-family: 'Bebas Neue', 'Inter', system-ui, sans-serif;
    font-size: clamp(3.2rem, 11vw, 5.6rem);   /* se adapta al ancho: ~50 px en móvil, ~90 px en escritorio */
    font-weight: 400;
    letter-spacing: 0.08em;
    color: #FFFFFF;
    margin: 0;
    line-height: 1;
    text-shadow: 0 4px 24px rgba(244, 168, 23, 0.35);
    animation: brandTitleReveal 4.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity, letter-spacing;
}

.intro-brand-title span {
    color: #F4C95D;
    background: linear-gradient(135deg, #FFFFFF 20%, #F4C95D 60%, #F4A817 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes brandTitleReveal {
    0%, 40% {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
        letter-spacing: 0.18em;
        filter: blur(8px);
    }
    58% {
        opacity: 1;
        transform: translateY(0) scale(1);
        letter-spacing: 0.08em;
        filter: blur(0px);
    }
    82% {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 0.09em;
    }
    100% {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.intro-brand-sub {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.9rem, 2.6vw, 1.05rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 92vw;
    padding-inline: 0.5rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: brandSubReveal 4.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.intro-brand-sub::before,
.intro-brand-sub::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1px;
    background: rgba(244, 168, 23, 0.45);
}

@keyframes brandSubReveal {
    0%, 50% {
        opacity: 0;
        transform: translateY(10px);
    }
    66% {
        opacity: 0.9;
        transform: translateY(0);
    }
    82% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translateY(-5px);
    }
}

/* ── SKIP BUTTON (TACTILE & DISCREET) ──────────────────── */
.intro-skip-btn {
    position: absolute;
    top: 2rem;
    right: 2.25rem;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.45rem 0.95rem;
    border-radius: 9999px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: background-color 160ms var(--ease, ease),
                border-color 160ms var(--ease, ease),
                color 160ms var(--ease, ease),
                transform 140ms var(--ease, ease);
    animation: skipFadeIn 1s ease 1s backwards;
}

@keyframes skipFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) and (pointer: fine) {
    .intro-skip-btn:hover {
        background: rgba(255, 255, 255, 0.16);
        border-color: rgba(244, 168, 23, 0.5);
        color: #FFFFFF;
        transform: translateY(-1px);
    }
}

.intro-skip-btn:active {
    transform: scale(0.96);
}

.intro-skip-kbd {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Aviso de salto: en pantallas táctiles no existe la tecla Esc, así que se pide tocar la pantalla */
.intro-skip-hint {
    display: none;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
}

@media (hover: none), (pointer: coarse) {
    .intro-skip-kbd { display: none; }
    .intro-skip-hint { display: inline; }
    .intro-skip-btn {
        top: calc(1rem + env(safe-area-inset-top, 0px));
        right: 1rem;
        min-height: 44px;
        padding: 0.55rem 1.1rem;
        font-size: 0.85rem;
    }
    .cinematic-intro { cursor: pointer; }
}

/* ── PROGRESS RING ON SKIP ─────────────────────────────── */
.skip-timer-ring {
    width: 14px;
    height: 14px;
    transform: rotate(-90deg);
}

.skip-timer-circle {
    fill: none;
    stroke: var(--gold, #F4A817);
    stroke-width: 2.2;
    stroke-dasharray: 38;
    stroke-dashoffset: 38;
    animation: timerDrain 4.2s linear forwards;
}

@keyframes timerDrain {
    0%   { stroke-dashoffset: 38; }
    100% { stroke-dashoffset: 0; }
}

/* ── REPLAY BUTTON LINK IN FOOTER ──────────────────────── */
.replay-intro-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: var(--muted, #7B6249);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: color 150ms ease, background-color 150ms ease;
}

.replay-intro-btn svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
}

@media (hover: hover) and (pointer: fine) {
    .replay-intro-btn:hover {
        color: var(--brand, #6B4226);
        background: rgba(107, 66, 38, 0.05);
    }
}

/* ── ACCESSIBILITY (PREFERS-REDUCED-MOTION) ─────────────── */
@media (prefers-reduced-motion: reduce) {
    .cinematic-intro {
        display: none !important;
    }
}
