:root {
  --bg:           #f5efe4;
  --bg-warm:      #ede5d5;
  --bg-card:      #fbf7ef;
  --bg-deep:      #e6dcc7;

  --ink:          #1f2a25;
  --ink-2:        #3a4843;
  --ink-mute:     #6b7a72;
  --ink-soft:     #94a098;

  --sage-1:       #a8b89e;
  --sage-2:       #6b8e6f;
  --sage-3:       #3d5a47;
  --sage-4:       #25382c;

  --accent:       #c4895a;
  --accent-soft:  #e8c8a4;

  --crisis-bg:    #dde8ec;
  --crisis-deep:  #4a6b78;
  --crisis-ink:   #1f3a44;

  --line:         #d8cdb4;
  --line-soft:    #e7decb;

  --radius-sm:    10px;
  --radius:       18px;
  --radius-lg:    28px;
  --radius-xl:    40px;

  --shadow-sm:    0 1px 2px rgba(31,42,37,0.04), 0 2px 8px rgba(31,42,37,0.04);
  --shadow:       0 2px 6px rgba(31,42,37,0.05), 0 10px 30px rgba(31,42,37,0.08);
  --shadow-lg:    0 20px 60px rgba(31,42,37,0.14);

  --container:    1180px;
  --header-h:     76px;

  --font-fa: 'Vazirmatn', 'Estedad', system-ui, -apple-system, sans-serif;
}

[data-palette="blue"] {
  --bg:        #eef2f3;
  --bg-warm:   #e2eaee;
  --bg-card:   #f6f9fa;
  --bg-deep:   #d6e2e7;
  --sage-1:    #b8d0dc;
  --sage-2:    #7fa8c9;
  --sage-3:    #3e5f7a;
  --sage-4:    #233a4d;
  --accent:    #b0846a;
  --accent-soft:#dec5af;
  --line:      #cfdae0;
  --line-soft: #dde5ea;
  --crisis-bg: #ede1d6;
  --crisis-deep:#9c6a4a;
  --crisis-ink:#52331e;
}

[data-palette="clay"] {
  --bg:        #faf4ec;
  --bg-warm:   #f1e5d2;
  --bg-card:   #fffaf2;
  --bg-deep:   #ead8be;
  --sage-1:    #e6c8a8;
  --sage-2:    #c89878;
  --sage-3:    #8a5a3f;
  --sage-4:    #4d3322;
  --accent:    #6b8e6f;
  --accent-soft:#bccdb4;
  --line:      #e3d2b6;
  --line-soft: #ece1cc;
}

[data-palette="dark"] {
  --bg:        #1a221e;
  --bg-warm:   #222b27;
  --bg-card:   #28332e;
  --bg-deep:   #2f3b35;
  --ink:       #ecead9;
  --ink-2:     #d8d4be;
  --ink-mute:  #9aa399;
  --ink-soft:  #6b7771;
  --sage-1:    #4a5a4e;
  --sage-2:    #8aac8e;
  --sage-3:    #b5cdb6;
  --sage-4:    #d8e5d3;
  --accent:    #e4a878;
  --accent-soft:#5a4530;
  --line:      #36433d;
  --line-soft: #2c3631;
  --crisis-bg: #2a3e44;
  --crisis-deep:#7fa5b1;
  --crisis-ink:#d8e9ee;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-fa);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 4.2vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p  { margin: 0; text-wrap: pretty; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--sage-3);
  letter-spacing: -0.01em;
}
.brand__mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand__mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand small {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0;
  margin-top: -2px;
}

