@font-face {
  font-family: "Vazirmatn Local Fallback";
  src: local("Vazirmatn");
  font-display: swap;
}

:root {
  --bg: #fff8ef;
  --surface: #fffdf9;
  --surface-2: #fff2e4;
  --text: #342f2d;
  --muted: #7d726d;
  --mint: #9fd9cb;
  --mint-strong: #4f9889;
  --pink: #f5cbd7;
  --yellow: #f6dfa7;
  --blue: #d5e3f8;
  --border: rgba(74, 61, 54, 0.09);
  --shadow: 0 14px 34px rgba(86, 65, 52, 0.08);
}

[data-theme="dark"] {
  --bg: #1b1816;
  --surface: #24201d;
  --surface-2: #2d2722;
  --text: #f5ede7;
  --muted: #b8aaa2;
  --mint: #78b9ab;
  --mint-strong: #9bd1c5;
  --pink: #7c5c64;
  --yellow: #7d6b45;
  --blue: #52647e;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

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

body {
  margin: 0;
  direction: rtl;
  font-family: "Vazirmatn", "Vazirmatn Local Fallback", Tahoma, sans-serif;
  background:
    radial-gradient(circle at 85% 8%, color-mix(in srgb, var(--mint) 26%, transparent), transparent 25%),
    radial-gradient(circle at 15% 16%, color-mix(in srgb, var(--pink) 30%, transparent), transparent 22%),
    var(--bg);
  color: var(--text);
  line-height: 1.8;
  transition: background .2s ease, color .2s ease;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }

.page-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  margin-top: 12px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.brand {
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
}

.nav-links a:hover { color: var(--text); }

.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.section { padding: 64px 0; }

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .75fr);
  align-items: center;
  gap: 48px;
  padding-top: 52px;
  padding-bottom: 52px;
}

.hero-copy { min-width: 0; }

.tiny-label,
.section-heading > span {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--mint-strong);
  font-size: .88rem;
  font-weight: 800;
}

.hero h1,
.section-heading h2,
.about-card h2 {
  margin: 0;
  letter-spacing: -0.02em;
}

.hero h1 {
  font-size: clamp(2.8rem, 6.5vw, 5rem);
  line-height: 1.2;
  font-weight: 800;
}

.accent { color: var(--mint-strong); }

.hero-text {
  max-width: 570px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 2.05;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 15px;
  text-decoration: none;
  font-weight: 700;
  transition: transform .18s ease;
}

.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--mint); color: #213a35; }
.button.secondary { background: var(--surface); border: 1px solid var(--border); }

.currently {
  display: inline-flex;
  margin-top: 18px;
  padding: 7px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--yellow) 58%, transparent);
  color: var(--muted);
  font-size: .86rem;
}

.cat-wrap {
  display: flex;
  justify-content: center;
}

.cat-card {
  width: min(100%, 330px);
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: rotate(-1.5deg);
}

.cat-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 21px;
}

.cat-caption {
  padding: 10px 8px 3px;
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.section-heading {
  max-width: 660px;
  margin-bottom: 22px;
}

.section-heading h2,
.about-card h2 {
  font-size: clamp(1.9rem, 4.5vw, 3.25rem);
  line-height: 1.35;
}

.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.95;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  min-height: 235px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 25px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.bisnor-card {
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--blue) 28%, var(--surface)));
}

.catng-card {
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--pink) 24%, var(--surface)));
}

.project-icon { font-size: 1.8rem; }
.project-card h3 { margin: 10px 0 7px; font-size: 1.55rem; }
.project-card p { margin: 0; color: var(--muted); line-height: 1.95; }
.project-card a {
  margin-top: auto;
  padding-top: 20px;
  text-decoration: none;
  color: var(--mint-strong);
  font-weight: 800;
}

.stack-section {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 27px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.small-heading { margin-bottom: 18px; }
.badge-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-cloud img { height: 28px; border-radius: 6px; }

.about-section { padding-bottom: 52px; }
.about-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 30px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 27px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.little-cat {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--mint-strong);
  font-size: 1.25rem;
}

.about-card p {
  color: var(--muted);
  line-height: 2;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 18px;
}

.socials a {
  padding: 8px 13px;
  border-radius: 13px;
  background: var(--surface-2);
  text-decoration: none;
  font-weight: 700;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 0 32px;
  color: var(--muted);
  font-size: .88rem;
}

@media (max-width: 820px) {
  .page-shell { width: min(100% - 24px, 1040px); }
  .nav-links { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 44px;
  }
  .hero-copy { text-align: center; }
  .hero-text { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .currently { justify-content: center; }
  .cat-card { width: min(100%, 300px); }
  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .page-shell { width: min(100% - 18px, 1040px); }
  .topbar { top: 8px; margin-top: 8px; border-radius: 18px; }
  .section { padding: 48px 0; }
  .hero h1 { font-size: clamp(2.6rem, 13vw, 3.8rem); }
  .hero-text { font-size: .97rem; }
  .stack-section, .about-card { padding: 22px; border-radius: 22px; }
  .badge-cloud img { height: 26px; }
  .footer { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
