/* Landing — dark math theme, responsive */
:root {
    --bg: #04060d;
    --card: rgba(15, 23, 42, 0.78);
    --border: rgba(99, 102, 241, 0.25);
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #818cf8;
    --accent2: #22d3ee;
    --accent3: #c084fc;
    --glow: rgba(129, 140, 248, 0.4);
    --hero-max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.landing {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-vazir);
    line-height: 1.8;
    overflow-x: hidden;
    margin: 0;
}

/* ─── background ─── */
.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    animation: orbFloat 16s ease-in-out infinite;
}

.orb-1 { width: min(420px, 80vw); height: min(420px, 80vw); background: #4338ca; top: -10%; right: -10%; }
.orb-2 { width: min(340px, 70vw); height: min(340px, 70vw); background: #0891b2; bottom: 5%; left: -12%; animation-delay: -5s; }
.orb-3 { width: min(260px, 55vw); height: min(260px, 55vw); background: #7c3aed; top: 40%; left: 35%; animation-delay: -9s; }

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -30px); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99,102,241,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
}

.floating-symbols { position: absolute; inset: 0; }

.symbol {
    position: absolute;
    font-family: 'Times New Roman', serif;
    color: rgba(129, 140, 248, 0.1);
    animation: symbolDrift 20s linear infinite;
    user-select: none;
    pointer-events: none;
}

@keyframes symbolDrift {
    0% { transform: translateY(105vh); opacity: 0; }
    15%, 85% { opacity: 1; }
    100% { transform: translateY(-15vh); opacity: 0; }
}

.landing-wrap { position: relative; z-index: 1; }

/* ─── nav ─── */
.l-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    backdrop-filter: blur(18px);
    background: rgba(4, 6, 13, 0.82);
    border-bottom: 1px solid var(--border);
}

.l-nav-inner {
    position: relative;
    max-width: var(--hero-max);
    margin: 0 auto;
    padding: .85rem 1.25rem;
    padding-inline: max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-left));
    display: flex;
    align-items: center;
    gap: .75rem;
}

.l-brand {
    font-weight: 900;
    font-size: 1.2rem;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
}

.l-brand--premium {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Times New Roman', serif;
    font-size: 1.5rem;
    color: #22d3ee;
    background: linear-gradient(145deg, rgba(99,102,241,.35), rgba(8,145,178,.2));
    border: 1px solid rgba(129, 140, 248, 0.35);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.2);
    animation: markGlow 3s ease-in-out infinite;
}

@keyframes markGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(34, 211, 238, 0.15); }
    50% { box-shadow: 0 0 32px rgba(129, 140, 248, 0.35); }
}

.brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.brand-en {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: .02em;
    background: linear-gradient(120deg, #fff 0%, #22d3ee 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-sub {
    font-size: .65rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-top: .15rem;
}

.l-brand em {
    font-style: normal;
    background: linear-gradient(135deg, var(--accent2), var(--accent3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.l-nav-links {
    display: flex;
    align-items: center;
    gap: .85rem 1.1rem;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-start;
    min-width: 0;
}

.l-nav-toggle {
    display: none;
    flex-shrink: 0;
    background: rgba(99,102,241,.15);
    border: 1px solid var(--border);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: .65rem;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
}

.l-nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: .88rem;
    transition: color .2s;
    white-space: nowrap;
}

.l-nav-links a:hover { color: var(--accent2); }

.l-nav-cta {
    padding: .5rem 1rem !important;
    border-radius: .6rem;
    background: linear-gradient(135deg, #6366f1, #0891b2);
    color: #fff !important;
    font-weight: 700;
}

.l-nav-auth {
    flex-shrink: 0;
    margin-inline-start: auto;
}

.l-nav-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .45rem .95rem !important;
    border-radius: .6rem;
    border: 1px solid var(--border) !important;
    color: var(--accent2) !important;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.l-nav-cta--menu {
    display: none;
}

@media (max-width: 768px) {
    .l-nav-inner {
        flex-wrap: nowrap;
        gap: .5rem;
        padding-block: .75rem;
    }

    .l-brand--premium {
        flex: 1;
        gap: .5rem;
        min-width: 0;
    }

    .brand-en {
        font-size: .95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-sub { font-size: .55rem; letter-spacing: .06em; }
    .brand-mark { width: 38px; height: 38px; font-size: 1.2rem; flex-shrink: 0; }
    .brand-text { min-width: 0; overflow: hidden; }

    .l-nav-auth {
        margin-inline-start: 0;
        flex-shrink: 0;
    }

    .l-nav-login {
        padding: .4rem .7rem !important;
        font-size: .78rem;
        max-width: 5.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .l-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: static;
        transform: none;
        flex-shrink: 0;
    }

    .l-nav-links {
        display: none;
        position: absolute;
        top: 100%;
        inset-inline: 0;
        flex-direction: column;
        align-items: stretch;
        flex: unset;
        padding: .75rem 1rem 1rem;
        background: rgba(4, 6, 13, 0.98);
        border-bottom: 1px solid var(--border);
        gap: 0;
        max-height: min(70vh, 480px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 210;
    }

    .l-nav-links.open { display: flex; }

    .l-nav-links a {
        padding: .85rem .5rem;
        border-bottom: 1px solid rgba(255,255,255,.05);
        white-space: normal;
        font-size: .92rem;
    }

    .l-nav-cta--menu {
        display: block;
        text-align: center;
        margin-top: .35rem;
    }

    .l-nav-links .l-nav-login {
        display: none;
    }
}

/* ─── Responsive — موبایل و تبلت ─── */
html { -webkit-text-size-adjust: 100%; }

body.landing {
    overflow-x: hidden;
}

.landing-wrap {
    overflow-x: clip;
}

@media (max-width: 480px) {
    .hero { padding: 1.75rem 1rem 3rem; }
    .section { padding: 2.5rem 1rem; }
    .hero-title { font-size: clamp(1.45rem, 6vw, 2rem); }
    .btn-glow, .btn-outline { min-height: 44px; }
}

@media (max-width: 360px) {
    .l-nav-inner { padding-inline: max(.65rem, env(safe-area-inset-right)) max(.65rem, env(safe-area-inset-left)); }
    .l-nav-login { max-width: 4.5rem; font-size: .72rem !important; }
    .brand-sub { display: none; }
}

/* ─── HERO (redesigned — no overlap) ─── */
.hero {
    position: relative;
    padding: 2.5rem 1.25rem 4rem;
    overflow: hidden;
}

.hero-stage {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-stage-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34,211,238,.35), transparent);
    width: 100%;
    top: 28%;
    animation: scanLine 6s ease-in-out infinite;
}

@keyframes scanLine {
    0%, 100% { opacity: .3; transform: translateY(0); }
    50% { opacity: .8; transform: translateY(120px); }
}

.hero-deco-ring {
    position: absolute;
    border: 1px solid rgba(129,140,248,.12);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hero-deco-ring.r1 { width: min(700px, 95vw); height: min(700px, 95vw); animation: slowSpin 40s linear infinite; }
.hero-deco-ring.r2 { width: min(520px, 75vw); height: min(520px, 75vw); animation: slowSpin 28s linear infinite reverse; border-style: dashed; }

@keyframes slowSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.hero-inner {
    position: relative;
    max-width: var(--hero-max);
    margin: 0 auto;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .hero-content { order: 2; text-align: center; }
    .hero-visual { order: 1; }
}

/* hero text */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .95rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    font-size: .82rem;
    margin-bottom: 1rem;
}

.hero-badge .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent2);
    box-shadow: 0 0 10px var(--accent2);
    animation: pulse 2s infinite;
}

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

.hero h1 {
    font-size: clamp(1.85rem, 5.5vw, 3.25rem);
    font-weight: 900;
    line-height: 1.3;
    margin: 0 0 1rem;
}

.hero h1 .gradient {
    display: block;
    background: linear-gradient(120deg, #fff 0%, var(--accent2) 45%, var(--accent3) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-lead {
    color: var(--muted);
    font-size: clamp(.95rem, 2.5vw, 1.05rem);
    max-width: 520px;
    margin: 0 0 1.25rem;
}

@media (max-width: 900px) {
    .hero-lead { margin-inline: auto; }
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 900px) { .tag-row { justify-content: center; } }

.tag {
    padding: .3rem .75rem;
    border-radius: 999px;
    font-size: .78rem;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.04);
}

.formula-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) { .formula-strip { justify-content: center; } }

.formula-chip {
    font-family: 'Times New Roman', serif;
    font-size: .85rem;
    padding: .35rem .7rem;
    border-radius: .5rem;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.2);
    color: var(--accent2);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

@media (max-width: 900px) {
    .hero-actions { justify-content: center; }
}

@media (max-width: 400px) {
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions a { justify-content: center; width: 100%; }
}

.btn-glow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .8rem 1.5rem;
    border-radius: .75rem;
    background: linear-gradient(135deg, #6366f1, #0891b2);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35);
    transition: transform .2s, box-shadow .2s;
    font-size: .95rem;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(34, 211, 238, 0.3);
    color: #fff;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .8rem 1.3rem;
    border-radius: .75rem;
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: .95rem;
    transition: background .2s, border-color .2s;
}

.btn-ghost:hover {
    border-color: var(--accent);
    background: rgba(99,102,241,.1);
    color: #fff;
}

/* hero visual — enhanced rotating frame */
.hero-visual {
    display: flex;
    justify-content: center;
    width: 100%;
}

.hero-photo-stack {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.photo-shell {
    position: relative;
    width: 100%;
    max-width: 280px;
    padding: 14px;
    border-radius: 1.5rem;
}
.photo-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    padding: 2px;
    background: conic-gradient(from 0deg, #6366f1, #22d3ee, #c084fc, #6366f1);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: frameSpin 8s linear infinite;
    filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.35));
}

