.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* ارتفاع هدر ۵۵px (۲۰٪ کمتر از ۶۹ قبلی): دکمه‌ها ۴۴px می‌مانند (حداقل
     ناحیه‌ی لمسی)، فقط فاصله‌ی بالا/پایین کم شده. */
  padding: 5px 20px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(74, 31, 150, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* موبایل: آیکون پروفایل هم‌فاصله با دکمه‌ی لایه‌های نقشه (#map-layer-toggle:
   ۴px فاصله‌ی نقشه از لبه + ۱۰px = ۱۴px از لبه‌ی راست) */
@media (max-width: 700px) {
  .header {
    padding-right: 14px;
  }
}

/* ===== منوی همبرگری ===== */
/* دکمه: سه خط با گرادیان لوگو که در حالت باز به X تبدیل می‌شوند */
.menu-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--brand-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover {
  background: #fff;
  box-shadow: 0 4px 14px rgba(153, 101, 253, 0.3);
}

.menu-toggle:active {
  transform: scale(0.94);
}

.menu-toggle:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.menu-toggle-bars {
  position: relative;
  width: 20px;
  height: 14px;
}

.menu-toggle-bars span {
  position: absolute;
  right: 0;
  height: 2.5px;
  border-radius: 3px;
  background: var(--grad);
  transition: transform 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6), width 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}

.menu-toggle-bars span:nth-child(1) { top: 0; width: 100%; }
.menu-toggle-bars span:nth-child(2) { top: 5.75px; width: 70%; }
.menu-toggle-bars span:nth-child(3) { top: 11.5px; width: 45%; }

.menu-toggle:hover .menu-toggle-bars span { width: 100%; }

.menu-toggle.is-open .menu-toggle-bars span:nth-child(1) { top: 5.75px; width: 100%; transform: rotate(45deg); }
.menu-toggle.is-open .menu-toggle-bars span:nth-child(2) { opacity: 0; transform: translateX(-8px); }
.menu-toggle.is-open .menu-toggle-bars span:nth-child(3) { top: 5.75px; width: 100%; transform: rotate(-45deg); }

/* کشو */
.menu-drawer {
  position: fixed;
  inset: 0;
  z-index: 180;
}

.menu-drawer[hidden] {
  display: none;
}

.menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 8, 45, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.menu-drawer.is-open .menu-backdrop {
  opacity: 1;
}

/* آشکارشدن دایره‌ای از گوشه‌ی بالا-راست (محل دکمه در RTL). خروج
   سریع‌تر از ورود (exit-faster-than-enter). */
/* پنل شناور در همه‌ی اندازه‌ها: عرض درصدی از صفحه، ارتفاع به‌اندازه‌ی
   محتوا با سقف نصف صفحه. */
.menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: max(24vw, 320px);
  /* ارتفاع = محتوا (~۵۰٪ صفحه با ۶ آیتم)؛ سقف ۶۰٪ فقط برای صفحه‌های کوتاه */
  max-height: 60vh;
  max-height: 60dvh;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  /* یکسان در موبایل/تبلت/دسکتاپ (پایین-راست ۱۰، پایین-چپ ۲۲) */
  border-radius: 0 0 10px 22px;
  /* hidden نه auto: گوی‌های absolute بیرون‌زده نباید اسکرول‌بار بسازند؛
     اسکرول فقط روی .menu-items است. */
  overflow: hidden;
  color: #fff;
  /* شیشه‌ای: گرادیان بنفش برند با ۵۰٪ شفافیت + بلور پشت پنل */
  background:
    radial-gradient(120% 50% at 100% 0%, rgba(153, 101, 253, 0.3), transparent 60%),
    linear-gradient(165deg, rgba(58, 23, 128, 0.5) 0%, rgba(36, 16, 79, 0.5) 55%, rgba(18, 7, 39, 0.5) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: -12px 12px 40px rgba(20, 8, 45, 0.35);
  clip-path: circle(0 at calc(100% - 42px) 27px);
  transition: clip-path 0.34s cubic-bezier(0.4, 0, 1, 1);
}

