/* ============================================================
   Sabz Daneh Parsina — custom styles (loaded after Tailwind CDN)
   Light theme · micro-interactions · a11y · responsive polish
   ============================================================ */

:root {
  --brand-blue: #0b2240;
  --brand-gold: #c5a86a;
  --brand-gold-light: #dfcaa0;
  --brand-emerald: #14532d;
  --brand-clay: #78350f;
  --nav-h: 5rem;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}
body { color: #1c1917; overflow-x: hidden; }

::selection { background-color: var(--brand-gold); color: var(--brand-blue); }

/* ---------- Accessibility: focus visible ---------- */
:focus { outline: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Skip-to-content link (visible only on keyboard focus) */
.skip-link {
  position: fixed;
  top: 0.75rem;
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(-200%);
  z-index: 100;
  background: var(--brand-blue);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--brand-gold);
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(11, 34, 64, 0.25);
  transition: transform 0.25s ease;
}
.skip-link:focus-visible { transform: translateX(-50%) translateY(0); }

/* ---------- Scroll progress bar ---------- */
#scroll-progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  height: 3px;
  width: 0%;
  z-index: 60;
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-gold-light), var(--brand-gold));
  box-shadow: 0 0 8px rgba(197, 168, 106, 0.6);
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ---------- Glassmorphism helpers ---------- */
.glassmorphism {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.glassmorphism-dark {
  background: rgba(11, 34, 64, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(197, 168, 106, 0.25);
}

/* Slightly stronger shadow + hairline when navbar is scrolled */
.nav-scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 24px -8px rgba(11, 34, 64, 0.18);
}

/* ---------- Scrollbar ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--brand-gold) #f1f0ec; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #f1f0ec; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--brand-gold), #b19357);
  border-radius: 6px;
  border: 2px solid #f1f0ec;
}
::-webkit-scrollbar-thumb:hover { background: #b19357; }

/* ---------- Language visibility, toggled by <html data-lang> ---------- */
html[data-lang="fa"] [data-en] { display: none !important; }
html[data-lang="en"] [data-fa] { display: none !important; }

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.reveal-left  { transform: translateX(-32px); }
.reveal.reveal-right { transform: translateX(32px); }
.reveal.reveal-zoom  { transform: scale(0.94); }
.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}
/* Stagger children via inline --i index set in JS */
.reveal[style*="--i"] { transition-delay: calc(var(--i) * 80ms); }

/* ============================================================
   Navbar active link indicator
   ============================================================ */
.nav-link { position: relative; }
.nav-link .nav-underline {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  height: 2px;
  background: var(--brand-gold);
  transform: scaleX(0);
  transform-origin: var(--logical-start, left);
  transition: transform 0.3s ease;
}
.nav-link:hover .nav-underline,
.nav-link.is-active .nav-underline { transform: scaleX(1); }
.nav-link.is-active { color: var(--brand-blue); }

/* ============================================================
   Mobile menu animation
   ============================================================ */
#mobile-menu-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}
#mobile-menu-panel.is-open {
  max-height: 80vh;
  opacity: 1;
}
#mobile-menu-trigger i { transition: transform 0.3s ease; }
#mobile-menu-trigger.is-open i { transform: rotate(90deg); }

/* Stagger mobile links when menu opens */
#mobile-menu-panel.is-open .mobile-link,
#mobile-menu-panel.is-open .pt-4 {
  animation: menuItemIn 0.4s both;
}
#mobile-menu-panel.is-open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu-panel.is-open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu-panel.is-open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
@keyframes menuItemIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Buttons / micro-interactions
   ============================================================ */
.btn-shine {
  position: relative;
  overflow: hidden;
}
.btn-shine::after {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: inset-inline-start 0.6s ease;
}
.btn-shine:hover::after { inset-inline-start: 130%; }

/* Submit button spinner */
.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Floating back-to-top button
   ============================================================ */
#back-to-top {
  position: fixed;
  bottom: 1.25rem;
  inset-inline-start: 1.25rem;
  z-index: 50;
  width: 2.85rem;
  height: 2.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--brand-blue);
  color: #fff;
  border: 1px solid rgba(197, 168, 106, 0.5);
  box-shadow: 0 10px 25px -8px rgba(11, 34, 64, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
#back-to-top:hover { background: var(--brand-gold); color: var(--brand-blue); }

/* ============================================================
   Hero decorative animated blobs
   ============================================================ */
@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(12px, -16px) scale(1.08); }
}
.blob-float { animation: floatBlob 9s ease-in-out infinite; }
.blob-float-slow { animation: floatBlob 13s ease-in-out infinite reverse; }

