@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --bg: #08080b;
  --bg-elevated: #101014;
  --card: #131316;
  --border: rgba(255, 255, 255, 0.10);
  --text: #f4f4f6;
  --text-muted: #a1a1aa;
  --accent: #ff5b2e;
  --accent-2: #ffa14a;
  --accent-glow: rgba(255, 91, 46, 0.55);
  --cursor-color: #ffffff;
  --cursor-ring: rgba(255, 91, 46, 0.55);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] {
  --bg: #f5f4f2;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --border: rgba(15, 15, 20, 0.10);
  --text: #15151a;
  --text-muted: #55555f;
  --accent: #e0491f;
  --accent-2: #ff8a3d;
  --accent-glow: rgba(224, 73, 31, 0.45);
  --cursor-color: #15151a;
  --cursor-ring: rgba(224, 73, 31, 0.45);
  --shadow: 0 20px 50px rgba(20, 20, 30, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  transition: background .35s ease, color .35s ease;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* رفع باگ کلاسیک CSS: آیتم‌های grid/flex به‌صورت پیش‌فرض min-width:auto دارن،
   یعنی اگه یه تیکه متن غیرقابل‌شکستن داشته باشن، کل باکس عریض‌تر از صفحه می‌شه.
   با صفر کردن min-width، مرورگر مجبور می‌شه متن رو داخل عرض واقعی نگه داره. */
* { min-width: 0; }

img, svg, spline-viewer, video, canvas { max-width: 100%; }

h1, h2, h3, p, a, span, div, .tag, .meta, li {
  overflow-wrap: anywhere;
}

html[dir="ltr"], html[dir="ltr"] body { font-family: 'Inter', 'Vazirmatn', 'Segoe UI', sans-serif; }

body { min-height: 100vh; cursor: none; }
a, button, input, textarea, [role="button"] { cursor: none; }

@media (pointer: coarse) {
  body, a, button, input, textarea { cursor: auto; }
  #smooth-cursor { display: none !important; }
}

/* ---------- Smooth custom cursor ---------- */
#smooth-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--cursor-color);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  will-change: transform;
}
#smooth-cursor::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1.5px solid var(--cursor-ring);
  transition: opacity .2s ease, transform .2s ease;
}
#smooth-cursor.is-active { transform: translate(-50%, -50%) scale(1.4); }

/* ---------- Layout basics ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-page { min-height: 100vh; display: flex; flex-direction: column; }

.top-controls {
  position: fixed;
  top: 18px;
  inset-inline-end: 18px;
  z-index: 50;
  display: flex;
  gap: 10px;
}

.icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--accent); }

/* ---------- Landing hero ---------- */
.hero-card {
  position: relative;
  width: 100%;
  height: min(78vh, 640px);
  border-radius: 22px;
  border: 1px solid var(--border);
  background: radial-gradient(1200px 600px at 20% -10%, rgba(255,91,46,.15), transparent 60%),
              var(--bg-elevated);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-inner { display: flex; height: 100%; flex-direction: row; }
html[dir="rtl"] .hero-inner { flex-direction: row-reverse; }

.hero-text {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
  position: relative;
}

.hero-text .eyebrow {
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: .04em;
  margin-bottom: 14px;
}

.hero-text h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.25;
  margin: 0 0 16px 0;
  background: linear-gradient(90deg, #fff, #b8b8c2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="light"] .hero-text h1 {
  background: linear-gradient(90deg, #15151a, #4a4a55);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-text h1 strong { color: var(--accent); font-weight: 700; -webkit-text-fill-color: var(--accent); }

.hero-text p {
  color: var(--text-muted);
  max-width: 440px;
  font-size: 15px;
  line-height: 1.8;
}

.hero-visual {
  flex: 1;
  position: relative;
  min-width: 0;
}
.hero-visual spline-viewer {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), rgba(255,255,255,.12), transparent 70%);
  mix-blend-mode: soft-light;
}

@media (max-width: 820px) {
  .hero-card { height: auto; }
  .hero-inner,
  html[dir="rtl"] .hero-inner,
  html[dir="ltr"] .hero-inner {
    flex-direction: column;
  }
  /* روی موبایل ربات بالا، متن پایین */
  .hero-visual { order: 1; flex: none; width: 100%; height: 280px; min-width: 0; }
  .hero-text { order: 2; flex: none; padding: 10px 22px 26px; text-align: center; }
  .hero-text p { max-width: 100%; margin-inline: auto; }
}

@media (max-width: 480px) {
  .hero-visual { height: 220px; }
  .hero-text { padding: 22px 16px 6px; }
}

/* ---------- Landing bottom buttons ---------- */
.landing-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 28px 0 60px;
  flex-wrap: wrap;
}