.menu-drawer.is-open .menu-panel {
  clip-path: circle(160% at calc(100% - 42px) 27px);
  transition: clip-path 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-orb {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  pointer-events: none;
  animation: menu-float 9s ease-in-out infinite alternate;
}

.menu-orb--cyan {
  width: 220px;
  height: 220px;
  top: -60px;
  left: -80px;
  background: var(--cyan);
}

.menu-orb--magenta {
  width: 240px;
  height: 240px;
  bottom: -90px;
  right: -90px;
  background: var(--magenta);
  opacity: 0.35;
  animation-delay: -4s;
}

.menu-head,
.menu-items,
.menu-foot {
  position: relative;
  z-index: 1;
}

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-brand strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
}

.menu-brand small {
  display: block;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.72);
}

.menu-logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--cyan), var(--violet), var(--magenta), var(--cyan));
  box-shadow: 0 0 18px rgba(153, 101, 253, 0.6);
}

.menu-logo img {
  width: 100%;
  height: 100%;
  padding: 3px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}

.menu-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.25s ease;
}

.menu-close:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(90deg);
}

.menu-items {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* آیتم‌ها هنگام ورود ۲۸px جابه‌جا می‌شوند؛ بدون این، اسکرول‌بار لحظه‌ای ظاهر می‌شد */
  overflow-x: hidden;
  list-style: none;
  margin: 0;
  padding: 8px 10px;
}

/* ورود پلکانی آیتم‌ها — ۵۰ms فاصله (stagger-sequence) */
.menu-items li {
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-drawer.is-open .menu-items li {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(0.12s + var(--i) * 0.05s);
}

.menu-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  margin-bottom: 2px;
  padding: 6px 10px;
  overflow: hidden;
  border-radius: 16px;
  color: #fff;
  isolation: isolate;
  transition: background 0.25s ease;
}

/* نوار نور گرادیان لوگو که روی هاور از راست به چپ پر می‌شود */
.menu-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(270deg, rgba(47, 208, 255, 0.22), rgba(153, 101, 253, 0.2) 50%, rgba(255, 1, 255, 0.12));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-link:hover::before,
.menu-link:focus-visible::before,
.menu-link[aria-current="page"]::before {
  transform: scaleX(1);
}

.menu-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.menu-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  right: 0;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--magenta));
}

.menu-link-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #a8f0ff;
  font-size: 15px;
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.menu-link:hover .menu-link-icon,
.menu-link[aria-current="page"] .menu-link-icon {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(153, 101, 253, 0.55);
  transform: rotate(-8deg) scale(1.06);
}

.menu-link-text {
  flex: 1;
  min-width: 0;
}

.menu-link-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.menu-link-text small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.68);
}

.menu-link-arrow {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  transition: transform 0.3s ease, color 0.3s ease;
}

.menu-link:hover .menu-link-arrow {
  color: #fff;
  transform: translateX(-4px);
}

