/* Premium motion and mobile-first enhancement layer */
:root {
  --font: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.2, .9, .25, 1.25);
  --header-height: 74px;
  --glow: 0 0 0 1px rgba(var(--accent-rgb), .08), 0 24px 80px rgba(var(--primary-rgb), .13);
}

html[lang="en"] { --font: "Inter", "Segoe UI", Arial, sans-serif; }
html { scrollbar-color: color-mix(in srgb, var(--accent) 72%, var(--primary)) var(--surface-2); }
body {
  min-width: 280px;
  background:
    radial-gradient(circle at 12% 0%, rgba(var(--accent-rgb), .08), transparent 30rem),
    radial-gradient(circle at 92% 34%, rgba(var(--primary-rgb), .07), transparent 28rem),
    var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .32;
  background-image:
    linear-gradient(rgba(var(--primary-rgb), .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--primary-rgb), .035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}
body.nav-open, body.drawer-open { overflow: hidden; }
::selection { color: #fff; background: var(--accent); }
:focus-visible { outline: 3px solid rgba(var(--accent-rgb), .42); outline-offset: 3px; }

.scroll-progress {
  position: fixed;
  z-index: 250;
  inset: 0 0 auto;
  height: 3px;
  pointer-events: none;
  background: transparent;
}
.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--accent), var(--primary), var(--accent));
  box-shadow: 0 0 16px rgba(var(--accent-rgb), .72);
  will-change: transform;
}
html[dir="rtl"] .scroll-progress span { transform-origin: right; }
.cursor-aura {
  position: fixed;
  z-index: 5;
  width: 390px;
  height: 390px;
  left: 0;
  top: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(circle, rgba(var(--accent-rgb), .10), transparent 67%);
  transition: opacity .3s ease;
  mix-blend-mode: multiply;
}
.cursor-aura.active { opacity: 1; }

.site-header {
  transition: min-height .25s ease, background .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 14px 45px rgba(13, 35, 58, .08);
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
}
.site-header.is-scrolled .nav-wrap { min-height: 64px; }
.nav-wrap { transition: min-height .25s ease; }
.brand-mark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-size: 180% 180%;
  animation: brandGradient 7s ease infinite;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: -80% -30%;
  z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  transform: rotate(24deg) translateX(-120%);
  animation: brandShine 5.5s ease-in-out infinite;
}
.desktop-nav a.active { color: var(--primary); }
.desktop-nav a.active::after { transform: scaleX(1); }
.header-actions { position: relative; z-index: 2; }
.mobile-menu-toggle { display: none; padding: 10px; }
.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px 0;
  border-radius: 999px;
  background: var(--primary);
  transition: transform .25s ease, opacity .25s ease;
}
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 108;
  background: rgba(5, 17, 29, .52);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity .25s ease;
}
.mobile-nav-backdrop.visible { opacity: 1; }
.mobile-nav-drawer {
  position: fixed;
  z-index: 109;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(90vw, 390px);
  padding: 22px;
  overflow: auto;
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0, rgba(var(--accent-rgb), .13), transparent 18rem),
    color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(24px);
  border-inline-start: 1px solid var(--border);
  box-shadow: -30px 0 90px rgba(7, 26, 44, .25);
  transform: translateX(110%);
  transition: transform .42s var(--ease-out);
}
html[dir="rtl"] .mobile-nav-drawer { transform: translateX(-110%); }
.mobile-nav-drawer.open { transform: translateX(0); }
.mobile-nav-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.mobile-nav-links { display: grid; gap: 7px; padding: 22px 0; }
.mobile-nav-links a {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  min-height: 56px;
  padding: 7px 12px;
  border-radius: 15px;
  transition: background .2s ease, transform .2s ease;
}
.mobile-nav-links a:hover, .mobile-nav-links a.active { background: var(--surface-2); transform: translateX(-3px); }
html[dir="ltr"] .mobile-nav-links a:hover, html[dir="ltr"] .mobile-nav-links a.active { transform: translateX(3px); }
.mobile-nav-links span { color: var(--accent); font-size: .7rem; font-weight: 900; }
.mobile-nav-links strong { font-size: .95rem; }
.mobile-nav-actions { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }

.hero-section {
  isolation: isolate;
  min-height: calc(100svh - var(--header-height));
  display: flex;
  align-items: center;
  padding-bottom: clamp(52px, 7vw, 94px);
}
.hero-section::before {
  animation: blobFloatOne 12s ease-in-out infinite alternate;
  filter: blur(8px);
}
.hero-section::after {
  animation: blobFloatTwo 15s ease-in-out infinite alternate;
  filter: blur(4px);
}
.hero-section > .container { position: relative; z-index: 3; }
.ambient-particle {
  position: absolute;
  z-index: 0;
  width: var(--particle-size, 5px);
  height: var(--particle-size, 5px);
  left: var(--particle-x, 50%);
  top: var(--particle-y, 50%);
  border-radius: 50%;
  background: rgba(var(--accent-rgb), var(--particle-alpha, .25));
  box-shadow: 0 0 16px rgba(var(--accent-rgb), .26);
  animation: particleFloat var(--particle-duration, 8s) ease-in-out infinite alternate;
  animation-delay: var(--particle-delay, 0s);
  pointer-events: none;
}
.resume-shell {
  isolation: isolate;
  box-shadow: var(--glow);
  transition: border-radius .25s ease, box-shadow .35s ease, transform .45s var(--ease-out);
}
.resume-shell::before {
  content: "";
  position: absolute;
  z-index: 6;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.8), rgba(var(--accent-rgb), .35), transparent 40%, rgba(var(--primary-rgb), .25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.profile-panel {
  background:
    radial-gradient(circle at 18% 8%, rgba(255,255,255,.2), transparent 24%),
    radial-gradient(circle at 85% 82%, rgba(var(--accent-rgb), .24), transparent 28%),
    linear-gradient(155deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #061523));
}
.profile-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 35%, #000, transparent 74%);
}
.profile-photo-wrap { z-index: 1; transition: transform .45s var(--ease-out); }
.profile-photo-wrap:hover { transform: translateY(-5px) scale(1.015); }
.profile-photo {
  position: relative;
  z-index: 3;
  transition: transform .5s var(--ease-out), box-shadow .5s ease;
  box-shadow: 0 24px 60px rgba(0,0,0,.30), 0 0 0 1px rgba(255,255,255,.2);
}
.profile-photo-wrap:hover .profile-photo { transform: scale(1.035); box-shadow: 0 32px 72px rgba(0,0,0,.34); }
.photo-orbit {
  position: absolute;
  z-index: 1;
  inset: -14px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 42px;
  pointer-events: none;
  animation: orbitSpin 13s linear infinite;
}
.photo-orbit::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  top: -4px;
  left: 50%;
  border-radius: 50%;
  background: #6ee7ff;
  box-shadow: 0 0 14px #6ee7ff;
}
.orbit-two { inset: -25px; opacity: .52; animation-duration: 19s; animation-direction: reverse; }
.orbit-two::after { top: auto; bottom: -3px; background: #65f2bd; box-shadow: 0 0 14px #65f2bd; }
.status-dot { z-index: 6; animation: statusPulse 2.2s ease-in-out infinite; }
.floating-tech {
  position: absolute;
  z-index: 8;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  color: #fff;
  background: rgba(6, 27, 45, .64);
  backdrop-filter: blur(8px);
  font: 700 .62rem/1 "Inter", sans-serif;
  box-shadow: 0 10px 24px rgba(0,0,0,.2);
}
.tech-python { top: 15%; inset-inline-start: -35px; animation: techFloat 4.6s ease-in-out infinite; }
.tech-react { bottom: 9%; inset-inline-end: -30px; animation: techFloat 5.2s ease-in-out infinite reverse; }
.profile-heading h1 { text-shadow: 0 8px 28px rgba(0,0,0,.18); }
.availability > span:first-child { animation: availabilityPulse 2.1s ease-out infinite; }
.profile-quick-actions { grid-template-columns: 1fr 1fr; }
.profile-share { grid-column: 1 / -1; }
.profile-panel .primary-btn, .profile-panel .ghost-btn { position: relative; overflow: hidden; }
.profile-panel .primary-btn::after, .contact-actions .primary-btn::after {
  content: "";
  position: absolute;
  inset: -50% -20%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform: translateX(-120%) rotate(20deg);
  animation: buttonShine 4.8s ease-in-out infinite;
}
.quick-facts > div { transition: background .25s ease, transform .25s ease; border-radius: 11px; padding-inline: 8px; }
.quick-facts > div:hover { background: rgba(255,255,255,.07); transform: translateX(-3px); }
html[dir="ltr"] .quick-facts > div:hover { transform: translateX(3px); }
.quick-facts strong { font-family: "Inter", sans-serif; font-variant-numeric: tabular-nums; }

.resume-version-bar {
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.resume-version-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(var(--accent-rgb), .08), transparent 70%);
  transform: translateX(-110%);
  animation: versionSweep 7s ease-in-out infinite;
}
.hero-title {
  text-wrap: balance;
  background: linear-gradient(135deg, var(--text) 10%, var(--primary) 60%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-summary { text-wrap: pretty; }
.expertise-chips span {
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.expertise-chips span:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 9px 24px rgba(var(--accent-rgb), .13);
}
.hero-highlight-grid article {
  position: relative;
  overflow: hidden;
  transition: transform .32s var(--ease-out), border-color .25s ease, box-shadow .32s ease;
}
.hero-highlight-grid article::before, .project-card::before, .services-grid article::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), .13), transparent 42%);
  transition: opacity .25s ease;
}
.hero-highlight-grid article:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 18px 38px rgba(var(--primary-rgb), .10); }
.hero-highlight-grid article:hover::before, .project-card:hover::before, .services-grid article:hover::before { opacity: 1; }
.hero-highlight-grid svg { transition: transform .4s var(--ease-spring); }
.hero-highlight-grid article:hover svg { transform: scale(1.16) rotate(-5deg); }
.hero-scroll-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: max-content;
  margin: 22px auto -34px;
  color: var(--muted);
  font-size: .7rem;
}
.hero-scroll-cue span { width: 20px; height: 32px; border: 1px solid var(--border); border-radius: 999px; position: relative; }
.hero-scroll-cue span::after { content: ""; position: absolute; width: 4px; height: 7px; left: 50%; top: 6px; transform: translateX(-50%); border-radius: 999px; background: var(--accent); animation: scrollCue 1.8s ease-in-out infinite; }