.pill-btn {
  padding: 14px 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  box-shadow: var(--shadow);
}
.pill-btn:hover { transform: translateY(-3px); border-color: var(--accent); }
.pill-btn.primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; border: none; }

/* ---------- Resume page ---------- */
.resume-header {
  padding: 70px 0 30px;
  text-align: center;
}
.resume-header h1 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 6px; }
.resume-header .subtitle { color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.resume-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 14px;
}
/* LTR fields (phone, email) inside an RTL page must be isolated, or the
   bidi algorithm re-orders their space-separated groups on screen. */
.ltr-text {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.section {
  padding: 34px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 60px; /* so clicking a nav link doesn't hide the title under the sticky navbar */
}
.section h2 {
  font-size: 20px;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section h2::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--accent);
  display: inline-block;
}

.summary-text { color: var(--text-muted); line-height: 1.9; max-width: 760px; }

.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 30px; }
.skill-group { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.skill-group h3 { margin: 0 0 10px; font-size: 14px; color: var(--text-muted); font-weight: 600; }
.skill-group .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-elevated);
}

.card-list { display: grid; gap: 14px; }
.item-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.item-card h3 { margin: 0 0 4px; font-size: 16px; }
.item-card .meta { color: var(--accent); font-size: 13px; margin-bottom: 6px; }
.item-card p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.8; }
.item-card p + p { margin-top: 6px; }

/* scroll-triggered card reveal (fade + slight rise) */
.reveal-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal-card.is-revealed { opacity: 1; transform: translateY(0); }

/* colorful per-character title reveal, inspired by magicui's DiaTextReveal */
.dia-reveal { display: inline-block; }
.dia-char {
  display: inline-block;
  opacity: 0;
  filter: blur(6px);
  transform: translateY(6px);
  transition: opacity .45s ease, transform .45s ease, filter .45s ease;
}
.reveal-card.is-revealed .dia-char { opacity: 1; filter: blur(0); transform: translateY(0); }

/* plain, unstyled links — no underline, no blue; just a color shift to the
   site's own accent color on hover. Used for every link this project adds
   on top of the base template (email/LinkedIn/phone, project links,
   certificate verification links, reference emails, the "view image" button). */
.plain-link {
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  transition: color .2s ease;
}
.plain-link:visited { color: var(--text); }
.plain-link:hover { color: var(--accent); }

/* the "view image" trigger reads as a plain link, inline with the card's
   own text rather than tucked away as a corner icon */
.view-image-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
}
.view-image-link:hover { color: var(--accent); }

.card-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.card-links .plain-link { margin-top: 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

/* section title blur-in reveal on scroll, inspired by magicui's TextAnimate */
.reveal-title {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(10px);
  transition: opacity .6s ease, filter .6s ease, transform .6s ease;
}
.reveal-title.is-revealed { opacity: 1; filter: blur(0); transform: translateY(0); }

/* ---------- Skills sphere ---------- */
.sphere-wrap {
  position: relative;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
  margin-bottom: 10px;
  overflow: hidden; /* keeps rotating tags from widening the page on narrow screens */
}
#skills-sphere {
  position: relative;
  z-index: 2;
  width: 260px;
  height: 260px;
  transform-style: preserve-3d;
  touch-action: none; /* drag-to-rotate on mobile no longer also scrolls the page */
}
.sphere-tag {
  position: absolute;
  top: 50%; left: 50%;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  transform-style: preserve-3d;
  backface-visibility: visible;
  user-select: none;
}

