:root {
    --bg: #080d1c;
    --bg-soft: #0e1830;
    --card: rgba(255, 255, 255, 0.075);
    --card-strong: rgba(255, 255, 255, 0.12);
    --text: #eef4ff;
    --muted: #a9b6d3;
    --line: rgba(255, 255, 255, 0.14);
    --primary: #68e1fd;
    --primary-2: #8b5cf6;
    --accent: #fbbf24;
    --success: #10b981;
    --danger: #ef4444;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 15%, rgba(104, 225, 253, 0.20), transparent 28%),
        radial-gradient(circle at 85% 10%, rgba(139, 92, 246, 0.24), transparent 30%),
        radial-gradient(circle at 65% 85%, rgba(251, 191, 36, 0.12), transparent 35%),
        var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.75;
    overflow-x: hidden;
}

body.lang-fa {
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255,255,255,.05), transparent 35%, rgba(255,255,255,.03));
    z-index: -2;
}

.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .16;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
    z-index: -1;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(var(--container), calc(100% - 40px)); margin-inline: auto; }
.section-pad { padding: 92px 0; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
    background: rgba(8, 13, 28, 0.72);
    border-bottom: 1px solid var(--line);
}

.navbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #06101e;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 12px 28px rgba(104, 225, 253, 0.28);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 22px;
    color: var(--muted);
    font-size: 0.95rem;
}
.nav-menu a { transition: color .2s ease, transform .2s ease; }
.nav-menu a:hover { color: var(--text); transform: translateY(-1px); }
.language-switch {
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    color: var(--text) !important;
}
.nav-toggle {
    display: none;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
}

.hero { padding-top: 114px; }
.hero-grid {
    display: grid;
    grid-template-columns: 1.18fr .82fr;
    gap: 46px;
    align-items: center;
}
.badge, .eyebrow, .paper-status, .period {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    background: rgba(104, 225, 253, .09);
    border: 1px solid rgba(104, 225, 253, .22);
    padding: 8px 13px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
}
.eyebrow { text-transform: uppercase; letter-spacing: .16em; }
.lang-fa .eyebrow { letter-spacing: 0; text-transform: none; }

h1, h2, h3 { line-height: 1.18; margin: 0; }
h1 {
    margin-top: 24px;
    font-size: clamp(2.35rem, 6vw, 5.6rem);
    max-width: 980px;
    letter-spacing: -0.065em;
}
.lang-fa h1 { letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.045em; }
.lang-fa h2 { letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; }
p { color: var(--muted); margin: 14px 0 0; }
.lead { font-size: 1.08rem; max-width: 760px; }
.hero-subtitle { color: var(--accent); font-weight: 700; font-size: 1.06rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    color: #06101e;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 18px 34px rgba(104, 225, 253, .18);
}
.btn-secondary, .btn-ghost {
    color: var(--text);
    border-color: var(--line);
    background: rgba(255,255,255,.07);
}
.btn-ghost { background: transparent; }

.hero-card, .glass-card, .research-panel, .pipeline-step, .timeline-item, .skill-card, .education-card, .contact-form, .cv-shell {
    border: 1px solid var(--line);
    background: linear-gradient(160deg, rgba(255,255,255,.11), rgba(255,255,255,.05));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.hero-card {
    padding: 30px;
    position: relative;
    overflow: hidden;
}
.hero-card::before {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(104, 225, 253, .18);
    filter: blur(20px);
    inset-inline-end: -80px;
    top: -80px;
}
.profile-orb {
    position: relative;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255,255,255,.08);
    border: 1px solid var(--line);
    margin-bottom: 22px;
}
.mini-tags, .highlight-list, .chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.mini-tags span, .highlight-list span, .chips span {
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.07);
    color: var(--text);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: .86rem;
}

.stats-grid {
    margin-top: 54px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.stat-card {
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255,255,255,.06);
}
.stat-card strong { display: block; font-size: 1.65rem; color: var(--text); }
.stat-card span { color: var(--muted); }

.two-col, .contact-grid {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 42px;
    align-items: center;
}
.aligned-start { align-items: start; }
.section-heading p { max-width: 640px; }
.center { text-align: center; max-width: 760px; margin-inline: auto; }
.compact { margin-bottom: 22px; }
.sub-heading { color: var(--primary); margin-top: 24px; }
.card-grid, .skills-grid, .pipeline-grid, .education-list, .contact-cards {
    display: grid;
    gap: 16px;
}
.card-grid { grid-template-columns: 1fr; }
.glass-card, .skill-card, .education-card { padding: 24px; }
.glass-card h3, .skill-card h3, .education-card h3 { color: var(--text); }

