/* ═══════════════════════════════════════════════════════════════════════
   ZamaniAuto — Portfolio v6.0 CSS — Industrial Engineering Showcase
   Design Language: Precision, Trust, Measurable Results
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --pf-hero-bg: #0A1628;
  --pf-card-bg: #FFFFFF;
  --pf-card-border: rgba(0,0,0,0.08);
  --pf-card-hover-border: rgba(13,115,119,0.4);
  --pf-accent: #0D7377;
  --pf-accent-light: #14A3A8;
  --pf-accent-soft: rgba(13,115,119,0.06);
  --pf-stats-bg: #F8FAFB;
  --pf-text: #0F172A;
  --pf-text-soft: #475569;
  --pf-text-muted: #94A3B8;
  --pf-hero-title: 3.4rem;
  --pf-hero-subtitle: 1.28rem;
  --pf-section-title: 1.8rem;
  --pf-card-title: 1.05rem;
  --pf-card-gap: 20px;
  --pf-section-gap: 80px;
  --pf-content-max: 1140px;
  --pf-card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --pf-card-shadow-hover: 0 10px 30px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --pf-radius-sm: 8px;
  --pf-radius: 12px;
  --pf-radius-lg: 16px;
  --pf-transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --pf-gold: #D97706;
}

[data-theme="dark"] {
  --pf-card-bg: #1E293B;
  --pf-card-border: rgba(255,255,255,0.08);
  --pf-card-hover-border: rgba(20,163,168,0.5);
  --pf-stats-bg: rgba(30,41,59,0.6);
  --pf-text: #F1F5F9;
  --pf-text-soft: #94A3B8;
  --pf-text-muted: #64748B;
  --pf-card-shadow: 0 1px 3px rgba(0,0,0,0.3);
  --pf-card-shadow-hover: 0 12px 36px rgba(0,0,0,0.5);
  --pf-accent-soft: rgba(20,163,168,0.1);
}

/* ═══════ BASE ═══════ */
.pf-container { max-width: var(--pf-content-max); margin: 0 auto; padding: 0 24px; }

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: var(--pf-accent-light); z-index: 9999; width: 0%;
  transition: width 100ms linear; pointer-events: none;
}

.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 10000;
  background: var(--pf-accent); color: #fff; padding: 10px 20px;
  border-radius: 6px; font-size: .875rem; transition: top .2s;
}
.skip-link:focus { top: 8px; }

/* ═══════ HERO — compact (copy + screenshot, no partners) ═══════ */
.pf-hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 104px 24px 0;         /* clears fixed 64px navbar + 40px air */
  background: var(--pf-hero-bg);
  isolation: isolate;
}

/* ── Decorative orbs (subtle, lg only) ── */
.pf-hero-decor {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden; opacity: .4; contain: strict; display: none;
}
.pf-decor-orb { position: absolute; display: block; border-radius: 9999px; }
.pf-decor-orb--1 {
  left: -12%; top: -60%; width: 560px; height: 1280px; transform: rotate(-45deg);
  background: radial-gradient(68.54% 68.72% at 55.02% 31.46%, hsla(0,0%,85%,.08) 0%, hsla(0,0%,55%,.02) 50%, hsla(0,0%,45%,0) 80%);
}
.pf-decor-orb--2 {
  left: 0; top: 0; width: 224px; height: 1280px; transform: rotate(-45deg) translate(5%, -50%);
  background: radial-gradient(50% 50% at 50% 50%, hsla(0,0%,85%,.06) 0%, hsla(0,0%,45%,.02) 80%, transparent 100%);
}
.pf-decor-orb--3 {
  left: 0; top: -60%; width: 224px; height: 1280px; transform: rotate(-45deg);
  background: radial-gradient(50% 50% at 50% 50%, hsla(0,0%,85%,.04) 0%, hsla(0,0%,45%,.02) 80%, transparent 100%);
}

/* ── Hero row: two columns (text right + screenshot left) ── */
.pf-hero-row {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  direction: rtl;   /* first child (copy) = right, second (shot) = left */
}

/* ── Copy — right-aligned (Persian) ── */
.pf-hero-copy {
  position: relative; z-index: 10;
  text-align: right;
}
.pf-hero-title {
  color: #fff; font-size: clamp(1.9rem, 4.5vw, 2.75rem);  /* slightly smaller */
  font-weight: 650; line-height: 1.2; letter-spacing: -0.02em;
  margin: 0; text-wrap: balance;
}
.pf-hero-title span {
  background: linear-gradient(135deg, #2DD4BF, #14A3A8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.pf-hero-subtitle {
  color: rgba(255,255,255,.68); font-size: 1.05rem;   /* compressed from 1.25rem */
  line-height: 1.6; margin: 16px 0 22px; max-width: 640px;
}

/* CTA button */
.pf-btn-hero {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 26px; border-radius: 9px; font-size: .92rem;  /* compressed */
  font-weight: 600; text-decoration: none; transition: var(--pf-transition);
  cursor: pointer; border: none; letter-spacing: 0.3px;
}
.pf-btn-hero-primary {
  background: rgba(13,115,119,0.22); color: #5EEAD4;
  border: 1px solid rgba(20,163,168,0.40);
}
.pf-btn-hero-primary:hover {
  background: rgba(13,115,119,0.35); transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13,115,119,0.3); color: #A7F3D0;
}

