@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital@0;1&display=swap');

:root {
    --dark-bg:    #032335;
    --dark-card:  #023649;
    --green:      #28a745;
    --green-light:#20c997;
    --gold:       #f0a500;
    --gold-light: #f5c842;
    --white:      #ffffff;
    --white-dim:  rgba(255,255,255,0.7);
    --white-faint:rgba(255,255,255,0.12);
}

/* ========== LOADER ========== */
#loader {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    font-family: 'Vazirmatn', sans-serif;
}

/* subtle radial glow */
#loader::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(40,167,69,0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* decorative arcs */
.arc {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.06);
}
.arc-1 { width: 600px; height: 600px; top: -200px; left: -200px; }
.arc-2 { width: 400px; height: 400px; bottom: -100px; right: -100px; }
.arc-3 { width: 220px; height: 220px; bottom: 120px; left: 60px; border-color: rgba(40,167,69,0.1); }

/* brand */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 36px;
    animation: fadeDown 1s ease forwards;
    opacity: 0;
    position: relative;
    z-index: 1;
}

.brand-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
}

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 40px;
    letter-spacing: 0.14em;
    color: var(--white);
    font-style: italic;
}

.brand-sub {
    font-size: 11px;
    letter-spacing: 0.35em;
    color: var(--gold);
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 300;
}

/* loader texts */
.loader-text {
    color: var(--white-dim);
    font-size: 15px;
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.05em;
    opacity: 0;
    position: relative;
    z-index: 1;
}

.loader-text:first-of-type {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 6px;
    animation: fadeUp 0.8s 0.3s ease forwards;
}

.loader-text:last-of-type {
    color: var(--gold);
    animation: fadeUp 0.8s 0.6s ease forwards;
    margin-bottom: 36px;
}

/* coffee cup */
.cup-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeUp 0.8s 0.9s ease forwards;
    opacity: 0;
    position: relative;
    z-index: 1;
}

.cup {
    width: 48px;
    height: 38px;
    border: 3px solid rgba(255,255,255,0.6);
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
}

.cup::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    animation: fill 2.5s ease-in-out infinite;
}

.cup-handle {
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.6);
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.cup-saucer {
    width: 64px;
    height: 6px;
    border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,0.5);
    margin-top: 2px;
}

/* steam */
.steam {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.steam span {
    display: block;
    width: 2px;
    height: 14px;
    background: var(--gold-light);
    border-radius: 2px;
    opacity: 0;
    animation: steam 1.8s ease-in-out infinite;
}

.steam span:nth-child(1) { animation-delay: 0s; }
.steam span:nth-child(2) { animation-delay: 0.3s; height: 20px; }
.steam span:nth-child(3) { animation-delay: 0.6s; }

/* progress bar */
.progress-wrap {
    margin-top: 44px;
    width: 180px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    animation: fadeUp 0.8s 1s ease forwards;
    opacity: 0;
    position: relative;
    z-index: 1;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--gold));
    border-radius: 2px;
    animation: load 2.8s ease-in-out infinite;
}

/* ============ KEYFRAMES ============ */

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fill {
    0%   { height: 0%; }
    50%  { height: 80%; }
    100% { height: 0%; }
}

@keyframes steam {
    0%   { opacity: 0; transform: translateY(0) scaleX(1); }
    30%  { opacity: 0.8; }
    100% { opacity: 0; transform: translateY(-18px) scaleX(1.5); }
}

@keyframes load {
    0%   { width: 0%;   margin-left: 0; }
    50%  { width: 100%; margin-left: 0; }
    100% { width: 0%;   margin-left: 100%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* hide loader */
#loader.hidden {
    animation: loaderOut 0.6s ease forwards;
}

@keyframes loaderOut {
    to { opacity: 0; pointer-events: none; }
}
