/* ========================================================
   MAHAN FAN POUYA (SMFP) - PRODUCTION CSS STYLE SHEET
   Nederman Minimal Corporate Theme + UI UX Pro Max Motion Engine
   ======================================================== */

@import url('./fonts.css');

:root {
  --nederman-blue: #0072ce;
  --nederman-hover: #005fa3;
  --nederman-dark: #003a66;
  --nederman-light: #f0f7fd;
  --nederman-border: #e2e8f0;
  --nederman-text: #1e293b;
  --nederman-muted: #64748b;

  /* UI UX Pro Max Motion Tokens */
  --motion-fast: 180ms;
  --motion-base: 540ms;
  --motion-slow: 760ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --stagger-step: 75ms;
}

/* Ensure Persian Typography & sticky header offset is applied cleanly */
html, body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  background-color: #ffffff;
  color: var(--nederman-text);
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

html[dir="ltr"], html[dir="ltr"] body {
  font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Force Vazirmatn on Persian headings and card titles */
h1, h2, h3, h4, h5, h6, p, span, a, button, input, select, textarea {
  font-family: inherit;
}

/* Accessible WCAG 2.2 Focus Visible Indicator */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--nederman-blue);
  outline-offset: 2px;
}

/* Tactile Press & Tap Responsiveness (Mobile Web UX) */
a, button {
  touch-action: manipulation;
}

/* Single line link utility */
.nowrap-link {
  white-space: nowrap !important;
  word-break: keep-all !important;
  flex-shrink: 0;
}

/* Nederman Logo Typography */
.nederman-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--nederman-blue);
}

/* ========================================================
   LAZY IMAGE SHIMMER & SHARP COMPOSITOR REVEAL
   ======================================================== */
.card-img-fit {
  width: 100%;
  height: 190px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(110deg, #e2e8f0 8%, #f8fafc 18%, #e2e8f0 33%);
  background-size: 200% 100%;
}

.card-img-fit.smfp-img-loading {
  animation: smfpShimmer 1.4s ease-in-out infinite;
}

@keyframes smfpShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.card-img-fit img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.55s var(--ease-out-expo), opacity 0.45s ease-out, filter 0.45s ease-out;
}

img[loading="lazy"].smfp-lazy-pending {
  opacity: 0;
  transform: scale(1.03);
}

img[loading="lazy"].smfp-lazy-loaded {
  opacity: 1;
  transform: scale(1);
}

.card-img-fit:hover img {
  transform: scale(1.05);
}

/* Corporate Card Shadow + Hardware-Accelerated Elevation */
.corp-shadow {
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  transition: transform 280ms var(--ease-out-expo), box-shadow 280ms var(--ease-out-expo), border-color 220ms ease;
}

.corp-shadow:hover {
  box-shadow: 0 12px 28px -4px rgba(0, 114, 206, 0.12), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
}

.smfp-hover-lift:hover {
  transform: translateY(-4px);
}

.smfp-hover-lift:active {
  transform: translateY(-1px) scale(0.99);
}

/* Top Reading Scroll Progress Bar */
#smfp-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, var(--nederman-blue) 0%, #0ea5e9 65%, #10b981 100%);
  transform: scaleX(0);
  transform-origin: right center;
  z-index: 70;
  pointer-events: none;
  will-change: transform;
}

html[dir="ltr"] #smfp-scroll-progress {
  transform-origin: left center;
}

/* ========================================================
   UI UX PRO MAX - DIVERSE LAZY-LOAD REVEAL SYSTEM
   Only hides elements while JS IntersectionObserver is active;
   ensures zero FOUC/invisibility fallback for crawlers & no-JS.
   ======================================================== */
html.smfp-motion-ready [data-reveal] {
  opacity: 0;
  will-change: transform, opacity;
  transition-property: opacity, transform, filter, clip-path;
  transition-duration: var(--motion-base);
  transition-timing-function: var(--ease-out-expo);
  transition-delay: calc(var(--stagger-index, 0) * var(--stagger-step, 75ms));
}

/* Variant 1: Hero Crisp Rise */
html.smfp-motion-ready [data-reveal="hero-rise"] {
  transform: translate3d(0, 22px, 0);
  transition-duration: 620ms;
}

/* Variant 2: Standard Vertical Fade Up */
html.smfp-motion-ready [data-reveal="fade-up"] {
  transform: translate3d(0, 30px, 0);
}

/* Variant 3: Soft Editorial Rise */
html.smfp-motion-ready [data-reveal="fade-up-soft"] {
  transform: translate3d(0, 14px, 0);
  transition-duration: 420ms;
}