.menu-foot {
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-note {
  margin: 0;
  font-size: 11px;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
}

.menu-link-text strong,
.menu-link-text small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* دسکتاپ: بدون سقف ۶۰٪ — همه‌ی آیتم‌ها یکجا و بدون اسکرول‌بار دیده شوند.
   (فقط در صفحه‌ی خیلی کوتاه، لیست بی‌اسکرول‌بار با چرخ موس جابه‌جا می‌شود.) */
@media (min-width: 1025px) {
  .menu-panel {
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .menu-items {
    scrollbar-width: none;
  }

  .menu-items::-webkit-scrollbar {
    display: none;
  }
}

/* موبایل و تبلت: پنل شناور نصف عرض × نصف ارتفاع صفحه در گوشه‌ی بالا-راست
   (همان‌جا که دکمه است)، با گوشه‌ی گرد و اسکرول داخلی در صورت نیاز. */
/* موبایل و تبلت: نصف عرض صفحه */
@media (max-width: 1024px) {
  .menu-panel {
    width: max(50vw, 200px);
  }

  .menu-orb--cyan { width: 140px; height: 140px; }
  .menu-orb--magenta { width: 150px; height: 150px; bottom: -70px; right: -60px; }
}

/* موبایل: فونت‌ها و فاصله‌ها ریزتر تا در نصف عرض جا شوند */
@media (max-width: 700px) {
  .menu-head {
    padding: 10px 12px;
    gap: 8px;
  }

  .menu-brand {
    gap: 8px;
    min-width: 0;
  }

  .menu-brand > span:last-child {
    min-width: 0;
  }

  .menu-brand strong {
    font-size: 13.5px;
  }

  .menu-brand small {
    font-size: 9.5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .menu-logo {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
  }

  .menu-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 13px;
  }

  .menu-items {
    padding: 8px 6px;
  }

  .menu-link {
    gap: 8px;
    min-height: 44px;
    margin-bottom: 2px;
    padding: 5px 8px;
    border-radius: 12px;
  }

  .menu-link-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 12px;
  }

  .menu-link-text strong {
    font-size: 12.5px;
  }

  .menu-link-text small {
    margin-top: 0;
    font-size: 9.5px;
  }

  .menu-link-arrow {
    font-size: 9px;
  }

  .menu-foot {
    padding: 8px 12px 10px;
  }

  .menu-note {
    font-size: 9px;
  }
}

@keyframes menu-float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, 40px) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .menu-panel,
  .menu-drawer.is-open .menu-panel { transition: none; clip-path: none; }
  .menu-items li,
  .menu-drawer.is-open .menu-items li { transition: none; transform: none; }
  .menu-orb { animation: none; }
  .menu-toggle-bars span { transition: none; }
}

/* «کجا؟» وسط هدر (js/header-where.js): کپسول SVG با حاشیه‌ی گرادیان چرخان
   (برند + کهربایی مکمل)، سنجاق کهربایی→مرجانی که می‌پرد، برق گذرا. متن داخل
   SVG ساخته می‌شود و انتخاب/کپی بسته است. عرض کپسول با طول متن عوض می‌شود. */
