:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg-soft: #0d1220;
  --surface: rgba(17, 24, 39, 0.66);
  --surface-strong: rgba(17, 24, 39, 0.9);
  --surface-hover: rgba(24, 34, 55, 0.95);
  --text: #f5f7fb;
  --muted: #9ba7bb;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.3);
  --primary: #7c5cff;
  --primary-bright: #9f8cff;
  --cyan: #37d7ff;
  --green: #49e6a1;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --container: 1180px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-soft: #e9eef7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-hover: rgba(255, 255, 255, 1);
  --text: #101828;
  --muted: #58647a;
  --line: rgba(51, 65, 85, 0.12);
  --line-strong: rgba(51, 65, 85, 0.22);
  --primary: #6246ea;
  --primary-bright: #7c5cff;
  --cyan: #007ea8;
  --green: #078b5c;
  --shadow: 0 24px 70px rgba(77, 91, 125, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  font-family: "Vazirmatn", "Inter", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(124, 92, 255, .13), transparent 25%),
    radial-gradient(circle at 85% 25%, rgba(55, 215, 255, .08), transparent 26%),
    var(--bg);
  color: var(--text);
  line-height: 1.8;
  overflow-x: hidden;
  transition: background-color .35s ease, color .35s ease;
}

::selection { background: rgba(124, 92, 255, .34); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.section-shell { position: relative; padding: 92px 0; }

.noise {
  position: fixed; inset: 0; pointer-events: none; opacity: .035; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
.ambient { position: fixed; width: 420px; height: 420px; border-radius: 50%; filter: blur(90px); opacity: .11; pointer-events: none; z-index: 0; animation: drift 16s ease-in-out infinite alternate; }
.ambient-one { top: 9%; right: -150px; background: var(--primary); }
.ambient-two { bottom: 10%; left: -170px; background: var(--cyan); animation-delay: -6s; }
@keyframes drift { to { transform: translate3d(30px, -35px, 0) scale(1.08); } }

.page-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 100; background: transparent; }
.page-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--cyan)); box-shadow: 0 0 16px rgba(55,215,255,.55); }

.site-header { position: sticky; top: 0; z-index: 50; padding: 15px 0; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid transparent; transition: border-color .3s ease, background .3s ease; }
.site-header.scrolled { border-color: var(--line); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: max-content; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--cyan)); font: 800 13px/1 "Inter", sans-serif; color: white; box-shadow: 0 10px 30px rgba(124,92,255,.28); }
.brand-copy { display: grid; line-height: 1.35; }
.brand-copy strong { font-size: .98rem; }
.brand-copy small { color: var(--muted); font: 500 .68rem/1.5 "Inter", sans-serif; direction: ltr; }
.desktop-nav { display: flex; align-items: center; gap: 7px; padding: 5px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; }
.desktop-nav a { padding: 8px 15px; border-radius: 999px; color: var(--muted); font-size: .84rem; font-weight: 600; transition: .25s ease; }
.desktop-nav a:hover, .desktop-nav a.active { background: var(--surface-hover); color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 9px; }
.icon-button { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--surface); cursor: pointer; transition: .25s ease; }
.icon-button:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: 14px; font-family: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease; }
.button:hover { transform: translateY(-3px); }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--primary), #4f7dff); box-shadow: 0 16px 36px rgba(98,70,234,.28); }
.button-primary:hover { box-shadow: 0 20px 48px rgba(98,70,234,.38); }
.button-secondary, .button-ghost { color: var(--text); border-color: var(--line); background: var(--surface); }
.button-secondary:hover, .button-ghost:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.print-button { min-height: 43px; padding-inline: 14px; }