/* ── 3D perspective screenshot ── */
.pf-hero-shot {
  position: relative; z-index: 1; width: 100%; max-width: 640px;  /* halved from 1280px */
  margin: 0;
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  overflow: hidden;
}
.pf-hero-shot-persp {
  perspective: 1200px;
  -webkit-mask-image: linear-gradient(to right, black 50%, transparent 100%);
  mask-image: linear-gradient(to right, black 50%, transparent 100%);
}
.pf-hero-shot-3d { transform: rotateX(20deg); }
.pf-hero-shot-skew { transform: skewX(-20.6deg); }
.pf-hero-shot-card {
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(94,234,212,0.12);
}
.pf-hero-shot-card .pf-dash { width: 100%; height: auto; display: block; }

/* ── Dashboard SVG — animated elements ── */

/* live status dot: soft blink */
.pf-live { animation: pfLive 1.6s ease-in-out infinite; transform-origin: center; }
@keyframes pfLive {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

/* ladder logic contacts: ON/OFF pulse */
.pf-contact { transform-origin: center; }
.pf-contact--c1 { animation: pfContact 2.2s ease-in-out infinite; }
.pf-contact--c2 { animation: pfContact 2.2s ease-in-out .35s infinite; }
.pf-contact--c3 { animation: pfContactFill 2.2s ease-in-out .7s infinite; }
.pf-contact--c4 { animation: pfContact 2.2s ease-in-out 1.05s infinite; }
@keyframes pfContact {
  0%, 100% { opacity: .4; stroke-width: 2; }
  50% { opacity: 1; stroke-width: 2.6; }
}
@keyframes pfContactFill {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

/* PID square wave: self-drawing sweep */
.pf-wave-square {
  stroke-dasharray: 340; stroke-dashoffset: 340;
  animation: pfSquare 4s linear infinite;
}
@keyframes pfSquare {
  0% { stroke-dashoffset: 340; }
  60% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -340; }
}

/* cosine wave: flowing brightness */
.pf-wave-cos { animation: pfCos 5s ease-in-out infinite; }
@keyframes pfCos {
  0%, 100% { opacity: .25; }
  50% { opacity: .7; }
}

/* trend line (golden time-series): self-draw + flow */
.pf-trend-line {
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: pfTrend 7s linear infinite;
}
@keyframes pfTrend {
  0%   { stroke-dashoffset: 1400; }
  60%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1400; }
}
.pf-trend-area { animation: pfTrendArea 6s ease-in-out infinite; }
@keyframes pfTrendArea {
  0%, 100% { opacity: .08; }
  50%       { opacity: .22; }
}
.pf-trend-dot { filter: drop-shadow(0 0 5px rgba(251,191,36,.95)); }

/* telemetry bars: height + opacity breathe (staggered) */
.pf-bar { transform-origin: center bottom; }
.pf-bar--1 { animation: pfBar 3s ease-in-out infinite; }
.pf-bar--2 { animation: pfBar 3.4s ease-in-out .3s infinite; }
.pf-bar--3 { animation: pfBar 2.6s ease-in-out .15s infinite; }
.pf-bar--4 { animation: pfBar 3.8s ease-in-out .5s infinite; }
.pf-bar--5 { animation: pfBar 3.2s ease-in-out .2s infinite; }
.pf-bar--6 { animation: pfBar 3.6s ease-in-out .4s infinite; }
.pf-bar--7 { animation: pfBar 2.8s ease-in-out .6s infinite; }
@keyframes pfBar {
  0%, 100% { transform: scaleY(.82); opacity: .55; }
  50% { transform: scaleY(1.06); opacity: 1; }
}

/* values: subtle color breath */
.pf-val { animation: pfVal 3.5s ease-in-out infinite; }
.pf-val--2 { animation-delay: .4s; }
.pf-val--3 { animation-delay: .8s; }
.pf-val--4 { animation-delay: 1.2s; }
@keyframes pfVal {
  0%, 100% { opacity: .8; }
  50% { opacity: 1; }
}

/* pulse line trace (self-draw) */
.pf-pulse {
  stroke-dasharray: 1300; stroke-dashoffset: 1300;
  animation: pfPulse 5s linear infinite;
}
@keyframes pfPulse {
  0% { stroke-dashoffset: 1300; }
  60% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1300; }
}