/* Subtle entrance for hero content */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.hero-in { animation: heroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Cinematic Ken-Burns zoom for hero banner background */
@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.14); }
}
.hero-kenburns { animation: kenburns 24s ease-in-out infinite alternate; }

/* ============================================================
   Business-card 3D flip (front / back)
   ============================================================ */
.flip-card { perspective: 1600px; }
.flip-card-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 1014 / 685;
  transition: transform 0.85s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner,
.flip-card:focus-within .flip-card-inner,
.flip-card.is-flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 18px 45px -18px rgba(11, 34, 64, 0.55);
}
.flip-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flip-back { transform: rotateY(180deg); }

/* ============================================================
   Trust bar (marquee of certifications)
   ============================================================ */
.trust-track {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: max-content;
  animation: trustScroll 32s linear infinite;
}
.trust-bar:hover .trust-track { animation-play-state: paused; }
@keyframes trustScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
/* RTL scrolls the other way for a natural feel */
html[dir="rtl"] .trust-track { animation-direction: reverse; }

/* ============================================================
   Process timeline (workflow tab rail)
   ============================================================ */
.timeline-list { position: relative; }
.timeline-list::before {
  content: "";
  position: absolute;
  inset-inline-start: 1.95rem;
  top: 1.6rem;
  bottom: 1.6rem;
  width: 2px;
  background: linear-gradient(var(--brand-gold), rgba(197, 168, 106, 0.12));
  z-index: 0;
}
.tl-node {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  background: #fff;
  color: var(--brand-blue);
  border: 2px solid var(--brand-gold);
  transition: all 0.3s ease;
}
.timeline-item.tl-active .tl-node {
  background: var(--brand-gold);
  color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(197, 168, 106, 0.25);
}

/* ============================================================
   Destinations map
   ============================================================ */
.map-dots {
  background-image: radial-gradient(rgba(197, 168, 106, 0.35) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
}
.map-pin {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: var(--brand-gold);
  box-shadow: 0 0 0 0 rgba(197, 168, 106, 0.6);
  animation: pinPulse 2.4s ease-out infinite;
}
.map-pin::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 9999px;
  border: 1px solid rgba(197, 168, 106, 0.5);
}
@keyframes pinPulse {
  0%   { box-shadow: 0 0 0 0 rgba(197, 168, 106, 0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(197, 168, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(197, 168, 106, 0); }
}

/* ============================================================
   Testimonials
   ============================================================ */
.quote-card { position: relative; }
.quote-card::before {
  content: "\201D";
  position: absolute;
  top: 0.25rem;
  inset-inline-end: 1.25rem;
  font-size: 4.5rem;
  line-height: 1;
  font-family: Georgia, serif;
  color: var(--brand-gold);
  opacity: 0.25;
  pointer-events: none;
}

/* Gradient text accent */
.text-gradient-gold {
  background: linear-gradient(120deg, #b8924f, var(--brand-gold), #e0c98f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Tab buttons keyboard/selected polish */
[role="tab"][aria-selected="true"] { font-weight: 800; }

/* ============================================================
   Responsive / mobile polish
   ============================================================ */
@media (max-width: 640px) {
  section { scroll-margin-top: var(--nav-h); }
  /* tighten very large decorative numbers on small screens */
  #workflow-panel .text-9xl { font-size: 5rem; }
}

/* Bigger tap targets on touch devices */
@media (hover: none) {
  .nav-link, .mobile-link, button, a { -webkit-tap-highlight-color: rgba(197,168,106,0.2); }
}

/* ============================================================
   Official registration card — press/tap feedback
   ============================================================ */
.reg-card { will-change: transform; }
/* tap/click press feedback (works on touch + mouse) */
.reg-card:active {
  transform: translateY(-2px) scale(0.985);
  box-shadow: 0 18px 40px -12px rgba(11, 34, 64, 0.45);
}
/* subtle sheen sweep on hover / focus / tap */
.reg-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(197,168,106,0.18) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
  pointer-events: none;
  z-index: 20;
}
.reg-card:hover::after,
.reg-card:focus::after,
.reg-card:active::after { transform: translateX(120%); }

/* ============================================================
   Respect reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