.hero { min-height: calc(100vh - 72px); display: grid; align-items: center; padding-top: 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.24fr) minmax(340px, .76fr); align-items: center; gap: clamp(48px, 8vw, 110px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--green); font-size: .84rem; font-weight: 700; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 7px color-mix(in srgb, var(--green) 14%, transparent); animation: pulse 2s ease infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px transparent; } }
.hero h1 { margin: 24px 0 20px; font-size: clamp(3.2rem, 8vw, 6.8rem); line-height: .98; letter-spacing: -.055em; font-weight: 900; }
.hero h1 span { display: block; margin-top: 22px; background: linear-gradient(95deg, var(--primary-bright), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: clamp(1.35rem, 3vw, 2.35rem); line-height: 1.45; letter-spacing: -.025em; font-weight: 800; }
.hero-lead { max-width: 780px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.14rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 30px; color: var(--muted); font-size: .85rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { color: var(--cyan); }

.hero-card { position: relative; overflow: hidden; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: linear-gradient(160deg, color-mix(in srgb, var(--surface-strong) 96%, transparent), color-mix(in srgb, var(--surface) 78%, transparent)); box-shadow: var(--shadow); isolation: isolate; }
.hero-card::before { content: ""; position: absolute; width: 220px; height: 220px; top: -100px; left: -70px; border-radius: 50%; background: var(--primary); opacity: .18; filter: blur(50px); z-index: -1; }
.profile-orbit { position: relative; width: 190px; aspect-ratio: 1; margin: 0 auto 28px; display: grid; place-items: center; }
.profile-avatar { width: 122px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 38px; background: linear-gradient(145deg, #11182a, #27355d); border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 28px 65px rgba(0,0,0,.28); font: 900 2.1rem/1 "Inter", sans-serif; color: #fff; transform: rotate(-4deg); }
.orbit { position: absolute; inset: 0; border: 1px dashed color-mix(in srgb, var(--primary) 48%, transparent); border-radius: 50%; animation: rotate 18s linear infinite; }
.orbit::before { content: ""; position: absolute; top: 13%; right: 7%; width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.orbit-two { inset: 20px; animation-direction: reverse; animation-duration: 13s; border-color: color-mix(in srgb, var(--cyan) 48%, transparent); }
.orbit-two::before { top: auto; right: auto; bottom: 5%; left: 25%; width: 9px; height: 9px; background: var(--primary-bright); box-shadow: 0 0 18px var(--primary); }
@keyframes rotate { to { transform: rotate(360deg); } }
.hero-card-copy { text-align: center; }
.hero-card-copy p { margin: 0 0 3px; color: var(--green); font-size: .79rem; font-weight: 700; }
.hero-card-copy h2 { margin: 0; font-size: 1.48rem; }
.hero-card-copy span { display: block; margin-top: 4px; color: var(--muted); font: 500 .74rem/1.6 "Inter", sans-serif; direction: ltr; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 26px; }
.metric-grid div { padding: 15px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 60%, transparent); border-radius: 17px; }
.metric-grid strong { display: block; font: 800 1.35rem/1.2 "Inter", "Vazirmatn", sans-serif; color: var(--text); }
.metric-grid span { color: var(--muted); font-size: .74rem; }

.section-heading { display: grid; grid-template-columns: minmax(180px, .5fr) minmax(280px, 1fr); gap: 12px 42px; align-items: end; margin-bottom: 42px; }
.section-heading > span { color: var(--primary-bright); font-size: .85rem; font-weight: 800; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.2; letter-spacing: -.04em; }
.section-heading p { grid-column: 2; max-width: 720px; margin: 2px 0 0; color: var(--muted); }
.glass-card, .focus-card, .skill-panel, .education-card, .certification-card { border: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.about-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; }
.about-copy { padding: clamp(28px, 5vw, 54px); border-radius: var(--radius-xl); font-size: 1.04rem; }
.about-copy p { margin: 0; }
.about-copy p + p { margin-top: 20px; color: var(--muted); }
.focus-grid { display: grid; gap: 14px; }
.focus-card { padding: 23px; border-radius: var(--radius-lg); transition: transform .25s ease, border-color .25s ease, background .25s ease; }
.focus-card:hover { transform: translateX(-7px); border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); background: var(--surface-hover); }
.icon-wrap { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, transparent); }
.focus-card h3 { margin: 15px 0 3px; font: 700 1rem/1.4 "Inter", "Vazirmatn", sans-serif; direction: ltr; text-align: right; }
.focus-card p { margin: 0; color: var(--muted); font-size: .86rem; }

.timeline { position: relative; display: grid; gap: 16px; }
.timeline::before { content: ""; position: absolute; right: 58px; top: 34px; bottom: 34px; width: 1px; background: linear-gradient(var(--primary), var(--line) 18%, var(--line) 82%, transparent); }
.timeline-item { position: relative; display: grid; grid-template-columns: 118px 1fr; gap: 22px; }
.timeline-marker { position: relative; display: flex; justify-content: flex-start; padding-top: 30px; z-index: 1; }
.timeline-marker::after { content: ""; position: absolute; top: 42px; right: 52px; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 3px solid var(--primary); box-shadow: 0 0 0 7px color-mix(in srgb, var(--primary) 10%, transparent); }
.timeline-marker span { color: var(--muted); font: 700 .72rem/1 "Inter", sans-serif; direction: ltr; }
.timeline-card { padding: 28px 30px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: linear-gradient(145deg, var(--surface-strong), var(--surface)); box-shadow: 0 18px 55px rgba(0,0,0,.13); transition: transform .25s ease, border-color .25s ease; }
.timeline-card:hover { transform: translateX(-6px); border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.timeline-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.timeline-head p { margin: 0 0 3px; color: var(--primary-bright); font-size: .85rem; font-weight: 700; }
.timeline-head h3 { margin: 0; font: 750 1.16rem/1.5 "Inter", "Vazirmatn", sans-serif; direction: ltr; text-align: right; }
.timeline-head time { min-width: max-content; color: var(--muted); font: 600 .72rem/1.5 "Inter", sans-serif; direction: ltr; }
.timeline-card > p { margin: 16px 0 0; color: var(--muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag-row span, .chip-cloud span { display: inline-flex; align-items: center; min-height: 31px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--surface) 70%, transparent); font: 600 .69rem/1.3 "Inter", "Vazirmatn", sans-serif; direction: ltr; }
.compact-card { padding-block: 22px; }

.skills-layout { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.skill-panel { padding: 28px; border-radius: var(--radius-lg); transition: transform .25s ease, border-color .25s ease; }
.skill-panel:hover { transform: translateY(-5px); border-color: var(--line-strong); }
.skill-title { display: flex; align-items: center; gap: 12px; }
.skill-title > span { color: var(--cyan); font: 800 .76rem/1 "Inter", sans-serif; }
.skill-title h3 { margin: 0; font: 750 1.08rem/1.4 "Inter", "Vazirmatn", sans-serif; direction: ltr; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.chip-cloud span { min-height: 35px; padding-inline: 13px; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--text); }

.education-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; align-items: stretch; }
.education-list { display: grid; gap: 14px; }
.education-card { display: grid; grid-template-columns: 145px 1fr; gap: 22px; align-items: center; padding: 25px 28px; border-radius: var(--radius-lg); transition: transform .25s ease, border-color .25s ease; }
.education-card:hover { transform: translateX(-5px); border-color: var(--line-strong); }
.edu-year { color: var(--muted); font: 700 .72rem/1.5 "Inter", sans-serif; direction: ltr; }
.education-card p { margin: 0 0 2px; color: var(--primary-bright); font: 700 .8rem/1.5 "Inter", sans-serif; direction: ltr; text-align: right; }
.education-card h3 { margin: 0; font: 700 1rem/1.55 "Inter", "Vazirmatn", sans-serif; direction: ltr; text-align: right; }
.education-card small { color: var(--muted); }
.certification-card { display: flex; flex-direction: column; justify-content: center; padding: 34px; border-radius: var(--radius-xl); background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 16%, var(--surface-strong)), var(--surface)); }
.cert-badge { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; color: var(--green); background: color-mix(in srgb, var(--green) 11%, transparent); }
.certification-card > p { margin: 19px 0 6px; color: var(--green); font-size: .8rem; font-weight: 700; }
.certification-card h3 { margin: 0; font: 700 1rem/1.5 "Inter", "Vazirmatn", sans-serif; direction: ltr; text-align: right; }
.certification-card > span { color: var(--muted); font: 500 .72rem/1.5 "Inter", sans-serif; direction: ltr; text-align: right; }
.certification-card hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 23px 0; }

