/* mehradcodes.ir — v3. Mobile-first, dark, Vazirmatn. Giant hero + marquee + stats + process + archive. */
/* Self-hosted Vazirmatn (variable font) — the page no longer waits on
   Google's font servers to paint, which is very slow from Iran. */
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(assets/fonts/vazirmatn-arabic.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(assets/fonts/vazirmatn-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #070711;
  --bg-2: #0d0d1f;
  --card: #12122a;
  --card-border: #23234d;
  --ink: #f4f4f8;
  --muted: #a9a5c4;
  --brand: #4f46e5;
  --violet: #7c3aed;
  --green: #4ade80;
  --amber: #fbbf24;
  --radius: 16px;
  --max: 1080px;
  --space: 1rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.8;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 2px;
  border-radius: 6px;
}

section[id], footer[id] { scroll-margin-top: 76px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(7, 7, 17, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--card-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
}
.brand-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--violet);
}
.brand-name { font-size: 1.05rem; letter-spacing: 0.02em; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--ink); background: var(--card); }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 56px;
  text-align: center;
  background:
    radial-gradient(600px 300px at 50% -80px, rgba(124, 58, 237, 0.35), transparent 70%),
    radial-gradient(500px 260px at 85% 0, rgba(79, 70, 229, 0.28), transparent 70%),
    var(--bg);
}
#stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.orb {
  position: absolute;
  width: 520px;
  height: 520px;
  left: 50%;
  top: -80px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(124, 58, 237, 0.4), transparent 65%);
  filter: blur(10px);
  pointer-events: none;
}
.hero-snake {
  position: absolute;
  left: 2%;
  bottom: 16px;
  width: 150px;
  height: auto;
  transform: rotate(-6deg);
  animation: floaty 7s ease-in-out infinite;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 16px;
  border: 1px solid rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.1);
  color: #bbf7d0;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
}
.status-badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
}
.giant {
  margin: 22px 0 0;
  font-size: clamp(2.3rem, 8.5vw, 4.4rem);
  font-weight: 900;
  line-height: 1.35;
}
.giant .grad {
  background: linear-gradient(135deg, #818cf8, var(--violet), #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-who {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  text-align: right;
}
.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box,
              linear-gradient(135deg, var(--brand), var(--violet)) border-box;
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.35);
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.hero-name { margin: 0; font-size: 1.25rem; font-weight: 800; }
.role { margin: 2px 0 0; color: var(--muted); font-size: 1.1rem; font-weight: 700; }
.role .sep { color: var(--violet); margin: 0 4px; }
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 28px;
}
.btn {
  display: inline-block;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.5;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost {
  color: var(--ink);
  border: 2px solid var(--violet);
  background: transparent;
}
.btn-ghost:hover { background: rgba(124, 58, 237, 0.15); }
.btn-small { padding: 10px 20px; min-height: 44px; font-size: 0.95rem; }
.hero-links {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 28px 0 0;
  padding: 0;
}
.hero-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  font-size: 0.92rem;
}
.hero-links a:hover { color: var(--ink); border-color: var(--violet); }