/* Variant 4: Subtle Descending Drop (Breadcrumbs / Bars) */
html.smfp-motion-ready [data-reveal="fade-down"] {
  transform: translate3d(0, -18px, 0);
  transition-duration: 440ms;
}

/* Variant 5: Directional Inline Start Slide (Adapts cleanly RTL <-> LTR) */
html.smfp-motion-ready [data-reveal="slide-start"] {
  transform: translate3d(36px, 0, 0);
  transition-duration: 600ms;
}
html[dir="ltr"].smfp-motion-ready [data-reveal="slide-start"] {
  transform: translate3d(-36px, 0, 0);
}

/* Variant 6: Directional Inline End Slide (Adapts cleanly RTL <-> LTR) */
html.smfp-motion-ready [data-reveal="slide-end"] {
  transform: translate3d(-36px, 0, 0);
  transition-duration: 600ms;
}
html[dir="ltr"].smfp-motion-ready [data-reveal="slide-end"] {
  transform: translate3d(36px, 0, 0);
}

/* Variant 7: Precision Scale Zoom-In */
html.smfp-motion-ready [data-reveal="zoom-in"] {
  transform: translate3d(0, 16px, 0) scale(0.92);
  transition-duration: 540ms;
  transition-timing-function: var(--ease-spring);
}

/* Variant 8: Atmospheric "Clean Air" Blur-to-Sharp Resolve */
html.smfp-motion-ready [data-reveal="blur-clean"] {
  transform: translate3d(0, 14px, 0) scale(0.985);
  filter: blur(7px);
  transition-duration: 650ms;
  transition-timing-function: var(--ease-out-quint);
}

/* Variant 9: Architectural Aperture / Curtain Unveil */
html.smfp-motion-ready [data-reveal="clip-curtain"] {
  transform: scale(1.04);
  clip-path: inset(12% 0 0 0);
  transition-duration: var(--motion-slow);
  transition-timing-function: var(--ease-out-expo);
}

html.smfp-motion-ready [data-reveal="clip-curtain"].is-revealed {
  clip-path: inset(0 0 0 0);
}

/* Variant 10: 3D Perspective Card Tilt-Up */
html.smfp-motion-ready [data-reveal="flip-perspective"] {
  transform: perspective(900px) rotateX(9deg) translate3d(0, 22px, 0) scale(0.97);
  transform-origin: center top;
  transition-duration: 580ms;
  transition-timing-function: var(--ease-out-expo);
}

/* Variant 11: Energetic Metric & Pill Spring Pop */
html.smfp-motion-ready [data-reveal="pop-badge"] {
  transform: translate3d(0, 12px, 0) scale(0.86);
  transition-duration: 460ms;
  transition-timing-function: var(--ease-spring);
}

/* Variant 12: Crisp Table Row Cascade (No Bounce/Overshoot for Info UI) */
html.smfp-motion-ready [data-reveal="row-cascade"] {
  transform: translate3d(14px, 0, 0);
  transition-duration: 360ms;
  transition-timing-function: ease-out;
}
html[dir="ltr"].smfp-motion-ready [data-reveal="row-cascade"] {
  transform: translate3d(-14px, 0, 0);
}

/* Variant 13: Accent Line Grow */
html.smfp-motion-ready [data-reveal="line-grow"] {
  transform: scaleX(0);
  transform-origin: right center;
  transition-duration: 640ms;
}
html[dir="ltr"].smfp-motion-ready [data-reveal="line-grow"] {
  transform-origin: left center;
}

/* Resolved Visible Final State for ALL Reveal Variants */
html.smfp-motion-ready [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  filter: blur(0);
  will-change: auto;
}

/* Modal & Filter Interaction Micro-Animations */
@keyframes smfpModalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
  }
}

.smfp-modal-animate {
  animation: smfpModalIn 240ms var(--ease-out-expo) both;
}

@keyframes smfpFilterPop {
  from {
    opacity: 0;
    transform: scale(0.94) translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
  }
}

.smfp-filter-pop {
  animation: smfpFilterPop 340ms var(--ease-spring) both;
}

/* ========================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION GUARD (CRITICAL)
   ======================================================== */
@media (prefers-reduced-motion: reduce) {
  html, body {
    scroll-behavior: auto !important;
  }
  html.smfp-motion-ready [data-reveal],
  html.smfp-motion-ready [data-reveal].is-revealed,
  .card-img-fit img,
  img[loading="lazy"].smfp-lazy-pending,
  .corp-shadow,
  .smfp-hover-lift:hover,
  .card-img-fit:hover img {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
    transition: none !important;
    animation: none !important;
    will-change: auto !important;
  }
  #smfp-scroll-progress {
    display: none !important;
  }
}

/* Minimalist Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f8fafc;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--nederman-blue);
}