/* pulse dot: glow */
.pf-pulse-dot { filter: drop-shadow(0 0 6px rgba(94,234,212,.95)); }

/* logo in title bar: gentle breathe */

/* respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .pf-live, .pf-contact, .pf-contact--c1, .pf-contact--c2, .pf-contact--c3, .pf-contact--c4,
  .pf-wave-square, .pf-wave-cos, .pf-bar, .pf-pulse, .pf-pulse-dot, .pf-val,
  .pf-trend-line, .pf-trend-area, .pf-trend-dot {
    animation: none !important;
  }
}






/* ═══════ FILTER BAR ═══════ */
.pf-filter-section {
  background: var(--pf-stats-bg); border-bottom: 1px solid var(--pf-card-border);
  position: sticky; top: 0; z-index: 100; padding: 10px 0; transition: box-shadow .3s;
}
.pf-filter-section.is-stuck { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.pf-filter-bar { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.pf-search-wrap { position: relative; }
.pf-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--pf-text-muted); font-size: .9rem; pointer-events: none;
}
.pf-search-input {
  padding: 9px 14px 9px 38px; border: 1px solid var(--pf-card-border);
  border-radius: 8px; font-size: .88rem; background: var(--pf-card-bg);
  color: var(--pf-text); width: 240px; transition: var(--pf-transition);
  font-family: inherit; outline: none;
}
.pf-search-input:focus {
  border-color: var(--pf-accent); box-shadow: 0 0 0 3px var(--pf-accent-soft);
  width: 270px;
}

.pf-filter-tabs {
  display: flex; gap: 8px; overflow-x: auto; flex: 1;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.pf-filter-tabs::-webkit-scrollbar { display: none; }
.pf-filter-tab {
  flex-shrink: 0; padding: 8px 20px; border-radius: 6px;
  font-size: .85rem; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--pf-text-soft);
  border: 1px solid transparent; transition: var(--pf-transition);
  white-space: nowrap; font-family: inherit;
}
.pf-filter-tab:hover { color: var(--pf-accent); background: var(--pf-accent-soft); }
.pf-filter-tab.active {
  background: var(--pf-accent); color: #fff; border-color: var(--pf-accent); font-weight: 600;
}

.pf-sort-view { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.pf-sort-select {
  padding: 7px 12px; border-radius: 6px; border: 1px solid var(--pf-card-border);
  font-size: .85rem; background: var(--pf-card-bg); color: var(--pf-text);
  font-family: inherit; cursor: pointer;
}
.pf-view-toggle { display: flex; gap: 6px; }
.pf-view-btn {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--pf-card-border);
  background: var(--pf-card-bg); color: var(--pf-text-soft); cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: var(--pf-transition);
}
.pf-view-btn.active { background: var(--pf-accent); color: #fff; border-color: var(--pf-accent); }

.pf-filter-meta {
  display: flex; align-items: center; justify-content: flex-start;
  flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.pf-results-info { font-size: .85rem; color: var(--pf-text-soft); white-space: nowrap; }
.pf-results-info span { font-weight: 700; color: var(--pf-accent); }

.pf-active-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--pf-accent-soft); color: var(--pf-accent);
  padding: 4px 12px; border-radius: 6px; font-size: .78rem; font-weight: 500;
}
.pf-chip button {
  background: none; border: none; cursor: pointer; color: var(--pf-accent);
  font-size: .85rem; padding: 0; line-height: 1;
}
.pf-chip-clear {
  background: rgba(239,68,68,0.08); color: #EF4444; border: none;
  padding: 4px 14px; border-radius: 6px; font-size: .78rem; cursor: pointer;
  font-family: inherit;
}
/* ═══════ FEATURED PROJECTS ═══════ */
.pf-featured-section { padding: 32px 0 0; }
.pf-section-header { margin-bottom: 20px; text-align: center; }
.pf-section-tag {
  display: inline-block; font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--pf-accent); margin-bottom: 8px;
}
.pf-section-header h2 {
  font-size: var(--pf-section-title); font-weight: 800; color: var(--pf-text);
  margin: 0; letter-spacing: -0.3px;
}
.pf-section-header h2 span { color: var(--pf-accent); }
.pf-featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--pf-card-gap); }

