:root {
  --green: #556536;        /* سبز سازمانی (سایه‌ی تیره) */
  --green-brand: #65733e;  /* سبز سازمانی (سایه‌ی روشن) */
  --green-dark: #44512b;
  --cream: #ffdd96;        /* کرم سازمانی */
  --gray: #d2d3d5;         /* طوسی سازمانی */
  --gray-dark: #b2b3b7;
  --ink: #2b3020;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html { background: #e4e4e4; }

body {
  margin: 0;
  font-family: Vazirmatn, Tahoma, sans-serif;
  color: var(--ink);
  background: transparent;
  line-height: 2;
  font-size: 18px;
}

a { color: inherit; }

/* بکگراند ثابت طوسی (مثل بکگراند لوگو): هنگام اسکرول تکان نمی‌خورد */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    url("bg-top.svg") top left / min(40vw, 430px) auto no-repeat,
    url("bg-bottom.svg") bottom right / min(36vw, 346px) auto no-repeat,
    linear-gradient(135deg, #f6f6f6 0%, #d6d6d6 100%);
}

/* بالای صفحه: بدون نوار، روی کاور؛ لوگو بالا سمت راست */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 6%;
}
html[dir="ltr"] .topbar { flex-direction: row-reverse; }
.brand img { height: 96px; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.topbar nav { display: flex; gap: 28px; padding-top: 18px; }
.topbar nav a { text-decoration: none; color: var(--green-dark); font-weight: bold; }
.topbar nav a:hover { text-decoration: underline; text-underline-offset: 8px; }
.menu-toggle, .burger { display: none; }

/* معرفی: عکس سازه به‌عنوان کاور */
.hero {
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), 0 100%);
  display: flex;
  align-items: center;
  justify-content: flex-start;   /* در فارسی سمت راست */
  min-height: clamp(380px, 40vw, 600px);
  padding: 140px 6% calc(70px + var(--cut));
  color: var(--cream);
  background:
    linear-gradient(to left, rgba(14, 22, 8, .82) 0%, rgba(14, 22, 8, .62) 45%, rgba(14, 22, 8, 0) 78%),
    url("cover.png") right center / cover no-repeat;
  background-color: var(--green-dark);
}
.hero-text { max-width: 540px; }
.hero h1 { font-size: 2.6rem; line-height: 1.5; margin: 0 0 20px; text-shadow: 0 2px 12px rgba(0, 0, 0, .55); }
.hero p { margin: 0 0 32px; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }

.btn {
  display: inline-block;
  padding: 12px 34px;
  background: var(--cream);
  color: var(--green-dark);
  font-weight: bold;
  text-decoration: none;
  border-radius: 4px;
}
.btn:hover { background: #fff; }

/* بخش‌های عمومی */
section { padding: 80px 6%; }
h2 { font-size: 2rem; margin: 0 0 24px; color: var(--green-dark); }

.about p { max-width: 720px; margin: 0 0 16px; }
h3 { font-size: 1.35rem; margin: 36px 0 14px; color: var(--green-dark); }
.timeline, .why { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.timeline li { display: flex; gap: 18px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid rgba(85,101,54,.25); }
.timeline strong { flex: 0 0 auto; min-width: 64px; text-align: center; padding: 0 12px; background: var(--green); color: var(--cream); border-radius: 4px; }
.why li { padding: 6px 28px 6px 0; position: relative; }
.why li::before { content: ""; position: absolute; right: 4px; top: 20px; width: 10px; height: 10px; background: var(--cream); border: 2px solid var(--green-brand); transform: rotate(45deg); }
html[dir="ltr"] .why li { padding: 6px 0 6px 28px; }
html[dir="ltr"] .why li::before { right: auto; left: 4px; }

/* خدمات */
.services { background: transparent; }

/* تماس */
.contact {
  position: relative;
  padding-top: 130px;
  color: #fff;
  background: linear-gradient(115deg, var(--green-dark) 0%, var(--green) 55%, var(--green-brand) 100%);
  clip-path: polygon(0 56px, 100% 0, 100% 100%, 0 100%);
}
.contact::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 64%, rgba(0,0,0,.2) 64%, rgba(0,0,0,.2) 74%, transparent 74%);
  pointer-events: none;
}
.contact > * { position: relative; }
.contact h2 { color: var(--cream); }
.phones { display: flex; gap: 28px; flex-wrap: wrap; font-size: 1.2rem; margin: 0 0 8px; }
.address { font-size: .95rem; line-height: 1.8; margin: 0 0 4px; opacity: .9; }
.email { margin-top: 16px; }
.contact .email a { color: var(--cream); text-decoration: underline; text-underline-offset: 5px; }
.contact .email a:hover { color: #fff; }
.contact a { text-decoration: none; }
.contact a:hover { color: var(--cream); }

footer {
  padding: 22px 6%;
  background: linear-gradient(115deg, #38441f, var(--green-dark));
  color: var(--cream);
  font-size: 15px;
}

/* نسخه‌ی انگلیسی (چپ‌به‌راست) */
html[dir="ltr"] .hero { justify-content: flex-end; }
html[dir="ltr"] .hero h1 { line-height: 1.3; }

/* منوی کشویی محصولات */
.dd { position: relative; padding-bottom: 14px; margin-bottom: -14px; }
.sub { display: none; position: absolute; top: 100%; right: 0; min-width: 190px; padding: 8px 0; background: rgba(46,58,26,.97); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.35); }
html[dir="ltr"] .sub { right: auto; left: 0; }
.dd:hover .sub, .dd:focus-within .sub { display: block; }
.topbar nav .sub a { display: block; padding: 10px 22px; color: var(--cream); font-weight: normal; text-decoration: none; }
.topbar nav .sub a:hover { background: rgba(255,255,255,.1); text-decoration: none; }

/* لبه‌ی گرافیکی کاور: تیرهای مورّب */

/* متن‌های صفحه‌ی تاریخچه و درباره ما */
.tagline { font-weight: bold; font-size: 1.15rem; color: var(--green); }
.center { text-align: center; }
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { font-size: 1.6rem; margin: 44px 0 14px; color: var(--green-dark); text-align: start; }
.prose p { margin: 0 0 16px; }
.prose .timeline { margin-bottom: 20px; }
.btn.off { background: #cfd0d3; color: #6b6c70; cursor: default; }
.btn.off:hover { background: #cfd0d3; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 900px; margin: 0 auto 28px; }
.card.link { display: block; text-decoration: none; color: inherit; }
.card.link:hover { box-shadow: 0 8px 22px rgba(0,0,0,.2); }

/* دایره‌های خدمات */
.services h2, .projects-map h2 { text-align: center; }
.circle h3 { margin: 0 0 6px; font-size: 1.15rem; }

/* نقشه */
.lead { text-align: center; max-width: 640px; margin: 0 auto 28px; }
.map-wrap { position: relative; max-width: 860px; margin: 0 auto; }
.map-wrap svg { width: 100%; height: auto; display: block; }
.iran { fill: rgba(101,115,62,.2); stroke: var(--green-brand); stroke-width: 1.2; stroke-linejoin: round; filter: drop-shadow(0 8px 10px rgba(40,50,25,.16)); }
.marker { cursor: pointer; transform-box: fill-box; transform-origin: center; }
.marker .dot { fill: #ff5a1f; stroke: #fff; stroke-width: 1.4; filter: drop-shadow(0 1px 2px rgba(70,25,0,.5)); transition: fill .15s; }
.marker .hit { fill: transparent; }
.marker:hover .dot, .marker:focus .dot { fill: #d93d05; }
.marker .ring { fill: none; stroke: #ff5a1f; stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: pulse 3.2s ease-out infinite; animation-delay: calc(var(--i) * .35s); }
@keyframes pulse { from { transform: scale(1); opacity: .55; } to { transform: scale(2.1); opacity: 0; } }
html.js .marker { opacity: 0; transform: scale(.35); pointer-events: none; transition: opacity .45s ease, transform .55s cubic-bezier(.05,0.5,.5,1); }
.tip { position: absolute; z-index: 5; padding: 10px 16px; background: #fff; border-right: 6px solid #ff5a1f; border-radius: 8px; box-shadow: 0 6px 22px rgba(0,0,0,.22); font-size: 15px; line-height: 1.8; white-space: nowrap; pointer-events: none; transform: translateY(-50%); }
.tip[hidden] { display: none; }
.tip b { display: block; color: var(--green-dark); }

/* صفحه‌های داخلی */
.topbar.inner { position: relative; align-items: center; background: linear-gradient(115deg, var(--green-dark), var(--green)); }
.topbar.inner nav { padding-top: 0; }
.topbar.inner nav a { color: var(--cream); }
.topbar.inner .brand img { height: 72px; }
.page { padding: 56px 6% 80px; min-height: 60vh; }
.page h1 { font-size: 2.2rem; margin: 0 0 12px; text-align: center; color: var(--green-dark); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; max-width: 1100px; margin: 0 auto; }
.card { background: rgba(255,255,255,.9); border-top: 4px solid var(--green-brand); border-radius: 8px; overflow: hidden; scroll-margin-top: 24px; }
.card:target { outline: 3px solid var(--cream); box-shadow: 0 0 0 6px var(--green-brand); }
.ph { aspect-ratio: 4 / 3; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #e2e3e5, #c9cacd); color: #85868a; font-size: .9rem; }
.card .body { padding: 14px 18px 18px; }
.card h2 { font-size: 1.1rem; margin: 0 0 2px; }
.card p { margin: 0; font-size: .9rem; line-height: 1.8; }
.card .meta { color: var(--green); font-weight: bold; }

/* موبایل */
@media (max-width: 760px) {
  .hero {
    justify-content: center;
    min-height: 460px;
    padding: 50px 6%;
    text-align: center;
    background:
      linear-gradient(rgba(14, 22, 8, .72), rgba(14, 22, 8, .72)),
      url("cover.png") 80% center / cover no-repeat;
    background-color: var(--green-dark);
  }
  html[dir="ltr"] .hero { justify-content: center; }
  .hero h1 { font-size: 1.9rem; }
  .topbar, html[dir="ltr"] .topbar { flex-direction: row; align-items: center; padding: 10px 5%; }
  html[dir="ltr"] .topbar { flex-direction: row-reverse; }
  .brand img, .topbar.inner .brand img { height: 60px; }
  .burger { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 10px; background: rgba(14, 22, 8, .5); cursor: pointer; }
  .burger span { display: block; width: 24px; height: 3px; background: var(--cream); box-shadow: 0 -8px 0 var(--cream), 0 8px 0 var(--cream); }
  .topbar nav { display: none; position: absolute; top: 100%; left: 4%; right: 4%; flex-direction: column; gap: 0; padding: 6px 0; background: rgba(46, 58, 26, .97); border-radius: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, .35); }
  .menu-toggle:checked ~ nav { display: flex; }
  .topbar nav a, .topbar.inner nav a { color: var(--cream); font-size: 16px; padding: 12px 22px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .topbar nav a:last-child { border-bottom: 0; }
  body::before { background: url("bg-top.svg") top left / 24vw auto no-repeat, url("bg-bottom.svg") bottom right / 22vw auto no-repeat, linear-gradient(135deg, #f6f6f6, #d6d6d6); }
  .about, .services { background: rgba(255, 255, 255, .6); }
  .circles { gap: 40px 12px; }
  .circle { flex-basis: calc(50% - 6px); }
  .disc { width: 112px; height: 112px; }
  .disc svg { width: 52px; height: 52px; }
  .marker .dot, .marker .ring { r: 5.6px; }
  .marker .hit { r: 8.5px; }
  .cards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .hero-wrap { --cut: 34px; }
  .dd { padding-bottom: 0; margin-bottom: 0; }
  .sub { display: block; position: static; min-width: 0; padding: 0; background: none; box-shadow: none; }
  .topbar nav .sub a { padding: 9px 40px 9px 22px; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .topbar nav a { color: var(--cream); text-shadow: 0 1px 6px rgba(0,0,0,.6); }
  .brand img { height: 64px; }
  .hero { padding-top: 100px; padding-bottom: calc(50px + var(--cut)); }
  .timeline li { flex-direction: column; gap: 6px; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  
  .ring { animation: none; }
  .edge polygon { animation: none; }
  html { scroll-behavior: auto; }
}

/* نسخه‌ی انگلیسی (چپ‌به‌راست) */
html[dir="ltr"] .tip { border-right: 0; border-left: 4px solid #ff5a1f; }
@media (max-width: 760px) { html[dir="ltr"] .topbar nav .sub a { padding: 9px 22px 9px 40px; } }

/* لبه‌ی کاور: برش مورّب با نوارهای موازی (هم‌خوان با المان‌های لوگو) */
.hero-wrap { --cut: 80px; position: relative; margin-bottom: calc(var(--cut) * 1.1); }
.edge { position: absolute; left: 0; width: 100%; bottom: calc(var(--cut) * -1.25); height: calc(var(--cut) * 2.25); pointer-events: none; z-index: 2; }
.edge polygon { animation: slide 1.3s cubic-bezier(.2, .8, .2, 1) both; }
.edge .e1 { fill: var(--cream); animation-delay: .15s; }
.edge .e2 { fill: var(--green-brand); animation-delay: .3s; }
.edge .e3 { fill: #b8b9bc; animation-delay: .45s; }
.edge .e4 { fill: #838487; animation-delay: .6s; }
@keyframes slide { from { transform: translateX(-1000px); opacity: 0; } to { transform: none; opacity: 1; } }

/* خدمات: دایره‌های پیشرفته */
.circles { display: flex; flex-wrap: wrap; justify-content: center; gap: 56px 28px; max-width: 1120px; margin: 0 auto; }
.circle { flex: 0 0 calc(25% - 21px); text-align: center; }
.disc { position: relative; width: 140px; height: 140px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, var(--green-brand), var(--green-dark)); box-shadow: inset 0 0 0 3px rgba(255,221,150,.35), 0 10px 24px rgba(0,0,0,.2); transition: transform .3s; }
.disc::before { content: ""; position: absolute; inset: -12px; border: 2px dashed rgba(85,101,54,.6); border-radius: 50%; animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.circle:hover .disc { transform: translateY(-6px); }
.disc svg { width: 70px; height: 70px; fill: none; stroke: var(--cream); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.num { position: absolute; top: -8px; inset-inline-end: -8px; width: 32px; height: 32px; border-radius: 50%; background: var(--cream); color: var(--green-dark); font-weight: bold; font-size: 13px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); z-index: 1; }
.circle p { margin: 0 auto; max-width: 230px; font-size: .9rem; line-height: 1.8; }
.ph.two { grid-template-columns: 1fr 1fr; gap: 2px; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 1000px) { .circle { flex-basis: calc(33.33% - 19px); } }
@media (prefers-reduced-motion: reduce) { .disc::before { animation: none; } .edge polygon { animation: none; } }
