/* ==========================================================================
   پایه پایدار — استایل سایت عمومی
   رنگ‌های اصلی از پنل مدیریت (base.html → :root --c-*) تزریق می‌شوند.
   ========================================================================== */

:root {
  --c-primary: #1e5fbf;
  --c-primary-light: #3f8cff;
  --c-accent: #c9a14a;
  --c-dark: #0b1f3a;
  --c-text: #1b2436;
  --c-bg: #f4f7fc;

  --bg: var(--c-bg);
  --surface: #ffffff;
  --surface-2: #eef3fb;
  --ink: var(--c-dark);
  --text: var(--c-text);
  --muted: #5b6b85;
  --line: #e1e8f4;
  --shadow-sm: 0 2px 10px rgba(11, 31, 58, .06);
  --shadow-md: 0 14px 32px rgba(11, 31, 58, .12);
  --shadow-lg: 0 26px 60px rgba(11, 31, 58, .18);
  --radius: 4px 16px 16px 16px;
  --radius-lg: 6px 22px 22px 22px;
  --nav-h: 92px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: 'Vazirmatn', Tahoma, 'Segoe UI', Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #08111f;
  --bg: color-mix(in srgb, var(--c-dark) 55%, #030811);
  --surface: #0f1b30;
  --surface: color-mix(in srgb, var(--c-dark) 82%, #ffffff 6%);
  --surface-2: #0c1729;
  --surface-2: color-mix(in srgb, var(--c-dark) 70%, #000);
  --ink: #eaf0fc;
  --text: #d3ddf0;
  --muted: #93a3c2;
  --line: #1d2c47;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .3);
  --shadow-md: 0 14px 32px rgba(0, 0, 0, .4);
  --shadow-lg: 0 26px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.95; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.55; margin: 0; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--c-primary-light); outline-offset: 3px; border-radius: 4px; }
.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* -------------------------------------------------------------- دکمه‌ها */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 26px; border-radius: 4px 12px 12px 12px; border: 1.5px solid transparent;
  font-weight: 700; font-size: .95rem; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: 0 10px 24px rgba(30, 95, 191, .32); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(30, 95, 191, .4); background: var(--c-primary-light); }
.btn-outline { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; }
[dir="rtl"] .btn .arr { transform: scaleX(-1); }

/* ---------------------------------------------------------------- ناوبری */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 100; height: var(--nav-h);
  background: rgba(11, 31, 58, .94); background: color-mix(in srgb, var(--c-dark) 94%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .07); color: #fff; transition: box-shadow .25s, height .25s;
}
.nav.scrolled { box-shadow: 0 8px 26px rgba(0, 0, 0, .28); }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 76px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 13px; border-radius: 8px; font-size: .92rem; font-weight: 500;
  color: rgba(255, 255, 255, .82); transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255, 255, 255, .09); }
