/* ============================================
        LIONWEB — MAIN STYLE (TOKENS + BASE)
============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Vazirmatn", Tahoma, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background .5s ease, color .5s ease;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
                THEME TOKENS
============================================ */

body.dark {
    --bg: #050505;
    --bg-soft: #0b0b0b;
    --bg-card: rgba(17, 17, 17, .78);
    --bg-chip: rgba(255, 255, 255, .04);
    --accent: #D4A42D;
    --accent-2: #F5C84B;
    --accent-3: #B57B00;
    --accent-soft: rgba(212, 164, 45, .10);
    --accent-border: rgba(212, 164, 45, .22);
    --accent-border-strong: rgba(212, 164, 45, .45);
    --accent-glow: rgba(212, 164, 45, .28);
    --accent-glow-strong: rgba(212, 164, 45, .45);
    --text: #ffffff;
    --text-muted: #A5A5A5;
    --text-faint: #777;
    --header-bg: rgba(15, 15, 15, .65);
    --input-bg: #0c0c0c;
    --shadow: rgba(0, 0, 0, .5);
    --shadow-strong: rgba(0, 0, 0, .7);
    --fade-from: #0b0b0b;
    --selection-bg: #D4A42D;
    --selection-color: #050505;
    color-scheme: dark;
}

body.light {
    --bg: #f5fbff;
    --bg-soft: #ffffff;
    --bg-card: rgba(255, 255, 255, .8);
    --bg-chip: rgba(255, 255, 255, .75);
    --accent: #59B8FF;
    --accent-2: #65D4FF;
    --accent-3: #2388D8;
    --accent-soft: rgba(89, 184, 255, .10);
    --accent-border: rgba(89, 184, 255, .22);
    --accent-border-strong: rgba(89, 184, 255, .45);
    --accent-glow: rgba(89, 184, 255, .22);
    --accent-glow-strong: rgba(89, 184, 255, .35);
    --text: #111111;
    --text-muted: #666666;
    --text-faint: #999;
    --header-bg: rgba(255, 255, 255, .65);
    --input-bg: #ffffff;
    --shadow: rgba(0, 0, 0, .08);
    --shadow-strong: rgba(0, 0, 0, .14);
    --fade-from: #f7fbff;
    --selection-bg: #59B8FF;
    --selection-color: #ffffff;
    color-scheme: light;
}

/* ============================================
                BASE
============================================ */

body.dark { background: var(--bg); color: var(--text); }
body.light { background: var(--bg); color: var(--text); }

::selection {
    background: var(--selection-bg);
    color: var(--selection-color);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    border-radius: 10px;
    border: 2px solid var(--bg-soft);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

button {
    font-family: inherit;
}

.container {
    width: min(1320px, 92%);
    margin: auto;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-2), var(--accent) 55%, var(--accent-3));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ============================================
                BUTTONS (SHARED)
============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 38px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 800;
    border: 1px solid transparent;
    transition: transform .35s ease, box-shadow .35s ease, background .35s ease, color .35s ease, border-color .35s ease;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-2), var(--accent) 55%, var(--accent-3));
    color: var(--bg);
    box-shadow: 0 12px 35px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px var(--accent-glow-strong);
}

.btn-outline {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent-soft);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--accent-glow);
}

/* ============================================
                REVEAL ANIMATIONS
============================================ */

.reveal,
.reveal-zoom {
    opacity: 0;
    transition: opacity .8s cubic-bezier(.22, .61, .36, 1), transform .8s cubic-bezier(.22, .61, .36, 1);
    transition-delay: var(--delay, 0s);
    will-change: opacity, transform;
}

.reveal {
    transform: translateY(45px);
}

.reveal-zoom {
    transform: scale(.92);
}

.reveal.visible,
.reveal-zoom.visible {
    opacity: 1;
    transform: none;
}

/* ============================================
                PRELOADER
============================================ */

.preloader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050505;
    transition: opacity .7s ease, visibility .7s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.preloader-logo {
    width: 180px;
    height: auto;
    animation: preloaderPulse 1.6s ease-in-out infinite;
}

.preloader-ring {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid var(--accent-border);
    border-top-color: var(--accent);
    animation: spin .9s linear infinite;
}

.preloader-text {
    font-size: 14px;
    color: #A5A5A5;
    letter-spacing: 1px;
}

@keyframes preloaderPulse {
    0%, 100% { transform: scale(1); opacity: .85; }
    50% { transform: scale(1.06); opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
                SCROLL PROGRESS BAR
============================================ */

.scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    height: 3.5px;
    width: 0;
    z-index: 9999;
    background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
    box-shadow: 0 0 12px var(--accent-glow);
    border-radius: 0 0 6px 0;
}

/* ============================================
                CUSTOM CURSOR
============================================ */

.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.cursor-ring {
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--accent);
    transition: transform .18s ease, opacity .3s ease, width .25s ease, height .25s ease;
}

.cursor-ring.hovering {
    width: 62px;
    height: 62px;
    border-color: var(--accent-2);
    background: var(--accent-soft);
}

@media (pointer: fine) {
    body.has-cursor .cursor-dot,
    body.has-cursor .cursor-ring {
        opacity: 1;
    }

    body.has-cursor a,
    body.has-cursor button {
        cursor: none;
    }
}

@media (pointer: coarse) {
    .cursor-dot, .cursor-ring { display: none; }
}

/* ============================================
                BACK TO TOP
============================================ */

.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 900;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    backdrop-filter: blur(12px);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all .4s ease;
    box-shadow: 0 10px 30px var(--shadow);
}

.back-to-top svg {
    width: 22px;
    height: 22px;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    color: var(--bg);
    box-shadow: 0 15px 40px var(--accent-glow-strong);
    transform: translateY(-5px);
}

/* ============================================
                TOASTS
============================================ */

.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9997;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-radius: 18px;
    background: var(--bg-card);
    border: 1px solid var(--accent-border);
    backdrop-filter: blur(15px);
    box-shadow: 0 15px 45px var(--shadow-strong);
    min-width: 290px;
    max-width: 380px;
    animation: toastIn .45s cubic-bezier(.22, .61, .36, 1);
    transform-origin: bottom right;
}

.toast.out {
    animation: toastOut .4s ease forwards;
}

.toast-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 18px;
}

.toast.success .toast-icon { color: #2ecc71; background: rgba(46, 204, 113, .12); }
.toast.error .toast-icon { color: #e74c3c; background: rgba(231, 76, 60, .12); }

.toast-body strong {
    display: block;
    font-size: 15px;
    margin-bottom: 3px;
}

.toast-body span {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-40px) scale(.9); }
    to { opacity: 1; transform: none; }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(-40px) scale(.9); }
}

/* ============================================
                RESPONSIVE (BASE)
============================================ */

@media (max-width: 1100px) {
    .container {
        width: 94%;
    }
}

@media (max-width: 768px) {
    .btn {
        padding: 14px 32px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }

    .preloader-logo {
        width: 130px;
    }

    .preloader-ring {
        width: 38px;
        height: 38px;
    }

    .btn {
        padding: 13px 28px;
        font-size: 14.5px;
    }

    .back-to-top {
        width: 46px;
        height: 46px;
        bottom: 18px;
        left: 18px;
    }

    .toast-container {
        right: 14px;
        left: 14px;
        bottom: 14px;
        align-items: center;
    }

    .toast {
        min-width: 0;
        width: 100%;
        max-width: 340px;
        padding: 14px 18px;
        border-radius: 16px;
    }
}

/* ============================================
                REDUCED MOTION
============================================ */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .reveal, .reveal-zoom {
        opacity: 1;
        transform: none;
    }
}