.header-where {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  max-width: min(58vw, 460px);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.hw-svg {
  display: block;
  max-width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 4px 12px rgba(109, 58, 224, 0.18));
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.hw-text {
  font-family: Vazirmatn, sans-serif;
  font-size: 15px;
}

.hw-lead { font-weight: 800; }

.hw-rest {
  font-weight: 600;
  fill: #0e7490;
}

.header-where.is-live .hw-rest { fill: #b4530a; }

.hw-caret { animation: hw-blink 1s steps(1) infinite; }

.hw-pin-body { animation: hw-hop 2.8s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; }
.hw-pin-shadow { transform: translateY(11px); animation: hw-shadow 2.8s ease infinite; }

.hw-shine {
  animation: hw-shine 5.5s ease-in-out infinite;
  animation-delay: 1.2s;
}

.header-where.is-pop .hw-svg { animation: hw-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes hw-blink { 50% { opacity: 0; } }
@keyframes hw-hop {
  0%, 62%, 100% { transform: translateY(0); }
  70% { transform: translateY(-5px); }
  80% { transform: translateY(0); }
  86% { transform: translateY(-1.5px); }
}
@keyframes hw-shadow {
  0%, 62%, 100% { transform: translateY(11px) scale(1); opacity: 1; }
  70% { transform: translateY(11px) scale(0.6); opacity: 0.5; }
}
@keyframes hw-shine {
  0% { transform: translateX(-80px) skewX(-20deg); }
  35%, 100% { transform: translateX(var(--hw-w, 400px)) skewX(-20deg); }
}
@keyframes hw-pop {
  0% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

@media (max-width: 480px) {
  .header-where { max-width: 62vw; }
  .hw-svg { height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .hw-caret, .hw-pin-body, .hw-pin-shadow, .hw-shine,
  .header-where.is-pop .hw-svg { animation: none; }
}

/* آیکون پروفایل: حلقه‌ی گرادیان مخروطی (بنفش برند → طلایی پلن‌ها) دور
   یک هسته‌ی شیشه‌ای؛ روی هاور حلقه می‌چرخد و آواتار کمی بالا می‌آید.
   ابعاد بیرونی ۴۴px برای حداقل ناحیه‌ی لمسی. */
.auth-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.auth-btn-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--cyan), var(--violet), var(--magenta), var(--cyan));
  box-shadow: 0 4px 14px rgba(153, 101, 253, 0.4);
  transition: box-shadow 0.25s ease;
  z-index: -1;
}

.auth-btn-core {
  display: grid;
  place-items: center;
  /* ۳۲ = ۴۴ − ۲×۶ ← حلقه‌ی رنگی ۶px (دو برابر ۳px قبلی، رو به داخل) */
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #ffffff 0%, #f1ecfe 70%);
  overflow: hidden;
}

/* موبایل و تبلت: حلقه ۱۰٪ باریک‌تر (۶ → ۵٫۴px)؛ ۴۴ − ۲×۵٫۴ = ۳۳٫۲ */
@media (max-width: 1024px) {
  .auth-btn-core {
    width: 33.2px;
    height: 33.2px;
  }
}

.auth-btn-core svg {
  transform: translateY(2px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-btn-dot {
  position: absolute;
  bottom: 1px;
  left: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2fd0ff;
  border: 2px solid #fff;
}

/* نقطه‌ی سبز = کاربر وارد حساب شده است */
.auth-btn.is-signed-in .auth-btn-dot {
  background: #10b981;
}

.auth-btn:hover .auth-btn-ring {
  animation: auth-ring-spin 2.4s linear infinite;
  box-shadow: 0 6px 20px rgba(109, 58, 224, 0.5);
}

.auth-btn:hover .auth-btn-core svg {
  transform: translateY(0) scale(1.08);
}

.auth-btn:active .auth-btn-core {
  transform: scale(0.94);
}

.auth-btn:focus-visible {
  outline: 3px solid #2fd0ff;
  outline-offset: 3px;
}

@keyframes auth-ring-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-btn:hover .auth-btn-ring { animation: none; }
  .auth-btn-core svg { transition: none; }
}


.hero {
  padding: 60px 20px;
  text-align: center;
}

/* فوتر صفحه‌ی اصلی (اطلاعات تماس و نشان اینماد). در موبایل/تبلت با نوار
   پایین پنهان می‌شود (tabbar.css) و همین اطلاعات در pages/about.html است. */
#footer {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  color: var(--muted);
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
}

.footer-col {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-about {
  display: flex;
  gap: 10px;
  align-items: center;
}

.footer-about p {
  margin: 0;
  line-height: 1.7;
}

.footer-about strong {
  color: var(--brand-ink);
}

.footer-logo {
  flex: none;
}

/* تماس در دو خط: تلفن‌ها و ایمیل کنار هم، نشانی در خط دوم */
.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  max-width: 560px;
}

.footer-contact li {
  line-height: 1.7;
  white-space: nowrap;
}

.footer-contact li:last-child {
  flex-basis: 100%;
  white-space: normal;
}

.footer-contact i {
  width: 16px;
  margin-inline-end: 5px;
  color: var(--brand);
}

#footer a {
  color: var(--brand);
}

#footer a:hover {
  text-decoration: underline;
}

/* جای نشان اینماد: سمت چپ فوتر، هم‌قد دو خط متن کناری تا فوتر بلند نشود.
   تا کد اینماد نیامده، جایش خالی نگه داشته می‌شود (اطلاعات تماس وسط می‌ماند). */
#enamad-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
}

#enamad-badge img {
  display: block;
  width: auto;
  max-width: 64px;
  max-height: 64px;
}

#enamad-badge a:hover {
  text-decoration: none;
}

.footer-bottom {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 0 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li + li::before {
  content: "·";
  margin: 0 8px;
  color: var(--muted);
}

.footer-copy {
  margin: 0;
}