.nav-links a.nav-cta { background: var(--c-primary); color: #fff; font-weight: 700; border-bottom: 2px solid var(--c-accent); margin-inline-start: 6px; }
.nav-links a.nav-cta:hover { background: var(--c-primary-light); }
.nav-utils { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.util-btn {
  height: 38px; min-width: 38px; padding: 0 11px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); color: #fff; font-size: .82rem; font-weight: 700;
  transition: background .2s;
}
.util-btn:hover { background: rgba(255, 255, 255, .18); }
.util-btn svg { width: 18px; height: 18px; }
.theme-btn .ic-sun { display: none; }
:root[data-theme="dark"] .theme-btn .ic-sun { display: block; }
:root[data-theme="dark"] .theme-btn .ic-moon { display: none; }
.nav-toggle { display: none; }

/* ------------------------------------------------------------------ هیرو */
.hero {
  position: relative; min-height: clamp(580px, 88vh, 820px); padding-top: calc(var(--nav-h) + clamp(20px, 4vh, 44px)); padding-bottom: clamp(88px, 11vh, 120px);
  display: flex; align-items: center; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(1100px 520px at 88% -5%, rgba(63, 140, 255, .20), transparent 62%),
    radial-gradient(900px 520px at 0% 105%, rgba(201, 161, 74, .16), transparent 62%),
    linear-gradient(180deg, #eaf1fc 0%, #f8fafe 100%);
}
:root[data-theme="dark"] .hero {
  background:
    radial-gradient(1100px 520px at 88% -5%, rgba(63, 140, 255, .22), transparent 62%),
    radial-gradient(900px 520px at 0% 105%, rgba(201, 161, 74, .12), transparent 62%),
    linear-gradient(160deg, var(--c-dark) 0%, #0d2a52 62%, #091a33 100%);
}
.hero-media { position: absolute; inset: 0; z-index: -3; }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(248, 250, 254, .82), rgba(248, 250, 254, .9)); }
:root[data-theme="dark"] .hero-media::after { background: linear-gradient(180deg, rgba(8, 17, 31, .72), rgba(8, 17, 31, .86)); }
.hero-grid {
  position: absolute; inset: 0; z-index: -2; opacity: .9;
  background-image:
    linear-gradient(rgba(30, 95, 191, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 95, 191, .08) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 35% 55%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 70% at 35% 55%, #000 25%, transparent 78%);
}
:root[data-theme="dark"] .hero-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
}
.hero-skyline {
  position: absolute; z-index: 0; left: -14%; bottom: -10px; width: 120%; height: 108%;
  color: var(--c-primary); opacity: .34; pointer-events: none;
}
:root[data-theme="dark"] .hero-skyline { color: #8fb8ff; opacity: .24; }
.hero-skyline .draw { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 3.2s var(--ease) .3s forwards; }
.hero-skyline .draw.d2 { animation-delay: .7s; }
.hero-skyline .draw.d3 { animation-delay: 1.1s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero-inner { direction: ltr; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 4.5vw, 72px); width: min(1320px, 100% - 40px); }
.hero-inner--solo { grid-template-columns: minmax(0, 560px); justify-content: center; }
.hero-inner--solo .hero-visual { display: none; }

/* چپ: قاب هندسی عکس پروژه‌ها روی خطوط ساختمانی */
.hero-visual { position: relative; display: flex; flex-direction: column; gap: clamp(16px, 2.6vh, 26px); align-items: center; justify-content: center; min-height: clamp(340px, 46vw, 640px); }
.hero-frame { position: relative; z-index: 2; width: min(740px, 100%); margin-inline: auto; aspect-ratio: 600 / 500; align-self: center; animation: logoIn 1.1s var(--ease) .15s both; }
.frame-shape {
  position: absolute; left: 5%; top: 6.52%; width: 90%; height: 86.96%; overflow: hidden; background: var(--c-dark);
  clip-path: polygon(0 0, 91.11% 0, 100% 12%, 100% 100%, 8.89% 100%, 0 88%);
  box-shadow: 0 24px 60px rgba(11, 31, 58, .3);
}
.frame-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center center; opacity: 0; transform: scale(1.07); transition: opacity 1.2s ease, transform 7s linear; }
.frame-img.fit-contain { object-fit: contain; background: var(--c-dark); }
.frame-img.is-on { opacity: 1; transform: scale(1); }
.frame-caption {
  position: absolute; z-index: 3; bottom: 16px; inset-inline-end: 7%; max-width: 78%; padding: 6px 16px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; line-height: 1.7; color: #fff; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(11, 31, 58, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: opacity .5s;
}
.frame-caption.is-fading { opacity: 0; }
.frame-outline { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; overflow: visible; }
.frame-outline polygon { stroke: var(--c-primary-light); stroke-width: 2.5; }
.frame-outline path { stroke: var(--c-accent); stroke-width: 3; stroke-linecap: square; }
.frame-outline path.thin { stroke: var(--c-primary); stroke-width: 1.5; opacity: .55; }
:root[data-theme="dark"] .frame-outline path.thin { stroke: #8fb8ff; }

/* راست: لوگوی بزرگ + متن */
.hero-brand { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 2.4vh, 24px); min-width: 0; }
.hero-logo-wrap { display: flex; justify-content: center; width: min(430px, 100%); animation: logoIn 1.1s var(--ease) both; }
.hero-logo-wrap img { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 34px rgba(11, 31, 58, .16)); }
.hero-logo-wrap .logo-light { display: none; }
:root[data-theme="dark"] .hero-logo-wrap .logo-color { display: none; }
:root[data-theme="dark"] .hero-logo-wrap .logo-light { display: block; filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .45)); }
/* متن هدر: کنار لوگو، روی پنل شیشه‌ای */
.hero-text {
  padding: 24px 28px; text-align: start; position: relative; z-index: 2;
  background: rgba(255, 255, 255, .62); border: 1px solid rgba(30, 95, 191, .14); border-inline-start: 3px solid var(--c-accent);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
  animation: textIn 1.1s var(--ease) .25s both;
}
:root[data-theme="dark"] .hero-text { background: rgba(15, 27, 48, .62); border-color: rgba(255, 255, 255, .12); border-inline-start-color: var(--c-accent); }
.hero-text { width: min(560px, 100%); margin-inline: auto; }
.hero-text p { margin: 0 0 .7em; color: var(--text); font-size: .95rem; line-height: 1.95; font-weight: 500; }
.hero-text p:first-child { color: var(--ink); font-weight: 700; }
.hero-text p:last-child { margin-bottom: 0; }
@keyframes textIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes logoIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }

