        @font-face {
            font-family: 'IRANSansWeb';
            src: url('../font/ISweb.eot');
            src: url('../font/ISweb.eot?#iefix') format('embedded-opentype'),
                 url('../font/ISweb.woff') format('woff'),
                 url('../font/ISweb.ttf') format('truetype');
            font-weight: 500;
            font-style: normal;
        }

        :root {
            --brand-50: #f5f3ff;
            --brand-100: #ede9fe;
            --brand-500: #7c3aed;
            --brand-600: #6d28d9;
            --brand-700: #5b21b6;
            --ink-900: #111827;
            --ink-700: #374151;
            --ink-500: #6b7280;
            --surface: #ffffff;
            --border: #e5e7eb;
            --section-gap: clamp(3.75rem, 6vw, 5.5rem);
            --card-radius: 1rem;
            --soft-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
            --lift-shadow: 0 18px 45px rgba(91, 33, 182, 0.15);
        }

        body {
            font-family: 'IRANSansWeb', sans-serif;
            color: var(--ink-900);
            text-rendering: optimizeLegibility;
            -webkit-font-smoothing: antialiased;
        }

        section {
            scroll-margin-top: 96px;
        }

        section.py-16,
        section.py-16.md\:py-24 {
            padding-top: var(--section-gap);
            padding-bottom: var(--section-gap);
        }

        #home.hero-section {
            position: relative;
            isolation: isolate;
            background-image:
                linear-gradient(120deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.66)),
                radial-gradient(circle at 90% 20%, rgba(139, 92, 246, 0.22), transparent 35%),
                url('../img/about.webp');
            background-size: cover;
            background-position: center;
        }

        .hero-panel {
            max-width: 920px;
            margin: 0 auto;
            padding: clamp(1.25rem, 3vw, 2.25rem);
            border-radius: 1.5rem;
            background: rgba(255, 255, 255, 0.65);
            border: 1px solid rgba(255, 255, 255, 0.8);
            box-shadow: var(--soft-shadow);
            backdrop-filter: blur(8px);
        }

        #site-header {
            transition: background-color 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
            border-bottom: 1px solid transparent;
        }

        #site-header.header-scrolled {
            background: rgba(255, 255, 255, 0.96);
            box-shadow: 0 8px 30px rgba(17, 24, 39, 0.08);
            border-color: var(--border);
            backdrop-filter: blur(8px);
        }

        #mobile-menu-button {
            width: 2.75rem;
            height: 2.75rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 0.75rem;
            transition: background-color 160ms ease, transform 160ms ease;
        }

        #mobile-menu-button:hover {
            background-color: #f3f4f6;
        }

        .hamburger-lines {
            width: 1.35rem;
            height: 1rem;
            display: inline-flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .hamburger-line {
            display: block;
            height: 2px;
            width: 100%;
            border-radius: 999px;
            background: var(--ink-700);
            transition: transform 220ms ease, opacity 220ms ease;
            transform-origin: center;
        }

        #mobile-menu-button.is-open .hamburger-line:nth-child(1) {
            transform: translateY(7px) rotate(45deg);
        }

        #mobile-menu-button.is-open .hamburger-line:nth-child(2) {
            opacity: 0;
        }

        #mobile-menu-button.is-open .hamburger-line:nth-child(3) {
            transform: translateY(-7px) rotate(-45deg);
        }

        #mobile-menu {
            opacity: 0;
            transform: translateY(-10px);
            transition: opacity 180ms ease, transform 180ms ease;
        }

        #mobile-menu.menu-visible {
            opacity: 1;
            transform: translateY(0);
        }

        .slider-container {
            position: relative;
            overflow: hidden;
            width: 100%;
            height: 100%;
        }

        .slider-content {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 600ms ease-in-out;
        }

        .slider-content.active {
            opacity: 1;
        }

        #course .grid > *,
        #teacher .grid > *,
        section.bg-gray-50 .grid > .bg-white,
        #articles article,
        .testimonial-text-box,
        #contact .bg-purple-800 {
            border: 1px solid var(--border);
            box-shadow: var(--soft-shadow);
            transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
        }

        #course .grid > *:hover,
        #teacher .grid > *:hover,
        section.bg-gray-50 .grid > .bg-white:hover,
        #articles article:hover,
        .testimonial-text-box:hover {
            transform: translateY(-4px);
            box-shadow: var(--lift-shadow);
            border-color: #d8ccff;
        }

        #articles article img {
            height: 12.5rem;
        }

        .splide__arrow {
            width: 2.5rem;
            height: 2.5rem;
            background: #ffffff;
            border: 1px solid var(--border);
            box-shadow: 0 6px 20px rgba(17, 24, 39, 0.12);
        }

        .splide__arrow svg {
            fill: var(--brand-700);
        }

        .splide__pagination__page {
            background: #d1d5db;
            opacity: 1;
        }

        .splide__pagination__page.is-active {
            background: var(--brand-600);
            transform: scale(1.2);
        }

        .testimonial-video {
            width: 100%;
            height: auto;
            max-height: 280px;
            object-fit: cover;
            border-radius: 0.9rem;
        }

        .testimonial-text-box {
            text-align: right;
            background: #fff;
            border-radius: var(--card-radius);
            padding: 1.25rem;
        }

        #back-to-top {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            z-index: 50;
            width: 2.75rem;
            height: 2.75rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: none;
            border-radius: 9999px;
            background: var(--brand-600);
            color: #fff;
            box-shadow: 0 10px 25px rgba(91, 33, 182, 0.35);
            opacity: 0;
            pointer-events: none;
            transform: translateY(14px);
            transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
            cursor: pointer;
            text-decoration: none;
        }

        #back-to-top svg {
            width: 1.35rem;
            height: 1.35rem;
        }

        #back-to-top:hover {
            background: var(--brand-700);
            color: #fff;
        }

        #back-to-top.visible {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }

        body:has(#sticky-test-cta) #back-to-top {
            bottom: 5.5rem;
        }

        #sticky-test-cta {
            opacity: 0;
            pointer-events: none;
            transform: translateY(12px);
            transition: opacity 200ms ease, transform 200ms ease;
            max-width: min(92vw, 360px);
            text-align: center;
        }

        #sticky-test-cta.visible {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }

        footer nav a {
            color: #d1d5db !important;
            margin: 0 0.45rem;
            line-height: 2;
        }

        footer nav a:hover {
            color: #ffffff !important;
        }

        a:focus-visible,
        button:focus-visible {
            outline: 2px solid var(--brand-500);
            outline-offset: 2px;
            border-radius: 0.5rem;
        }

        @media (max-width: 768px) {
            #home h1 {
                line-height: 1.35;
            }
            #hero-text-slider {
                height: 8.75rem !important;
            }
            #hero-text-slider2 {
                height: 7rem !important;
            }
            #mobile-menu {
                border-top: 1px solid var(--border);
            }
            #sticky-test-cta {
                right: 1rem;
                left: 1rem;
                text-align: center;
                max-width: none;
            }
            footer {
                padding-bottom: 8rem !important;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            * {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
                scroll-behavior: auto !important;
            }
        }
    

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    text-align: right;
    direction: rtl;
}

.grid-cols-3 > * {
    text-align: center;
}

#userAnswer,
#currentMathQuestion {
    text-align: center;
    direction: ltr;
}

.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-btn.active { border-bottom: 2px solid #2563eb; color: #2563eb; }

.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.25rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid currentColor;
    font-weight: 700;
    font-size: 0.875rem;
    line-height: 1.25;
    text-decoration: none;
    opacity: 0.95;
    transition: background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.lang-switch:hover {
    opacity: 1;
    background: rgba(124, 58, 237, 0.12);
}

header .lang-switch,
nav .lang-switch {
    color: inherit;
}

footer .lang-switch {
    color: #e5e7eb;
    border-color: #9ca3af;
    margin-inline: 0.35rem;
}

footer .lang-switch:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 768px) {
    #wheel {
        width: 300px !important;
        height: 300px !important;
    }
}

@media (max-width: 480px) {
    #wheel {
        width: 250px !important;
        height: 250px !important;
    }
}