@media (max-width: 480px) {
  .sphere-wrap { height: 280px; }
  #skills-sphere { width: 170px; height: 170px; }
  .sphere-tag { font-size: 11px; padding: 4px 9px; }
}

/* ---------- Contact / border-beam ---------- */
.contact-card {
  position: relative;
  border-radius: 18px;
  padding: 2px;
  overflow: hidden;
  background: var(--card);
}
@property --beam-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  padding: 2px;
  background: conic-gradient(from var(--beam-angle), transparent 0%, var(--accent) 12%, var(--accent-2) 20%, transparent 32%, transparent 100%);
  animation: beam-rotate 4.5s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
@keyframes beam-rotate {
  from { --beam-angle: 0deg; }
  to { --beam-angle: 360deg; }
}

.contact-inner {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  padding: 30px;
}

.contact-form { display: grid; gap: 16px; margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--text-muted); }
/* honeypot: kept in the DOM and focusable-in-theory so bots that blanket-fill
   forms still catch it, but invisible and unreachable for real visitors */
.field-honeypot-wrap {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.field-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .2s ease;
}
.field-input:focus { border-color: var(--accent); }
.field-textarea { resize: vertical; min-height: 90px; }

.submit-btn {
  justify-self: start;
  position: relative;
  padding: 12px 28px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.pulsating-btn span { position: relative; z-index: 2; }
.pulsating-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: pulsate-ring 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  z-index: 1;
  pointer-events: none;
}
@keyframes pulsate-ring {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 14px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.success-msg {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(60, 200, 120, .12);
  border: 1px solid rgba(60, 200, 120, .35);
  color: #2fbf71;
  font-size: 14px;
}

.errorlist { color: #ff6b6b; font-size: 12px; margin: 2px 0 0; padding: 0; list-style: none; }

.footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 30px 0 50px;
}
.footer-note a { color: var(--accent); text-decoration: none; }

/* ---------- Scroll progress bar (magicui: scroll-progress) ---------- */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 999;
  transition: width .1s linear;
}

/* ---------- Dock footer (magicui: dock) ---------- */
/* Part of the normal page footer now (not a floating overlay) — sits once
   at the true bottom of the page and scrolls away with the rest of it. */
.dock {
  position: static;
  margin: 30px auto 40px;
  width: fit-content;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}
.dock-icon {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  transition: transform .15s ease;
  transform-origin: bottom center;
}
.dock-icon:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 46px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.dock-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 4px 2px;
}

/* ---------- In-page section navigation (resume only) ---------- */
.resume-nav {
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.resume-nav-inner {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.resume-nav a {
  flex: none;
  padding: 14px 2px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.resume-nav a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Popup modals (success message / image lightbox) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity .2s ease;
  padding: 20px;
}
.modal-overlay.is-open { opacity: 1; }
.modal-overlay[hidden] { display: none; }
.modal-box {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  transform: scale(.92);
  transition: transform .2s ease;
}
.modal-overlay.is-open .modal-box { transform: scale(1); }
.modal-box p { margin: 0 0 18px; color: var(--text); font-size: 15px; line-height: 1.8; }
.modal-ok-btn {
  padding: 10px 26px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.modal-box--image {
  max-width: min(90vw, 800px);
  width: fit-content;
  padding: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.modal-box--image img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  margin: 0 auto;
  border-radius: 12px;
}
.modal-box--image .modal-ok-btn {
  position: absolute;
  top: -14px;
  inset-inline-end: -14px;
  width: 34px; height: 34px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 480px) {
  .dock { gap: 4px; padding: 6px 10px; }
  .dock-icon { width: 34px; height: 34px; }
}
