/* Build 004 — unified global header controls + mobile spacing + first-visit tour */

/* Kill the legacy floating docks everywhere: one global control cluster only. */
.quick-actions,
.roadmap-quick {
  display: none !important;
}

/* Keep the previously requested safe mobile distance from the top edge. */
@media (max-width: 720px) {
  .site-header {
    margin-top: max(12px, env(safe-area-inset-top, 0px)) !important;
  }
}

/* One unified utility cluster in the header on every page. */
.site-nav-actions {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
}

.site-utility-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  direction: ltr;
  flex: 0 0 auto;
}

.site-nav-actions .site-utility-group .site-util-btn {
  box-sizing: border-box;
  width: 40px !important;
  min-width: 40px;
  height: 40px !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center;
  border: 1px solid var(--button-border) !important;
  border-radius: 50% !important;
  color: var(--text-soft) !important;
  background: var(--field-bg) !important;
  box-shadow: 0 7px 20px rgb(0 0 0 / 5%);
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
  transition: transform .18s ease, color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.site-nav-actions .site-utility-group .site-util-btn:hover {
  color: #252525 !important;
  border-color: var(--yellow) !important;
  background: var(--yellow) !important;
  box-shadow: 0 9px 24px color-mix(in srgb, var(--yellow) 18%, transparent);
  transform: translateY(-2px);
}

.site-nav-actions .site-utility-group .site-util-btn:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

.site-nav-actions .site-utility-group .site-util-language {
  font-family: Arial, sans-serif !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  letter-spacing: .035em;
}

.site-nav-actions .site-utility-group .site-util-theme {
  font-size: 16px !important;
}

.site-nav-actions .site-utility-group .site-util-theme svg,
.site-nav-actions .site-utility-group .site-util-resume svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Keep CTA visually related but clearly primary, not a duplicated utility control. */
.site-nav-actions .nav-cta {
  min-height: 40px;
  border-radius: 999px;
}

@media (max-width: 720px) {
  .site-header {
    gap: 10px !important;
  }
  .site-nav-actions {
    gap: 7px !important;
  }
  .site-utility-group {
    gap: 5px;
  }
  .site-nav-actions .site-utility-group .site-util-btn {
    width: 36px !important;
    min-width: 36px;
    height: 36px !important;
  }
  .site-nav-actions .site-utility-group .site-util-theme svg,
  .site-nav-actions .site-utility-group .site-util-resume svg {
    width: 17px;
    height: 17px;
  }
  .site-brand {
    gap: 8px !important;
  }
  .site-brand strong {
    font-size: 12px !important;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .site-brand div {
    display: none !important;
  }
}

/* First-visit guide */
.site-tour-card {
  position: fixed;
  z-index: 2147483001;
  width: min(330px, calc(100vw - 24px));
  padding: 16px 16px 14px;
  border: 1px solid var(--line, #e7e7e7);
  border-radius: 20px;
  color: var(--text-body, #777);
  background: color-mix(in srgb, var(--field-bg, #fff) 94%, transparent);
  box-shadow: 0 20px 60px rgb(0 0 0 / 18%);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(8px) scale(.98);
  transition: opacity .24s ease, transform .24s ease, top .22s ease, left .22s ease;
  direction: ltr;
  text-align: left;
}

.site-tour-card[dir="rtl"] {
  direction: rtl;
  text-align: right;
  font-family: IRANYekan, system-ui, sans-serif;
}

.site-tour-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.site-tour-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.site-tour-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #262626;
  background: var(--yellow, #f8bb10);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}

.site-tour-title {
  margin: 0;
  color: var(--ink-strong, #4f4f4f);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.site-tour-step {
  margin-inline-start: auto;
  color: var(--text-faint, #999);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.site-tour-copy {
  margin: 0;
  color: var(--text-body, #777);
  font-size: 12px;
  line-height: 1.75;
}

.site-tour-actions {
  margin-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.site-tour-skip,
.site-tour-next {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.site-tour-skip {
  border: 0;
  color: var(--text-faint, #999);
  background: transparent;
}

.site-tour-next {
  border: 1px solid var(--yellow, #f8bb10);
  color: #262626;
  background: var(--yellow, #f8bb10);
}

.site-tour-next:hover,
.site-tour-skip:hover {
  filter: brightness(.98);
}

.site-tour-ring {
  position: fixed;
  z-index: 2147483000;
  pointer-events: none;
  border: 2px solid var(--yellow, #f8bb10);
  border-radius: 999px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--yellow, #f8bb10) 18%, transparent),
              0 8px 28px color-mix(in srgb, var(--yellow, #f8bb10) 28%, transparent);
  opacity: 0;
  transform: scale(.86);
  transition: left .22s ease, top .22s ease, width .22s ease, height .22s ease, opacity .2s ease, transform .2s ease;
}

.site-tour-ring.is-visible {
  opacity: 1;
  transform: scale(1);
  animation: siteTourPulse 1.45s ease-in-out infinite;
}

.site-tour-ring::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--yellow, #f8bb10);
  border-bottom: 2px solid var(--yellow, #f8bb10);
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%) rotate(45deg);
  animation: siteTourPoint .8s ease-in-out infinite alternate;
}

@keyframes siteTourPulse {
  0%, 100% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--yellow, #f8bb10) 16%, transparent), 0 8px 28px color-mix(in srgb, var(--yellow, #f8bb10) 20%, transparent); }
  50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--yellow, #f8bb10) 7%, transparent), 0 10px 34px color-mix(in srgb, var(--yellow, #f8bb10) 32%, transparent); }
}

@keyframes siteTourPoint {
  from { transform: translate(-50%, 0) rotate(45deg); }
  to { transform: translate(-50%, 4px) rotate(45deg); }
}

@media (max-width: 720px) {
  .site-tour-card {
    width: calc(100vw - 24px);
    padding: 14px;
    border-radius: 18px;
  }
  .site-tour-copy { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-tour-card,
  .site-tour-ring,
  .site-nav-actions .site-utility-group .site-util-btn {
    transition: none !important;
  }
  .site-tour-ring,
  .site-tour-ring::after {
    animation: none !important;
  }
}
