/* rezahpf.ir — minimal glassmorphism + scroll-driven animations */
@font-face {
  font-family: "Vazirmatn";
  src: local("Vazirmatn"), url("../../fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}

:root {
  --bg: #0b1020; --text: #e8ecf8; --muted: #9aa6c4;
  --glass: rgba(255,255,255,.07); --glass-b: rgba(255,255,255,.14); --glass-hi: rgba(255,255,255,.22);
  --accent: #7c9cff; --accent2: #b58bff; --shadow: 0 10px 40px rgba(0,0,0,.35);
  --blob1: #4f6bff; --blob2: #a15bff; --blob3: #17c3b2;
  --radius: 22px; --maxw: 1080px;
  --font: "Vazirmatn", "Vazir", system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef2fb; --text: #141a2e; --muted: #5a6685;
  --glass: rgba(255,255,255,.55); --glass-b: rgba(255,255,255,.9); --glass-hi: #fff;
  --accent: #3b5bff; --accent2: #8a4dff; --shadow: 0 10px 40px rgba(40,60,120,.14);
  --blob1: #9bb0ff; --blob2: #d2b5ff; --blob3: #8ee6d9; color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #eef2fb; --text: #141a2e; --muted: #5a6685;
    --glass: rgba(255,255,255,.55); --glass-b: rgba(255,255,255,.9); --glass-hi: #fff;
    --accent: #3b5bff; --accent2: #8a4dff; --shadow: 0 10px 40px rgba(40,60,120,.14);
    --blob1: #9bb0ff; --blob2: #d2b5ff; --blob3: #8ee6d9; color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  line-height: 1.85; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.35; margin: 0; }
p { margin: 0 0 .9rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--accent); color: #fff; padding: .5rem 1rem; border-radius: 10px; z-index: 100; }
.skip:focus { top: 1rem; }

/* ─── Background blobs (parallax on scroll) ─── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: .55; }
.b1 { background: var(--blob1); top: -14vmax; inset-inline-start: -10vmax; }
.b2 { background: var(--blob2); bottom: -16vmax; inset-inline-end: -12vmax; }
.b3 { background: var(--blob3); top: 38%; inset-inline-start: 38%; width: 30vmax; height: 30vmax; opacity: .3; }

/* ─── Glass ─── */
.glass {
  background: var(--glass); border: 1px solid var(--glass-b);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
}
.card { border-radius: var(--radius); padding: 1.5rem 1.6rem; }

/* ─── Nav ─── */
.nav {
  position: fixed; top: 12px; inset-inline: 0; margin-inline: auto; width: min(94%, var(--maxw)); z-index: 50;
  display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem; border-radius: 999px;
}
.brand { font-weight: 700; color: var(--text); white-space: nowrap; }
.nav nav { display: flex; gap: .25rem; margin-inline-start: auto; overflow-x: auto; scrollbar-width: none; }
.nav nav::-webkit-scrollbar { display: none; }
.nav nav a { color: var(--muted); padding: .25rem .8rem; border-radius: 999px; white-space: nowrap; font-size: .92rem; }
.nav nav a:hover { color: var(--text); background: var(--glass); text-decoration: none; }
.icon-btn {
  border: 1px solid var(--glass-b); background: var(--glass); color: var(--text); width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; font-size: 1rem; flex: none; font-family: inherit;
  /* دکمه‌ای که <a> هم باشد، متنش دقیقاً وسط دایره می‌نشیند */
  display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1;
  text-decoration: none; unicode-bidi: isolate;
}
.icon-btn:hover { background: var(--glass-hi); text-decoration: none; }
.icon-btn.lang { font-size: .86rem; font-weight: 700; letter-spacing: 0; }

/* ─── Layout ─── */
main { width: min(92%, var(--maxw)); margin-inline: auto; }
.sec { padding: 5.5rem 0 1rem; }
.sec > h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin-bottom: 1.4rem; }
.sec > h2::after { content: ""; display: block; width: 46px; height: 4px; border-radius: 4px; margin-top: .5rem; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid.cols { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid .wide { grid-column: span 2; }
@media (max-width: 680px) { .grid .wide { grid-column: auto; } }

/* ─── Hero: خلاصهٔ کل رزومه در اولین نگاه ─── */
.hero { padding: 6.2rem 0 1.5rem; position: relative; }
.hero-inner { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 960px) { .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2.2rem; } }

.id { display: grid; gap: .8rem; align-content: center; justify-items: start; text-align: start; }
.id-head { display: flex; align-items: center; gap: 1.1rem; }
.avatar { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 3px solid var(--glass-hi); box-shadow: var(--shadow); flex: none; }
.id-head > div { display: grid; gap: .45rem; justify-items: start; min-width: 0; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); letter-spacing: -.01em; }
.headline { font-size: clamp(1.05rem, 2.2vw, 1.35rem); margin: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }
.tagline { color: var(--muted); max-width: 36rem; margin: 0; font-size: 1rem; line-height: 1.8; }
.pill { display: inline-flex; align-items: center; gap: .5rem; padding: .15rem .85rem; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-b); font-size: .82rem; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #37d67a; box-shadow: 0 0 0 0 rgba(55,214,122,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(55,214,122,0); } 100% { box-shadow: 0 0 0 0 rgba(55,214,122,0); } }
.id .cta { justify-content: flex-start; margin-top: .2rem; }
.quick { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: 0; padding: 0; list-style: none; }
.quick a, .quick span { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; padding: .15rem .75rem; border-radius: 999px; border: 1px solid var(--glass-b); background: var(--glass); color: var(--text); }
.quick a:hover { background: var(--glass-hi); text-decoration: none; }
.quick .k { color: var(--muted); }

.snap { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { border-radius: 18px; padding: .95rem 1.15rem; min-width: 0; display: grid; gap: .35rem; align-content: start; line-height: 1.6; }
.tile.full { grid-column: 1 / -1; }
.tile h2 { font-size: .86rem; font-weight: 600; color: var(--muted); margin: 0; }
.tile .big { font-size: 1.02rem; font-weight: 700; }
.tile .sub { font-size: .88rem; color: var(--muted); }
.tile .chips { margin-top: .15rem; gap: .35rem; }
.tile .chip { font-size: .78rem; padding: 0 .6rem; }
.tile .chip.hi { color: var(--text); }
.skill-row { display: grid; gap: .25rem; }
.skill-row + .skill-row { margin-top: .35rem; }
.skill-row b { font-size: .84rem; font-weight: 600; }
.works { list-style: none; margin: 0; padding: 0; display: grid; }
.works li + li { border-top: 1px solid var(--glass-b); }
.work { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; width: 100%; padding: .4rem 0; background: none; border: 0; font: inherit; color: var(--text); text-align: start; cursor: pointer; }
.work:hover strong { color: var(--accent); }
.work strong { font-size: .93rem; font-weight: 600; }
.work span { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.more { font-size: .82rem; justify-self: start; margin-top: .1rem; }

/* ─── Buttons / chips ─── */
.cta { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; margin-top: .6rem; }
.btn {
  display: inline-flex; align-items: center; gap: .55rem; padding: .6rem 1.2rem; border-radius: 14px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-b); color: var(--text); font: inherit; font-size: .95rem;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--glass-hi); text-decoration: none; box-shadow: var(--shadow); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; }
.btn.static { cursor: default; } .btn.static:hover { transform: none; box-shadow: none; background: var(--glass); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; }
.chip { font-size: .82rem; padding: .1rem .7rem; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-b); color: var(--muted); }

/* ─── Content ─── */
.prose p { font-size: 1.05rem; } .prose p:last-child { margin: 0; }
.bullets { margin: .6rem 0 0; padding-inline-start: 1.2rem; }
.bullets li { margin-bottom: .3rem; } .bullets li::marker { color: var(--accent); }
.plain { list-style: none; padding: 0; margin: .5rem 0 0; } .plain li { padding: .25rem 0; }
.card h3 { font-size: 1.1rem; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 1.1rem; padding-inline-start: 2rem; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), var(--accent2), transparent); border-radius: 2px; }
.tl-item { position: relative; }
.tl-dot { position: absolute; inset-inline-start: calc(-2rem + 1px); top: 1.5rem; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--glass-b), 0 0 18px var(--accent); }