/* inner counter-rotating square */
.photo-shell::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 1.25rem;
    border: 1px dashed rgba(129, 140, 248, 0.45);
    animation: frameSpin 14s linear infinite reverse;
    pointer-events: none;
}

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

.photo-glow {
    position: absolute;
    inset: -20px;
    border-radius: 2rem;
    background: radial-gradient(circle, rgba(99,102,241,.25) 0%, transparent 70%);
    animation: glowPulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes glowPulse {
    0%, 100% { opacity: .6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.teacher-frame {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 1.1rem;
    overflow: hidden;
    background: #0f172a;
    box-shadow: inset 0 0 40px rgba(0,0,0,.4);
}

.teacher-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* corner accents */
.photo-corners span {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 2;
    opacity: .85;
}

.photo-corners .c-tl { top: 4px; left: 4px; border-top: 2px solid var(--accent2); border-left: 2px solid var(--accent2); }
.photo-corners .c-tr { top: 4px; right: 4px; border-top: 2px solid var(--accent2); border-right: 2px solid var(--accent2); }
.photo-corners .c-bl { bottom: 4px; left: 4px; border-bottom: 2px solid var(--accent3); border-left: 2px solid var(--accent3); }
.photo-corners .c-br { bottom: 4px; right: 4px; border-bottom: 2px solid var(--accent3); border-right: 2px solid var(--accent3); }

.hero-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    width: 100%;
}

.hero-stat {
    text-align: center;
    padding: .65rem .4rem;
    border-radius: .75rem;
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.hero-stat strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--accent2);
    line-height: 1.2;
}

.hero-stat span {
    font-size: .68rem;
    color: var(--muted);
    line-height: 1.3;
}

.teacher-card {
    width: 100%;
    padding: 1rem 1.15rem;
    border-radius: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    text-align: center;
}

.teacher-card h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.teacher-card p {
    margin: .3rem 0 0;
    color: var(--muted);
    font-size: .82rem;
}

.teacher-card .fields {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: center;
    margin-top: .65rem;
}

.teacher-card .fields span {
    font-size: .7rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(99,102,241,.15);
    color: var(--accent);
}

@media (max-width: 380px) {
    .hero-stats-row { grid-template-columns: 1fr; }
    .hero-stat { display: flex; align-items: center; justify-content: space-between; gap: .5rem; text-align: right; }
    .hero-stat strong { font-size: 1rem; }
}

/* ─── stats bar ─── */
.stats-bar {
    max-width: var(--hero-max);
    margin: 0 auto 1rem;
    padding: 0 1.25rem;
}

.stats-bar-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    padding: 1.25rem;
    border-radius: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.stats-bar-item {
    text-align: center;
    padding: .5rem;
}

.stats-bar-item strong {
    display: block;
    font-size: clamp(1.4rem, 4vw, 1.85rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent2), var(--accent3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-bar-item span { font-size: .78rem; color: var(--muted); }

@media (max-width: 600px) {
    .stats-bar-inner { grid-template-columns: repeat(2, 1fr); }
}

/* ─── sections ─── */
.section {
    padding: clamp(3rem, 8vw, 5rem) 1.25rem;
    max-width: var(--hero-max);
    margin: 0 auto;
}

.section-head {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-head h2 {
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    font-weight: 900;
    margin: 0 0 .5rem;
}

.section-head p { color: var(--muted); margin: 0; max-width: 560px; margin-inline: auto; }

.section-label {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: var(--accent2);
    margin-bottom: .5rem;
}

.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible { opacity: 1; transform: translateY(0); }

.cards-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1rem;
}

.glass-card {
    padding: 1.35rem;
    border-radius: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    transition: transform .3s, border-color .3s, box-shadow .3s;
    height: 100%;
}

.glass-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 16px 40px rgba(0,0,0,.3);
}

.glass-card .icon {
    width: 44px; height: 44px;
    border-radius: .65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(34,211,238,.12));
    margin-bottom: .85rem;
}

.glass-card h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .4rem; }
.glass-card p { color: var(--muted); font-size: .88rem; margin: 0; }

