/**
 * Sunny Days Starter - Page loader (hero sun on logo → morph)
 */

html.sds-preload,
html.sds-preload body {
    background: #0A2E5C;
}

html.sds-preload body {
    overflow: hidden;
}

.sds-loader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0A2E5C;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

.sds-loader__wash {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: #0A2E5C;
}

.sds-loader__wash-layer {
    position: absolute;
    inset: -8%;
    filter: blur(56px);
}

.sds-loader__wash-layer--a {
    background:
        radial-gradient(ellipse 120vw 110vh at 50% 46%, #F7FBFF 0%, #EAF1FB 22%, #61A1D5 52%, #2970C5 74%, transparent 92%);
    animation: sds-loader-wash-a 9s ease-in-out infinite;
}

.sds-loader__wash-layer--b {
    background:
        radial-gradient(ellipse 118vw 108vh at 48% 48%, #F4F9FD 0%, #DEE9F5 22%, #609FE3 50%, #1562B5 72%, transparent 92%);
    opacity: 0;
    animation: sds-loader-wash-b 9s ease-in-out infinite;
}

.sds-loader__wash-layer--c {
    background:
        radial-gradient(ellipse 122vw 112vh at 52% 44%, #F7FBFF 0%, #E4EEF7 22%, #3E81C9 50%, #1E5AA8 72%, transparent 92%);
    opacity: 0;
    animation: sds-loader-wash-c 9s ease-in-out infinite;
}

.sds-loader__wash::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 100% 100% at 50% 50%,
        transparent 0%,
        transparent 78%,
        rgba(10, 46, 92, 0.22) 90%,
        #0A2E5C 100%
    );
}

.sds-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.sds-loader__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sds-loader__mark {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.sds-loader__logo {
    position: relative;
    z-index: 1;
    height: 180px;
    width: auto;
    max-width: 240px;
    display: block;
    opacity: 0;
    filter: blur(10px);
    transform: scale(0.78);
}

.sds-loader__sun {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 420px;
    height: 420px;
    z-index: 2;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(2.2);
    transform-origin: center;
    filter: blur(22px);
    animation: sds-loader-sun-settle 2.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.sds-loader__sun-body {
    position: absolute;
    inset: 0;
    animation: sds-loader-sun-dance 1.65s ease-in-out infinite;
}

.sds-loader__sun-haze {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 220px;
    height: 220px;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(255, 236, 170, 0.55) 32%,
        rgba(255, 214, 64, 0.18) 58%,
        transparent 76%
    );
    filter: blur(26px);
}

.sds-loader__sun-rays {
    position: absolute;
    inset: 0;
    z-index: 1;
    animation: sds-loader-sun-rotate 18s linear infinite;
}

.sds-loader__spoke {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    transform: rotate(var(--angle));
}

.sds-loader__ray {
    position: absolute;
    left: 50%;
    bottom: 36px;
    width: 8px;
    height: calc(178px * var(--len));
    margin-left: -4px;
    border-radius: 100px;
    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.7) 18%,
        rgba(255, 255, 255, 0.32) 55%,
        rgba(255, 255, 255, 0.06) 82%,
        transparent 100%
    );
    filter: blur(9px);
}

.sds-loader__ray::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 22px;
    height: 42%;
    margin-left: -11px;
    border-radius: 50%;
    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 0.45) 0%,
        rgba(255, 255, 255, 0.12) 60%,
        transparent 100%
    );
    filter: blur(12px);
}

.sds-loader__ray--soft {
    width: 14px;
    margin-left: -7px;
    filter: blur(14px);
    opacity: 0.75;
}

.sds-loader__ray--soft::before {
    width: 28px;
    margin-left: -14px;
    height: 55%;
    filter: blur(16px);
}

.sds-loader__ray--shoot {
    width: 7px;
    margin-left: -3.5px;
    transform-origin: 50% 100%;
    filter: blur(10px);
    animation: sds-loader-ray-shoot var(--dur, 1.15s) ease-out infinite;
    animation-delay: var(--delay, 0s);
}

.sds-loader__ray--shoot::before {
    display: none;
}