.hero::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 64px; background: var(--bg);
  clip-path: polygon(0 100%, 100% 100%, 100% 30%); z-index: 2;
}
[dir="rtl"] .hero::after { clip-path: polygon(0 100%, 100% 100%, 0 30%); }
.scroll-cue {
  position: absolute; z-index: 3; bottom: 52px; inset-inline-start: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: .74rem; letter-spacing: .05em; color: var(--muted);
}
[dir="rtl"] .scroll-cue { transform: translateX(50%); }
.scroll-cue .line { width: 1.5px; height: 34px; background: linear-gradient(var(--c-primary), transparent); animation: cue 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------------------------------------------------------------- بخش‌ها */
.section { padding: 88px 0; position: relative; }
.section--alt { background: var(--surface); }
#about { padding: 44px 0 56px; }
.section--ink { background: var(--c-dark); color: #dbe6fb; }
.section--ink h2, .section--ink h3 { color: #fff; }
.section--ink .section-lead { color: #a9bbdc; }
.section-head { margin-bottom: 40px; max-width: 720px; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--c-accent); font-weight: 800; font-size: .82rem; letter-spacing: .03em; margin-bottom: 10px; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--c-accent); }
.section-head.center .eyebrow::after { content: ""; width: 28px; height: 2px; background: var(--c-accent); }
.section-title { font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 800; margin-bottom: 12px; }
.section-lead { color: var(--muted); margin: 0; }

/* ----------------------------------------------------------- درباره ما */
.about-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.ceo-figure { margin: 0 auto; width: fit-content; max-width: 100%; border-radius: var(--radius-lg); overflow: hidden; background: var(--c-dark); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.ceo-photo { background: var(--c-dark); line-height: 0; }
.ceo-photo img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100vh - var(--nav-h) - 170px); max-height: calc(100svh - var(--nav-h) - 170px); margin: 0 auto; object-fit: contain; }
.ceo-tag { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; color: #fff; background: var(--c-dark); border-top: 3px solid var(--c-accent); }
.ceo-tag b { font-size: 1.1rem; line-height: 1.5; }
.ceo-tag span { font-size: .86rem; color: var(--c-accent); font-weight: 700; }
.eyebrow--lg { font-size: 1.2rem; gap: 14px; margin-bottom: 22px; }
.eyebrow--lg::before, .eyebrow--lg::after { width: 44px; height: 3px; }
.about-text p { color: var(--muted); font-size: 1.05rem; line-height: 2.1; }
.about-text p:first-of-type { color: var(--ink); font-weight: 600; font-size: 1.12rem; }
.legal-line {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 22px 0 6px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--c-accent); border-radius: var(--radius);
  font-size: .9rem; color: var(--muted);
}
.legal-line b { color: var(--ink); }
.stat-grid { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 26px; }
.stat-card { flex: 1 1 150px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); border-top: 3px solid var(--c-primary); box-shadow: var(--shadow-sm); }
.stat-card b { display: block; font-size: 2rem; font-weight: 900; color: var(--c-primary); line-height: 1.3; }
:root[data-theme="dark"] .stat-card b { color: var(--c-primary-light); }
.stat-card span { color: var(--muted); font-size: .88rem; font-weight: 600; }