section[id] { position: relative; }
.section-heading h2 { text-wrap: balance; }
.section-heading .eyebrow { display: inline-flex; align-items: center; gap: 9px; }
.section-heading .eyebrow::before { content: ""; width: 24px; height: 2px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), transparent); }
html[dir="rtl"] .section-heading .eyebrow::before { background: linear-gradient(-90deg, var(--accent), transparent); }

.timeline::before { transform-origin: top; transition: transform 1.2s var(--ease-out); }
.timeline:not(.timeline-visible)::before { transform: scaleY(0); }
.timeline-card, .project-card, .services-grid article, .stack-list article, .certificate-list article {
  will-change: transform;
  transition: transform .36s var(--ease-out), box-shadow .36s ease, border-color .28s ease;
}
.timeline-card:hover, .project-card:hover, .stack-list article:hover, .certificate-list article:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 56px rgba(var(--primary-rgb), .13);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}
.timeline-marker { animation: markerPulse 2.7s ease-in-out infinite; }
.project-card { position: relative; }
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  border: 1px solid transparent;
  background: linear-gradient(135deg, rgba(255,255,255,.7), transparent 35%, rgba(var(--accent-rgb), .18)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .5;
}
.project-visual { background-size: 180% 180%; animation: projectGradient 10s ease infinite; }
.dashboard-mock i { transform-origin: bottom; animation: chartRise 2.4s var(--ease-out) both, chartGlow 3.4s ease-in-out infinite alternate; }
.dashboard-mock i:nth-child(2) { animation-delay: .12s; }
.dashboard-mock i:nth-child(3) { animation-delay: .24s; }
.dashboard-mock i:nth-child(4) { animation-delay: .36s; }
.dashboard-mock i:nth-child(5) { animation-delay: .48s; }
.dashboard-mock i:nth-child(6) { animation-delay: .6s; }
.project-icon { transition: transform .45s var(--ease-spring), box-shadow .3s ease; }
.project-card:hover .project-icon { transform: scale(1.1) rotate(-5deg); box-shadow: 0 16px 32px rgba(var(--accent-rgb), .15); }
.tag-list span, .cloud span { transition: transform .2s ease, background .2s ease; }
.tag-list span:hover, .cloud span:hover { transform: translateY(-2px); }