.pf-featured-card {
  border-radius: var(--pf-radius); overflow: hidden;
  background: var(--pf-card-bg); border: 1px solid var(--pf-card-border);
  box-shadow: var(--pf-card-shadow); cursor: pointer; transition: var(--pf-transition);
}
.pf-featured-card:hover {
  transform: translateY(-4px); box-shadow: var(--pf-card-shadow-hover);
  border-color: var(--pf-card-hover-border);
}
.pf-featured-img { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #1E293B; }
.pf-featured-img img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 600ms ease;
}
.pf-featured-card:hover .pf-featured-img img { transform: scale(1.04); }
.pf-featured-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,22,40,0.75) 0%, rgba(10,22,40,0.2) 60%);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 24px;
  opacity: 0; transition: opacity var(--pf-transition);
}
.pf-featured-card:hover .pf-featured-overlay { opacity: 1; }
.pf-view-cs {
  color: #fff; font-weight: 600; font-size: .9rem;
  background: var(--pf-accent); padding: 10px 24px; border-radius: 6px;
}
.pf-featured-badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--pf-gold); color: #fff;
  padding: 3px 12px; border-radius: 4px; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}
.pf-featured-body { padding: 20px; }
.pf-featured-title {
  font-size: 1.1rem; font-weight: 700; color: var(--pf-text); margin: 0 0 8px; line-height: 1.45;
}
.pf-featured-summary {
  font-size: .85rem; color: var(--pf-text-soft); line-height: 1.65;
  margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.pf-featured-meta {
  padding-top: 14px; border-top: 1px solid var(--pf-card-border);
  display: flex; gap: 16px; font-size: .82rem; color: var(--pf-text-soft);
}

/* ═══════ TAG SYSTEM ═══════ */
.pf-tag-service, .pf-tag-industry {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: .72rem; font-weight: 600;
}
.pf-tag-service { background: rgba(13,115,119,0.1); color: var(--pf-accent); }
.pf-tag-industry { background: rgba(71,85,105,0.08); color: var(--pf-text-soft); }

.pf-tech-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.pf-pill {
  display: inline-block; padding: 4px 10px; border-radius: 4px;
  font-size: .74rem; font-weight: 500;
  background: var(--pf-accent-soft); color: var(--pf-text-soft);
  white-space: nowrap;
}
.pf-pill-more { color: var(--pf-accent); font-weight: 600; }
.pf-pill-lg { padding: 6px 14px; font-size: .82rem; border-radius: 6px; }

/* ═══════ PROJECT GRID ═══════ */
.pf-grid-section { padding: 24px 0 60px; }
.pf-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--pf-card-gap);
}
.pf-grid[data-view="list"] { grid-template-columns: 1fr; }

.pf-card {
  border-radius: var(--pf-radius); overflow: hidden;
  background: var(--pf-card-bg); border: 1px solid var(--pf-card-border);
  box-shadow: var(--pf-card-shadow); cursor: pointer; transition: var(--pf-transition);
  display: flex; flex-direction: column;
}
.pf-card:hover {
  transform: translateY(-4px); box-shadow: var(--pf-card-shadow-hover);
  border-color: var(--pf-card-hover-border);
}
.pf-card[data-type="detailed"] { /* no special span — uniform grid */ }

/* Masonry-grid auto-rows for consistent card heights */
.pf-grid { grid-auto-rows: 1fr; }
.pf-card { height: 100%; }

.pf-card-img-wrap {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  background: linear-gradient(135deg, #1E293B, #334155);
}
.pf-card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms ease; }
.pf-card:hover .pf-card-img { transform: scale(1.04); }
.pf-card-hover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,22,40,0.8) 0%, rgba(10,22,40,0.2) 60%);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 24px;
  opacity: 0; transition: opacity var(--pf-transition);
}
.pf-card:hover .pf-card-hover-overlay { opacity: 1; }
.pf-card-hover-overlay span {
  color: #fff; font-weight: 600; font-size: .85rem;
  background: var(--pf-accent); padding: 8px 20px; border-radius: 6px;
}

.pf-img-placeholder, .pf-card-img-ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; background: linear-gradient(135deg, #0F172A, #1E293B);
  color: rgba(255,255,255,.10); position: relative;
}
.pf-img-placeholder::after {
  content: ''; position: absolute; inset: 0;
  background: 
    linear-gradient(rgba(13,115,119,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,115,119,0.12) 1px, transparent 1px);
  background-size: 30px 30px;
}

.pf-card-feat-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--pf-gold); color: #fff;
  width: 26px; height: 26px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700;
}
.pf-card-cs-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(13,115,119,0.9); color: #fff;
  padding: 4px 10px; border-radius: 4px;
  font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}

.pf-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.pf-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pf-card-title {
  font-size: var(--pf-card-title); font-weight: 700; color: var(--pf-text);
  margin: 0 0 8px; line-height: 1.45;
}
.pf-card-summary {
  font-size: .84rem; color: var(--pf-text-soft); line-height: 1.65; margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; flex: 1;
}
.pf-card-metric {
  margin: 10px 0; padding: 12px 14px;
  background: var(--pf-accent-soft); border-radius: 8px;
  display: flex; align-items: center; gap: 10px;
  border-left: 3px solid var(--pf-accent);
}
[dir="rtl"] .pf-card-metric { border-left: none; border-right: 3px solid var(--pf-accent); }
.pf-metric-val { font-size: 1.25rem; font-weight: 800; color: var(--pf-accent); }
.pf-metric-lbl { font-size: .8rem; color: var(--pf-text-soft); }