/* levels grid */
.levels-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
}

.level-pill {
    padding: .55rem 1.1rem;
    border-radius: .65rem;
    background: rgba(99,102,241,.1);
    border: 1px solid var(--border);
    font-size: .88rem;
    font-weight: 500;
}

/* steps */
.steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1rem;
}

.step-card {
    position: relative;
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    text-align: center;
}

.step-num {
    width: 36px; height: 36px;
    margin: 0 auto .75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    background: linear-gradient(135deg, #6366f1, #0891b2);
    font-size: .95rem;
}

.step-card h3 { font-size: .95rem; margin: 0 0 .4rem; }
.step-card p { color: var(--muted); font-size: .85rem; margin: 0; }

/* content scroll */
.content-scroll {
    display: flex;
    gap: .85rem;
    overflow-x: auto;
    padding-bottom: .75rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.content-scroll::-webkit-scrollbar { height: 5px; }
.content-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.scroll-item {
    flex: 0 0 min(280px, 82vw);
    scroll-snap-align: start;
}

.landing-lesson-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    height: 100%;
}

.landing-lesson-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: .65rem;
    margin-bottom: .35rem;
}

.landing-lesson-card__play {
    display: inline-block;
    margin-top: .5rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent2);
}

/* categories */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
}

.cat-item {
    text-align: center;
    padding: 1.1rem .75rem;
    border-radius: .85rem;
    background: var(--card);
    border: 1px solid var(--border);
    transition: transform .25s;
}

.cat-item:hover { transform: scale(1.03); }
.cat-item .emoji { font-size: 1.6rem; display: block; margin-bottom: .35rem; }
.cat-item span { font-size: .85rem; font-weight: 600; }

/* cta banner */
.cta-banner {
    max-width: var(--hero-max);
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

.cta-inner {
    padding: clamp(2rem, 5vw, 3rem);
    border-radius: 1.25rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(8,145,178,.2));
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.cta-inner::before {
    content: '∫ Σ π';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(4rem, 15vw, 8rem);
    opacity: .04;
    font-family: 'Times New Roman', serif;
    pointer-events: none;
}

.cta-inner h2 { font-size: clamp(1.3rem, 4vw, 1.75rem); font-weight: 900; margin: 0 0 .5rem; position: relative; }
.cta-inner p { color: var(--muted); margin: 0 0 1.25rem; position: relative; }

/* faq */
.faq-list { max-width: 720px; margin: 0 auto; }

.faq-item {
    margin-bottom: .65rem;
    border-radius: .85rem;
    border: 1px solid var(--border);
    background: var(--card);
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.15rem;
    cursor: pointer;
    font-weight: 700;
    font-size: .92rem;
    list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '+';
    float: left;
    color: var(--accent2);
    font-weight: 900;
}

.faq-item[open] summary::after { content: '−'; }

.faq-body {
    padding: 0 1.15rem 1rem;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.75;
}

/* footer */
.l-footer {
    border-top: 1px solid var(--border);
    background: rgba(4,6,13,.92);
    padding: 3rem 1.25rem 1.5rem;
}

.footer-grid {
    max-width: var(--hero-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
}

@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }

#neshan-map {
    height: min(320px, 55vw);
    border-radius: .85rem;
    border: 1px solid var(--border);
}