.dark-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(var(--accent-rgb), .18), transparent 28rem),
    radial-gradient(circle at 90% 90%, rgba(255,255,255,.07), transparent 25rem),
    linear-gradient(145deg, color-mix(in srgb, var(--primary) 88%, #061726), #071d31);
}
.dark-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image: radial-gradient(rgba(255,255,255,.7) .7px, transparent .7px);
  background-size: 20px 20px;
}
.dark-section .container { position: relative; z-index: 1; }
.skill-row progress {
  --skill-value: 0%;
  position: relative;
  overflow: hidden;
  transition: filter .3s ease;
}
.skill-row progress::-webkit-progress-value { transform-origin: left; transform: scaleX(0); transition: transform 1.25s var(--ease-out); }
html[dir="rtl"] .skill-row progress::-webkit-progress-value { transform-origin: right; }
.skills-animated .skill-row progress::-webkit-progress-value { transform: scaleX(1); }
.skill-row progress::-moz-progress-bar { transform-origin: left; transform: scaleX(0); transition: transform 1.25s var(--ease-out); }
.skills-animated .skill-row progress::-moz-progress-bar { transform: scaleX(1); }
.skill-row:hover progress { filter: brightness(1.18); }
.skill-groups article { transition: transform .3s var(--ease-out), background .3s ease, border-color .3s ease; }
.skill-groups article:hover { transform: translateY(-5px); background: rgba(255,255,255,.075); border-color: rgba(255,255,255,.20); }

.services-grid article { isolation: isolate; }
.services-grid article > span { transition: transform .4s var(--ease-out), color .3s ease; }
.services-grid article:hover > span { transform: translateY(6px) scale(1.06); color: rgba(var(--accent-rgb), .20); }
.services-grid svg { transition: transform .45s var(--ease-spring), color .25s ease; }
.services-grid article:hover svg { transform: translateY(-4px) scale(1.12) rotate(-5deg); color: var(--primary); }
.stack-list article, .certificate-list article { position: relative; overflow: hidden; }
.stack-list article::after, .certificate-list article::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: linear-gradient(var(--accent), var(--primary)); transform: scaleY(0); transform-origin: top; transition: transform .35s var(--ease-out); }
.stack-list article:hover::after, .certificate-list article:hover::after { transform: scaleY(1); }

.contact-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-size: 180% 180%;
  animation: contactGradient 12s ease infinite;
}
.contact-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 340px;
  height: 340px;
  inset-inline-end: -120px;
  top: -180px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  box-shadow: 0 0 0 50px rgba(255,255,255,.025), 0 0 0 100px rgba(255,255,255,.018);
  animation: contactOrbit 14s linear infinite;
}
.contact-actions .ghost-btn { position: relative; overflow: hidden; }
.footer-copy { margin-top: 3px; color: var(--muted); font-size: .67rem; }

/* Motion classes are only activated by JS, so content remains visible without JavaScript. */
html.motion-ready .reveal-item {
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(.985);
  filter: blur(5px);
  transition:
    opacity .72s var(--ease-out) var(--reveal-delay, 0ms),
    transform .72s var(--ease-out) var(--reveal-delay, 0ms),
    filter .65s ease var(--reveal-delay, 0ms);
}
html.motion-ready .reveal-item.reveal-from-side { transform: translate3d(var(--reveal-x, 36px), 0, 0) scale(.985); }
html.motion-ready .reveal-item.is-visible { opacity: 1; transform: translate3d(0,0,0) scale(1); filter: blur(0); }

