/* ============================================================
   Base — Reset, typography, layout primitives
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss02", "kern";
  overflow-x: hidden;
}

img, svg, picture, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--c-blue-500);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--c-navy-700); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.25;
  color: var(--c-navy-900);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.2; }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }

p { text-wrap: pretty; }

/* Containers */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
}
.container.narrow { max-width: var(--container-narrow); }

/* Section */
.section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}
.section.tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

/* Subtle background */
.bg-surface { background: var(--c-surface); }
.bg-navy {
  background: linear-gradient(135deg, var(--c-navy-900) 0%, var(--c-navy-700) 100%);
  color: white;
}
.bg-navy h1, .bg-navy h2, .bg-navy h3 { color: white; }

/* Utility */
.text-muted { color: var(--c-text-muted); }
.text-center { text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--c-blue-500);
  background: var(--c-blue-50);
  padding: 7px 16px;
  border-radius: var(--r-full);
  margin-bottom: var(--space-4);
}
.eyebrow.on-dark {
  background: rgba(255,255,255,0.1);
  color: var(--c-orange-400);
}

.lead {
  font-size: var(--fs-md);
  color: var(--c-text-muted);
  line-height: 1.8;
  max-width: 60ch;
}
.lead.center { margin-inline: auto; }

/* Section header */
.section-head {
  max-width: 60ch;
  margin-bottom: var(--space-8);
}
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 {
  margin-bottom: var(--space-4);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  letter-spacing: -0.02em;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  right: 0;
  background: var(--c-navy-800);
  color: white;
  padding: 8px 16px;
  z-index: 1000;
}
.skip-link:focus { top: 0; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--c-blue-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Selection */
::selection { background: var(--c-navy-800); color: white; }

/* Numbers in latin always */
.ltr { direction: ltr; unicode-bidi: embed; }

/* Persian digits force on Vazirmatn happens by default; otherwise: */
.fa-digits { font-feature-settings: "ss01" 1; }

/* ============================================================
   Custom Scrollbar
   ============================================================ */
/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--c-navy-800) var(--c-surface-2);
}
/* WebKit */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--c-surface-2);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--c-navy-800), var(--c-blue-500));
  border-radius: 999px;
  border: 3px solid var(--c-surface-2);
  transition: background var(--t-fast) var(--ease);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--c-navy-700), var(--c-orange-500));
}
::-webkit-scrollbar-corner { background: var(--c-surface-2); }

/* ============================================================
   Custom Cursor
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, label[for], input[type="submit"], input[type="checkbox"], input[type="radio"],
  select, .faq-item summary, .tab-btn, .nav-toggle, [role="button"], [data-tab-btn],
  [data-faq-cat], .leaflet-control a, .area-card, .card { cursor: none; }

  /* Hide custom cursor over text inputs (use native I-beam) */
  input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
  input[type="url"], input[type="search"], input[type="password"], textarea {
    cursor: text;
  }
  input[type="text"] ~ .cursor-dot, textarea ~ .cursor-dot { display: none; }
}

.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--c-orange-500);
  border-radius: 50%;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 200ms ease;
}
.cursor-ring {
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(0, 59, 122, 0.45);
  border-radius: 50%;
  transform: translate3d(-50%, -50%, 0) scale(1);
  background: transparent;
  transition: opacity 200ms ease,
              border-color 280ms ease,
              background-color 280ms ease;
}
.cursor-ring.is-hover {
  border-color: var(--c-navy-800);
  background: rgba(0, 59, 122, 0.08);
}
.cursor-ring.is-hover-accent {
  border-color: var(--c-orange-500);
  background: rgba(245, 134, 52, 0.12);
}
.cursor-ring.is-hidden,
.cursor-dot.is-hidden { opacity: 0; }
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none !important; }
  body { cursor: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor-ring, .cursor-dot { display: none !important; }
  body { cursor: auto; }
}

/* ============================================================
   Mobile floating bottom dock — Apple-style liquid glass
   ============================================================ */
.mob-tabbar {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  z-index: 90;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.35) 100%);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(0, 59, 122, 0.06) inset,
    0 18px 40px -8px rgba(0, 59, 122, 0.28),
    0 8px 16px -2px rgba(0, 0, 0, 0.08);
  transition: transform 600ms cubic-bezier(.2, .9, .2, 1.1), opacity 360ms ease;
  opacity: 0;
  width: calc(100vw - 24px);
  max-width: 420px;
}
.mob-tabbar.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
/* Soft top glass highlight */
.mob-tabbar::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 45%;
  border-radius: 999px 999px 60% 60%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 90%);
  pointer-events: none;
}

/* Indicator pill (liquid blob) behind active tab */
.mob-tabbar .tab-indicator {
  position: absolute;
  top: 7px;
  bottom: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--c-navy-800), var(--c-blue-500));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 6px 14px -3px rgba(0, 59, 122, 0.45);
  transition: left 480ms cubic-bezier(.2, .8, .2, 1.1),
              width 480ms cubic-bezier(.2, .8, .2, 1.1);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}
.mob-tabbar .tab-indicator.is-ready { opacity: 1; }

.mob-tabbar a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 4px;
  color: var(--c-navy-800);
  border-radius: 999px;
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
  transition: color 260ms ease, transform 220ms ease;
  -webkit-tap-highlight-color: transparent;
}
.mob-tabbar a:active { transform: scale(0.92); }
.mob-tabbar a svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  transition: transform 320ms cubic-bezier(.2, .9, .2, 1.15);
}
.mob-tabbar a.is-active { color: white; }
.mob-tabbar a.is-active svg { transform: translateY(-1px) scale(1.08); }
.mob-tabbar a .lbl {
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0.95;
}

/* Show only on mobile / narrow screens */
@media (max-width: 900px) {
  .mob-tabbar { display: flex; }
  main { padding-bottom: 110px; }
  .site-footer { padding-bottom: calc(var(--space-6) + 110px); }
}