.contact-card { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 36px; padding: clamp(32px, 6vw, 64px); border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line)); border-radius: var(--radius-xl); background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 17%, var(--surface-strong)), color-mix(in srgb, var(--cyan) 8%, var(--surface))); box-shadow: var(--shadow); }
.contact-card::after { content: "HN"; position: absolute; left: 25px; bottom: -50px; color: color-mix(in srgb, var(--text) 4%, transparent); font: 900 12rem/1 "Inter", sans-serif; pointer-events: none; }
.contact-card h2 { margin: 12px 0 9px; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.25; }
.contact-card p { max-width: 690px; margin: 0; color: var(--muted); }
.contact-card .button { min-width: max-content; z-index: 1; }

footer { padding: 0 0 34px; }
.footer-wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.footer-wrap p { margin: 0; }
.to-top { position: fixed; left: 24px; bottom: 24px; z-index: 30; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; border: 1px solid var(--line); color: var(--text); background: var(--surface-strong); box-shadow: var(--shadow); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(10px); transition: .25s ease; }
.to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .desktop-nav { display: none; }
  .hero { min-height: auto; }
  .hero-grid, .about-grid, .education-grid { grid-template-columns: 1fr; }
  .hero-card { max-width: 600px; }
  .section-heading { grid-template-columns: 1fr; }
  .section-heading p { grid-column: 1; }
}

