/* ==========================================================================
   Intro Splash — Cinematic Preloader
   Ported from the React "IntroSplash" component into plain CSS/JS
   Uses the site's existing design tokens (--bg-base, --saffron, --gold, etc.)
   ========================================================================== */

#intro-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    color: var(--text-primary);
    overflow: hidden;
    transition: opacity 1s cubic-bezier(0.76, 0, 0.24, 1),
                transform 1s cubic-bezier(0.76, 0, 0.24, 1);
}

/* Faint moving grid background, matches hero mesh */
#intro-splash::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,107,26,0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,107,26,0.08) 1px, transparent 1px);
    background-size: 4rem 4rem;
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 70%, transparent 100%);
    mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 70%, transparent 100%);
    opacity: 0.6;
}

/* Glowing depth circles */
#intro-splash .intro-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
}
#intro-splash .intro-glow-1 {
    width: 30rem;
    height: 30rem;
    background: rgba(255, 107, 26, 0.12);
    filter: blur(120px);
}
#intro-splash .intro-glow-2 {
    width: 20rem;
    height: 20rem;
    background: rgba(245, 166, 35, 0.12);
    filter: blur(100px);
}

/* Exit state — cinematic upward fade, triggered by JS adding this class */
#intro-splash.intro-exit {
    opacity: 0;
    transform: translateY(-100vh);
}

.intro-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 36rem;
    width: 100%;
    padding: 0 1.5rem;
}

/* 1. Logo entrance */
.intro-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    opacity: 0;
    transform: scale(0.3) rotate(-180deg);
    transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1),
                transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.intro-logo-wrap.show {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}
.intro-logo-wrap img {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    box-shadow: var(--shadow-glow);
}

/* 2. Company name — letter cascade */
.intro-name-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 100px;
    width: 100%;
    text-align: center;
}
.intro-name-wrap h1 {
    font-family: var(--font-head);
    font-size: clamp(1.9rem, 5vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -0.01em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.15;
}
.intro-name-wrap .line1,
.intro-name-wrap .line2 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.intro-name-wrap .line1 {
    background: linear-gradient(90deg, var(--saffron-light), #fff, var(--gold-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.intro-name-wrap .line2 {
    background: var(--grad-saffron);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.intro-letter {
    display: inline-block;
    opacity: 0;
    filter: blur(4px);
    transform: translateX(70px);
    transition: opacity 0.5s ease, filter 0.5s ease, transform 0.55s cubic-bezier(0.16,1,0.3,1);
    will-change: transform, opacity;
}
.intro-letter.show {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
}

/* 3. Tagline + progress bar */
.intro-tagline-wrap {
    margin-top: 3rem;
    height: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.intro-tagline-wrap.show {
    opacity: 1;
    transform: translateY(0);
}
.intro-tagline-wrap p {
    font-family: var(--font-body);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: var(--text-secondary);
    font-weight: 600;
}
.intro-tagline-wrap p span {
    color: var(--saffron);
    font-weight: 800;
}
.intro-progress-track {
    width: 12rem;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 999px;
    margin-top: 1rem;
    overflow: hidden;
}
.intro-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--grad-saffron);
    transition: width 0.6s ease-in-out;
}
.intro-tagline-wrap.show .intro-progress-fill {
    width: 100%;
}

/* Skip button */
#intro-skip-btn {
    position: absolute;
    bottom: 2.5rem;
    right: 2.5rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(8px);
    font-family: var(--font-body);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.75;
    cursor: pointer;
    transition: var(--t-base);
    z-index: 2;
}
#intro-skip-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-glow);
    transform: scale(1.05);
}

/* Main site: hidden + faded until intro completes, then revealed */
body.intro-active #main-site-wrapper {
    opacity: 0;
}
#main-site-wrapper {
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

/* Respect reduced motion preference: skip animation instantly */
@media (prefers-reduced-motion: reduce) {
    #intro-splash { display: none !important; }
    body.intro-active #main-site-wrapper { opacity: 1 !important; }
}

@media (max-width: 640px) {
    .intro-logo-wrap img { width: 190px; height: 190px; }
    #intro-skip-btn { bottom: 1.5rem; right: 1.5rem; }
}