/* ------------------------------------------------------ زمینه‌های فعالیت */
.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.act-card {
  position: relative; padding: 30px 24px 26px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 3px solid transparent; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.section:not(.section--alt) .act-card { background: var(--surface); }
.act-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-top-color: var(--c-accent); }
.act-icon {
  width: 54px; height: 54px; border-radius: 14px; margin-bottom: 20px; display: flex; align-items: center; justify-content: center;
  background: var(--c-dark); color: var(--c-accent); box-shadow: 0 8px 18px rgba(11, 31, 58, .2);
}
.act-icon svg { width: 27px; height: 27px; }
.act-card .num { position: absolute; top: 18px; inset-inline-end: 20px; font-size: 1.9rem; font-weight: 900; color: var(--line); line-height: 1; }
.act-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.act-card p { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------------------------------------------------------------- تاریخچه */
.timeline { position: relative; max-width: 760px; margin: 0 auto; padding-inline-start: 34px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--c-primary), var(--c-accent)); }
.timeline-item { position: relative; padding-bottom: 28px; }
.timeline-dot { position: absolute; inset-inline-start: -34px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c-primary); }
.timeline-year { display: inline-block; font-weight: 900; color: var(--c-primary); font-size: 1.1rem; }
.timeline-text { margin: 2px 0 0; color: var(--muted); }

/* --------------------------------------------------------------- پروژه‌ها */
.projects-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1 1 280px; }
.search-box input {
  width: 100%; padding: 13px 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font-family: inherit; font-size: .95rem;
}
.search-box input:focus { outline: 2px solid var(--c-primary-light); border-color: transparent; }
.search-box svg { position: absolute; top: 50%; inset-inline-start: 15px; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.projects-count { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.projects-count b { color: var(--ink); }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project-card {
  display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease); text-align: start; padding: 0; color: inherit; font: inherit;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.project-photo { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--c-dark), var(--c-primary)); overflow: hidden; }
