:root {
  --bg: #f6f7f2;
  --ink: #16201f;
  --muted: #5b6560;
  --line: rgba(22, 32, 31, 0.14);
  --teal: #1f7a73;
  --amber: #d89535;
  --coral: #c95f4a;
  --paper: #fffdf8;
  --shadow: 0 24px 70px rgba(22, 32, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 72px);
  color: #fff;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.site-header.scrolled,
.site-header.menu-open {
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink);
  box-shadow: 0 8px 30px rgba(22, 32, 31, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2vw, 28px);
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-links a,
.site-footer a,
.project-card a {
  transition: color 160ms ease;
}

.nav-links a:hover,
.site-footer a:hover,
.project-card a:hover {
  color: var(--teal);
}

.header-action,
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.header-action {
  border-color: currentColor;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 128px clamp(20px, 5vw, 72px) 56px;
  color: #fff;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(11, 17, 17, 0.22), rgba(11, 17, 17, 0.46) 45%, rgba(11, 17, 17, 0.78)),
    linear-gradient(0deg, rgba(11, 17, 17, 0.72), rgba(11, 17, 17, 0.12) 42%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 0.9rem;
  font-weight: 800;
}

.hero h1,
.section-heading h2,
.contact-content h2 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  font-weight: 800;
}

.hero-copy {
  max-width: 640px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.14rem;
}

.hero-actions,
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button.primary {
  background: var(--teal);
  color: #fff;
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

.hero-stats {
  gap: 18px;
  padding-top: 18px;
  color: rgba(255, 255, 255, 0.82);
}

.hero-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.hero-stats strong {
  color: #fff;
  font-size: 1.35rem;
}

.section {
  padding: 88px clamp(20px, 5vw, 72px);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 34px;
}

.section-heading h2,
.contact-content h2 {
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
}

.about-grid,
.contact-content {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 28px;
  align-items: start;
}

.about-text {
  max-width: 820px;
  color: var(--muted);
  font-size: 1.05rem;
}

.profile-panel,
.contact-form,
.project-card,
.skill-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.profile-panel {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.profile-panel div {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.profile-panel div:last-child {
  border-bottom: 0;
}

.profile-panel span,
.project-meta,
.timeline time {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.skills-section {
  background: #eaf2ef;
}

.skill-list,
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.skill-card,
.project-card {
  padding: 24px;
}

.skill-card span {
  color: var(--coral);
  font-weight: 800;
}

.skill-card h3,
.project-card h3,
.timeline h3 {
  margin: 12px 0 8px;
  line-height: 1.45;
}

.skill-card p,
.project-card p,
.timeline p,
.contact-content p {
  margin: 0;
  color: var(--muted);
}

.project-card.featured {
  background: #173230;
  color: #fff;
}

.project-card.featured p,
.project-card.featured .project-meta {
  color: rgba(255, 255, 255, 0.75);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.project-card a {
  display: inline-block;
  margin-top: 18px;
  color: var(--teal);
  font-weight: 800;
}

.project-card.featured a {
  color: var(--amber);
}

.experience-section {
  background: var(--paper);
}

.timeline {
  display: grid;
  gap: 18px;
  max-width: 900px;
}

.timeline article {
  position: relative;
  padding: 0 28px 22px 0;
  border-right: 2px solid var(--line);
}

.timeline article::before {
  position: absolute;
  top: 8px;
  right: -7px;
  width: 12px;
  height: 12px;
  content: "";
  border-radius: 50%;
  background: var(--teal);
}

.contact-section {
  background: #132321;
  color: #fff;
}

.contact-content {
  align-items: center;
}

.contact-content p {
  max-width: 620px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.72);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.contact-links a {
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.contact-form {
  display: grid;
  gap: 16px;
  padding: 24px;
  color: var(--ink);
}

.contact-form label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.contact-form textarea {
  resize: vertical;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(20px, 5vw, 72px);
  color: var(--muted);
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-links,
  .header-action {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .site-header.menu-open .nav-links {
    position: absolute;
    top: 100%;
    right: 20px;
    left: 20px;
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow);
  }

  .site-header.menu-open .nav-links a {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
  }

  .site-header.menu-open .nav-links a:last-child {
    border-bottom: 0;
  }

  .hero {
    min-height: 88vh;
    padding-top: 112px;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(11, 17, 17, 0.32), rgba(11, 17, 17, 0.74)),
      linear-gradient(0deg, rgba(11, 17, 17, 0.78), rgba(11, 17, 17, 0.16) 44%);
  }

  .about-grid,
  .contact-content,
  .skill-list,
  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero h1 {
    font-size: 2.45rem;
  }

  .hero-actions .button,
  .contact-form .button {
    width: 100%;
  }

  .section {
    padding-block: 64px;
  }

  .site-footer {
    flex-direction: column;
  }
}
