﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --saffron: #FF9933;
    --green: #138808;
    --navy: #000080;
    --bg: #f0f2f5;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: #1a1a2e;
}

/* ===== PRELOADER ===== */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.9s cubic-bezier(0.65, 0, 0.35, 1), visibility 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}

    .preloader.done {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

/* Ambient glow orbs */
.preloader-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0;
    animation: orbReveal 1.2s ease-out forwards;
}

    .preloader-orb.saffron {
        width: 400px;
        height: 400px;
        background: radial-gradient(circle, rgba(255, 153, 51, 0.22), transparent 70%);
        top: 10%;
        left: 15%;
        animation-delay: 0.1s;
    }

    .preloader-orb.green {
        width: 350px;
        height: 350px;
        background: radial-gradient(circle, rgba(19, 136, 8, 0.18), transparent 70%);
        bottom: 10%;
        right: 15%;
        animation-delay: 0.25s;
    }

@keyframes orbReveal {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Chakra Stage */
.chakra-stage {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.6);
    animation: stageReveal 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

/* Outer ring — SVG progress */
.progress-ring {
    position: absolute;
    inset: -12px;
    transform: rotate(-90deg);
}

.progress-ring-track {
    fill: none;
    stroke: rgba(0, 0, 0, 0.06);
    stroke-width: 1.5;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#ringGradient);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 628;
    stroke-dashoffset: 628;
    animation: ringDraw 2.8s cubic-bezier(0.45, 0, 0.15, 1) 0.6s forwards;
}

@keyframes ringDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Decorative dashes */
.ring-dashes {
    position: absolute;
    inset: -28px;
    animation: slowRotate 20s linear infinite;
}

    .ring-dashes svg {
        width: 100%;
        height: 100%;
    }

.dash {
    fill: rgba(0, 0, 0, 0.08);
}

@keyframes slowRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Chakra image */
.chakra-img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(0, 0, 128, 0.15)) drop-shadow(0 0 60px rgba(0, 0, 128, 0.08));
    animation: chakraRotate 12s linear infinite, chakraPulse 3s ease-in-out infinite;
}

@keyframes chakraRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes chakraPulse {

    0%, 100% {
        filter: drop-shadow(0 0 30px rgba(0, 0, 128, 0.15)) drop-shadow(0 0 60px rgba(0, 0, 128, 0.08));
    }

    50% {
        filter: drop-shadow(0 0 45px rgba(0, 0, 128, 0.25)) drop-shadow(0 0 80px rgba(0, 0, 128, 0.12));
    }
}

/* Saffron & Green accent bars */
.accent-bar {
    position: absolute;
    height: 1px;
    border-radius: 1px;
    opacity: 0;
}

    .accent-bar.top {
        top: -50px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        background: linear-gradient(90deg, transparent, var(--saffron), transparent);
        animation: barExpand 1s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
    }

    .accent-bar.bottom {
        bottom: -50px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        background: linear-gradient(90deg, transparent, var(--green), transparent);
        animation: barExpand 1s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards;
    }

@keyframes barExpand {
    from {
        width: 0;
        opacity: 0;
    }

    to {
        width: 140px;
        opacity: 0.6;
    }
}

/* Brand text */
.preloader-brand {
    margin-top: 56px;
    text-align: center;
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards;
}

    .preloader-brand h2 {
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 6px;
        text-transform: uppercase;
        color: rgba(26, 26, 46, 0.85);
        margin-bottom: 8px;
    }

    .preloader-brand .brand-line {
        width: 40px;
        height: 2px;
        background: linear-gradient(90deg, var(--saffron), var(--green));
        margin: 0 auto 12px;
        border-radius: 2px;
        transform: scaleX(0);
        animation: lineGrow 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.9s forwards;
    }

    .preloader-brand p {
        font-size: 11px;
        font-weight: 400;
        letter-spacing: 4px;
        text-transform: uppercase;
        color: rgba(26, 26, 46, 0.35);
    }

/* Loading percentage */
.preloader-pct {
    position: absolute;
    bottom: 60px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    color: rgba(26, 26, 46, 0.25);
    font-variant-numeric: tabular-nums;
    opacity: 0;
    animation: fadeUp 0.6s ease-out 1s forwards;
}

@keyframes stageReveal {
    from {
        opacity: 0;
        transform: scale(0.6);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lineGrow {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

/* Exit animation enhancements */
.preloader.done .chakra-stage {
    animation: stageExit 0.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.preloader.done .preloader-brand {
    animation: fadeOut 0.5s ease-out forwards;
}

.preloader.done .preloader-orb {
    animation: orbFade 0.8s ease-out forwards;
}

@keyframes stageExit {
    to {
        opacity: 0;
        transform: scale(1.15);
        filter: blur(8px);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes orbFade {
    to {
        opacity: 0;
        transform: scale(1.3);
    }
}

/* Demo content */
.demo-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

    .demo-hero h1 {
        font-size: clamp(36px, 6vw, 72px);
        font-weight: 800;
        background: linear-gradient(135deg, #1a1a2e 30%, rgba(26, 26, 46, 0.5));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        margin-bottom: 16px;
        letter-spacing: -2px;
    }

    .demo-hero p {
        font-size: 18px;
        color: rgba(26, 26, 46, 0.45);
        max-width: 500px;
        line-height: 1.6;
    }