.footer-copy {
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    max-width: var(--hero-max);
    margin-inline: auto;
}

@media (max-width: 600px) {
    .floating-symbols { display: none; }
    .hero-deco-ring { display: none; }
}

.graph-demo-section {
    position: relative;
    padding-block: 4rem 5rem;
}

.graph-demo-section::before {
    content: '';
    position: absolute;
    inset: 10% 5% 20%;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.12), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.graph-demo-head {
    text-align: center;
    max-width: 720px;
    margin-inline: auto;
    margin-bottom: 2.5rem;
}

.graph-demo-title {
    font-size: clamp(1.45rem, 3.5vw, 2.15rem) !important;
    line-height: 1.45;
    background: linear-gradient(135deg, #e2e8f0 0%, #22d3ee 45%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.graph-demo-sub {
    font-size: 1.05rem !important;
    max-width: 540px;
    margin-inline: auto;
}

.graph-demo-stage {
    position: relative;
    z-index: 1;
    max-width: min(1100px, 96vw);
    margin: 0 auto;
}

.graph-demo-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: stretch;
}

.graph-fn-rail {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: .65rem;
    padding: .25rem .15rem .5rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.graph-fn-rail::-webkit-scrollbar { height: 4px; }
.graph-fn-rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.graph-fn-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    flex: 0 0 auto;
    min-width: min(160px, 38vw);
    max-width: 200px;
    scroll-snap-align: start;
    padding: .85rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(129, 140, 248, 0.25);
    background: rgba(12, 18, 36, 0.85);
    color: var(--text);
    text-align: right;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .25s, transform .2s, box-shadow .25s;
}

.graph-fn-card__glow {
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(192, 132, 252, 0.1));
    transition: opacity .25s;
}

.graph-fn-card__icon {
    font-size: 1.35rem;
    line-height: 1;
    opacity: .85;
    direction: ltr;
}

.graph-fn-card__label {
    position: relative;
    z-index: 1;
    font-family: ui-monospace, monospace;
    font-size: .92rem;
    font-weight: 700;
    direction: ltr;
    text-align: left;
    width: 100%;
}

.graph-fn-card__hint {
    position: relative;
    z-index: 1;
    font-size: .72rem;
    color: var(--muted);
}