@media (max-width: 720px) {
  .container { width: min(calc(100% - 28px), var(--container)); }
  .section-shell { padding: 70px 0; }
  .brand-copy { display: none; }
  .print-button { width: 43px; padding: 0; font-size: 0; }
  .hero { padding-top: 40px; }
  .hero h1 { font-size: clamp(3.25rem, 18vw, 5rem); }
  .hero-grid { gap: 44px; }
  .hero-card { padding: 24px; }
  .section-heading { margin-bottom: 30px; }
  .section-heading h2 { font-size: 2.1rem; }
  .skills-layout { grid-template-columns: 1fr; }
  .timeline::before { right: 14px; }
  .timeline-item { grid-template-columns: 36px 1fr; gap: 13px; }
  .timeline-marker { padding: 0; }
  .timeline-marker span { display: none; }
  .timeline-marker::after { right: 8px; top: 34px; }
  .timeline-card { padding: 23px 20px; }
  .timeline-head { display: grid; gap: 7px; }
  .timeline-head time { order: -1; }
  .education-card { grid-template-columns: 1fr; gap: 8px; }
  .contact-card { align-items: flex-start; flex-direction: column; }
  .footer-wrap { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .hero-actions .button { width: 100%; }
  .hero-meta { display: grid; gap: 10px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .contact-card .button { width: 100%; min-width: 0; }
}

@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 { opacity: 1; transform: none; }
}

@media print {
  :root, [data-theme="light"] {
    --bg: #fff; --surface: #fff; --surface-strong: #fff; --text: #111827; --muted: #475569; --line: #d9dee8; --line-strong: #bbc4d2; --primary: #4f46e5; --primary-bright: #4f46e5; --cyan: #0369a1; --green: #047857; --shadow: none;
  }
  @page { size: A4; margin: 10mm; }
  body { background: #fff !important; font-size: 9.5pt; line-height: 1.55; }
  .site-header, .ambient, .noise, .page-progress, .to-top, .hero-actions, .contact-section, footer { display: none !important; }
  .section-shell { padding: 10mm 0 0; break-inside: avoid; }
  .hero { min-height: auto; padding-top: 0; }
  .hero-grid { grid-template-columns: 1.5fr .7fr; gap: 10mm; }
  .hero h1 { margin-top: 5mm; font-size: 33pt; }
  .hero h1 span { margin-top: 3mm; font-size: 14pt; color: #4f46e5; -webkit-text-fill-color: #4f46e5; }
  .hero-lead { font-size: 10pt; }
  .hero-card { padding: 7mm; }
  .profile-orbit { width: 36mm; margin-bottom: 4mm; }
  .profile-avatar { width: 24mm; border-radius: 8mm; }
  .metric-grid { gap: 2mm; margin-top: 5mm; }
  .metric-grid div { padding: 3mm; }
  .section-heading { display: block; margin-bottom: 5mm; }
  .section-heading h2 { font-size: 18pt; margin: 1mm 0; }
  .section-heading p { margin: 0; }
  .about-grid, .education-grid { grid-template-columns: 1.2fr .8fr; gap: 4mm; }
  .about-copy { padding: 6mm; }
  .focus-grid { gap: 2mm; }
  .focus-card { padding: 4mm; }
  .focus-card p { font-size: 8.2pt; }
  .timeline { gap: 2.5mm; }
  .timeline::before, .timeline-marker { display: none; }
  .timeline-item { grid-template-columns: 1fr; }
  .timeline-card { padding: 4mm 5mm; break-inside: avoid; }
  .timeline-card > p, .tag-row { margin-top: 2mm; }
  .tag-row { gap: 1.5mm; }
  .tag-row span, .chip-cloud span { min-height: auto; padding: 1mm 2.2mm; font-size: 6.7pt; }
  .skills-layout { grid-template-columns: 1fr 1fr; gap: 3mm; }
  .skill-panel { padding: 5mm; }
  .chip-cloud { margin-top: 3mm; gap: 1.5mm; }
  .education-card { padding: 4mm 5mm; gap: 4mm; }
  .certification-card { padding: 6mm; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
