/* Al-tawakkal-poultryfarm — animated SVG crest loader */

html:has(.at-load:not(.is-exit)) {
    overflow-x: hidden;
}

.at-load {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 40%, rgba(240, 196, 90, 0.3), transparent 42%),
        radial-gradient(circle at 18% 80%, rgba(62, 140, 255, 0.18), transparent 40%),
        linear-gradient(165deg, #0a2a62 0%, #061530 55%, #0c3a7a 100%);
}

.at-load-stage {
    display: grid;
    justify-items: center;
    width: min(300px, 88vw);
}

.at-load-3d {
    position: relative;
    width: 220px;
    height: 220px;
    perspective: 900px;
    transform-style: preserve-3d;
}

.at-load-glow {
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 220, 130, 0.65), rgba(240, 196, 90, 0.1) 55%, transparent 72%);
    filter: blur(10px);
    animation: atLoadGlow 2s ease-in-out infinite;
}

.at-load-ring {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #ffe08a;
    border-right-color: rgba(62, 224, 138, 0.85);
    box-shadow: 0 0 22px rgba(240, 196, 90, 0.25);
}

.at-load-ring.r1 { animation: atLoadSpin3d 2.2s linear infinite; }

.at-load-ring.r2 {
    inset: 12px;
    border-top-color: #3ee08a;
    border-right-color: #ffe08a;
    animation: atLoadSpin3dRev 2.8s linear infinite;
}

.at-load-orbit {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

.at-load-orbit i {
    position: absolute;
    top: 0;
    left: 50%;
    width: 12px;
    height: 16px;
    margin-left: -6px;
    border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
    background: linear-gradient(180deg, #fff8e0 0%, #f0c45a 48%, #b07818 100%);
    box-shadow:
        inset -2px -3px 4px rgba(80, 40, 0, 0.35),
        inset 2px 2px 3px rgba(255, 255, 255, 0.7),
        0 6px 10px rgba(0, 0, 0, 0.3);
}

.at-load-orbit.o1 { animation: atLoadOrbit 2.4s linear infinite; }
.at-load-orbit.o2 { animation: atLoadOrbit 3s linear infinite reverse; }

.at-load-logo {
    position: absolute;
    top: 25px;
    left: 25px;
    width: 170px;
    height: 170px;
    overflow: visible;
    filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.45));
    animation:
        atLogoIn 0.7s cubic-bezier(0.2, 1.3, 0.4, 1) both,
        atLogoTilt 3.2s ease-in-out 0.7s infinite;
}

.at-load-logo g,
.at-load-logo ellipse,
.at-load-logo circle,
.at-load-logo rect {
    transform-box: fill-box;
    transform-origin: center;
}

.at-load-logo .lg-draw {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: atDraw 0.9s ease-out 0.1s forwards;
}

.at-load-logo .lg-sun { animation: atSun 2.4s ease-in-out infinite; }

.at-load-logo .lg-roof {
    transform-origin: center bottom;
    animation: atRise 0.45s ease-out 0.15s both;
}

.at-load-logo .lg-rooster {
    transform-origin: center bottom;
    animation: atPopUp 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 0.25s both;
}

.at-load-logo .lg-banner { animation: atStretch 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) 0.35s both; }
.at-load-logo .lg-ribbon { animation: atStretch 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) 0.45s both; }

.at-load-logo .lg-hen { animation: atSlideIn 0.5s ease-out 0.4s both; }

.at-load-logo .lg-hen-head {
    transform-origin: 30% 90%;
    animation: atPeck 1.4s ease-in-out 1s infinite;
}

.at-load-logo .lg-basket { animation: atRise 0.4s ease-out 0.45s both; }