.project-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.project-card:hover .project-photo img { transform: scale(1.06); }
.project-photo .count {
  position: absolute; bottom: 10px; inset-inline-end: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; color: #fff; line-height: 1.6;
  background: rgba(11, 31, 58, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.project-photo .count svg { width: 14px; height: 14px; flex: none; }
.project-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pill { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--c-primary); }
:root[data-theme="dark"] .pill { color: var(--c-primary-light); }
.pill.status-ongoing { background: #fff4e5; color: #a8650a; }
.pill.status-done { background: #e8f6ee; color: #1a7a4d; }
:root[data-theme="dark"] .pill.status-ongoing { background: #3a2d10; color: #f0c675; }
:root[data-theme="dark"] .pill.status-done { background: #0f2e1e; color: #7fd9a6; }
.project-body h4 { font-size: 1.02rem; }
.project-loc { color: var(--muted); font-size: .86rem; display: flex; align-items: center; gap: 6px; }
.project-loc svg { width: 15px; height: 15px; flex: none; }
.project-desc { color: var(--muted); font-size: .88rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-foot { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .8rem; }
.project-foot b { color: var(--text); font-weight: 700; }
.empty-state {
  text-align: center; padding: 56px 24px; border: 1.5px dashed var(--line); border-radius: var(--radius-lg); color: var(--muted); background: var(--bg);
}
.empty-state svg { width: 46px; height: 46px; color: var(--c-primary); opacity: .7; margin: 0 auto 12px; }
.empty-state p { margin: 0; }

/* -------------------------------------------------------------- تجهیزات */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table-wrap th { text-align: start; background: var(--c-dark); color: #fff; padding: 14px 18px; font-weight: 700; }
.table-wrap td { padding: 13px 18px; border-bottom: 1px solid var(--line); }
.table-wrap tr:last-child td { border-bottom: 0; }

/* -------------------------------------------- گواهینامه‌ها — حالت شیشه‌ای */
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; max-width: 1080px; margin-inline: auto; }
.cert-card {
  position: relative; display: block; width: 100%; min-height: 300px; padding: 0; border: 0; overflow: hidden; text-align: start; color: #fff;
  border-radius: var(--radius-lg); background: #0a1a33; isolation: isolate;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35); transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.cert-card:hover, .cert-card:focus-visible { transform: translateY(-8px); box-shadow: 0 28px 56px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .25); }
/* سند واقعی زیر شیشه */
.cert-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; z-index: -3; transform: scale(1.04); transition: transform .8s var(--ease); pointer-events: none; }
.cert-card:hover .cert-bg { transform: scale(1.12); }
/* لایه‌ی شیشه‌ای مات */
.cert-glass {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(40, 80, 150, .34) 38%, rgba(8, 20, 40, .86) 100%);
  -webkit-backdrop-filter: blur(5px) saturate(1.3); backdrop-filter: blur(5px) saturate(1.3);
  transition: -webkit-backdrop-filter .5s var(--ease), backdrop-filter .5s var(--ease), background .5s var(--ease);
}
.cert-card:hover .cert-glass, .cert-card:focus-visible .cert-glass {
  -webkit-backdrop-filter: blur(1.5px) saturate(1.15); backdrop-filter: blur(1.5px) saturate(1.15);
  background: linear-gradient(180deg, rgba(255, 255, 255, .08) 0%, rgba(40, 80, 150, .2) 40%, rgba(8, 20, 40, .88) 100%);
}
/* لبه‌ی درخشان شیشه */
.cert-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .42); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 0 40px rgba(255, 255, 255, .06);
}
.cert-shine {
  position: absolute; top: 0; bottom: 0; inset-inline-start: -70%; width: 40%; z-index: 1; pointer-events: none;
  background: linear-gradient(75deg, transparent, rgba(255, 255, 255, .42), transparent); transform: skewX(-20deg); transition: inset-inline-start .9s var(--ease);
}
.cert-card:hover .cert-shine { inset-inline-start: 135%; }
.cert-body { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-height: 300px; padding: 26px 24px 24px; }
.cert-grade { font-size: 3.6rem; font-weight: 900; line-height: 1.1; color: #fff; text-shadow: 0 4px 18px rgba(0, 0, 0, .45); }
.cert-grade small { font-size: 1.05rem; font-weight: 800; opacity: .92; margin-inline-end: 10px; letter-spacing: .02em; vertical-align: .55em; }
.cert-icon { width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .4); margin-bottom: 6px; }
.cert-icon svg { width: 28px; height: 28px; }
.cert-title { font-size: 1.15rem; font-weight: 800; line-height: 1.6; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.cert-desc { font-size: .84rem; color: rgba(255, 255, 255, .86); text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.cert-hint {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 6px 14px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.cert-hint svg { width: 15px; height: 15px; }

/* --------------------------------------------- افتخارات / روزنامه رسمی */
.doc-block + .doc-block { margin-top: 56px; }
.doc-head { margin-bottom: 22px; }
.doc-head h3 { font-size: 1.3rem; margin-bottom: 4px; }
.doc-head p { color: var(--muted); font-size: .92rem; margin: 0; }
.showcase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 190px)); gap: 18px; justify-content: center; }
.showcase-thumb {
  position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; border: 0; padding: 0; background: var(--surface-2); box-shadow: var(--shadow-sm); cursor: zoom-in;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.showcase-thumb:hover { transform: translateY(-5px); box-shadow: var(--shadow-md), 0 0 0 1px rgba(201, 161, 74, .6); }
.showcase-thumb img { width: 100%; height: 100%; object-fit: contain; }

/* ------------------------------------------------------------------ تماس */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.contact-list { display: grid; gap: 18px; margin-top: 28px; }
.contact-row { display: flex; gap: 16px; align-items: flex-start; justify-content: flex-start; text-align: start; }
.contact-ic {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--c-primary); box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .contact-ic { color: var(--c-primary-light); }
.contact-ic svg { display: block; width: 22px; height: 22px; margin: auto; }
.contact-ic { padding: 0; line-height: 0; }
.contact-txt { min-width: 0; text-align: start; }
.contact-txt b { display: block; color: var(--ink); font-size: .95rem; }
.contact-txt span, .contact-txt a { display: block; color: var(--muted); font-size: .96rem; text-align: start; }
.contact-txt a:hover { color: var(--c-primary); }
.map-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .86rem; font-weight: 700; color: var(--c-primary) !important; }
.map-link svg { width: 16px; height: 16px; }
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-md); display: grid; gap: 14px; }
.contact-form h3 { font-size: 1.15rem; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 13px 15px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-family: inherit; font-size: .95rem;
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form input, .contact-form textarea { direction: inherit; text-align: start; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--c-primary-light); border-color: transparent; }
.contact-form .btn { width: 100%; }
.hp-field { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.form-alert { padding: 13px 16px; border-radius: 12px; margin-bottom: 16px; font-size: .92rem; font-weight: 600; }
.form-alert-success { background: #e8f6ee; color: #14663f; border: 1px solid #b6e2c9; }
.form-alert-error { background: #fdecea; color: #a02418; border: 1px solid #f3c1bb; }
:root[data-theme="dark"] .form-alert-success { background: #0f2e1e; color: #8fe0b1; border-color: #1c5a3a; }
:root[data-theme="dark"] .form-alert-error { background: #3a1613; color: #ffb4ac; border-color: #6b2b25; }

/* ------------------------------------------------------------------ فوتر */
.footer { background: var(--c-dark); color: #b7c6e2; padding: 56px 0 26px; font-size: .92rem; }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 34px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.footer-brand { max-width: 380px; }
.footer-brand img { height: 92px; width: auto; margin-bottom: 16px; }
.footer-brand p { color: #9fb1d3; font-size: .88rem; margin: 0 0 6px; }
.footer-brand .legal { color: var(--c-accent); font-weight: 700; font-size: .92rem; line-height: 1.9; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col b { color: #fff; margin-bottom: 4px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; color: #8ea3c9; font-size: .85rem; }
.footer-bottom a { opacity: .55; }
.footer-bottom a:hover { opacity: 1; }
.footer-note { font-size: .76rem; color: rgba(255, 255, 255, .38); margin: 14px 0 0; }

/* -------------------------------------------------- مودال پروژه و لایت‌باکس */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(5, 12, 24, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  position: relative; width: min(760px, 100%); max-height: 90vh; overflow-y: auto; padding: 34px 32px 30px; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); transform: translateY(18px); transition: transform .3s var(--ease);
}
.modal-overlay.open .modal-box { transform: none; }
.modal-close, .lightbox-close, .lightbox-nav {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; transition: background .2s;
}
.modal-close { position: absolute; top: 14px; inset-inline-end: 14px; }
.modal-close:hover { background: var(--line); }
.modal-close svg, .lightbox-close svg, .lightbox-nav svg { width: 20px; height: 20px; }
.modal-box h3 { font-size: 1.35rem; margin: 0 0 6px; padding-inline-end: 44px; }
.modal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 20px 0; }
.modal-grid > div { padding: 12px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.modal-grid span { display: block; color: var(--muted); font-size: .76rem; font-weight: 700; }
.modal-grid b { color: var(--ink); font-size: .94rem; }
.modal-desc { color: var(--muted); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 20px; }
.doc-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 0; padding: 0; cursor: zoom-in; background: var(--surface-2); }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.doc-thumb:hover img { transform: scale(1.08); }

.lightbox-overlay {
  position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(3, 8, 17, .9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .25s;
}
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.lightbox-inner { position: relative; width: min(1000px, 100%); text-align: center; }
.lightbox-inner img { max-width: 100%; max-height: 82vh; margin-inline: auto; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); background: #fff; user-select: none; -webkit-user-drag: none; }
.lightbox-caption { margin-top: 14px; color: #dbe6fb; font-size: .95rem; font-weight: 600; }
.lightbox-counter { direction: ltr; position: absolute; top: -40px; inset-inline-start: 0; color: #b8c8e6; font-size: .84rem; }
.lightbox-close { position: absolute; top: -48px; inset-inline-end: 0; background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .28); width: 46px; height: 46px; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .28); }
.lightbox-prev { inset-inline-start: -8px; }
.lightbox-next { inset-inline-end: -8px; }

/* ------------------------------------------------------- افکت ورود / جزئیات */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--stagger, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }
.glow-card { position: relative; }
.protected-media { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.error-page img { height: 90px; margin: 0 auto 24px; }
.error-page h1 { font-size: 4rem; color: var(--c-primary); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-skyline .draw { stroke-dashoffset: 0; }
}

/* ------------------------------------------------------------- واکنش‌گرا */
@media (max-width: 1040px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { gap: 40px; }
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: var(--nav-h); inset-inline: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 16px 18px;
    background: var(--c-dark); border-top: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 18px 30px rgba(0, 0, 0, .35);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-links a.nav-cta { margin: 6px 0 0; text-align: center; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; width: min(640px, 100% - 40px); }
  .hero-brand { order: -1; }
  .hero-visual { min-height: 0; padding-top: 6px; }
  .hero { min-height: auto; align-items: flex-start; }
}
@media (max-width: 640px) {
  :root { --nav-h: 72px; }
  .brand img { height: 58px; }
  .section { padding: 64px 0; }
  .hero { padding-bottom: 76px; }
  .hero-logo-wrap { width: min(86vw, 340px); }
  .hero-text { padding: 20px 18px; }
  .frame-caption { font-size: .74rem; bottom: 12px; }
  .footer-brand img { height: 72px; }
  .cards-grid, .project-grid, .cert-grid { grid-template-columns: 1fr; }
  .cert-card, .cert-body { min-height: 260px; }
  .modal-box { padding: 26px 20px 22px; }
  .modal-grid { grid-template-columns: 1fr; }
  .contact-form { padding: 22px; }
  .footer-top { flex-direction: column; }
  .util-btn .lang-full { display: none; }
  .scroll-cue { display: none; }
}
@media (min-width: 641px) { .util-btn .lang-short { display: none; } }

/* نوار کارت مدیرعامل: «مدیرعامل + نام» کنار هم، لینک «رزومه» در جای قبلی سمت */
.ceo-tag { flex-wrap: wrap; row-gap: 8px; }
.ceo-id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ceo-resume { font-size: .86rem; color: var(--c-accent); font-weight: 700; text-decoration: none; padding-bottom: 1px; border-bottom: 1px dotted rgba(201, 161, 74, .7); transition: color .2s var(--ease), border-color .2s var(--ease); }
.ceo-resume:hover, .ceo-resume:focus-visible { color: #fff; border-bottom-color: #fff; outline: none; }

/* لایت‌باکس: جهت فلش‌ها (راست‌به‌چپ و چپ‌به‌راست) */
.lightbox-prev svg { transform: scaleX(-1); }
.lightbox-next svg { transform: none; }
[dir="rtl"] .lightbox-prev svg { transform: none; }
[dir="rtl"] .lightbox-next svg { transform: scaleX(-1); }

/* متن باکس هدر: یک‌دست و بولد */
.hero-text p, .hero-text p:first-child { color: var(--ink); font-weight: 700; }

/* متن معرفی شرکت در تم تیره: کمی روشن‌تر، دو خط تیتر سفیدتر */
:root[data-theme="dark"] .about-text p { color: #c9d5ec; }
:root[data-theme="dark"] .about-text p:first-of-type { color: #ffffff; font-weight: 700; }

/* قاب عکس هدر: کمی کوچک‌تر */
.hero-frame { width: min(700px, 95%); }