.noscript-banner { position: fixed; z-index: 300; inset-inline: 12px; bottom: 12px; padding: 12px 16px; color: #fff; background: #172d43; border-radius: 12px; text-align: center; font-size: .8rem; }

@keyframes brandGradient { 0%,100% { background-position: 0 50%; } 50% { background-position: 100% 50%; } }
@keyframes brandShine { 0%, 55% { transform: rotate(24deg) translateX(-140%); } 75%,100% { transform: rotate(24deg) translateX(140%); } }
@keyframes blobFloatOne { to { transform: translate3d(60px, 50px, 0) scale(1.12); } }
@keyframes blobFloatTwo { to { transform: translate3d(-45px, -40px, 0) scale(.92); } }
@keyframes particleFloat { to { transform: translate3d(18px, -30px, 0) scale(1.5); opacity: .2; } }
@keyframes orbitSpin { to { transform: rotate(360deg); } }
@keyframes statusPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(56,213,154,.55); } 50% { box-shadow: 0 0 0 10px rgba(56,213,154,0); } }
@keyframes techFloat { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-9px) rotate(2deg); } }
@keyframes availabilityPulse { 0% { box-shadow: 0 0 0 0 rgba(69,224,166,.48); } 75%,100% { box-shadow: 0 0 0 10px rgba(69,224,166,0); } }
@keyframes buttonShine { 0%,62% { transform: translateX(-140%) rotate(20deg); } 82%,100% { transform: translateX(140%) rotate(20deg); } }
@keyframes versionSweep { 0%,55% { transform: translateX(-120%); } 80%,100% { transform: translateX(120%); } }
@keyframes scrollCue { 0% { opacity: 0; transform: translate(-50%, 0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 11px); } }
@keyframes markerPulse { 0%,100% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 0 rgba(var(--accent-rgb), .32); } 50% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 9px rgba(var(--accent-rgb), 0); } }
@keyframes projectGradient { 0%,100% { background-position: 0 50%; } 50% { background-position: 100% 50%; } }
@keyframes chartRise { from { transform: scaleY(.05); opacity: .2; } to { transform: scaleY(1); opacity: 1; } }
@keyframes chartGlow { to { filter: brightness(1.18); } }
@keyframes contactGradient { 0%,100% { background-position: 0 50%; } 50% { background-position: 100% 50%; } }
@keyframes contactOrbit { to { transform: rotate(360deg); } }

@media (hover: hover) and (pointer: fine) {
  .primary-btn, .ghost-btn, .template-card { transform: translate3d(var(--magnet-x, 0), var(--magnet-y, 0), 0); }
}

@media (max-width: 1020px) {
  .mobile-menu-toggle { display: grid; place-content: center; }
  .header-actions .primary-btn.compact { display: none; }
  .hero-section { min-height: auto; }
  .profile-quick-actions { grid-template-columns: 1fr; }
  .profile-share { grid-column: auto; }
}