.research-section {
    background: linear-gradient(180deg, transparent, rgba(255,255,255,.035), transparent);
}
.research-panel { padding: clamp(24px, 5vw, 46px); }
.research-panel h3 { margin-top: 18px; font-size: clamp(1.5rem, 3vw, 2.35rem); }
.pipeline-block { margin-top: 36px; }
.pipeline-grid { grid-template-columns: repeat(4, 1fr); }
.pipeline-step { padding: 24px; position: relative; overflow: hidden; }
.pipeline-step span {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #06101e;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-weight: 900;
    margin-bottom: 18px;
}
.pipeline-step::after {
    content: "";
    position: absolute;
    inset-inline-end: -36px;
    bottom: -36px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(139, 92, 246, .14);
}

.sticky-heading { position: sticky; top: 110px; }
.timeline { position: relative; display: grid; gap: 18px; }
.timeline-item { padding: 26px 26px 26px 32px; position: relative; }
.lang-fa .timeline-item { padding: 26px 32px 26px 26px; }
.timeline-dot {
    position: absolute;
    top: 32px;
    inset-inline-start: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 8px rgba(104, 225, 253, .13);
}
.place { color: var(--accent); font-weight: 700; }

.skills-grid { grid-template-columns: repeat(4, 1fr); }
.skill-card { min-height: 190px; }
.skill-card .chips span { color: var(--muted); }

.education-list { grid-template-columns: 1fr; }
.education-card span { color: var(--primary); font-weight: 800; }
.accent-card { background: linear-gradient(135deg, rgba(104,225,253,.13), rgba(251,191,36,.10)); }

.contact-grid { align-items: start; }
.contact-cards { margin-top: 24px; grid-template-columns: 1fr; }
.contact-cards a {
    padding: 16px 18px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.055);
    border-radius: 16px;
    transition: transform .2s ease, border-color .2s ease;
}
.contact-cards a:hover { transform: translateY(-2px); border-color: rgba(104,225,253,.5); }
.contact-cards strong { display: block; color: var(--text); }
.contact-cards span { color: var(--muted); overflow-wrap: anywhere; }
.contact-form { padding: 26px; display: grid; gap: 16px; }
.contact-form label { display: grid; gap: 8px; color: var(--text); font-weight: 700; }
.contact-form input, .contact-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(6, 16, 30, .55);
    color: var(--text);
    padding: 14px 16px;
    outline: none;
    font: inherit;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(104,225,253,.10); }
.honeypot { display: none !important; }
.form-alert { padding: 12px 14px; border-radius: 14px; font-weight: 700; }
.form-alert.success { color: #d1fae5; background: rgba(16,185,129,.13); border: 1px solid rgba(16,185,129,.35); }
.form-alert.error { color: #fee2e2; background: rgba(239,68,68,.13); border: 1px solid rgba(239,68,68,.35); }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; text-align: center; background: rgba(8, 13, 28, .72); }
.site-footer p { margin: 0; }

.cv-shell { padding: clamp(24px, 5vw, 54px); background: rgba(255,255,255,.08); }
.cv-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 28px; }
.cv-shell section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.cv-shell section:last-child { border-bottom: 0; }
.cv-item { margin-top: 18px; }
.cv-item span { color: var(--primary); font-weight: 800; }
.compact-skills { grid-template-columns: repeat(2, 1fr); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: .12s; }
.delay-2 { transition-delay: .22s; }

@media (max-width: 980px) {
    .hero-grid, .two-col, .contact-grid { grid-template-columns: 1fr; }
    .pipeline-grid, .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .sticky-heading { position: static; }
}

@media (max-width: 760px) {
    .container { width: min(100% - 28px, var(--container)); }
    .section-pad { padding: 70px 0; }
    .hero { padding-top: 76px; }
    .nav-toggle { display: inline-grid; place-items: center; }
    .nav-menu {
        position: absolute;
        top: 76px;
        inset-inline: 14px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 20px;
        background: rgba(8, 13, 28, .96);
        box-shadow: var(--shadow);
    }
    .nav-menu.open, .nav-menu.always-open { display: flex; }
    .nav-menu a { padding: 10px 12px; }
    h1 { font-size: clamp(2.2rem, 13vw, 3.6rem); }
    .pipeline-grid, .skills-grid, .compact-skills { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .cv-header { flex-direction: column; }
}

@media print {
    body { background: #fff; color: #111; }
    .noise, .site-header, .btn { display: none !important; }
    .cv-shell { box-shadow: none; border: 0; background: #fff; color: #111; }
    p, .place { color: #333; }
    h1, h2, h3 { color: #111; }
}
