/* ============================================================
   INTRO SPLASH — apertura de marca con impacto real.
   Tipografía Fraunces a escala real, movimiento con peso,
   salida tipo "cortina" que revela el sitio.
   ============================================================ */

#intro-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    overflow: hidden;
}

body.splash-active { overflow: hidden; }

/* Fondo: gradiente radial que respira lentamente + grano */
.splash-bg-glow {
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle at 50% 55%, rgba(198, 106, 46, 0.22) 0%, rgba(198, 106, 46, 0.05) 38%, transparent 65%);
    animation: splashBgPulse 2.4s ease-in-out infinite;
}

@keyframes splashBgPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.08); }
}

#intro-splash::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* ---------- Lockup tipográfico ---------- */
.splash-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 900px;
}

.splash-letters {
    display: flex;
    line-height: 1;
}

.splash-letters span {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(7rem, 22vw, 13rem);
    color: var(--text-on-ink);
    display: inline-block;
    opacity: 0;
    will-change: transform, opacity, filter;
}

/* J entra desde abajo-izquierda con caída de peso */
.splash-letters .l1 {
    transform: translate3d(-30px, 90px, 0) rotateZ(-8deg) scale(0.7);
    filter: blur(6px);
    animation: dropIn 0.62s cubic-bezier(0.34, 1.56, 0.64, 1) 0.08s forwards;
}

/* N entra desde abajo-derecha, ligeramente después */
.splash-letters .l2 {
    color: var(--copper-light);
    transform: translate3d(30px, 90px, 0) rotateZ(8deg) scale(0.7);
    filter: blur(6px);
    animation: dropIn 0.62s cubic-bezier(0.34, 1.56, 0.64, 1) 0.22s forwards;
}

@keyframes dropIn {
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) rotateZ(0deg) scale(1);
        filter: blur(0);
    }
}

/* Destello de luz que cruza el lockup tras el impacto de caída */
.splash-flash {
    position: absolute;
    inset: -20% -40%;
    background: linear-gradient(100deg, transparent 40%, rgba(255, 220, 190, 0.55) 50%, transparent 60%);
    opacity: 0;
    transform: translateX(-120%);
    pointer-events: none;
}

.splash-flash.run {
    animation: flashSweep 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.62s forwards;
}

@keyframes flashSweep {
    0%   { opacity: 0;   transform: translateX(-120%); }
    35%  { opacity: 1; }
    100% { opacity: 0;   transform: translateX(120%); }
}

/* Subrayado que se dibuja después del impacto */
.splash-rule {
    position: absolute;
    bottom: -14px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--copper), transparent);
    transform: translateX(-50%);
    animation: ruleGrow 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.78s forwards;
}

@keyframes ruleGrow {
    to { width: 180px; }
}

/* Tagline */
.splash-tag {
    position: absolute;
    bottom: -42px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-on-ink-dim);
    opacity: 0;
    white-space: nowrap;
    animation: tagFadeIn 0.4s ease 0.95s forwards;
}

@keyframes tagFadeIn {
    to { opacity: 1; }
}

/* ---------- Salida tipo cortina: dos paneles que se abren ---------- */
.splash-curtain {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    display: flex;
}

.splash-curtain-panel {
    flex: 1;
    background: var(--ink);
}

#intro-splash.exit .splash-inner {
    animation: lockupExit 0.5s cubic-bezier(0.6, 0, 0.4, 1) forwards;
}

@keyframes lockupExit {
    to { opacity: 0; transform: scale(0.94); filter: blur(4px); }
}

#intro-splash.exit .splash-bg-glow,
#intro-splash.exit::after {
    animation: simpleFade 0.4s ease forwards;
}

@keyframes simpleFade {
    to { opacity: 0; }
}

.splash-curtain.run .splash-curtain-panel:nth-child(1) {
    animation: curtainLeft 0.65s cubic-bezier(0.76, 0, 0.24, 1) 0.15s forwards;
}
.splash-curtain.run .splash-curtain-panel:nth-child(2) {
    animation: curtainRight 0.65s cubic-bezier(0.76, 0, 0.24, 1) 0.15s forwards;
}

@keyframes curtainLeft  { to { transform: translateX(-100%); } }
@keyframes curtainRight { to { transform: translateX(100%); } }

@media (max-width: 700px) {
    .splash-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    #intro-splash, .splash-curtain { display: none; }
}