/* Card Footer */
.pf-card-footer {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--pf-card-border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: .82rem; color: var(--pf-text-muted);
  gap: 10px;
}
.pf-card-duration { display: flex; align-items: center; gap: 4px; }
.pf-card-cta { color: var(--pf-accent); font-weight: 600; white-space: nowrap; }

/* ═══════ MID CTA ═══════ */
.pf-mid-cta { padding: 24px 0; }
.pf-mid-cta-box {
  background: linear-gradient(135deg, var(--pf-accent), #095A5F);
  border-radius: var(--pf-radius-lg); padding: 26px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; color: #fff;
}
.pf-mid-cta-box h3 { font-size: 1.2rem; font-weight: 700; margin: 0 0 6px; }
.pf-mid-cta-box p { margin: 0; font-size: .88rem; opacity: .85; line-height: 1.6; }
.pf-mid-cta-box a {
  flex-shrink: 0; background: #fff; color: var(--pf-accent);
  padding: 14px 32px; border-radius: 6px; font-weight: 700; text-decoration: none;
  transition: var(--pf-transition); white-space: nowrap;
}
.pf-mid-cta-box a:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.15); }

/* ═══════ TRUST SIGNALS ═══════ */
.pf-trust-section { padding: 24px 0; }
.pf-trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pf-trust-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--pf-stats-bg);
  border-radius: var(--pf-radius-sm); border: 1px solid transparent;
  transition: var(--pf-transition); font-size: .88rem; font-weight: 500;
  color: var(--pf-text-soft);
}
.pf-trust-item:hover { border-color: var(--pf-card-hover-border); }
.pf-trust-icon { font-size: 1.3rem; flex-shrink: 0; }

/* ═══════ BOTTOM CTA ═══════ */
.pf-cta-section { padding: 0 0 48px; }
.pf-cta-box {
  background: var(--pf-hero-bg); border-radius: var(--pf-radius-lg);
  padding: 40px 36px; text-align: center; position: relative; overflow: hidden;
}
.pf-cta-box::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(13,115,119,0.12) 0%, transparent 60%);
}
.pf-cta-content { position: relative; z-index: 1; min-width: 0; }
.pf-cta-box h2 { color: #fff; font-size: 1.6rem; font-weight: 800; margin: 0 0 14px; line-height: 1.3; }
/* عنوان CTA: در موبایل/تبلت تک‌خط بماند */
.pf-cta-box h2.pf-cta-title { white-space: nowrap; }
.pf-cta-box > div > p {
  color: rgba(255,255,255,.6); font-size: 1rem; margin: 0 auto 28px; max-width: 600px; line-height: 1.7;
}
.pf-cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.pf-cta-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 15px 34px; border-radius: 6px; font-size: .95rem;
  font-weight: 600; text-decoration: none; transition: var(--pf-transition);
  cursor: pointer; border: none; font-family: inherit;
  white-space: nowrap; max-width: 100%; box-sizing: border-box;
}
.pf-cta-btn-primary { background: var(--pf-accent); color: #fff; }
.pf-cta-btn-primary:hover { background: var(--pf-accent-light); transform: translateY(-2px); }
.pf-cta-btn-secondary {
  background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.2);
}
.pf-cta-btn-secondary:hover { border-color: #fff; background: rgba(255,255,255,.05); transform: translateY(-2px); }
.pf-cta-sub { margin-top: 18px; color: rgba(255,255,255,.4); font-size: .82rem; }
.pf-cta-sub a { color: var(--pf-accent-light); text-decoration: none; }

/* ═══════ EMPTY ═══════ */
.pf-empty, .pf-no-results {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 80px 24px;
}
.pf-empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: .4; }
.pf-empty h3, .pf-no-results h3 { color: var(--pf-text); font-size: 1.2rem; margin: 0 0 8px; }
.pf-empty p, .pf-no-results p { color: var(--pf-text-soft); margin: 0 0 20px; }
.pf-btn-reset {
  padding: 10px 24px; border-radius: 6px; border: 1.5px solid var(--pf-accent);
  background: transparent; color: var(--pf-accent); font-weight: 600;
  cursor: pointer; font-family: inherit; font-size: .88rem; transition: var(--pf-transition);
}
.pf-btn-reset:hover { background: var(--pf-accent); color: #fff; }
/* ═══════ MODAL ═══════ */
.pf-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  z-index: 2000; opacity: 0; visibility: hidden; transition: opacity .3s;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.pf-modal-backdrop.open { opacity: 1; visibility: visible; }

.pf-modal {
  position: fixed; inset: 0; z-index: 2001; overflow-y: auto;
  opacity: 0; visibility: hidden; transition: opacity .3s;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px 80px;
}
.pf-modal.open { opacity: 1; visibility: visible; }

.pf-modal-close {
  position: fixed; top: 16px; right: 16px; z-index: 2010;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.12); color: #fff; font-size: 1.2rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--pf-transition);
}
.pf-modal-close:hover { background: rgba(239,68,68,0.7); }
[dir="rtl"] .pf-modal-close { right: auto; left: 16px; }