.sds-loader__ray--gold {
    background: linear-gradient(
        to top,
        rgba(255, 214, 64, 0.28) 0%,
        rgba(255, 208, 70, 0.85) 16%,
        rgba(255, 224, 110, 0.4) 54%,
        rgba(255, 224, 110, 0.1) 78%,
        transparent 100%
    );
}

.sds-loader__ray--gold::before {
    background: linear-gradient(
        to top,
        rgba(255, 214, 64, 0.75) 0%,
        rgba(255, 224, 110, 0.3) 55%,
        transparent 100%
    );
}

.sds-loader__sun-core {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.92) 16%,
        rgba(255, 242, 190, 0.75) 34%,
        rgba(255, 214, 64, 0.32) 52%,
        rgba(253, 206, 44, 0.1) 68%,
        transparent 80%
    );
    filter: blur(34px);
    animation: sds-loader-sun-pulse 1.35s ease-in-out infinite;
}

.sds-loader__percent {
    margin-top: 12px;
    font-family: Roboto, system-ui, sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #0A2E5C;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.sds-loader__percent-suffix {
    margin-left: 1px;
}

.sds-loader--reveal .sds-loader__sun {
    animation: sds-loader-sun-morph 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.sds-loader--reveal .sds-loader__sun-body,
.sds-loader--reveal .sds-loader__sun-core,
.sds-loader--reveal .sds-loader__sun-rays,
.sds-loader--reveal .sds-loader__ray--shoot {
    animation-play-state: paused;
}

.sds-loader--reveal .sds-loader__logo {
    animation: sds-loader-logo-in 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sds-loader-wash-a {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(5%, -4%) scale(1.08);
        opacity: 0.7;
    }
}

@keyframes sds-loader-wash-b {
    0%, 100% {
        opacity: 0;
        transform: translate(-3%, 4%) scale(1.04);
    }
    40% {
        opacity: 1;
        transform: translate(4%, -3%) scale(1.1);
    }
    75% {
        opacity: 0.25;
        transform: translate(-5%, 2%) scale(1.06);
    }
}

@keyframes sds-loader-wash-c {
    0%, 100% {
        opacity: 0;
        transform: translate(4%, 3%) scale(1.05);
    }
    30% {
        opacity: 0.2;
    }
    60% {
        opacity: 1;
        transform: translate(-4%, -5%) scale(1.12);
    }
}

@keyframes sds-loader-sun-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes sds-loader-ray-shoot {
    0% {
        transform: scaleY(0.12);
        filter: blur(10px);
        opacity: 0.45;
    }
    12% {
        transform: scaleY(0.32);
        filter: blur(12px);
        opacity: 1;
    }
    55% {
        transform: scaleY(1);
        filter: blur(11px);
        opacity: 0.8;
    }
    100% {
        transform: scaleY(1.22);
        filter: blur(18px);
        opacity: 0;
    }
}

@keyframes sds-loader-sun-pulse {
    0%, 100% {
        opacity: 0.92;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(34px);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.04);
        filter: blur(40px);
    }
}

@keyframes sds-loader-sun-settle {
    0% {
        transform: translate(-50%, -50%) scale(2.2);
        filter: blur(22px);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        filter: blur(2px);
    }
}

@keyframes sds-loader-sun-dance {
    0%, 100% {
        transform: scale(1) rotate(-5deg);
    }
    28% {
        transform: scale(1.08) rotate(6deg);
    }
    56% {
        transform: scale(0.94) rotate(-3deg);
    }
    78% {
        transform: scale(1.05) rotate(4deg);
    }
}

@keyframes sds-loader-sun-morph {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.18) rotate(28deg);
        filter: blur(8px);
    }
}

@keyframes sds-loader-logo-in {
    0% {
        opacity: 0;
        filter: blur(10px);
        transform: scale(0.78);
    }
    55% {
        opacity: 1;
        filter: blur(1px);
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sds-loader {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .sds-loader__mark {
        width: 220px;
        height: 220px;
    }

    .sds-loader__sun {
        width: 320px;
        height: 320px;
    }

    .sds-loader__logo {
        height: 150px;
    }

    .sds-loader__percent {
        font-size: 22px;
    }
}
