:root {
  --bg: #040b16;
  --bg-2: #081224;
  --text: #e8f0ff;
  --muted: #a8bbd9;
  --card: rgba(13, 27, 45, 0.72);
  --stroke: rgba(160, 197, 255, 0.22);
  --accent: #1fe0b5;
  --accent-2: #1ba5ff;
  --warm: #ffb449;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
html[data-theme="light"] {
  --bg: #fcf4ea;
  --bg-2: #f7e8d6;
  --text: #261810;
  --muted: #7a6050;
  --card: rgba(255, 250, 242, 0.88);
  --stroke: rgba(180, 120, 70, 0.18);
  --accent: #e06030;
  --accent-2: #3090c0;
  --warm: #d49030;
  --shadow: 0 18px 44px rgba(120, 70, 30, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  text-align: start;
  background:
    radial-gradient(1000px 600px at 0% 0%, rgba(124, 58, 237, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 20%, rgba(31, 224, 181, 0.1), transparent 60%),
    radial-gradient(800px 400px at 50% 100%, rgba(27, 165, 255, 0.08), transparent 60%),
    linear-gradient(150deg, var(--bg), #030a14, var(--bg-2));
}
html[data-theme="light"] body {
  background:
    radial-gradient(800px 500px at 0% 0%, rgba(224, 96, 48, 0.1), transparent 60%),
    radial-gradient(700px 400px at 100% 30%, rgba(211, 144, 48, 0.12), transparent 60%),
    radial-gradient(600px 350px at 30% 100%, rgba(48, 144, 192, 0.08), transparent 60%),
    linear-gradient(150deg, var(--bg), #faf0e4, var(--bg-2));
}

html[dir="rtl"] { font-family: "Vazirmatn", sans-serif; }
html[dir="rtl"] body { font-family: inherit; }
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] .navbar-brand,
html[dir="rtl"] .display-title,
html[dir="rtl"] .lead,
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .btn { font-family: inherit; letter-spacing: 0; }

h1, h2, h3, h4, .navbar-brand {
  font-family: "Sora", sans-serif;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
.section-pad { padding: 5.5rem 0; position: relative; z-index: 2; }
main > section:not(#home) {
  content-visibility: auto;
  contain-intrinsic-size: 720px;
}

.bg-grid {
  position: fixed; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 80%);
  z-index: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.bg-orb {
  position: fixed; width: 26rem; aspect-ratio: 1; border-radius: 999px;
  pointer-events: none; filter: blur(36px); opacity: 0.3; z-index: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.orb-1 { top: -8rem; left: -8rem; background: #18c6f3; }
.orb-2 { right: -8rem; bottom: -10rem; background: #29e0a6; }

#mainNav {
  backdrop-filter: blur(12px);
  background: rgba(7, 18, 33, 0.5);
  border-bottom: 1px solid transparent;
  transition: 0.25s ease;
}
#mainNav.scrolled { background: rgba(7, 18, 33, 0.85); border-color: var(--stroke); }
html[data-theme="light"] #mainNav { background: rgba(252, 244, 234, 0.75); }
html[data-theme="light"] #mainNav.scrolled { background: rgba(252, 244, 234, 0.92); }

.navbar-brand { color: var(--text); font-weight: 800; }
.navbar-toggler { border: 1px solid var(--stroke); }
.navbar-toggler-icon { filter: invert(1); }
html[data-theme="light"] .navbar-toggler-icon { filter: invert(0); }
.nav-link { color: var(--muted); font-weight: 600; }
.nav-link:hover, .nav-link:focus { color: var(--text); }

.top-controls {
  display: inline-flex;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.2rem;
}
.nav-socials {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.5rem;
}
.nav-socials a {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  font-size: 1.1rem;
  transition: color 0.2s, background 0.2s;
}
.nav-socials a:hover { color: var(--accent); background: rgba(255,255,255,0.05); }
html[dir="rtl"] .nav-socials { margin-right: 0; margin-left: 0.5rem; }
.tool-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.tool-btn.is-active {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #04131f;
}
.tool-btn i { font-size: 0.9rem; }

.hero { padding-top: 9rem; position: relative; overflow: hidden; }
.hero .container { position: relative; z-index: 2; }
.hero-3d {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}
html[data-theme="light"] .hero-3d { opacity: 0.6; }
body.no-webgl .hero-3d {
  background:
    radial-gradient(60rem 30rem at 15% 30%, rgba(26, 115, 204, 0.25), transparent 70%),
    radial-gradient(40rem 25rem at 78% 42%, rgba(31, 224, 181, 0.2), transparent 68%);
  opacity: 0.6;
}
html[data-theme="light"] body.no-webgl .hero-3d {
  background:
    radial-gradient(60rem 30rem at 15% 30%, rgba(26, 115, 204, 0.15), transparent 70%),
    radial-gradient(40rem 25rem at 78% 42%, rgba(26, 157, 127, 0.15), transparent 68%);
  opacity: 0.7;
}
.muted { color: var(--muted); }
.eyebrow { color: var(--warm); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 1rem; }
html[dir="rtl"] .eyebrow { letter-spacing: 0; }
.display-title { font-size: clamp(2.1rem, 6vw, 4rem); line-height: 1.05; margin-bottom: 1.2rem; }
.lead { color: var(--muted); max-width: 60ch; }
.hero-actions { display: flex; gap: 0.9rem; margin-top: 1.6rem; flex-wrap: wrap; }

.btn { border-radius: 999px; font-weight: 700; padding: 0.75rem 1.25rem; }
.btn-accent { background: linear-gradient(120deg, var(--accent), var(--accent-2)); border: 0; color: #051225; }
.btn-accent:hover { color: #051225; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(27, 165, 255, 0.28); }

a,
button,
.btn,
.tool-btn,
.socials a,
.to-top,
.nav-link {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease;
}
.btn:hover,
.tool-btn:hover,
.socials a:hover,
.to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.nav-link:hover {
  text-shadow: 0 0 12px rgba(125, 197, 255, 0.45);
}

.hero-meta { margin-top: 1.4rem; display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: 0.95rem; }
.hero-meta i { color: var(--accent); }

.profile-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}
.profile-card img {
  width: min(360px, 100%);
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  min-height: 0;
  display: block;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid var(--stroke);
}
.profile-chip {
  position: static;
  width: min(360px, 100%);
  background: rgba(6, 16, 29, 0.8); border: 1px solid var(--stroke);
  border-radius: 999px; padding: 0.55rem 0.9rem; display: flex; align-items: center; gap: 0.55rem;
}
.profile-chip span { color: #fff7cc; font-weight: 700; }
.profile-chip i { color: #ffd24d; }
html[data-theme="light"] .profile-chip { background: rgba(250, 240, 226, 0.9); }
html[data-theme="light"] .profile-chip span { color: #7a5030; }
html[data-theme="light"] .profile-chip i { color: #d49030; }

.panel { border: 1px solid var(--stroke); background: var(--card); border-radius: 1.25rem; padding: 1.5rem; box-shadow: var(--shadow); }
.panel p { color: var(--muted); }
.panel, .skill-card, .project-card, .contact-list li, .section-head, .hero-meta, .profile-chip, .footer-inner {
  text-align: start;
}
#about .row > [class*="col-lg-"] { display: flex; }
#about .row > [class*="col-lg-"] > .panel { width: 100%; height: 100%; }
.list-panel ul { list-style: none; margin: 0; padding: 0; }
.list-panel li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px dashed rgba(168, 187, 217, 0.2); }
.list-panel li:last-child { border-bottom: 0; }
.list-panel span { color: var(--muted); }
.list-panel strong { text-align: end; }

.section-head { margin-bottom: 1.6rem; }
.section-head p { color: var(--muted); }

.skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.skill-card { border: 1px solid var(--stroke); border-radius: 1rem; background: var(--card); padding: 1rem; }
.skill-head { display: flex; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.6rem; font-weight: 600; }
.skill-head strong { color: var(--warm); }
.meter { background: rgba(255, 255, 255, 0.06); border-radius: 999px; height: 10px; overflow: hidden; }
.meter span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.tag-cloud { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tag-cloud span { border: 1px solid var(--stroke); padding: 0.45rem 0.8rem; border-radius: 999px; font-size: 0.9rem; color: var(--muted); background: rgba(255, 255, 255, 0.02); }

.timeline-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.timeline-card {
  border: 1px solid var(--stroke);
  border-radius: 1rem;
  background: var(--card);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.timeline-meta strong {
  color: var(--warm);
  font-size: 1.06rem;
  margin-top: 0;
  line-height: 1.1;
  align-self: center;
}
.timeline-card h3 { margin-bottom: 0.5rem; font-size: 1.08rem; }
.timeline-card p { margin: 0; color: var(--muted); }

.project-card { border: 1px solid var(--stroke); border-radius: 1rem; overflow: hidden; background: var(--card); height: 100%; display: flex; flex-direction: column; }
.project-card img { width: 100%; height: 220px; object-fit: cover; }
.project-card div { padding: 1rem; }
.project-card p { color: var(--muted); margin: 0; }

.cert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.cert-grid picture { display: block; }
.cert-grid picture img,
.cert-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.9rem;
  border: 1px solid var(--stroke);
  object-fit: cover;
  display: block;
}

.contact-panel .contact-form { display: grid; gap: 0.85rem; }
.contact-panel, .contact-side {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.contact-panel .contact-form { flex: 1; }
.contact-form label { display: grid; gap: 0.45rem; }
.contact-form span { color: var(--muted); font-size: 0.9rem; }
.contact-form input, .contact-form textarea {
  width: 100%; border: 1px solid var(--stroke); border-radius: 0.8rem;
  background: rgba(5, 14, 26, 0.85); color: var(--text); padding: 0.75rem;
}
html[data-theme="light"] .contact-form input,
html[data-theme="light"] .contact-form textarea {
  background: rgba(255, 250, 242, 0.9);
  color: var(--text);
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: 2px solid rgba(31, 224, 181, 0.3);
  border-color: rgba(31, 224, 181, 0.6);
}

.contact-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.7rem; }
.contact-list li { display: flex; align-items: center; gap: 0.55rem; color: var(--muted); }
.contact-list i { color: var(--accent); }
.contact-list a, .contact-list span { overflow-wrap: anywhere; }

.socials { display: flex; gap: 0.6rem; margin: 1.1rem 0; }
.socials a {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid var(--stroke); transition: transform 0.2s ease, border-color 0.2s ease;
}
.socials a:hover { transform: translateY(-2px); border-color: rgba(31, 224, 181, 0.7); }

.donate-box { border: 1px dashed var(--stroke); border-radius: 0.9rem; padding: 0.8rem; background: rgba(255, 255, 255, 0.02); }
.donate-box p { margin-bottom: 0.3rem; }
.donate-section + .donate-section { margin-top: 0.75rem; }
.donate-subtitle { margin: 0 0 0.5rem; font-size: clamp(0.75rem, 2.5vw, 0.9rem); color: var(--warm); }
.donate-divider { border: none; border-top: 1px dashed var(--stroke); margin: 0.75rem 0; opacity: 0.5; }
.wallet-usdt { display: flex; gap: 0.75rem; align-items: flex-start; }
.wallet-main { display: flex; gap: 0.75rem; flex: 1; min-width: 0; }
.wallet-badge { flex-shrink: 0; }
.wallet-body { flex: 1; min-width: 0; }
.wallet-label { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--warm); margin-bottom: 0.25rem; }
.wallet-usdt code { word-break: break-all; font-size: 0.7rem; margin-top: 0.25rem; background: var(--card-bg); padding: 0.35rem 0.5rem; border-radius: 6px; border: 1px solid var(--stroke); white-space: pre-wrap; color: var(--warm); direction: ltr; display: block; text-align: left; }
.wallet-qr { margin-top: 0.75rem; text-align: center; }
.wallet-qr img { display: inline-block; border-radius: 10px; border: 1px solid var(--stroke); background: #fff; max-width: 160px; height: auto; }
@media (min-width: 576px) { .wallet-qr img { max-width: 200px; } }
html[data-theme="dark"] .wallet-qr img { filter: brightness(0.85); }
.donate-box code { white-space: pre-wrap; color: var(--warm); direction: ltr; display: block; text-align: left; }

.map-box {
  margin-top: 1rem;
  border: 1px solid var(--stroke);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.7rem;
}
.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.map-head h4 {
  margin: 0;
  font-size: 0.95rem;
}
.map-head a {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
}
.map-box iframe {
  width: 100%;
  height: 190px;
  border: 1px solid var(--stroke);
  border-radius: 0.7rem;
}

.footer { border-top: 1px solid var(--stroke); padding: 1rem 0; background: rgba(3, 10, 18, 0.7); }
html[data-theme="light"] .footer { background: rgba(247, 232, 214, 0.7); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.footer p { margin: 0; color: #ffd24d; font-weight: 700; }
.footer-badges { color: inherit !important; font-weight: 400 !important; display: flex; align-items: center; gap: 0.5rem; }
.to-top { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--stroke); border-radius: 999px; }

.reveal { opacity: 0; transform: translateY(30px) rotateX(-10deg) scale(0.98); will-change: transform, opacity; perspective: 800px; transform-origin: center top; }
.reveal.in { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
.hero .reveal { opacity: 1; transform: none; }
.reveal { transition: opacity 0.5s ease-out, transform 0.5s ease-out; }

.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.32s; }

html[dir="rtl"] .navbar-nav { margin-right: auto !important; margin-left: 0 !important; }
html[dir="rtl"] .hero-meta,
html[dir="rtl"] .hero-actions,
html[dir="rtl"] .tag-cloud,
html[dir="rtl"] .socials { justify-content: flex-start; }
html[dir="rtl"] .contact-list li { flex-direction: row-reverse; justify-content: flex-end; }
html[dir="rtl"] .footer-inner { flex-direction: row-reverse; }
html[dir="rtl"] .top-controls { direction: ltr; }
html[dir="rtl"] .list-panel strong { text-align: start; }
html[dir="rtl"] .timeline-meta { flex-direction: row-reverse; }
html[dir="ltr"] .timeline-meta { flex-direction: row-reverse; }

body.lang-transition main,
body.lang-transition .footer {
  opacity: 0.35;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (max-width: 991px) {
  .skills-grid, .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding-top: 7.8rem; }
  .top-controls { margin-top: 0.8rem; }
  .list-panel li { align-items: flex-start; }
}

@media (max-width: 575px) {
  .section-pad { padding: 4.3rem 0; }
  .skills-grid, .cert-grid, .timeline-grid { grid-template-columns: 1fr; }
  .profile-card img { min-height: 0; width: min(300px, 100%); }
  .hero { padding-top: 7rem; }
  .display-title { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .lead { font-size: 0.92rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; }
  .hero-meta { font-size: 0.82rem; gap: 0.6rem; }
  .section-head h2 { font-size: 1.4rem; }
  .profile-chip { width: 100%; max-width: 360px; font-size: 0.82rem; padding: 0.45rem 0.7rem; }
  .panel { padding: 1rem; border-radius: 0.9rem; }
  .skill-card { padding: 0.8rem; }
  .tag-cloud span { font-size: 0.78rem; padding: 0.35rem 0.6rem; }
  .footer-inner { flex-direction: column; text-align: center; gap: 0.3rem; }
  .contact-panel .contact-form { gap: 0.6rem; }
  .timeline-meta { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .project-card img { height: 160px; }
  #mainNav .navbar-collapse { background: var(--bg); border-radius: 1rem; padding: 0.5rem; margin-top: 0.5rem; border: 1px solid var(--stroke); }
  html[data-theme="light"] #mainNav .navbar-collapse { background: var(--bg); }
  #mainNav .nav-socials { margin: 0.5rem 0; justify-content: center; }
  #mainNav .top-controls { justify-content: center; margin: 0.5rem 0; }
}

/* ——— GitHub Report Section ——— */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.stat-box {
  border: 1px solid var(--stroke);
  border-radius: 0.85rem;
  padding: 0.75rem 0.5rem;
  background: rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-align: center;
}
.stat-box strong { font-size: 1.25rem; }
.stat-box span { font-size: 1.05rem; font-weight: 700; }
.stat-box label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.activity-feed { display: grid; gap: 0.45rem; margin-top: 0.75rem; }
.activity-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--stroke); border-radius: 0.6rem;
  font-size: 0.88rem;
}
.activity-date { margin-left: auto; color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.contribution-bars {
  display: flex; gap: 2px; align-items: flex-end;
  height: 50px; padding: 0.3rem 0; overflow: hidden;
  border: 1px solid var(--stroke); border-radius: 0.5rem;
  background: rgba(255,255,255,0.02); padding: 0.3rem 0.4rem;
}
.contribution-bar {
  width: calc(100% / 31 - 2px); min-width: 4px;
  border-radius: 1px; transition: height 0.3s;
}
.lang-row { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.focus-tags { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.focus-tag {
  padding: 0.25rem 0.6rem; border: 1px solid var(--stroke);
  border-radius: 999px; font-size: 0.8rem; color: var(--muted);
}

/* ——— Portfolio Section ——— */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.portfolio-card {
  border: 1px solid var(--stroke);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.portfolio-card:hover { transform: translateY(-4px); box-shadow: 0 12px 36px rgba(0,0,0,0.3); }
.portfolio-thumb { position: relative; }
.portfolio-browser-bar {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.45rem 0.6rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--stroke);
}
.pb-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff5f56; flex-shrink: 0;
}
.pb-dot:nth-child(2) { background: #ffbd2e; }
.pb-dot:nth-child(3) { background: #27c93f; }
.pb-url {
  margin-left: auto; font-size: 0.7rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;
}
html[dir="rtl"] .pb-url { margin-left: 0; margin-right: auto; }
.portfolio-preview {
  position: relative;
  width: 100%; height: 170px;
  overflow: hidden;
  background: rgba(0,0,0,0.15);
}
.portfolio-preview img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.4s ease;
}
.portfolio-card:hover .portfolio-preview img { transform: scale(1.05); }
.portfolio-fallback {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; color: var(--muted);
}
.portfolio-fallback i { font-size: 2rem; }
.portfolio-fallback span { font-size: 0.85rem; }
.portfolio-info {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem;
  font-weight: 600; font-size: 0.9rem;
}
.portfolio-info i { color: var(--accent); font-size: 1rem; }

/* ——— Portfolio Modal / Browser Popup ——— */
.portfolio-modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 9999;
  align-items: center; justify-content: center;
}
.portfolio-modal.active { display: flex; }
.portfolio-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
}
.portfolio-modal-content {
  position: relative;
  width: min(95vw, 1200px);
  height: min(90vh, 800px);
  background: var(--bg-2);
  border: 1px solid var(--stroke);
  border-radius: 1rem;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.portfolio-modal-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--stroke);
  flex-shrink: 0;
}
.pmb-left { display: flex; align-items: center; gap: 0.4rem; }
.pmb-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--stroke);
  background: transparent; color: var(--muted);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem;
  transition: background 0.15s, color 0.15s;
}
.pmb-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.pmb-btn:disabled { opacity: 0.3; cursor: default; }
.pmb-close { font-size: 1.4rem; line-height: 1; }
.pmb-nav-btns { display: flex; gap: 0.2rem; }
.pmb-url-bar {
  flex: 1; display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  min-width: 0;
}
.pmb-lock { color: var(--accent); font-size: 0.8rem; flex-shrink: 0; }
.pmb-url-text {
  font-size: 0.8rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  direction: ltr; text-align: left;
}
.pmb-right { display: flex; align-items: center; }
.pmb-external { text-decoration: none; color: var(--muted); }
.pmb-external:hover { color: var(--accent); }
.portfolio-modal-body {
  flex: 1; position: relative;
  background: #000;
}
.portfolio-modal-body img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.portfolio-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.8rem; background: var(--bg);
  color: var(--muted);
  transition: opacity 0.3s;
  z-index: 1;
}
.portfolio-loading.hidden { opacity: 0; pointer-events: none; }
.spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--stroke);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pmb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 2;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.2rem;
  backdrop-filter: blur(4px);
}
.pmb-nav:hover { background: rgba(0,0,0,0.8); color: #fff; border-color: var(--accent); }
.pmb-prev { left: 12px; }
.pmb-next { right: 12px; }
.portfolio-modal-counter {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 2;
  background: rgba(0,0,0,0.6);
  color: rgba(255,255,255,0.7);
  padding: 4px 14px; border-radius: 20px;
  font-size: 0.75rem;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 991px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-modal-content { width: 100vw; height: 100vh; border-radius: 0; }
  .pmb-nav { width: 32px; height: 32px; font-size: 1rem; }
  .pmb-prev { left: 6px; }
  .pmb-next { right: 6px; }
}
@media (max-width: 575px) {
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-preview { height: 140px; }
}

/* ——— Mini 3D scenes ——— */
.mini-3d {
  position: absolute;
  pointer-events: none;
  opacity: 0.3;
  z-index: -1;
  border-radius: 50%;
  overflow: hidden;
}
#mini3dSkills {
  top: -8%;
  right: -6%;
  width: 260px;
  height: 260px;
}
#mini3dReport {
  bottom: -5%;
  left: -8%;
  width: 200px;
  height: 200px;
}
html[data-theme="light"] .mini-3d { opacity: 0.15; }
body.no-webgl .mini-3d { display: none; }

/* Three.js background canvas */
.hero-3d canvas { display: block; width: 100%; height: 100%; }

.contact-clock-item { align-items: flex-start !important; }
.contact-clock-item .clock-face { flex-direction: row; gap: 0.4rem; flex-wrap: wrap; padding: 0; }
.contact-clock-item #clockTime { font-size: 1rem; background: none; -webkit-text-fill-color: var(--accent); }
.contact-clock-item #clockDate { font-size: 0.8rem; }
.clock-tz { color: var(--accent); font-size: 0.75rem; font-weight: 600; margin-bottom: 0.25rem; }
.clock-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0;
}
#clockTime {
  font-family: "JetBrains Mono", monospace;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
#clockDate {
  font-size: 0.85rem;
  color: var(--muted);
}

html[dir="rtl"] .activity-item { flex-direction: row-reverse; }
html[dir="rtl"] .activity-date { margin-left: 0; margin-right: auto; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-orb,
  .bg-grid { transform: none !important; }
  .reveal,
  #mainNav,
  .socials a,
  .btn-accent { transition: none !important; animation: none !important; }
}