.graph-fn-card[data-graph-fn="sine"] { border-right: 3px solid #22d3ee; }
.graph-fn-card[data-graph-fn="cosine"] { border-right: 3px solid #818cf8; }
.graph-fn-card[data-graph-fn="quadratic"] { border-right: 3px solid #c084fc; }
.graph-fn-card[data-graph-fn="cubic"] { border-right: 3px solid #f472b6; }
.graph-fn-card[data-graph-fn="absolute"] { border-right: 3px solid #34d399; }

.graph-fn-card:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

.graph-fn-card:hover .graph-fn-card__glow { opacity: 1; }

.graph-fn-card.active {
    border-color: rgba(34, 211, 238, 0.6);
    box-shadow: 0 0 36px rgba(34, 211, 238, 0.18);
    transform: translateY(-4px);
}

.graph-fn-card.active .graph-fn-card__glow { opacity: 1; }

.graph-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.graph-details-panel {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.graph-axis-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .55rem;
    padding: .85rem 1rem;
    border-radius: .85rem;
    background: rgba(12, 18, 36, 0.9);
    border: 1px solid rgba(129, 140, 248, 0.25);
    direction: rtl;
    font-size: .8rem;
}

.graph-axis-info__item {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.graph-axis-info__label {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
}

.graph-axis-info__value {
    font-family: ui-monospace, monospace;
    direction: ltr;
    text-align: right;
    color: #e2e8f0;
    font-weight: 600;
}

.graph-canvas-shell {
    position: relative;
    width: 100%;
    border-radius: 1.35rem;
    border: 1px solid rgba(129, 140, 248, 0.35);
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 0%, rgba(34, 211, 238, 0.08), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(192, 132, 252, 0.1), transparent 40%),
        rgba(8, 12, 24, 0.92);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 24px 80px rgba(0, 0, 0, 0.45),
        0 0 60px rgba(34, 211, 238, 0.08);
}

.graph-canvas-glow {
    position: absolute;
    inset: -30%;
    background: conic-gradient(from 180deg, rgba(99,102,241,.15), rgba(34,211,238,.12), rgba(192,132,252,.15), rgba(99,102,241,.15));
    animation: graphGlowSpin 18s linear infinite;
    opacity: .55;
    pointer-events: none;
}

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

#graphCanvas {
    position: relative;
    z-index: 1;
    width: 100%;
    height: clamp(320px, 50vw, 480px);
    display: block;
}

.graph-meta {
    position: absolute;
    top: 1.1rem;
    left: 1.1rem;
    right: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
    z-index: 2;
}

.graph-formula {
    font-family: ui-monospace, monospace;
    font-size: clamp(1rem, 2vw, 1.15rem);
    font-weight: 600;
    color: #67e8f9;
    background: rgba(15, 23, 42, 0.82);
    padding: .5rem 1rem;
    border-radius: .65rem;
    border: 1px solid rgba(34, 211, 238, 0.35);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
    direction: ltr;
}

.graph-progress-wrap {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: rgba(15, 23, 42, 0.82);
    padding: .45rem .85rem;
    border-radius: .65rem;
    border: 1px solid var(--border);
}

.graph-progress-bar {
    display: block;
    width: 88px;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.graph-progress-bar span {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6366f1, #22d3ee);
    transition: width .08s linear;
}

.graph-progress {
    font-size: .88rem;
    font-weight: 700;
    color: var(--accent2);
    min-width: 2.5rem;
    text-align: center;
}

.graph-intercepts {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1.25rem;
    padding: .85rem 1rem;
    border-radius: .85rem;
    background: rgba(12, 18, 36, 0.9);
    border: 1px solid rgba(129, 140, 248, 0.3);
    direction: rtl;
    font-size: .82rem;
    line-height: 1.65;
}

.graph-intercepts__title {
    width: 100%;
    font-weight: 800;
    color: var(--accent2);
    font-size: .78rem;
    margin-bottom: .15rem;
}

.graph-intercepts__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .5rem;
}

.graph-intercepts__axis {
    color: var(--muted);
    font-weight: 600;
}

.graph-intercepts__point {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border-radius: .45rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(129, 140, 248, 0.25);
    font-family: ui-monospace, monospace;
    direction: ltr;
    color: #e2e8f0;
}

.graph-intercepts__point-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

@media (max-width: 900px) {
    .graph-fn-card__hint { display: none; }
    .graph-fn-card__label { font-size: .82rem; }
}

@media (max-width: 640px) {
    .graph-meta {
        flex-direction: row;
        flex-wrap: wrap;
        top: .65rem;
        left: .65rem;
        right: .65rem;
        gap: .45rem;
    }

    .graph-formula {
        font-size: .82rem;
        padding: .4rem .65rem;
        flex: 1 1 auto;
    }

    .graph-progress-wrap {
        padding: .35rem .6rem;
    }

    .graph-progress-bar { width: 56px; }

    #graphCanvas {
        height: min(72vw, 320px);
    }

    .graph-demo-head { margin-bottom: 1.5rem; padding-inline: .25rem; }
    .graph-demo-title { font-size: 1.25rem !important; }
    .graph-demo-sub { font-size: .88rem !important; }

    .graph-axis-info {
        grid-template-columns: 1fr 1fr;
        padding: .65rem .75rem;
        font-size: .74rem;
    }

    .graph-intercepts {
        font-size: .74rem;
        padding: .65rem .75rem;
    }

    .graph-intercepts__row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ─── global mobile polish ─── */
@media (max-width: 767px) {
    .landing-wrap,
    .section,
    .stats-bar,
    .cta-banner,
    .graph-demo-stage {
        max-width: 100%;
        overflow-x: hidden;
    }

    .l-nav-inner { padding: .65rem 1rem; }

    .hero {
        padding: 1.25rem 1rem 2.5rem;
    }

    .hero h1 {
        font-size: clamp(1.55rem, 7vw, 2rem);
        line-height: 1.35;
    }

    .hero-badge {
        font-size: .72rem;
        padding: .35rem .75rem;
        line-height: 1.5;
        text-align: center;
        justify-content: center;
    }

    .hero-lead { font-size: .9rem; }

    .formula-chip { font-size: .75rem; }

    .section {
        padding: 2.25rem 1rem;
    }

    .section-head { margin-bottom: 1.75rem; }
    .section-head h2 { font-size: 1.35rem; }
    .section-head p { font-size: .88rem; }

    .graph-demo-section {
        padding-block: 2rem 2.5rem;
    }

    .graph-demo-stage {
        padding-inline: 0;
        max-width: 100%;
    }

    .stats-bar { padding: 0 1rem; margin-bottom: .5rem; }
    .stats-bar-inner { padding: 1rem .75rem; gap: .5rem; }
    .stats-bar-item span { font-size: .72rem; }

    .glass-card { padding: 1.1rem; }
    .glass-card h3 { font-size: .92rem; }
    .glass-card p { font-size: .82rem; }

    .step-card { padding: 1.15rem 1rem; }

    .level-pill { font-size: .8rem; padding: .45rem .85rem; }

    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: .55rem; }
    .cat-item { padding: .85rem .5rem; }
    .cat-item span { font-size: .78rem; }

    .scroll-item { flex: 0 0 min(260px, 88vw); }

    .cta-inner { padding: 1.75rem 1.25rem; }
    .cta-inner h2 { font-size: 1.2rem; }
    .cta-inner p { font-size: .88rem; }

    .l-footer { padding: 2rem 1rem 1.25rem; }

    .footer-copy {
        font-size: .72rem;
        padding-inline: .5rem;
        line-height: 1.6;
    }

    .photo-shell { max-width: min(260px, 78vw); padding: 10px; }

    .hero-photo-stack { max-width: min(300px, 92vw); }

    .btn-glow,
    .btn-ghost {
        font-size: .88rem;
        padding: .75rem 1.15rem;
    }
}

@media (max-width: 380px) {
    .stats-bar-inner { grid-template-columns: 1fr 1fr; }
    .graph-axis-info { grid-template-columns: 1fr; }
    .brand-sub { display: none; }
}

/* ─── Mobile performance (reduce GPU / main-thread load) ─── */
html.is-mobile .bg-canvas,
html.is-mobile .orb,
html.is-mobile .grid-overlay,
html.is-mobile .floating-symbols,
html.is-mobile .hero-stage,
html.is-mobile .photo-glow,
html.is-mobile .graph-canvas-glow {
    display: none !important;
}

@media (max-width: 768px) {
    .bg-canvas,
    .orb,
    .grid-overlay,
    .floating-symbols,
    .hero-stage,
    .photo-glow,
    .graph-canvas-glow {
        display: none !important;
    }

    body.landing {
        background: var(--bg);
    }

    .l-nav,
    .glass-card,
    .stats-bar-inner,
    .teacher-card,
    .auth-card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .l-nav {
        background: rgba(4, 6, 13, 0.98);
    }

    .orb,
    .symbol,
    .hero-deco-ring,
    .photo-glow,
    .brand-mark,
    .mark-glow,
    .scan-line,
    .graph-canvas-glow,
    .stats-bar-item strong,
    .btn-glow,
    .frame-spin,
    .glow-pulse {
        animation: none !important;
    }

    .hero-visual {
        contain: layout style paint;
    }

    .graph-demo-section {
        padding-block: 2.5rem 3rem;
    }
}

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

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

    .bg-canvas { display: none !important; }
}