.nav {
  display: flex;
  gap: 4px;
  margin-inline-start: auto;
  align-items: center;
  list-style: none;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
}
.nav li {
  list-style: none;
  display: flex;
  align-items: center;
}
.nav a,
.nav li a {
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--ink-2);
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
.nav a:hover,
.nav li a:hover { background: var(--bg-deep); color: var(--ink); }
.nav .current-menu-item > a,
.nav .current_page_item > a,
.nav a.is-active {
  background: var(--sage-3);
  color: var(--bg);
}
.nav .nav-crisis {
  margin-inline-start: 12px;
  background: var(--crisis-bg);
  color: var(--crisis-ink);
  border: 1px solid color-mix(in srgb, var(--crisis-deep) 30%, transparent);
}
.nav .nav-crisis:hover { background: color-mix(in srgb, var(--crisis-bg) 70%, var(--crisis-deep) 10%); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  margin-inline-start: auto;
  color: var(--ink);
}

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-card);
    border-bottom: 1px solid var(--line-soft);
    padding: 12px;
    gap: 4px;
    margin: 0;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a,
  .nav li a { padding: 14px 16px; }
  .nav li { width: 100%; }
  .nav .nav-crisis { margin-inline-start: 0; margin-top: 8px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-align: center;
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--sage-3); color: var(--bg); }
.btn--primary:hover { background: var(--sage-4); box-shadow: 0 8px 20px color-mix(in srgb, var(--sage-3) 30%, transparent); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--bg-warm); border-color: var(--sage-2); }

.btn--soft { background: var(--bg-warm); color: var(--ink); }
.btn--soft:hover { background: var(--bg-deep); }

.btn--accent { background: var(--accent); color: white; }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 80%, black); }

.btn--sm { padding: 10px 16px; font-size: 0.9rem; border-radius: 12px; }
.btn--lg { padding: 18px 28px; font-size: 1.05rem; border-radius: 16px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line); }

section { padding: 80px 0; }
@media (max-width: 720px) { section { padding: 56px 0; } }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.section-head__title { max-width: 640px; }
.section-head__title .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--sage-3);
  font-weight: 600;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sage-1) 40%, transparent);
}
.section-head p {
  color: var(--ink-mute);
  margin-top: 12px;
  font-size: 1.05rem;
}

.site-footer {
  background: var(--sage-4);
  color: color-mix(in srgb, var(--bg) 80%, transparent);
  padding: 64px 0 32px;
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}
.site-footer__pattern {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  pointer-events: none;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  position: relative;
}
.site-footer h4 { color: var(--bg); font-size: 0.95rem; margin-bottom: 16px; }
.site-footer a {
  color: color-mix(in srgb, var(--bg) 75%, transparent);
  display: block;
  padding: 4px 0;
  font-size: 0.92rem;
}
.site-footer a:hover { color: var(--bg); }
.site-footer__brand { font-size: 1.4rem; color: var(--bg); font-weight: 800; margin-bottom: 8px; }
.site-footer__about {
  color: color-mix(in srgb, var(--bg) 65%, transparent);
  font-size: 0.92rem;
  max-width: 320px;
  line-height: 1.8;
}
.social { display: flex; gap: 10px; margin-top: 16px; }
.social a {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 10%, transparent);
  display: grid;
  place-items: center;
  padding: 0;
}
.social a:hover { background: color-mix(in srgb, var(--bg) 20%, transparent); }
.site-footer__bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid color-mix(in srgb, var(--bg) 15%, transparent);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: color-mix(in srgb, var(--bg) 55%, transparent);
  position: relative;
}
@media (max-width: 760px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}

.motif-bg {
  position: absolute;
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
  z-index: 0;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 0.9rem; color: var(--ink-2); font-weight: 500; }
.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
  direction: rtl;
  text-align: right;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--sage-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sage-2) 18%, transparent);
}
.field textarea { resize: vertical; min-height: 100px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: var(--bg-warm);
  color: var(--ink-2);
  font-weight: 500;
}
.pill--sage { background: color-mix(in srgb, var(--sage-1) 50%, transparent); color: var(--sage-4); }
.pill--accent { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 50%, var(--ink)); }
.pill--crisis { background: var(--crisis-bg); color: var(--crisis-ink); }

.hidden { display: none !important; }
.text-mute { color: var(--ink-mute); }
.text-sage { color: var(--sage-3); }
.fa-num { font-feature-settings: "ss01"; font-variant-numeric: tabular-nums; }

.scroll-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-fade.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.page-head {
  padding: 56px 0 24px;
  position: relative;
  overflow: hidden;
}
.page-head__motif {
  position: absolute;
  top: -40px; right: -30px;
  width: 220px;
  color: var(--sage-2);
  opacity: 0.1;
  pointer-events: none;
}
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.page-head p {
  color: var(--ink-mute);
  font-size: 1.1rem;
  max-width: 640px;
  margin-top: 12px;
}
