/* ========== PAGE LOADER ========== */
.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 6, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 800ms ease-out, visibility 800ms ease-out;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    animation: fadeInLoader 800ms ease-out 300ms forwards;
}

@keyframes fadeInLoader {
    to {
        opacity: 1;
    }
}

/* ========== LOGO TEXT ANIMATION ========== */
.loader-logo {
    margin-bottom: 40px;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(48px, 8vw, 84px);
    font-weight: 700;
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 30px;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(-100px) rotateX(-90deg);
    animation: letterDrop 800ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: var(--delay);
    text-shadow: 0 4px 20px currentColor;
}

.letter-green {
    color: #5c7f4a;
    filter: drop-shadow(0 0 20px rgba(92, 127, 74, 0.6));
}

.letter-orange {
    color: #d2a75b;
    filter: drop-shadow(0 0 20px rgba(210, 167, 91, 0.6));
}

@keyframes letterDrop {
    0% {
        opacity: 0;
        transform: translateY(-100px) rotateX(-90deg) scale(0.5);
    }
    70% {
        transform: translateY(10px) rotateX(10deg) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
    }
}

/* Hover effect on letters */
.letter {
    cursor: default;
    transition: all 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.letter:hover {
    transform: translateY(-10px) scale(1.2);
    filter: drop-shadow(0 0 30px currentColor);
}

/* ========== OLIVE BRANCH ANIMATION ========== */
.loader-branch {
    opacity: 0;
    animation: branchFadeIn 1000ms ease-out 1.2s forwards;
}

@keyframes branchFadeIn {
    to {
        opacity: 1;
    }
}

.branch-svg {
    width: 200px;
    height: 60px;
    margin: 0 auto;
    display: block;
}

.branch-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: drawBranch 2s ease-out 1.2s forwards;
}

@keyframes drawBranch {
    to {
        stroke-dashoffset: 0;
    }
}

.olive {
    opacity: 0;
    transform: scale(0);
    animation: oliveGrow 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.olive-1 {
    animation-delay: 1.8s;
}

.olive-2 {
    animation-delay: 2.0s;
}

.olive-3 {
    animation-delay: 2.2s;
}

.olive-4 {
    animation-delay: 2.4s;
}

@keyframes oliveGrow {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    70% {
        transform: scale(1.3);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== LOADING BAR ========== */
.loader-bar {
    width: 280px;
    height: 4px;
    background: rgba(134, 183, 106, 0.15);
    border-radius: 999px;
    overflow: hidden;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(134, 183, 106, 0.2);
}

.loader-progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #5c7f4a, #86b76a, #d2a75b);
    background-size: 200% 100%;
    border-radius: 999px;
    animation: progressBar 3s ease-out forwards, progressGlow 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(134, 183, 106, 0.8);
}

@keyframes progressBar {
    to {
        width: 100%;
    }
}

@keyframes progressGlow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 0 20px rgba(134, 183, 106, 0.8);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 30px rgba(134, 183, 106, 1);
    }
}

/* ========== LOADING TEXT ========== */
.loader-text {
    font-size: 14px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(134, 183, 106, 0.8);
    opacity: 0;
    animation: textPulse 2s ease-in-out 1s infinite;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* ========== BACKGROUND DECORATION ========== */
.loader-decoration {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.deco-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(134, 183, 106, 0.1);
}

.deco-ring:nth-child(1) {
    width: 300px;
    height: 300px;
    animation: ringRotate1 20s linear infinite;
}

.deco-ring:nth-child(2) {
    width: 500px;
    height: 500px;
    border-style: dashed;
    animation: ringRotate2 25s linear infinite reverse;
    opacity: 0.6;
}

.deco-ring:nth-child(3) {
    width: 700px;
    height: 700px;
    animation: ringRotate1 30s linear infinite;
    opacity: 0.3;
}

@keyframes ringRotate1 {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ringRotate2 {
    to {
        transform: rotate(-360deg);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 720px) {
    .logo-text {
        font-size: 42px;
        gap: 2px;
    }
    
    .loader-bar {
        width: 220px;
    }
    
    .branch-svg {
        width: 160px;
        height: 50px;
    }
    
    .deco-ring:nth-child(2),
    .deco-ring:nth-child(3) {
        display: none;
    }
}