.pf-modal-inner {
  background: var(--pf-card-bg); border-radius: var(--pf-radius-lg);
  max-width: 920px; width: 100%; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}
.pf-modal-loading {
  display: flex; align-items: center; justify-content: center; padding: 100px 20px;
}
.pf-spinner {
  width: 36px; height: 36px; border: 3px solid var(--pf-card-border);
  border-top-color: var(--pf-accent); border-radius: 50%;
  animation: pf-spin .7s linear infinite;
}
@keyframes pf-spin { to { transform: rotate(360deg); } }

/* ── CS Header ── */
.pf-cs-header { padding: 32px 36px 24px; border-bottom: 1px solid var(--pf-card-border); }
.pf-cs-breadcrumb {
  display: flex; align-items: center; gap: 6px; font-size: .85rem;
  color: var(--pf-text-muted); margin-bottom: 18px;
}
.pf-cs-breadcrumb a { color: var(--pf-accent); text-decoration: none; }
.pf-cs-header h2 { font-size: 1.5rem; font-weight: 800; color: var(--pf-text); margin: 0 0 10px; line-height: 1.35; }
.pf-cs-summary { color: var(--pf-text-soft); font-size: .95rem; line-height: 1.75; margin: 0 0 14px; }
.pf-cs-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.pf-cs-meta-item {
  font-size: .82rem; color: var(--pf-text-soft); background: var(--pf-stats-bg);
  padding: 4px 12px; border-radius: 6px; font-weight: 500;
}

/* ── Carousel ── */
.pf-carousel {
  position: relative; overflow: hidden; background: #0F172A; min-height: 280px; height: 460px;
}
.pf-carousel-track { position: relative; width: 100%; height: 100%; }
.pf-carousel-slide {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  max-height: 460px; background: #0F172A; opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.pf-carousel-slide.active { opacity: 1; pointer-events: auto; }
.pf-carousel-slide img {
  width: 100%; height: 100%; object-fit: contain; max-height: 450px;
}
.pf-carousel-slide video { width: 100%; max-height: 450px; }
.pf-carousel-slide iframe { width: 100%; height: 450px; border: none; }

.pf-car-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.1); color: #fff; font-size: 1.4rem;
  cursor: pointer; transition: var(--pf-transition); z-index: 2;
}
.pf-car-btn:hover { background: rgba(255,255,255,.25); }
.pf-car-prev { left: 12px; }
.pf-car-next { right: 12px; }

.pf-car-dots {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 2;
}
.pf-car-dot {
  width: 8px; height: 8px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.35); cursor: pointer; padding: 0;
  transition: var(--pf-transition);
}
.pf-car-dot.active { background: #fff; width: 22px; border-radius: 10px; }

/* ── CS Body (Dual Column) ── */
.pf-cs-body { padding: 28px 36px 32px; }
.pf-cs-body-with-sidebar {
  display: grid; grid-template-columns: 1fr 260px; gap: 32px; align-items: start;
}
.pf-cs-main-content { min-width: 0; }
.pf-cs-sidebar {
  position: sticky; top: 80px; background: var(--pf-stats-bg);
  border-radius: var(--pf-radius); padding: 24px 20px;
  border: 1px solid var(--pf-card-border);
}
.pf-cs-sidebar h3 {
  font-size: .95rem; font-weight: 700; color: var(--pf-text);
  margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--pf-card-border);
}