@media (max-width: 760px) {
  :root { --header-height: 66px; }
  body {
    background:
      radial-gradient(circle at 0 0, rgba(var(--accent-rgb), .10), transparent 20rem),
      var(--bg);
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
  body::before { background-size: 28px 28px; opacity: .2; }
  .cursor-aura { display: none; }
  .site-header { position: sticky; }
  .site-header.is-scrolled .nav-wrap { min-height: 60px; }
  .header-actions .ghost-btn.compact { min-width: 42px; }
  .mobile-menu-toggle { width: 42px; height: 42px; border-radius: 12px; }
  .hero-section { display: block; min-height: 0; padding-top: 22px; }
  .resume-shell { box-shadow: 0 18px 56px rgba(var(--primary-rgb), .14); }
  .resume-shell::before { opacity: .7; }
  .profile-panel { gap: 22px; padding-top: 33px; }
  .profile-photo-wrap { width: 138px; }
  .photo-orbit { inset: -10px; border-radius: 34px; }
  .orbit-two { inset: -18px; }
  .floating-tech { display: none; }
  .profile-quick-actions { grid-template-columns: 1fr 1fr; }
  .profile-share { grid-column: 1 / -1; }
  .quick-facts > div:hover { transform: none; }
  .hero-content { padding-top: 28px; }
  .hero-title { font-size: clamp(1.72rem, 8.2vw, 2.45rem); line-height: 1.42; letter-spacing: -.035em; }
  .hero-summary { line-height: 1.95; }
  .expertise-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -20px;
    padding-inline: 20px;
    padding-bottom: 7px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .expertise-chips::-webkit-scrollbar { display: none; }
  .expertise-chips span { flex: 0 0 auto; scroll-snap-align: start; }
  .hero-highlight-grid article { min-height: 78px; }
  .hero-scroll-cue { display: none; }
  .section-heading h2 { font-size: clamp(1.65rem, 7vw, 2.2rem); }
  .timeline-card:hover, .project-card:hover, .services-grid article:hover, .stack-list article:hover, .certificate-list article:hover { transform: none; }
  .timeline-card { box-shadow: 0 12px 32px rgba(var(--primary-rgb), .08); }
  .project-card { box-shadow: 0 12px 34px rgba(var(--primary-rgb), .09); }
  .project-visual { min-height: 215px; }
  .services-grid article { min-height: 175px; padding: 22px; }
  .contact-card { padding: 30px 21px; }
  .contact-card::before { width: 220px; height: 220px; top: -130px; inset-inline-end: -90px; }
  .contact-actions { width: 100%; }
  .mobile-action-bar {
    grid-template-columns: repeat(4, 1fr);
    inset-inline: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    border-radius: 20px;
    padding: 4px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: 0 18px 50px rgba(7, 25, 42, .24);
  }
  .mobile-action-bar a, .mobile-action-bar button {
    min-height: 57px;
    border-radius: 16px;
    transition: background .2s ease, color .2s ease, transform .2s ease;
  }
  .mobile-action-bar a + a, .mobile-action-bar a + button, .mobile-action-bar button + button { border-inline-start: 0; }
  .mobile-action-bar a.active { color: var(--primary); background: var(--surface-2); }
  .mobile-action-bar a.active svg { transform: translateY(-2px); }
  .mobile-action-bar svg { transition: transform .25s var(--ease-spring); }
  .customizer-drawer { padding-bottom: env(safe-area-inset-bottom); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); max-width: calc(100% - 24px); text-align: center; }
  html.motion-ready .reveal-item { transform: translate3d(0, 18px, 0) scale(.99); filter: blur(2px); }
  html.motion-ready .reveal-item.reveal-from-side { transform: translate3d(0, 18px, 0) scale(.99); }
}

@media (max-width: 480px) {
  .container { width: min(calc(100% - 18px), var(--container)); }
  .nav-wrap { gap: 8px; }
  .brand { gap: 8px; }
  .brand-text strong { font-size: .84rem; }
  .header-actions { gap: 5px; }
  .header-actions .ghost-btn.compact { width: 39px; min-width: 39px; padding: 0; }
  .mobile-menu-toggle { width: 39px; height: 39px; }
  .resume-shell { border-radius: 21px; }
  .profile-panel { border-radius: 21px 21px 0 0; padding-inline: 17px; }
  .profile-photo-wrap { width: 126px; }
  .profile-heading h1 { font-size: 1.7rem; }
  .hero-role { font-size: .83rem; }
  .profile-quick-actions { grid-template-columns: 1fr; }
  .profile-share { grid-column: auto; }
  .quick-facts { grid-template-columns: repeat(3, 1fr); }
  .quick-facts > div { min-width: 0; flex-direction: column; align-items: center; text-align: center; padding: 9px 2px 0; }
  .quick-facts span { font-size: .59rem; }
  .hero-content { padding-inline: 17px; }
  .resume-version-bar { padding: 10px; }
  .hero-title { font-size: clamp(1.58rem, 8vw, 2.05rem); }
  .hero-highlight-grid article { padding: 13px; }
  .timeline-card { margin-inline-start: 24px; padding-inline: 16px; }
  .timeline-marker { inset-inline-start: -23px; }
  .timeline::before { inset-inline-start: 7px; }
  .project-content { padding: 18px 16px; }
  .services-grid article { padding: 20px 17px; }
  .mobile-nav-drawer { width: 100%; }
}