.proj { display: flex; flex-direction: column; gap: .9rem; text-align: start; font: inherit; color: inherit; cursor: pointer; padding: 0; overflow: hidden; transition: transform .35s ease, box-shadow .35s ease; }
.proj:hover { transform: translateY(-5px); }
.thumb { display: block; aspect-ratio: 16/10; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.proj:hover .thumb img { transform: scale(1.06); }
.proj-body { display: grid; gap: .35rem; padding: 0 1.4rem 1.3rem; }
.proj:not(:has(.thumb)) .proj-body { padding-top: 1.4rem; }
.proj-title { font-size: 1.12rem; }
.proj-sum { font-size: .93rem; line-height: 1.7; }

.contact .lead { font-size: 1.1rem; }
.contact-list { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1rem 0 .4rem; }
.contact-list .btn { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.5; }
.contact-list .btn .muted { font-size: .75rem; }
.contact-list a[target] { flex-direction: row; align-items: center; }
.foot { text-align: center; padding: 4rem 0 2rem; font-size: .9rem; }

/* ─── Project dialog ─── */
.dlg { border-radius: var(--radius); color: var(--text); padding: 0; width: min(94%, 760px); max-height: 88vh; overflow: auto; margin: auto; }
.dlg::backdrop { background: rgba(5,8,20,.6); backdrop-filter: blur(6px); }
.dlg[open] { animation: pop .35s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.dlg-in { padding: 1.4rem 1.6rem 1.6rem; display: grid; gap: .9rem; }
.dlg-in .cta { justify-content: flex-start; }
.gallery { display: flex; gap: .8rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .3rem; }
.gallery figure { margin: 0; flex: 0 0 88%; scroll-snap-align: center; }
.gallery img { width: 100%; border-radius: 14px; border: 1px solid var(--glass-b); }
.gallery figcaption { font-size: .85rem; padding-top: .3rem; }

/* ─── Scroll-driven animations ─── */
@keyframes reveal { from { opacity: 0; transform: translateY(46px) scale(.97); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes drift-a { to { transform: translate3d(8vmax, 30vmax, 0) scale(1.15); } }
@keyframes drift-b { to { transform: translate3d(-10vmax, -34vmax, 0) scale(.9); } }
@keyframes drift-c { to { transform: translate3d(-12vmax, 18vmax, 0) rotate(40deg); } }
@keyframes hero-out { to { opacity: .15; transform: translateY(-36px) scale(.97); } }

.progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 60; background: linear-gradient(90deg, var(--accent), var(--accent2)); transform-origin: left; transform: scaleX(0); }
[dir="rtl"] .progress { transform-origin: right; }

@supports (animation-timeline: view()) {
  .rv { animation: reveal linear both; animation-timeline: view(); animation-range: entry 4% entry 52%; }
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
  .b1 { animation: drift-a linear both; animation-timeline: scroll(root); }
  .b2 { animation: drift-b linear both; animation-timeline: scroll(root); }
  .b3 { animation: drift-c linear both; animation-timeline: scroll(root); }
  .hero-inner { animation: hero-out linear both; animation-timeline: view(); animation-range: exit 20% exit 85%; }
}
@supports not (animation-timeline: view()) {
  .js .rv { opacity: 0; transform: translateY(34px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
  .js .rv.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv { opacity: 1 !important; transform: none !important; }
  .progress { display: none; }
}
@media (max-width: 720px) {
  .nav { padding-inline: .7rem; } .brand { max-width: 36vw; overflow: hidden; text-overflow: ellipsis; }
  .sec { padding-top: 4rem; }
  .hero { padding-top: 5.4rem; }
  .avatar { width: 84px; height: 84px; }
}
@media (max-width: 520px) { .snap { grid-template-columns: minmax(0, 1fr); } .tile.half { grid-column: auto; } }