.pf-cs-section { margin-bottom: 28px; }
.pf-cs-section h3 {
  font-size: 1.1rem; font-weight: 700; color: var(--pf-text);
  margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.pf-cs-icon { font-size: 1.2rem; }
.pf-cs-text { font-size: .9rem; color: var(--pf-text-soft); line-height: 1.9; }
.pf-cs-section.pf-cs-challenge {
  border-right: 3px solid #EF4444; padding-right: 16px;
}
[dir="rtl"] .pf-cs-section.pf-cs-challenge { border-right: none; border-left: 3px solid #EF4444; padding-right: 0; padding-left: 16px; }
.pf-cs-section.pf-cs-solution {
  border-right: 3px solid var(--pf-accent); padding-right: 16px;
}
[dir="rtl"] .pf-cs-section.pf-cs-solution { border-right: none; border-left: 3px solid var(--pf-accent); padding-right: 0; padding-left: 16px; }

.pf-cs-pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* Metrics in sidebar */
.pf-cs-sidebar .pf-metric-card {
  background: var(--pf-card-bg); border-radius: 8px;
  padding: 14px; margin-bottom: 10px; border: 1px solid var(--pf-card-border);
  text-align: center;
}
.pf-metric-big {
  display: block; font-size: 1.6rem; font-weight: 800; color: var(--pf-accent);
  margin-bottom: 4px;
}
.pf-cs-sidebar .pf-metric-card span { font-size: .78rem; color: var(--pf-text-soft); }

/* Quote */
.pf-cs-quote {
  background: var(--pf-stats-bg); border-radius: var(--pf-radius-sm);
  padding: 24px 28px; margin: 24px 0; font-size: .95rem;
  color: var(--pf-text); line-height: 1.9; border: none;
  border-right: 4px solid var(--pf-accent); font-style: italic;
}
[dir="rtl"] .pf-cs-quote { border-right: none; border-left: 4px solid var(--pf-accent); }
.pf-cs-quote span { color: var(--pf-accent); font-size: 1.3rem; }

/* Related */
.pf-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.pf-related-card {
  background: var(--pf-stats-bg); border-radius: var(--pf-radius-sm);
  padding: 16px; cursor: pointer; border: 1px solid transparent;
  transition: var(--pf-transition);
}
.pf-related-card:hover { border-color: var(--pf-card-hover-border); transform: translateY(-2px); }
.pf-related-card h4 { font-size: .88rem; font-weight: 700; color: var(--pf-text); margin: 0 0 4px; }
.pf-related-card p {
  font-size: .78rem; color: var(--pf-text-soft); margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* CTA in modal */
.pf-cs-cta {
  display: flex; gap: 12px; flex-wrap: wrap; padding: 20px 0 0;
  border-top: 1px solid var(--pf-card-border); margin-top: 8px;
}
.pf-cta-pdf { background: transparent; color: var(--pf-accent); border: 1.5px solid var(--pf-accent); }

/* ═══════ LIGHTBOX ═══════ */
.pf-lightbox {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.pf-lightbox.open { opacity: 1; visibility: visible; }
.pf-lightbox-overlay { position: absolute; inset: 0; cursor: zoom-out; }
.pf-lightbox-close {
  position: absolute; top: 16px; right: 16px; z-index: 3010;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.1); color: #fff; font-size: 1.3rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.pf-lightbox-close:hover { background: rgba(239,68,68,0.7); }
.pf-lightbox-prev, .pf-lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3010;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.1); color: #fff; font-size: 1.6rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.pf-lightbox-prev:hover, .pf-lightbox-next:hover { background: rgba(255,255,255,.25); }
.pf-lightbox-prev { left: 16px; }
.pf-lightbox-next { right: 16px; }
.pf-lightbox-content {
  position: relative; z-index: 3005; display: flex; flex-direction: column;
  align-items: center; cursor: default;
}
.pf-lightbox-img {
  max-width: 90vw; max-height: 75vh; object-fit: contain;
  border-radius: 4px; box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
.pf-lightbox-caption {
  color: rgba(255,255,255,.7); font-size: .88rem; margin-top: 12px;
  text-align: center; max-width: 700px;
}
.pf-lightbox-counter { color: rgba(255,255,255,.4); font-size: .78rem; margin-top: 6px; }

/* ═══════ ANIMATIONS ═══════ */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .6s ease, transform .6s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0ms; }
.reveal-d2 { transition-delay: 80ms; }
.reveal-d3 { transition-delay: 160ms; }
.reveal-d4 { transition-delay: 240ms; }
.reveal-d5 { transition-delay: 320ms; }
.reveal-d6 { transition-delay: 400ms; }

/* ═══════ RESPONSIVE ═══════ */
@media (min-width: 1024px) {
  .pf-hero-decor { display: block; }
}
@media (max-width: 1023px) {
  :root { --pf-hero-title: 1.8rem; --pf-section-title: 1.4rem; --pf-section-gap: 56px; }
  .pf-featured-grid { grid-template-columns: repeat(2, 1fr); }
  .pf-grid { grid-template-columns: repeat(2, 1fr); }
  .pf-card[data-type="detailed"] { /* uniform */ }
  .pf-trust-grid { grid-template-columns: repeat(2, 1fr); }
  .pf-hero { padding: 88px 20px 0; }
  .pf-hero-row { grid-template-columns: 1fr; gap: 32px; direction: rtl; }
  .pf-hero-copy { text-align: center; }
  .pf-hero-subtitle { margin: 16px auto 22px; }
  .pf-hero-shot { margin: 0 auto; }
  .pf-modal-inner { max-width: 95vw; }
  .pf-cs-body-with-sidebar { grid-template-columns: 1fr; }
  .pf-cs-sidebar { position: static; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pf-related-grid { grid-template-columns: repeat(2, 1fr); }
  .pf-cta-box { padding: 36px 28px; }
  /* تبلت: عنوان CTA در یک خط با فونت کمی فشرده‌تر */
  .pf-cta-box h2.pf-cta-title { white-space: nowrap; font-size: 1.25rem; }
  /* لوگوهای شرکتها در تبلت: ستون باریکتر تا کنار CTA جا بگیرد و بیرون نزند */
  .pf-cta-layout { grid-template-columns: minmax(150px, 1fr) 2fr; gap: 24px; }
  .pf-cta-clients-viewport { max-width: 160px; height: 200px; }
  .pf-cta-client-logo { width: 60px; height: 60px; }
  .pf-cta-client-logo img { max-width: 46px; max-height: 46px; }
  .pf-cta-box h2 { font-size: 1.4rem; }
  .pf-cta-btn { padding: 13px 22px; font-size: .9rem; }
}

@media (max-width: 767px) {
  :root { --pf-hero-title: 1.5rem; --pf-section-title: 1.25rem; --pf-section-gap: 48px; --pf-card-gap: 16px; }
  .pf-hero { padding: 80px 16px 0; }
  .pf-hero-title { font-size: 1.75rem; line-height: 1.2; }
  .pf-hero-subtitle { font-size: .95rem; margin: 12px auto 18px; }
  .pf-hero-shot { max-width: 100%; margin: 0 auto 8px; }
  .pf-hero-shot-3d { transform: rotateX(12deg); }
  .pf-hero-shot-skew { transform: skewX(-6deg); }
  .pf-btn-hero { justify-content: center; }
  .pf-filter-bar { flex-direction: column; align-items: stretch; }
  .pf-search-input { width: 100%; }
  .pf-search-input:focus { width: 100%; }
  .pf-sort-view { justify-content: space-between; }
  .pf-featured-grid { grid-template-columns: 1fr; }
  .pf-grid { grid-template-columns: 1fr; }
  .pf-card[data-type="detailed"] { /* no span — uniform */ }
  .pf-trust-grid { grid-template-columns: 1fr; }
  .pf-mid-cta-box { flex-direction: column; text-align: center; padding: 28px 20px; }
  .pf-cta-box { padding: 32px 20px; }
  .pf-cta-box h2 { font-size: 1.3rem; }
  /* موبایل: عنوان CTA تک‌خط با فونت مقیاس‌پذیر (کوچک‌تر تا در عرض جا شود) */
  .pf-cta-box h2.pf-cta-title { white-space: nowrap; font-size: clamp(1rem, 5vw, 1.25rem); }
  .pf-cta-actions { flex-direction: column; align-items: stretch; }
  .pf-cta-btn { justify-content: center; width: 100%; white-space: normal; }
  /* موبایل: لوگوها افقی روی محتوای CTA */
  .pf-cta-layout { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .pf-cta-clients { order: -1; border: none; padding: 0; }
  .pf-cta-clients-viewport { max-width: 100%; height: auto; }
  .pf-cta-clients-track { flex-direction: row; width: max-content; height: auto; }
  .pf-cta-client-logo { width: 56px; height: 56px; }
  .pf-cta-client-logo img { max-width: 44px; max-height: 44px; }
  .pf-modal { padding: 16px 8px 60px; }
  .pf-modal-inner { border-radius: var(--pf-radius-sm); }
  .pf-cs-header { padding: 24px 20px 16px; }
  .pf-cs-body { padding: 20px; }
  .pf-cs-sidebar { grid-template-columns: 1fr; }
  .pf-related-grid { grid-template-columns: 1fr; }
  .pf-carousel { height: 260px; }
  .pf-carousel-slide { max-height: 260px; }
  .pf-carousel-slide img, .pf-carousel-slide video { max-height: 260px; }
  .pf-carousel-slide iframe { height: 260px; }
  .pf-lightbox-prev { left: 8px; width: 36px; height: 36px; }
  .pf-lightbox-next { right: 8px; width: 36px; height: 36px; }
  .pf-lightbox-close { top: 8px; right: 8px; width: 36px; height: 36px; }
}

/* ─── فوق‌باریک: < 360px ─── */
@media (max-width: 359px) {
  .pf-cta-box { padding: 28px 14px; }
  .pf-cta-client-logo { width: 48px; height: 48px; padding: 6px; }
  .pf-cta-client-logo img { max-width: 38px; max-height: 38px; }
}