@media (max-width: 350px) {
  .brand-text { display: none; }
  .quick-facts { grid-template-columns: 1fr; }
  .quick-facts > div { flex-direction: row; justify-content: center; gap: 8px; }
  .mobile-action-bar span { font-size: .61rem; }
}

@media (max-height: 520px) and (orientation: landscape) and (max-width: 900px) {
  .mobile-action-bar { display: none; }
  body { padding-bottom: 0; }
  .mobile-nav-drawer { width: min(68vw, 440px); }
  .profile-panel { min-height: auto; }
}

@media print {
  .scroll-progress, .cursor-aura, .mobile-nav-backdrop, .mobile-nav-drawer, .hero-scroll-cue, .photo-orbit, .floating-tech, .ambient-particle { display: none !important; }
  html.motion-ready .reveal-item { opacity: 1 !important; transform: none !important; filter: none !important; }
  .profile-photo, .contact-card, .project-visual { animation: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-aura, .ambient-particle, .hero-scroll-cue { display: none !important; }
  html.motion-ready .reveal-item { opacity: 1 !important; transform: none !important; filter: none !important; }
  .scroll-progress span { transition: none; }
}

/* Strict mobile width containment */
@media (max-width: 760px) {
  .resume-shell {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  .profile-panel,
  .hero-content,
  .profile-heading,
  .profile-quick-actions,
  .quick-facts,
  .resume-version-bar,
  .hero-highlight-grid,
  .hero-highlight-grid article {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .hero-role,
  .hero-summary,
  .hero-title,
  .profile-heading h1 {
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .resume-version-bar select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
}

html[dir="rtl"] .mobile-nav-drawer.open,
html[dir="ltr"] .mobile-nav-drawer.open {
  transform: translateX(0) !important;
}


/* Back-to-top controls */
.footer-top-button,
.floating-back-to-top {
  border: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  box-shadow: 0 14px 34px rgba(var(--primary-rgb), .24);
}
.footer-top-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  transition: transform .25s var(--ease-out), box-shadow .25s ease;
}
.footer-top-button svg { width: 21px; height: 21px; }
.footer-top-button:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(var(--primary-rgb), .32); }
.footer-top-button:active { transform: translateY(-1px) scale(.96); }

.floating-back-to-top {
  --scroll-progress: 0;
  position: fixed;
  z-index: 85;
  inset-inline-end: clamp(16px, 2.4vw, 34px);
  bottom: 28px;
  width: 54px;
  height: 54px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) scale(.88);
  transition: opacity .28s ease, visibility .28s ease, transform .35s var(--ease-out), box-shadow .25s ease;
  isolation: isolate;
}
.floating-back-to-top::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: -1;
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 82%, #081522);
}
.floating-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.floating-back-to-top:hover { transform: translateY(-5px) scale(1.03); box-shadow: 0 20px 45px rgba(var(--primary-rgb), .38); }
.floating-back-to-top:active { transform: translateY(-1px) scale(.94); }
.back-to-top-ring,
.back-to-top-icon { position: absolute; }
.back-to-top-ring { inset: 3px; width: 48px; height: 48px; transform: rotate(-90deg); }
.back-to-top-ring circle { fill: none; stroke-width: 2; }
.back-to-top-ring .ring-track { stroke: rgba(255,255,255,.18); }
.back-to-top-ring .ring-progress {
  stroke: rgba(255,255,255,.95);
  stroke-linecap: round;
  stroke-dasharray: 131.95;
  stroke-dashoffset: calc(131.95 * (1 - var(--scroll-progress)));
  transition: stroke-dashoffset .12s linear;
}
.back-to-top-icon { width: 24px; height: 24px; transition: transform .25s var(--ease-out); }
.floating-back-to-top:hover .back-to-top-icon { transform: translateY(-3px); }

@media (max-width: 760px) {
  .floating-back-to-top {
    width: 48px;
    height: 48px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    inset-inline-end: 14px;
    border-radius: 16px;
  }
  .floating-back-to-top::before { border-radius: 12px; }
  .back-to-top-ring { width: 42px; height: 42px; }
  .back-to-top-icon { width: 21px; height: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .floating-back-to-top,
  .footer-top-button,
  .back-to-top-icon { transition: none !important; }
}