/* Marquee divider */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  background: var(--bg-2);
  padding: 14px 0;
}
.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: scrollx 24s linear infinite;
}
.marquee-track span {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(203, 185, 255, 0.45);
}
@keyframes scrollx {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Sections */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-2); }
.section h2 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  font-weight: 900;
  background: linear-gradient(90deg, #ffffff, #cbb9ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-lead { color: var(--muted); margin: 0 0 28px; max-width: 60ch; }
.group-title {
  margin: 36px 0 16px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
}
.group-title:first-of-type { margin-top: 8px; }

/* About */
.about-text { max-width: 65ch; margin: 0 0 24px; }
.skills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.skills li {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.skills strong { display: block; font-size: 1.05rem; }
.skills span { color: var(--muted); }
.skill-code {
  display: block;
  margin-top: 12px;
  background: #0a0a18;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--green);
  font-size: 0.92rem;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}
.skill-browser {
  margin-top: 12px;
  background: #0a0a18;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
}
.skill-browser i { width: 9px; height: 9px; border-radius: 50%; background: #2a2a4d; }
.skill-browser i:nth-child(1) { background: #f87171; }
.skill-browser i:nth-child(2) { background: #fbbf24; }
.skill-browser i:nth-child(3) { background: #4ade80; }
.skill-browser em {
  font-style: normal;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--card);
  border-radius: 6px;
  padding: 2px 10px;
  margin-inline-start: 6px;
}

/* Stats */
.stats { padding: 48px 0 8px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff, #cbb9ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { color: var(--muted); font-size: 0.95rem; }
.stats-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 20px 0 0;
  padding-bottom: 40px;
}

/* Cards grid — 3D tilt on hover (JS sets the transform on fine pointers) */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform-style: preserve-3d;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 58, 237, 0.6);
  box-shadow: 0 16px 40px rgba(124, 58, 237, 0.25);
}
.card h3 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.card p { margin: 0; color: var(--muted); }
.card p:last-of-type { flex: 1; }
.tags {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 0;
  padding: 0;
}
.tags li {
  font-size: 0.82rem;
  color: #cbb9ff;
  background: rgba(124, 58, 237, 0.16);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 999px;
  padding: 3px 12px;
}
.card-link {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
  margin-top: 6px;
}
.card-link:hover { text-decoration: underline; }

/* Badges */
.badge {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 12px;
}
.badge-demo { color: var(--amber); background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.4); }
.badge-level { color: #cbb9ff; background: rgba(124, 58, 237, 0.18); border: 1px solid rgba(124, 58, 237, 0.4); }

/* Courses */
.course-card .btn { margin-top: 8px; align-self: flex-start; }
.syllabus {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.syllabus li {
  font-size: 0.9rem;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 4px 12px;
}
.syllabus code {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  direction: ltr;
  unicode-bidi: isolate;
}
.soon { color: var(--amber); font-weight: 700; }

/* Process */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
.steps li {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
}
.step-num {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(124, 58, 237, 0.8);
  margin-bottom: 8px;
}
.steps strong { font-size: 1.1rem; }
.steps p { color: var(--muted); margin: 6px 0 0; }

/* Archive table */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}
.archive-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.95rem;
}
.archive-table th,
.archive-table td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--card-border);
}
.archive-table th { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.archive-table tr:last-child td { border-bottom: none; }
.archive-table .group-row td { background: var(--bg-2); font-weight: 800; color: var(--ink); }
.archive-table a { color: var(--green); font-weight: 700; text-decoration: none; white-space: nowrap; }
.archive-table a:hover { text-decoration: underline; }

/* Footer */
.footer {
  border-top: 1px solid var(--card-border);
  background: var(--bg-2);
  padding: 48px 0 32px;
  text-align: center;
}
.footer h2 { margin: 0 0 8px; font-size: 1.4rem; font-weight: 900; }
.footer p { color: var(--muted); margin: 0 auto 20px; max-width: 55ch; }
.social {
  list-style: none;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 0 24px;
  padding: 0;
}
.social a {
  display: inline-block;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.social a:hover { border-color: var(--violet); background: rgba(124, 58, 237, 0.15); }
.copy { font-size: 0.88rem; color: var(--muted); }

/* Snake only where there is room */
@media (max-width: 1099px) {
  .hero-snake { display: none; }
}

/* Mobile: declutter — hide nav, airier stacking */
@media (max-width: 639px) {
  .nav { display: none; }
  .header-inner { min-height: 56px; }
  .hero { padding: 44px 0 40px; }
  .hero-avatar { width: 96px; height: 96px; }
  .hero-name { font-size: 1.05rem; }
  .role { font-size: 0.95rem; }
  .status-badge { font-size: 0.85rem; }
  .cta-row { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; }
  .cta-row .btn { width: 100%; text-align: center; }
  .hero-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 320px; }
  .hero-links a { display: block; text-align: center; }
  .marquee-track { animation-duration: 32s; }
  .marquee-track span { font-size: 1.2rem; }
  .section { padding: 40px 0; }
  .section h2 { font-size: 1.45rem; }
  .group-title { margin: 28px 0 12px; }
  .card { padding: 18px; }
  .grid { gap: 14px; }
  .skills { gap: 10px; }
  .skills li { padding: 14px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-num { font-size: 1.7rem; }
  .social { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .social a { display: block; text-align: center; }
  .footer { padding: 36px 0 28px; }
}

/* Larger screens */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .skills { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .section { padding: 72px 0; }
  .hero { padding: 84px 0 72px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-avatar, .hero-snake, .marquee-track, .status-badge .dot { animation: none; }
}

/* Courses accordion — tap the header to open, one open at a time */
.acc-list { display: flex; flex-direction: column; gap: 12px; }
.course-card.accordion { padding: 0; gap: 0; overflow: hidden; }
.course-card.accordion:hover { transform: none; }
.acc-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 18px 20px; background: none; border: none; cursor: pointer;
  color: var(--ink); font: inherit; text-align: right;
}
.acc-head .badge { flex-shrink: 0; }
.acc-title { flex: 1; font-size: 1.15rem; font-weight: 800; }
.acc-chev {
  flex-shrink: 0; width: 10px; height: 10px;
  border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.3s ease;
}
.course-card.open .acc-chev { transform: rotate(225deg); border-color: var(--ink); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.course-card.open .acc-body { max-height: 480px; }
.acc-inner {
  display: flex; flex-direction: column; gap: 10px;
  padding: 0 20px 20px;
}
.btn-whatsapp {
  color: #fff; background: #1faa55;
  box-shadow: 0 8px 24px rgba(31, 170, 85, 0.3);
}
.btn-whatsapp:hover { background: #25d366; }
@media (prefers-reduced-motion: reduce) {
  .acc-body, .acc-chev { transition: none; }
}

/* Social icons next to each link (hero + footer) */
.hero-links a, .social a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.hero-links a svg.ic, .social a svg.ic { width: 17px; height: 17px; flex: none; fill: currentColor; }
