/* ============================================================
   AK WEB STUDIO — CINEMATIC SLIDE-IN LOADER
   Colors auto-adapt via CSS theme variables
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
#hero-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-primary, #0a0a0a);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#hero-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ── Loader Content Container ─────────────────────────────── */
.ak-loader-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    user-select: none;
}

/* ── Letters Row ──────────────────────────────────────────── */
.ak-letters-row {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    line-height: 1;
}

/* ── Individual Letter Styles ─────────────────────────────── */
.ak-letter {
    font-family: 'Outfit', 'Poppins', 'Inter', sans-serif;
    font-size: clamp(5rem, 20vw, 12rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    display: inline-block;
    position: relative;
    /* Shared shadow for depth */
    text-shadow:
        0 0 40px rgba(var(--accent-rgb, 220 38 38), 0.5),
        0 4px 20px rgba(0, 0, 0, 0.4);
}

/* "A" — accent colored, slides from left */
.ak-letter-a {
    color: var(--accent-color, #dc2626);
    transform: translateX(-150vw);
    animation: slideInLeft 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

/* "K" — text primary colored, slides from right */
.ak-letter-k {
    color: var(--text-primary, #f5f5f5);
    transform: translateX(150vw);
    animation: slideInRight 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
    margin-left: -0.05em;
    /* letters touch/overlap slightly */
}

/* ── Flash / Glow Burst ───────────────────────────────────── */
.ak-flash {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(var(--accent-rgb, 220 38 38), 0.7) 40%,
            transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: none;
}

.ak-flash.burst {
    animation: flashBurst 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Subtitle ─────────────────────────────────────────────── */
.ak-subtitle {
    font-family: 'Outfit', 'Poppins', 'Inter', sans-serif;
    font-size: clamp(0.85rem, 3vw, 1.4rem);
    font-weight: 400;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-secondary, #a3a3a3);
    opacity: 0;
    transform: translateY(16px);
    margin-top: 0.6rem;
    white-space: nowrap;
}

.ak-subtitle.visible {
    animation: subtitleReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Decorative line under letters ───────────────────────── */
.ak-divider {
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            var(--accent-color, #dc2626),
            transparent);
    border-radius: 2px;
    margin: 0.3rem 0 0.1rem;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.ak-divider.expand {
    width: 100%;
}

/* ── Ambient Glow Rings (decorative) ──────────────────────── */
.ak-glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid rgba(var(--accent-rgb, 220 38 38), 0.15);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.ak-glow-ring.ring-1 {
    width: 280px;
    height: 280px;
}

.ak-glow-ring.ring-2 {
    width: 420px;
    height: 420px;
}

.ak-glow-ring.ring-3 {
    width: 560px;
    height: 560px;
}

.ak-glow-ring.pulse {
    animation: ringPulse 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.ak-glow-ring.ring-2.pulse {
    animation-delay: 0.1s;
}

.ak-glow-ring.ring-3.pulse {
    animation-delay: 0.2s;
}

/* ── Keyframes ────────────────────────────────────────────── */
@keyframes slideInLeft {
    from {
        transform: translateX(-150vw);
        opacity: 0;
        filter: blur(8px);
    }

    60% {
        opacity: 1;
        filter: blur(0px);
    }

    to {
        transform: translateX(0);
        opacity: 1;
        filter: blur(0px);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(150vw);
        opacity: 0;
        filter: blur(8px);
    }

    60% {
        opacity: 1;
        filter: blur(0px);
    }

    to {
        transform: translateX(0);
        opacity: 1;
        filter: blur(0px);
    }
}

@keyframes flashBurst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    25% {
        transform: translate(-50%, -50%) scale(18);
        opacity: 1;
    }

    55% {
        transform: translate(-50%, -50%) scale(28);
        opacity: 0.6;
    }

    100% {
        transform: translate(-50%, -50%) scale(38);
        opacity: 0;
    }
}

@keyframes subtitleReveal {
    from {
        opacity: 0;
        transform: translateY(16px);
        letter-spacing: 0.55em;
    }

    to {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 0.35em;
    }
}

@keyframes ringPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* ── Logo Dark/Minimalist Theme Filter ───────────────────── */
[data-theme="dark_matter"] .brand-logo,
[data-theme="minimalist"] .brand-logo {
    filter: brightness(0) invert(1);
}

/* ── Toast Animation ──────────────────────────────────────── */
#toast-notification {
    will-change: transform, opacity;
}