.at-load-logo .lg-eggs ellipse { animation: atEggDrop 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.at-load-logo .lg-eggs .e1 { animation-delay: 0.55s; }
.at-load-logo .lg-eggs .e2 { animation-delay: 0.62s; }
.at-load-logo .lg-eggs .e3 { animation-delay: 0.69s; }
.at-load-logo .lg-eggs .e4 { animation-delay: 0.76s; }
.at-load-logo .lg-eggs .e5 { animation-delay: 0.83s; }

.at-load-logo .lg-chick { transform-origin: center bottom; }
.at-load-logo .lg-chick.c1 { animation: atHop 0.9s ease-in-out 0.6s infinite; }
.at-load-logo .lg-chick.c2 { animation: atHop 0.9s ease-in-out 0.85s infinite; }

.at-load-logo .lg-shine {
    transform-box: view-box;
    animation: atShine 2.4s ease-in-out 0.9s infinite;
}

.at-load-name {
    margin: 14px 0 12px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-align: center;
    background: linear-gradient(100deg, #fff6d8, #ffe08a, #fff, #f0b429, #fff6d8);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: atLoadName 2.8s ease-in-out infinite;
}

.at-load-bar {
    display: block;
    width: 180px;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.at-load-bar i {
    display: block;
    width: 38%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3ee08a, #ffe08a, #fff6d8);
    animation: atLoadBar 1.4s ease-in-out infinite;
}

.at-load.is-exit {
    pointer-events: none;
    opacity: 0;
    transform: scale(1.04);
    filter: blur(8px);
    transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
}

.at-load.is-done { visibility: hidden; }

@keyframes atLoadGlow {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
}

@keyframes atLoadSpin3d {
    from { transform: rotateX(64deg) rotateZ(0deg); }
    to { transform: rotateX(64deg) rotateZ(360deg); }
}

@keyframes atLoadSpin3dRev {
    from { transform: rotateX(72deg) rotateY(16deg) rotateZ(360deg); }
    to { transform: rotateX(72deg) rotateY(16deg) rotateZ(0deg); }
}

@keyframes atLoadOrbit {
    from { transform: rotateX(66deg) rotateZ(0deg); }
    to { transform: rotateX(66deg) rotateZ(360deg); }
}

@keyframes atLogoIn {
    from { opacity: 0; transform: scale(0.55) rotateY(-70deg); }
    to { opacity: 1; transform: scale(1) rotateY(0); }
}

@keyframes atLogoTilt {
    0%, 100% { transform: rotateY(-10deg) rotateX(4deg) translateY(0); }
    50% { transform: rotateY(10deg) rotateX(-3deg) translateY(-4px); }
}

@keyframes atDraw { to { stroke-dashoffset: 0; } }

@keyframes atSun {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.18); }
}

@keyframes atRise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes atPopUp {
    from { opacity: 0; transform: scale(0.3) translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes atStretch {
    from { opacity: 0; transform: scaleX(0.2); }
    to { opacity: 1; transform: none; }
}

@keyframes atSlideIn {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: none; }
}

@keyframes atPeck {
    0%, 60%, 100% { transform: rotate(0); }
    70% { transform: rotate(14deg); }
    80% { transform: rotate(0); }
    88% { transform: rotate(10deg); }
}

@keyframes atEggDrop {
    from { opacity: 0; transform: translateY(-18px) scale(0.6); }
    to { opacity: 1; transform: none; }
}

@keyframes atHop {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px) rotate(-6deg); }
    60% { transform: translateY(0); }
}

@keyframes atShine {
    0% { transform: skewX(-18deg) translateX(0); }
    60%, 100% { transform: skewX(-18deg) translateX(320px); }
}

@keyframes atLoadName {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

@keyframes atLoadBar {
    0% { transform: translateX(-130%); }
    100% { transform: translateX(260%); }
}

@media (max-width: 340px) {
    .at-load-3d { transform: scale(0.85); }
}

@media (prefers-reduced-motion: reduce) {
    .at-load-glow,
    .at-load-ring,
    .at-load-orbit,
    .at-load-logo,
    .at-load-logo *,
    .at-load-name,
    .at-load-bar i {
        animation: none !important;
    }
    .at-load-logo .lg-draw { stroke-dashoffset: 0; }
    .at-load.is-exit { transition: none; }
}
