/* ==========================================================
   سایت شخصی میلاد حلمی
   ایده‌ی بصری: «پیش‌فاکتور» — قیمت و محدوده‌ی کار شفاف، مثل یک فاکتور تمیز.
   ========================================================== */

@font-face {
  font-family: "Vazirmatn";
  src: url("/lib/fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Kufi";
  src: url("/lib/fonts/noto-kufi-arabic-arabic-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Kufi";
  src: url("/lib/fonts/noto-kufi-arabic-arabic-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Kufi";
  src: url("/lib/fonts/noto-kufi-arabic-arabic-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --paper: #f3f5f4;
  --sheet: #ffffff;
  --ink: #14232b;
  --ink-2: #4a5a62;
  --ink-3: #7a8a91;
  --line: #d3dcd9;
  --teal: #0e6b68;
  --teal-deep: #0a4f4d;
  --teal-wash: #e3efed;
  --saffron: #e3a21a;
  --saffron-ink: #8a5d00;

  --font-body: "Vazirmatn", Tahoma, sans-serif;
  --font-display: "Kufi", "Vazirmatn", Tahoma, sans-serif;

  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: 2.375rem;
  --step-5: 3.25rem;

  --radius-sm: 6px;
  --radius: 10px;
  --wrap: 1140px;

  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-link-color: var(--teal);
  --bs-link-color-rgb: 14, 107, 104;
  --bs-link-hover-color: var(--teal-deep);
  --bs-border-color: var(--line);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.85;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: 0;
}
h1 { font-size: clamp(1.9rem, 4.6vw, var(--step-5)); font-weight: 800; line-height: 1.35; }
h2 { font-size: clamp(1.5rem, 3vw, var(--step-4)); }
h3 { font-size: var(--step-2); }

a { text-underline-offset: .25em; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }
.measure { max-width: 68ch; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.lead-text { font-size: var(--step-1); color: var(--ink-2); line-height: 2; }

/* ---------------- دکمه‌ها ---------------- */
.btn-ink, .btn-line {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: var(--step-0);
  padding: .7rem 1.35rem; border-radius: var(--radius-sm);
  text-decoration: none; border: 1.5px solid transparent;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-ink { background: var(--teal); color: #fff; }
.btn-ink:hover { background: var(--teal-deep); color: #fff; }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: #fff; }

/* ---------------- هدر ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .75rem; color: var(--ink-3); line-height: 1.2; }
.nav-main { display: flex; gap: .25rem; margin-inline-start: auto; }
.nav-main a { color: var(--ink-2); text-decoration: none; padding: .4rem .8rem; border-radius: var(--radius-sm); font-weight: 500; }
.nav-main a:hover { color: var(--ink); background: var(--teal-wash); }
.nav-main a[aria-current="page"] { color: var(--teal-deep); font-weight: 700; }
.nav-toggle { display: none; margin-inline-start: auto; background: none; border: 0; font-size: 1.6rem; color: var(--ink); padding: .25rem .5rem; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-main, .site-header .btn-ink { display: none; }
  .site-header.open .nav-main {
    display: flex; flex-direction: column; position: absolute; inset-inline: 0; top: 68px;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: .75rem 1.25rem 1.25rem;
  }
  .site-header.open .nav-main a { padding: .7rem .5rem; font-size: var(--step-1); }
}

/* ---------------- هیرو + پیش‌فاکتور ---------------- */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 1.25rem; }
.hero .lead-text { max-width: 46ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-proof { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; color: var(--ink-2); font-size: var(--step--1); }
.hero-proof i { color: var(--teal); margin-inline-end: .35rem; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.invoice {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(20, 35, 43, .35);
}
/* لبه‌ی دندانه‌دار پایین فاکتور */
.invoice::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -9px; height: 10px;
  background: radial-gradient(circle at 8px -2px, transparent 7px, var(--sheet) 7.5px) repeat-x;
  background-size: 16px 10px;
  filter: drop-shadow(0 1px 0 var(--line));
}
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1rem; border-bottom: 2px solid var(--ink); }
.invoice-head .title { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); line-height: 1.3; }
.invoice-head .meta { text-align: left; font-size: var(--step--1); color: var(--ink-3); line-height: 1.7; }
.invoice-item { padding: 1rem 0 .5rem; }
.invoice-item .name { font-weight: 700; font-size: var(--step-1); margin-bottom: .35rem; }
.invoice-item ul { list-style: none; padding: 0; margin: 0; }
.invoice-item li { position: relative; padding-inline-start: 1.25rem; color: var(--ink-2); font-size: .95rem; line-height: 1.9; }
.invoice-item li::before { content: ""; position: absolute; inset-inline-start: 0; top: .8em; width: .5rem; height: 2px; background: var(--teal); }
.leader { display: flex; align-items: baseline; gap: .5rem; padding: .45rem 0; font-size: .95rem; }
.leader .k { color: var(--ink-2); white-space: nowrap; }
.leader .dots { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-.3em); min-width: 1rem; }
.leader .v { font-weight: 600; white-space: nowrap; }
.invoice-total { margin-top: .75rem; padding-top: .9rem; border-top: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.invoice-total .k { font-weight: 700; }
.invoice-total .v { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); color: var(--teal-deep); line-height: 1.3; }
.invoice-foot { margin-top: 1rem; font-size: var(--step--1); color: var(--ink-3); padding-inline-end: 7rem; }
.invoice.has-stamp { margin-bottom: 46px; }
.ltr-num { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.stamp {
  /* مهر روی لبه‌ی پایین فاکتور، جایی که متنی را نپوشاند */
  position: absolute; inset-inline-end: 1.5rem; bottom: -46px; z-index: 2;
  width: 104px; height: 104px; border-radius: 50%;
  border: 3px double var(--saffron); color: var(--saffron-ink);
  display: grid; place-items: center; text-align: center;
  font-family: var(--font-display); font-weight: 800; font-size: .95rem; line-height: 1.35;
  transform: rotate(-14deg);
  background: color-mix(in srgb, var(--saffron) 12%, var(--sheet));
  animation: stamp-in .5s cubic-bezier(.2, 1.6, .4, 1) .35s both;
}
.stamp small { display: block; font-family: var(--font-body); font-weight: 600; font-size: .7rem; }
@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-14deg) scale(1.6); }
  to { opacity: 1; transform: rotate(-14deg) scale(1); }
}
@media (max-width: 520px) {
  .invoice { padding: 1.25rem 1.1rem 1.25rem; }
  .stamp { width: 84px; height: 84px; font-size: .8rem; bottom: -38px; inset-inline-end: .75rem; }
}

/* ---------------- بخش‌ها ---------------- */
.band { padding: clamp(3rem, 7vw, 5rem) 0; }
.band-sheet { background: var(--sheet); border-block: 1px solid var(--line); }
.band-ink { background: var(--ink); color: #dfe7e5; }
.band-ink h2, .band-ink h3 { color: #fff; }
.band-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.band-head h2 { margin: 0; }
.band-head p { margin: .5rem 0 0; color: var(--ink-2); max-width: 60ch; }

/* ---------------- لیست قیمت پکیج‌ها ---------------- */
.price-list { border-top: 2px solid var(--ink); }
.price-row {
  display: grid; grid-template-columns: 3rem 1fr 11rem 13rem;
  gap: 1.25rem; align-items: center;
  padding: 1.35rem .25rem; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.price-row:hover { background: var(--teal-wash); }
.price-row:hover .go { color: var(--teal); }
.price-row .ico { width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 50%; background: var(--teal-wash); color: var(--teal-deep); font-size: 1.35rem; }
.price-row .name { font-weight: 700; font-size: var(--step-1); line-height: 1.6; }
.price-row .tag { color: var(--ink-2); font-size: .95rem; line-height: 1.8; }
.price-row .when { color: var(--ink-2); font-size: var(--step--1); }
.price-row .when i { margin-inline-end: .3rem; }
.price-row .price { text-align: left; font-family: var(--font-display); font-weight: 700; color: var(--ink); line-height: 1.5; }
.price-row .price small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .78rem; color: var(--ink-3); }
.price-row .go { color: var(--ink-3); transition: color .15s; }

@media (max-width: 860px) {
  .price-row { grid-template-columns: 2.75rem 1fr; gap: .25rem 1rem; }
  .price-row .ico { grid-row: span 3; width: 2.75rem; height: 2.75rem; align-self: start; }
  .price-row .when, .price-row .price { grid-column: 2; text-align: right; }
  .price-row .price small { display: inline; margin-inline-start: .4rem; }
}

/* ---------------- روند کار (ترتیب واقعی) ---------------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; }
.step { position: relative; padding: 0 1.25rem 0 0; }
.step::before {
  counter-increment: step; content: counter(step, persian);
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  border: 2px solid var(--saffron); color: #fff; font-family: var(--font-display); font-weight: 800; margin-bottom: 1rem;
  background: var(--ink);
}
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 1.25rem; inset-inline-start: 3rem; inset-inline-end: 0;
  border-top: 2px dashed rgba(223, 231, 229, .3);
}
.step h3 { font-size: var(--step-1); margin-bottom: .4rem; }
.step p { color: #b7c4c1; font-size: .95rem; margin: 0; padding-inline-end: 1rem; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr 1fr; gap: 2rem 0; }
  .step:nth-child(2)::after { display: none; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .step::after { display: none; }
}

/* ---------------- نمونه‌کار ---------------- */
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.case { display: flex; flex-direction: column; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; text-decoration: none; color: inherit; }
.case:hover { border-color: var(--teal); }
.case .who { font-size: var(--step--1); color: var(--ink-3); margin-bottom: .5rem; }
.case h3 { font-size: var(--step-1); line-height: 1.7; margin-bottom: .75rem; }
.case .metric { margin-top: auto; padding-top: 1rem; border-top: 1px dashed var(--line); display: flex; align-items: baseline; gap: .6rem; }
.case .metric b { font-family: var(--font-display); font-size: var(--step-3); color: var(--teal-deep); line-height: 1.2; }
.case .metric span { color: var(--ink-2); font-size: var(--step--1); }
@media (max-width: 900px) { .cases { grid-template-columns: 1fr; } }

.psr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 2rem 0; }
.psr > div { background: var(--sheet); padding: 1.25rem 1.4rem; }
.psr h3 { font-size: var(--step-0); color: var(--teal-deep); margin-bottom: .35rem; }
.psr p { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) { .psr { grid-template-columns: 1fr; } }

/* ---------------- درباره ---------------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-grid.no-photo { grid-template-columns: 1fr; max-width: 820px; }
.about-grid .portrait { aspect-ratio: 4/5; border-radius: var(--radius); background: var(--teal-wash) center/cover no-repeat; border: 1px solid var(--line); display: grid; place-items: center; color: var(--teal); font-size: 4rem; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.facts b { display: block; font-family: var(--font-display); font-size: var(--step-3); line-height: 1.3; }
.facts span { color: var(--ink-2); font-size: var(--step--1); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .about-grid.no-photo { grid-template-columns: 1fr; max-width: 820px; }
.about-grid .portrait { max-width: 320px; } }

/* ---------------- وبلاگ ---------------- */
.post-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem 1.5rem; }
.post-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: .6rem; }
.post-card .cover { aspect-ratio: 16/9; border-radius: var(--radius); background: var(--teal-wash) center/cover no-repeat; border: 1px solid var(--line); }
.post-card h3 { font-size: var(--step-1); line-height: 1.7; margin: 0; }
.post-card:hover h3 { color: var(--teal-deep); text-decoration: underline; text-decoration-thickness: 1px; }
.post-card p { color: var(--ink-2); font-size: .95rem; margin: 0; }
.post-card .info { font-size: var(--step--1); color: var(--ink-3); }
@media (max-width: 900px) { .post-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .post-list { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.chip { display: inline-block; padding: .3rem .9rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: var(--step--1); background: var(--sheet); }
.chip:hover { border-color: var(--teal); color: var(--teal-deep); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.article { max-width: 72ch; margin-inline: auto; }
.article header { margin-bottom: 2rem; }
.article .info { color: var(--ink-3); font-size: var(--step--1); display: flex; gap: 1.25rem; flex-wrap: wrap; }
.article .cover { width: 100%; border-radius: var(--radius); margin: 1.5rem 0 0; border: 1px solid var(--line); }

.prose { font-size: 1.075rem; line-height: 2.05; }
.prose h2 { font-size: var(--step-3); margin: 2.5rem 0 1rem; }
.prose h3 { font-size: var(--step-2); margin: 2rem 0 .75rem; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.25rem; }
.prose li { margin-bottom: .35rem; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose blockquote { border-inline-start: 4px solid var(--saffron); padding: .25rem 1.25rem; color: var(--ink-2); margin: 1.5rem 0; background: var(--sheet); }
.prose pre { direction: ltr; text-align: left; background: var(--ink); color: #e6eeec; padding: 1rem 1.25rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: .9rem; line-height: 1.7; }
.prose code { direction: ltr; unicode-bidi: embed; font-size: .9em; background: var(--teal-wash); padding: .1em .35em; border-radius: 4px; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .5rem .75rem; }
.prose th { background: var(--teal-wash); }
.prose a { color: var(--teal); }

.tag-list { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2rem; }

.pager { display: flex; gap: .5rem; justify-content: center; margin-top: 3rem; }
.pager a, .pager span { padding: .4rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2); background: var(--sheet); }
.pager .on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------------- صفحه‌ی پکیج ---------------- */
.pkg-hero { padding: clamp(2rem, 6vw, 4rem) 0 2rem; }
.crumbs { font-size: var(--step--1); color: var(--ink-3); margin-bottom: 1rem; }
.crumbs a { color: var(--ink-3); }
.pkg-grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.pkg-grid aside { position: sticky; top: 88px; }
.pkg-section { margin-bottom: 2.5rem; }
.pkg-section h2 { font-size: var(--step-2); margin-bottom: .75rem; }
.includes ul { list-style: none; padding: 0; }
.includes li { position: relative; padding: .55rem 2rem .55rem 0; border-bottom: 1px solid var(--line); }
/* تیک ساده با border تا به کد آیکون وابسته نباشد */
.includes li::before { content: ""; position: absolute; inset-inline-start: .35rem; top: 1.05rem; width: .45rem; height: .8rem; border: solid var(--teal); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.excludes li::before { border: 0; width: .65rem; height: 2.5px; background: var(--ink-3); transform: none; top: 1.35rem; }
.excludes li { color: var(--ink-2); }
@media (max-width: 900px) { .pkg-grid { grid-template-columns: 1fr; } .pkg-grid aside { position: static; } }

/* ---------------- فرم تماس ---------------- */
.form-sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2.25rem); }
.form-label { font-weight: 600; margin-bottom: .35rem; }
.form-control, .form-select { border-color: var(--line); border-radius: var(--radius-sm); padding: .65rem .85rem; font-size: 1rem; }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 .2rem rgba(14, 107, 104, .15); }
.form-hint { font-size: var(--step--1); color: var(--ink-3); margin-top: .3rem; }
.budget-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.budget-grid input { position: absolute; opacity: 0; pointer-events: none; }
.budget-grid label { padding: .5rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: .95rem; background: var(--paper); }
.budget-grid input:checked + label { border-color: var(--teal); background: var(--teal-wash); color: var(--teal-deep); font-weight: 600; }
.budget-grid input:focus-visible + label { outline: 3px solid var(--saffron); outline-offset: 2px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.field-validation-error, .validation-summary-errors { color: #b3261e; font-size: var(--step--1); }
.validation-summary-errors ul { margin: 0; padding-inline-start: 1.25rem; }

/* ---------------- CTA و فوتر ---------------- */
.cta { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.cta p { margin: .5rem 0 0; color: #b7c4c1; }
@media (max-width: 760px) { .cta { grid-template-columns: 1fr; } }

.site-footer { padding: 2.5rem 0; border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--ink-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--teal-deep); }

.empty { padding: 3rem 1rem; text-align: center; color: var(--ink-2); border: 1px dashed var(--line); border-radius: var(--radius); }
.error-page { padding: 6rem 0; text-align: center; }
.error-page .code { font-family: var(--font-display); font-size: 5rem; font-weight: 800; color: var(--teal); line-height: 1; }
