/*
 * Nematollahi.site – main stylesheet
 * Designed & programmed by Shahyad Nematollahi (شهیاد نعمت‌اللهی)
 * Last pass: layout tweaks + dark theme polish
 */

@import url("fonts.css");

/* ---
   1. Design Tokens
--- */
:root {
  --primary: #1E3A8A;
  --primary-hover: #1e40af;
  --accent: #F59E0B;
  --accent-hover: #d97706;
  --bg: #F8FAFC;
  --bg-alt: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 72px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: var(--font-body, 'Vazirmatn', Tahoma, sans-serif);
  --font-body: 'Vazirmatn', Tahoma, 'Segoe UI', system-ui, sans-serif;
  --font-heading: 'Vazirmatn', Tahoma, 'Segoe UI', system-ui, sans-serif;
  --success: #10B981;
  --danger: #EF4444;
}

[data-theme="dark"] {
  --primary: #3B82F6;
  --primary-hover: #60A5FA;
  --accent: #FBBF24;
  --accent-hover: #F59E0B;
  --bg: #0F172A;
  --bg-alt: #1E293B;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --border: #334155;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
  --success: #34D399;
  --danger: #F87171;
}

/* ---
   2. Reset & Base
--- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition), color var(--transition);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button, input, textarea, select { font-family: inherit; border: none; outline: none; }
ul { list-style: none; }

/* ---
   3. Utilities
--- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section { padding: 5rem 0; }
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  min-height: 48px;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}
.btn-accent {
  background: var(--accent);
  color: #0F172A;
}
.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}
.btn-sm {
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
  min-height: 38px;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

/* ---
   4. Header
--- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 1000;
  transition: background-color var(--transition), box-shadow var(--transition), backdrop-filter var(--transition);
}
.header.scrolled {
  background: color-mix(in srgb, var(--bg-alt) 92%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}
.logo .dot { color: var(--accent); font-weight: 800; margin: 0 1px; }
.nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}
.nav a {
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  transition: color var(--transition);
  cursor: pointer;
}
.nav a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav a:hover,
.nav a.active { color: var(--primary); }
.nav a:hover::after,
.nav a.active::after { width: 100%; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.icon-btn:hover {
  background: var(--border);
  color: var(--primary);
}
.icon-btn svg { width: 20px; height: 20px; }

/* User Menu */
.user-menu-wrapper { position: relative; }
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: all var(--transition);
}
.user-avatar:hover { transform: scale(1.05); box-shadow: var(--shadow); }
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  z-index: 100;
}
.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
[dir="rtl"] .user-dropdown { right: auto; left: 0; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition);
  width: 100%;
  background: none;
  color: var(--text);
  text-align: left;
}
[dir="rtl"] .user-dropdown-item { text-align: right; }
.user-dropdown-item:hover { background: var(--border); }
.user-dropdown-item.logout { color: var(--danger); }

/* Hamburger & Mobile */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  cursor: pointer;
  background: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
.mobile-menu {
  position: fixed;
  top: 0; right: -100%;
  width: min(320px, 85vw);
  height: 100vh;
  background: var(--bg-alt);
  z-index: 999;
  padding: 5rem 1.5rem 2rem;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}
[dir="rtl"] .mobile-menu {
  right: auto; left: -100%;
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
}
.mobile-menu.open { right: 0; }
[dir="rtl"] .mobile-menu.open { left: 0; }
.mobile-menu a {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1.05rem;
  transition: background var(--transition);
  cursor: pointer;
}
.mobile-menu a:hover,
.mobile-menu a.active {
  background: var(--border);
  color: var(--primary);
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.overlay.open { opacity: 1; visibility: visible; }

/* ---
   5. Page System (SPA Views)
--- */
.page {
  display: none;
  min-height: calc(100vh - var(--header-h));
  padding-top: var(--header-h);
  animation: pageFadeIn 0.45s ease;
}
.page.active { display: block; }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---
   6. Hero – Stable Typing + Premium 3D Cube (REBUILT)
--- */
.hero {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%,
      color-mix(in srgb, var(--primary) 12%, transparent), transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 80%,
      color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%);
  padding: 3rem 0 4rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}
.hero-content { text-align: center; }

/* Badge – stable */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent-hover);
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* ---------- STABLE HERO TITLE (dual-layer, no jump) ---------- */
.hero-title-wrapper {
  min-height: 4.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}
[dir="rtl"] .hero-title-wrapper { justify-content: center; }

.hero-title {
  font-size: clamp(1.85rem, 5vw, 3.15rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
  max-width: 100%;
  text-align: center;
}

/* Invisible sizer reserves exact final dimensions */
.hero-title-sizer {
  visibility: hidden;
  display: block;
  pointer-events: none;
  background: linear-gradient(135deg, var(--text) 15%, var(--primary) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Live layer sits on top of sizer — same box, no layout shift */
.hero-title-live {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#typedText {
  display: inline;
  unicode-bidi: isolate;
  position: relative;
}

/* Word chips — graphical staggered reveal */
#typedText .tw {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em) scale(0.92);
  filter: blur(2px);
  background: linear-gradient(135deg, var(--text) 0%, var(--text) 40%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition:
    opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}
#typedText .tw.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}
#typedText .tw-space { display: inline; }

/* Complete state — clean solid gradient, no glass/shimmer */
.hero-title.is-complete #typedText .tw {
  background: linear-gradient(135deg, var(--text) 10%, var(--primary) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: none;
}

/* Exit fade for loop */
.hero-title.is-exiting #typedText .tw {
  opacity: 0 !important;
  transform: translateY(-0.25em) scale(0.97) !important;
  filter: none !important;
  transition:
    opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.55s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.hero-title.is-exiting::after {
  width: 0 !important;
  transition: width 0.45s ease !important;
}

.hero-title .cursor { display: none; }

/* Underline draws only after completion */
.hero-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-title.is-complete::after { width: 48%; }

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ---------- HERO MARK: N → Nematollahi → signal dot → Site (برند اصلی همیشه لاتین) ---------- */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 380px;
  position: relative;
  overflow: visible;
}
.hero-mark {
  position: relative;
  width: min(420px, 92vw);
  height: min(320px, 70vw);
  display: grid;
  place-items: center;
  direction: ltr;
  user-select: none;
}
.hm-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
/* Signal rings behind the dot */
.hm-rings {
  position: absolute;
  width: 220px;
  height: 220px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}
.hm-rings.on { opacity: 1; }
.hm-rings i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent);
  animation: hmWave 2.8s ease-out infinite;
  opacity: 0;
}
.hm-rings.on i { opacity: 1; }
.hm-rings i:nth-child(2) {
  animation-delay: .7s;
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}
.hm-rings i:nth-child(3) {
  animation-delay: 1.4s;
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}
.hm-rings i:nth-child(4) {
  animation-delay: 2.1s;
  border-color: color-mix(in srgb, var(--primary) 18%, transparent);
}
@keyframes hmWave {
  0%   { transform: scale(0.15); opacity: 0.65; }
  100% { transform: scale(1); opacity: 0; }
}

.hm-word {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  white-space: nowrap;
  line-height: 1;
  direction: ltr;
  unicode-bidi: isolate;
  transition: transform 0.85s cubic-bezier(.4,0,.2,1), font-size 0.85s cubic-bezier(.4,0,.2,1);
  font-size: clamp(2.8rem, 9vw, 4.6rem);
}
.hm-word.is-compact {
  font-size: clamp(1.55rem, 5.2vw, 2.35rem);
  letter-spacing: -0.03em;
}
/* N: brand primary blue — strongest anchor */
.hm-n {
  display: inline-block;
  color: var(--primary);
  text-shadow: 0 0 28px rgba(59, 130, 246, 0.35);
  opacity: 0;
  transform: translateY(12px) scale(0.85);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1);
}
.hm-n.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
/* ematollahi: soft neutral — readable, not competing with N */
.hm-rest {
  display: inline-block;
  opacity: 0;
  transform: translateX(-12px);
  color: var(--text);
  transition: opacity .55s ease .1s, transform .7s cubic-bezier(.4,0,.2,1);
}
.hm-rest.show {
  opacity: 1;
  transform: translateX(0);
}
/* domain dot: accent gold — signal core */
.hm-dot {
  display: inline-block;
  width: 0.28em;
  height: 0.28em;
  margin: 0 0.08em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, var(--accent) 42%, #b45309 100%);
  vertical-align: middle;
  position: relative;
  top: -0.08em;
  opacity: 0;
  transform: scale(0);
  box-shadow:
    0 0 14px rgba(245, 158, 11, 0.75),
    0 0 32px rgba(245, 158, 11, 0.4);
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,1.2,.3,1);
}
.hm-dot.show {
  opacity: 1;
  transform: scale(1);
}
.hm-dot.pulse {
  animation: hmDotPulse 1.6s ease-in-out infinite;
}
@keyframes hmDotPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.22); filter: brightness(1.12); }
}
/* site: slightly softer than body — finishes the domain */
.hm-site {
  display: inline-block;
  opacity: 0;
  transform: translateX(-10px);
  color: var(--text);
  font-weight: 750;
  transition: opacity .5s ease .05s, transform .65s cubic-bezier(.4,0,.2,1);
}
.hm-site.show {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .hm-rings i, .hm-dot.pulse { animation: none !important; }
  .hm-n, .hm-rest, .hm-dot, .hm-site {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hm-word { font-size: clamp(1.55rem, 5.2vw, 2.35rem) !important; }
}


/* ---
   7. Services
--- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.service-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 0;
  background: var(--accent);
  transition: height var(--transition);
}
.service-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.service-card:hover::before { height: 100%; }
.service-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--primary);
}
.service-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.service-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---
   8. Portfolio
--- */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.project-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
}
.project-card:hover {
  box-shadow: var(--shadow-lg);
}
.project-img {
  height: 220px;
  position: relative;
  overflow: hidden;
  background: #0f172a;
}
.project-img .gradient {
  width: 100%; height: 100%;
  transition: transform 0.5s ease;
}
.project-card:hover .gradient { transform: scale(1.06); }
/* Live preview iframe – continuous live demo */
.project-preview {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  pointer-events: none;
  background: #0f172a;
}
.project-preview iframe {
  position: absolute;
  top: 0;
  left: 0;
  /* Base desktop size – actual scale is calculated by JS to perfectly fit the card width */
  width: 1280px;
  height: 900px;
  border: 0;
  transform: scale(0.25);
  transform-origin: top left;
  background: #f8fafc;
  opacity: 0.15;
  transition: opacity 0.45s ease;
  will-change: opacity, transform;
  pointer-events: none;
}
.project-preview iframe.is-loaded {
  opacity: 1;
}

/* Static image preview (uploaded screenshot) */
.project-preview--image {
  pointer-events: none;
}
.project-preview--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.5s ease;
}
.project-card:hover .project-preview--image img {
  transform: scale(1.05);
}
.project-card:hover .project-preview {
  /* keep pointer-events none so the overlay + card link work cleanly */
  pointer-events: none;
}
/* soft loading shimmer while iframe is preparing */
.preview-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    #0f172a 0%,
    #1e293b 40%,
    #334155 50%,
    #1e293b 60%,
    #0f172a 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.preview-shimmer.hidden {
  opacity: 0;
  visibility: hidden;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Hover overlay – professional "view site" button */
.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 4;
  pointer-events: none;
}
.project-card:hover .project-overlay {
  opacity: 1;
}
.project-overlay span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent);
  color: #0F172A;
  padding: 0.7rem 1.55rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.45);
  transform: translateY(14px) scale(0.92);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.project-card:hover .project-overlay span {
  transform: translateY(0) scale(1);
}
.project-overlay span svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.project-info { padding: 1.25rem 1.5rem; }
.project-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  margin-bottom: 0.5rem;
}
.project-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ---
   9. About
--- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}
.about-visual {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  aspect-ratio: 1;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary) 20%, transparent),
    color-mix(in srgb, var(--accent) 25%, transparent));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  position: relative;
  overflow: hidden;
}
.about-visual::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 2px dashed color-mix(in srgb, var(--text) 20%, transparent);
  border-radius: calc(var(--radius) - 8px);
}
.about-text h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1.05rem;
}
.about-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}
.stat-item strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}
.stat-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---
   10. Contact + Form + Toast
--- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
.contact-info h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.contact-info p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.contact-links a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 500;
  transition: color var(--transition);
}
.contact-links a:hover { color: var(--primary); }
.contact-links svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.contact-form {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.form-group textarea {
  min-height: 130px;
  resize: vertical;
}
.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.35rem;
  display: none;
}
.form-group.has-error input,
.form-group.has-error textarea {
  border-color: var(--danger);
}
.form-group.has-error .form-error { display: block; }
.form-submit { width: 100%; }
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary);
  color: #fff;
  padding: 1rem 1.75rem;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 90vw;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error { background: var(--danger); }

/* ---
   11. Footer & Back-to-Top
--- */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  text-align: center;
}
.footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 900;
}
[dir="rtl"] .back-to-top {
  right: auto;
  left: 1.5rem;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
}
.back-to-top svg { width: 20px; height: 20px; }

/* ---
   12. Pricing
--- */
.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}
.pricing-toggle span {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.pricing-toggle span.active { color: var(--primary); }
.toggle-switch {
  width: 56px;
  height: 30px;
  background: var(--border);
  border-radius: 50px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
  direction: ltr;
  flex-shrink: 0;
  border: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.toggle-switch.active { background: var(--primary); }
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--transition);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  pointer-events: none;
}
.toggle-switch.active::after { transform: translateX(26px); }
.pricing-toggle { direction: ltr; }
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  max-width: 1100px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem 1.75rem;
  position: relative;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.pricing-card:hover {
  box-shadow: var(--shadow-lg);
}
.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent);
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0F172A;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 1rem;
  border-radius: 50px;
}
.pricing-card h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-align: center;
}
.pricing-price {
  text-align: center;
  margin: 1.25rem 0;
}
.pricing-price .amount {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.pricing-price .period {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.pricing-features {
  list-style: none;
  margin: 1.5rem 0 2rem;
  flex: 1;
}
.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.pricing-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}
.pricing-card .btn { width: 100%; }

/* ---
   13. Blog
--- */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}
.blog-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.blog-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.blog-card-body { padding: 1.5rem; }
.blog-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  display: flex;
  gap: 1rem;
}
.blog-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.35;
}
.blog-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.blog-read {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
}
.blog-post {
  max-width: 760px;
  margin: 0 auto;
}
.blog-post-header { margin-bottom: 2.5rem; }
.blog-post-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
}
.blog-post-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.blog-post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}
.blog-post-content p { margin-bottom: 1.25rem; }
.blog-post-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
}
.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 2rem;
  cursor: pointer;
}

/* ---
   14. INFINITE TESTIMONIALS MARQUEE (completely rebuilt)
--- */
.testimonials-section {
  padding: 5rem 0;
  overflow: hidden;
}
.testimonials-marquee {
  width: 100%;
  overflow: hidden;
  /* Soft edge fade for premium feel */
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
}
.testimonials-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  /* Continuous smooth scroll – right → left */
  animation: marquee-scroll 45s linear infinite;
}
.testimonials-track:hover {
  animation-play-state: paused;
}

/* Reverse direction for RTL so it still feels natural */
[dir="rtl"] .testimonials-track {
  animation-name: marquee-scroll-rtl;
}

@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes marquee-scroll-rtl {
  0%   { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

.testimonial-card {
  flex-shrink: 0;
  width: min(380px, 85vw);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.testimonial-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}
.testimonial-quote {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 1.4rem;
  font-style: italic;
  min-height: 4.8em;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.testimonial-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.testimonial-info strong {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
}
.testimonial-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---
   15. FAQ Accordion
--- */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
}
.faq-item {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.faq-item.active { box-shadow: var(--shadow); }
.faq-question {
  width: 100%;
  padding: 1.15rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: none;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
}
[dir="rtl"] .faq-question { text-align: right; }
.faq-icon {
  width: 24px; height: 24px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--primary);
}
.faq-item.active .faq-icon { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 1.35rem 1.25rem;
}
.faq-answer p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---
   16. Process — Premium Graphical Animations
--- */
.process-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.75rem;
  max-width: 980px;
  margin: 0 auto;
  align-items: center;
}
@media (min-width: 900px) {
  .process-wrapper {
    grid-template-columns: 380px 1fr;
    gap: 3.25rem;
  }
}

.process-stage {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1;
  margin: 0 auto;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.process-anim {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: 32px;
}
.process-anim.is-active {
  opacity: 1;
  pointer-events: auto;
}
.process-svg {
  width: 82%;
  height: 82%;
  color: var(--primary);
}
.process-anim-label {
  position: absolute;
  bottom: 38px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  opacity: 0.9;
}
.process-progress {
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 5;
}
.pp-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.4s ease;
}
.pp-dot.is-active {
  background: var(--primary);
  transform: scale(1.4);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.process-svg * { stroke: currentColor; fill: none; }

/* ========== STEP 1: Listening (stable group-based rings) ========== */
.s1-glow {
  animation: s1-breathe 4s ease-in-out infinite;
}
.s1-ring {
  /* groups already translated to 100,100 — scale from origin */
  transform-origin: 0 0;
  opacity: 0;
}
.process-anim.is-active .s1-ring-1 {
  animation: s1-ring-expand 3.2s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
}
.process-anim.is-active .s1-ring-2 {
  animation: s1-ring-expand 3.2s cubic-bezier(0.25, 0.1, 0.25, 1) 1.05s infinite;
}
.process-anim.is-active .s1-ring-3 {
  animation: s1-ring-expand 3.2s cubic-bezier(0.25, 0.1, 0.25, 1) 2.1s infinite;
}
.s1-ring circle {
  stroke-width: 1.5;
  fill: none;
}
.s1-head {
  stroke-width: 1.8;
  fill: color-mix(in srgb, var(--primary) 14%, transparent);
  animation: s1-head-soft 3.5s ease-in-out infinite;
}
.s1-body {
  stroke-width: 1.5;
  fill: color-mix(in srgb, var(--primary) 8%, transparent);
  opacity: 0.9;
}
.s1-eq-bar {
  stroke: none;
  fill: currentColor;
  opacity: 0.45;
  transform-origin: center center;
  transform-box: fill-box;
}
.process-anim.is-active .s1-eq-b1 { animation: s1-eq 1.5s ease-in-out infinite; }
.process-anim.is-active .s1-eq-b2 { animation: s1-eq 1.5s ease-in-out 0.2s infinite; }
.process-anim.is-active .s1-eq-b3 { animation: s1-eq 1.5s ease-in-out 0.4s infinite; }
.process-anim.is-active .s1-eq-b4 { animation: s1-eq 1.5s ease-in-out 0.15s infinite; }
.process-anim.is-active .s1-eq-b5 { animation: s1-eq 1.5s ease-in-out 0.35s infinite; }
.process-anim.is-active .s1-eq-b6 { animation: s1-eq 1.5s ease-in-out 0.5s infinite; }
.s1-arc {
  stroke-width: 1.6;
  opacity: 0.35;
  stroke-linecap: round;
}
.process-anim.is-active .s1-arc {
  animation: s1-arc-pulse 2.5s ease-in-out infinite;
}

@keyframes s1-breathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@keyframes s1-ring-expand {
  0%   { transform: scale(0.2); opacity: 0; }
  12%  { opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 0; }
}
@keyframes s1-head-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}
@keyframes s1-eq {
  0%, 100% { transform: scaleY(0.55); opacity: 0.35; }
  50% { transform: scaleY(1.1); opacity: 0.85; }
}
@keyframes s1-arc-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.55; }
}

/* ========== STEP 2: Prototype ========== */
.pa-float {
  stroke-width: 1.3;
  fill: color-mix(in srgb, var(--primary) 10%, transparent);
  opacity: 0;
}
.process-anim.is-active .pa-float-1 { animation: pa-float-in 0.6s ease 0.2s forwards, pa-float-bob 3s ease-in-out 0.8s infinite; }
.process-anim.is-active .pa-float-2 { animation: pa-float-in 0.6s ease 0.35s forwards, pa-float-bob 3.2s ease-in-out 1s infinite; }
.process-anim.is-active .pa-float-3 { animation: pa-float-in 0.6s ease 0.5s forwards, pa-float-bob 2.8s ease-in-out 1.2s infinite; }
.pa-frame {
  stroke-width: 1.8;
  stroke-dasharray: 480;
  stroke-dashoffset: 480;
}
.process-anim.is-active .pa-frame {
  animation: pa-draw 1.4s cubic-bezier(0.4,0,0.2,1) 0.15s forwards;
}
.pa-chrome {
  stroke-width: 0; fill: color-mix(in srgb, var(--primary) 8%, transparent);
  opacity: 0;
}
.pa-chrome-fill {
  stroke: none; fill: color-mix(in srgb, var(--primary) 6%, transparent);
  opacity: 0;
}
.process-anim.is-active .pa-chrome,
.process-anim.is-active .pa-chrome-fill {
  animation: pa-fade-in 0.4s ease 0.9s forwards;
}
.pa-dot { stroke: none; opacity: 0; }
.pa-dot-r { fill: #f87171; }
.pa-dot-y { fill: #fbbf24; }
.pa-dot-g { fill: #34d399; }
.process-anim.is-active .pa-dot {
  animation: pa-fade-in 0.35s ease 1.05s forwards;
}
.pa-block {
  stroke: none;
  fill: color-mix(in srgb, var(--primary) 18%, transparent);
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
}
.process-anim.is-active .pa-block-1 { animation: pa-block-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) 1.15s forwards; }
.process-anim.is-active .pa-block-2 { animation: pa-block-pop 0.45s cubic-bezier(0.34,1.56,0.64,1) 1.4s forwards; }
.process-anim.is-active .pa-block-3 { animation: pa-block-pop 0.45s cubic-bezier(0.34,1.56,0.64,1) 1.55s forwards; }
.process-anim.is-active .pa-block-4 { animation: pa-block-pop 0.45s cubic-bezier(0.34,1.56,0.64,1) 1.7s forwards; }
.pa-check-bg {
  stroke: none;
  fill: color-mix(in srgb, var(--primary) 20%, transparent);
  opacity: 0;
  transform-origin: center; transform-box: fill-box;
}
.process-anim.is-active .pa-check-bg {
  animation: pa-block-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) 2.0s forwards;
}
.pa-check {
  stroke-width: 2.4;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  opacity: 0;
}
.process-anim.is-active .pa-check {
  animation: pa-check-draw 0.5s cubic-bezier(0.4,0,0.2,1) 2.15s forwards;
}

@keyframes pa-draw { to { stroke-dashoffset: 0; } }
@keyframes pa-fade-in { to { opacity: 1; } }
@keyframes pa-float-in {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 0.6; transform: scale(1); }
}
@keyframes pa-float-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes pa-block-pop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pa-check-draw {
  to { stroke-dashoffset: 0; opacity: 1; }
}

/* ========== STEP 3: Development (structure + code) ========== */
.s3-grid circle { stroke: none; }
.s3-layer {
  stroke-width: 1.5;
  opacity: 0;
  transform-origin: center bottom;
  transform-box: fill-box;
}
.process-anim.is-active .s3-layer-0 {
  animation: s3-layer-up 0.5s cubic-bezier(0.34,1.4,0.64,1) 0.15s forwards;
}
.process-anim.is-active .s3-layer-1 {
  animation: s3-layer-up 0.5s cubic-bezier(0.34,1.4,0.64,1) 0.45s forwards;
}
.process-anim.is-active .s3-layer-2 {
  animation: s3-layer-up 0.5s cubic-bezier(0.34,1.4,0.64,1) 0.75s forwards;
}
.process-anim.is-active .s3-layer-3 {
  animation: s3-layer-up 0.5s cubic-bezier(0.34,1.4,0.64,1) 1.05s forwards;
}
.s3-conn {
  stroke-width: 1.4;
  opacity: 0;
  stroke-dasharray: 12;
  stroke-dashoffset: 12;
}
.process-anim.is-active .s3-conn-0 { animation: s3-conn-draw 0.3s ease 0.4s forwards; }
.process-anim.is-active .s3-conn-1 { animation: s3-conn-draw 0.3s ease 0.7s forwards; }
.process-anim.is-active .s3-conn-2 { animation: s3-conn-draw 0.3s ease 1.0s forwards; }
.s3-panel {
  stroke-width: 1.5;
  fill: color-mix(in srgb, var(--primary) 5%, transparent);
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
}
.process-anim.is-active .s3-panel {
  animation: pa-draw 1.0s cubic-bezier(0.4,0,0.2,1) 0.5s forwards;
}
.s3-line {
  stroke: none;
  fill: currentColor;
  opacity: 0;
}
.process-anim.is-active .s3-line-1 { animation: s3-line-in 0.3s ease 1.2s forwards; }
.process-anim.is-active .s3-line-2 { animation: s3-line-in 0.3s ease 1.35s forwards; }
.process-anim.is-active .s3-line-3 { animation: s3-line-in 0.3s ease 1.5s forwards; }
.process-anim.is-active .s3-line-4 { animation: s3-line-in 0.3s ease 1.65s forwards; }
.process-anim.is-active .s3-line-5 { animation: s3-line-in 0.3s ease 1.8s forwards; }
.process-anim.is-active .s3-line-6 { animation: s3-line-in 0.3s ease 1.95s forwards; }
.s3-cursor {
  stroke: none;
  fill: currentColor;
  opacity: 0;
}
.process-anim.is-active .s3-cursor {
  animation: s3-cursor-blink 1.05s step-end 2.15s infinite;
}
.s3-bridge {
  stroke-width: 1.8;
  opacity: 0;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}
.process-anim.is-active .s3-bridge {
  animation: s3-conn-draw 0.4s ease 2.2s forwards;
}
.s3-bracket {
  stroke-width: 2.2;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  opacity: 0.55;
}
.process-anim.is-active .s3-br-l {
  animation: pa-draw 0.7s cubic-bezier(0.4,0,0.2,1) 0.2s forwards;
}
.process-anim.is-active .s3-br-r {
  animation: pa-draw 0.7s cubic-bezier(0.4,0,0.2,1) 0.35s forwards;
}

@keyframes s3-layer-up {
  from { opacity: 0; transform: translateY(12px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes s3-conn-draw {
  to { stroke-dashoffset: 0; opacity: 0.5; }
}
@keyframes s3-line-in {
  from { opacity: 0; transform: translateX(-5px); }
  to { opacity: 0.75; transform: translateX(0); }
}
@keyframes s3-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ========== STEP 4: Growth ========== */
.pa-grid-line {
  stroke-width: 0.8; opacity: 0.08;
}
.pa-area {
  stroke: none;
  fill: color-mix(in srgb, var(--primary) 8%, transparent);
  opacity: 0;
}
.process-anim.is-active .pa-area {
  animation: pa-fade-in 1.2s ease 0.8s forwards;
}
.pa-path {
  stroke-width: 2.4;
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
}
.process-anim.is-active .pa-path {
  animation: pa-draw 1.8s cubic-bezier(0.4,0,0.2,1) 0.2s forwards;
}
.pa-node-glow { opacity: 0; }
.pa-node {
  stroke-width: 1.6;
  fill: color-mix(in srgb, var(--primary) 30%, transparent);
  opacity: 0;
  transform-origin: center; transform-box: fill-box;
}
.process-anim.is-active .pa-ng-1 { animation: pa-fade-in 0.4s ease 0.35s forwards; }
.process-anim.is-active .pa-node-1 { animation: pa-node-pop 0.45s cubic-bezier(0.34,1.56,0.64,1) 0.35s forwards; }
.process-anim.is-active .pa-ng-2 { animation: pa-fade-in 0.4s ease 0.8s forwards; }
.process-anim.is-active .pa-node-2 { animation: pa-node-pop 0.45s cubic-bezier(0.34,1.56,0.64,1) 0.8s forwards; }
.process-anim.is-active .pa-ng-3 { animation: pa-fade-in 0.4s ease 1.25s forwards; }
.process-anim.is-active .pa-node-3 { animation: pa-node-pop 0.45s cubic-bezier(0.34,1.56,0.64,1) 1.25s forwards; }
.process-anim.is-active .pa-ng-4 { animation: pa-fade-in 0.4s ease 1.7s forwards; }
.process-anim.is-active .pa-node-4 { animation: pa-node-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) 1.7s forwards; }
.pa-particle {
  stroke: none; fill: currentColor; opacity: 0;
}
.process-anim.is-active .pa-p-1 { animation: pa-particle 2s ease-in-out 1.0s infinite; }
.process-anim.is-active .pa-p-2 { animation: pa-particle 2.2s ease-in-out 1.3s infinite; }
.process-anim.is-active .pa-p-3 { animation: pa-particle 1.8s ease-in-out 1.6s infinite; }
.process-anim.is-active .pa-p-4 { animation: pa-particle 2.4s ease-in-out 1.9s infinite; }
.pa-spark {
  stroke-width: 2; opacity: 0;
}
.process-anim.is-active .pa-spark {
  animation: pa-fade-in 0.45s ease 2.1s forwards;
}
.pa-orbit {
  stroke-width: 1; opacity: 0;
  transform-origin: center; transform-box: fill-box;
}
.process-anim.is-active .pa-orbit-1 {
  animation: pa-orbit-spin 3s linear 2.0s infinite;
}
.process-anim.is-active .pa-orbit-2 {
  animation: pa-orbit-spin 4s linear 2.0s infinite reverse;
}

@keyframes pa-node-pop {
  from { opacity: 0; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pa-particle {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 0.7; }
  100% { opacity: 0; transform: translateY(-18px); }
}
@keyframes pa-orbit-spin {
  from { opacity: 0.25; transform: rotate(0deg) scale(1); }
  50% { opacity: 0.4; }
  to { opacity: 0.25; transform: rotate(360deg) scale(1); }
}

/* ===== Steps list ===== */
.process-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.process-step {
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.process-step::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.4s ease;
}
.process-step.is-active {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, var(--bg-alt));
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 12%, transparent);
  transform: translateY(-2px);
}
.process-step.is-active::before {
  background: var(--primary);
}
.process-step:hover:not(.is-active) {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.process-num {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
  flex-shrink: 0;
  transition: all 0.4s ease;
}
.process-step.is-active .process-num {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
}
.process-content h3 {
  font-size: 1.08rem; font-weight: 700;
  margin-bottom: 0.35rem;
  transition: color 0.3s ease;
}
.process-step.is-active .process-content h3 {
  color: var(--primary);
}
.process-content p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

@media (max-width: 899px) {
  .process-stage { max-width: 290px; }
}

/* ---
   17. Tech Stack
--- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}
.tech-item {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all var(--transition);
}
.tech-item:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.tech-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.tech-item span {
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---
   18. Auth Pages
--- */
.auth-wrapper {
  min-height: calc(100vh - var(--header-h) - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
}
.auth-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.5rem;
}
.auth-card .auth-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}
.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.auth-switch a {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}
.auth-switch a:hover { text-decoration: underline; }

/* ---
   19. Dashboard
--- */
.dashboard { padding: 2.5rem 0 4rem; }
.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.dashboard-header h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
}
.dashboard-welcome {
  color: var(--text-muted);
  font-size: 1rem;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.dash-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.dash-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.dash-stat {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  text-align: center;
}
.dash-stat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}
.dash-stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.project-list { display: flex; flex-direction: column; gap: 1rem; }
.project-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.project-item-info h4 {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.project-item-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Dashboard tabs */
.dash-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border, #e2e8f0);
  padding-bottom: .25rem;
}
.dash-tab {
  background: transparent;
  border: none;
  padding: .65rem 1.1rem;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all .15s;
  position: relative;
}
.dash-tab:hover { color: var(--text); background: color-mix(in srgb, var(--bg-alt) 80%, transparent); }
[data-theme="dark"] .dash-tab:hover { background: rgba(255,255,255,.06); }
.dash-tab.active {
  color: var(--accent, #F59E0B);
}
.dash-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent, #F59E0B);
  border-radius: 2px 2px 0 0;
}
.order-brief-intro {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, var(--bg-alt)), color-mix(in srgb, var(--accent) 10%, var(--bg-alt)));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.35rem;
}
.order-brief-intro strong {
  color: var(--text);
  font-size: 1.05rem;
  display: block;
}
.order-brief-intro p {
  margin: .45rem 0 0;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.order-files-box {
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 1rem;
}
.order-files-box label { font-weight: 700; color: var(--text); }
.order-files-guide {
  font-size: .85rem;
  color: var(--text-muted);
  margin: .4rem 0 .75rem;
  line-height: 1.6;
}
.form-hint {
  display: block;
  margin-top: .35rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.dash-panel { display: none; animation: fadeIn .25s ease; }
.dash-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Chat – matches site theme (light + dark) */
.chat-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  max-height: 520px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  background: var(--bg);
}
.chat-bubble {
  max-width: 80%;
  padding: .75rem 1.05rem;
  border-radius: 14px;
  font-size: .9rem;
  line-height: 1.55;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.chat-bubble.me {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-left-radius: 4px;
}
.chat-bubble.them {
  align-self: flex-start;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-right-radius: 4px;
}
.chat-bubble .time {
  font-size: .7rem;
  opacity: .65;
  margin-top: .3rem;
}
.chat-input-row {
  display: flex;
  gap: .5rem;
  padding: .9rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  align-items: flex-end;
}
.chat-input-row textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .65rem .9rem;
  font-family: inherit;
  font-size: .9rem;
  background: var(--bg);
  color: var(--text);
  min-height: 48px;
  line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.chat-input-row textarea::placeholder {
  color: var(--text-muted);
  opacity: .7;
}
.chat-input-row textarea:focus {
  outline: none;
  border-color: var(--accent, #F59E0B);
  box-shadow: 0 0 0 3px rgba(245,158,11,.18);
}
.chat-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
  font-size: .9rem;
}

/* Project card extras */
.project-item {
  flex-wrap: wrap;
}
.project-pay {
  width: 100%;
  margin-top: .6rem;
  padding-top: .6rem;
  border-top: 1px dashed var(--border, #e2e8f0);
}
.project-pay form {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.project-pay input[type="file"] { font-size: .8rem; max-width: 200px; }
.project-pay input[type="text"] { flex: 1; min-width: 140px; padding: .4rem .6rem; border-radius: 8px; border: 1px solid #cbd5e1; font-family: inherit; font-size: .85rem; }
.badge-pay {
  font-size: .72rem;
  padding: .2rem .55rem;
  border-radius: 50px;
  font-weight: 600;
}
.badge-unpaid { background: #fee2e2; color: #b91c1c; }
.badge-awaiting { background: #fef3c7; color: #92400e; }
.badge-paid { background: #d1fae5; color: #065f46; }

.progress-bar {
  width: 100%;
  max-width: 140px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.6s ease;
}
.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
}
.status-progress { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }
.status-review { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent-hover); }
.status-done { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.message-list { display: flex; flex-direction: column; gap: 0.85rem; }
.message-item {
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-inline-start: 3px solid var(--primary);
}
.message-item strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.message-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.message-item .msg-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  opacity: 0.8;
}

/* ---
   20. Responsive
--- */

/* Hover-only effects – disable lift on pure touch devices to avoid sticky hover */
@media (hover: hover) and (pointer: fine) {
  .project-card:hover,
  .service-card:hover,
  .pricing-card:hover {
    transform: translateY(-6px);
  }
}
@media (hover: none) {
  .project-card:hover,
  .service-card:hover,
  .pricing-card:hover {
    transform: none;
  }
}

@media (min-width: 640px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
  .tech-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-stat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 768px) {
  .nav { display: flex; }
  .hamburger { display: none; }
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
  }
  .hero-content { text-align: left; }
  [dir="rtl"] .hero-content { text-align: right; }
  .hero-title-wrapper { justify-content: flex-start; }
  [dir="rtl"] .hero-title-wrapper { justify-content: flex-end; }
  .hero-title { text-align: center; }
  [dir="rtl"] .hero-title { text-align: center; }
  [dir="rtl"] .hero-title-wrapper { justify-content: center; }
  [dir="rtl"] .hero-title-live { justify-content: center; }
  .hero-title::after { left: 0; transform: none; }
  [dir="rtl"] .hero-title::after { left: auto; right: 0; }
  .hero-sub { margin-left: 0; margin-right: 0; }
  .hero-ctas { justify-content: flex-start; }
  [dir="rtl"] .hero-ctas { justify-content: flex-end; }
  .about-grid { grid-template-columns: 0.9fr 1.1fr; }
  .contact-grid { grid-template-columns: 0.9fr 1.1fr; }
  /* process-grid stays single column for sequential focus */
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .services-grid { grid-template-columns: repeat(4, 1fr); }
  .portfolio-grid { grid-template-columns: repeat(4, 1fr); }
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-visual { height: 420px; }
  .hero-mark { width: 460px; height: 300px; }
  .tech-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ========== MOBILE FIRST POLISH (phones) ========== */
@media (max-width: 639px) {
  /* Base spacing & typography */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .section {
    padding: 3rem 0;
  }
  .section-title {
    font-size: clamp(1.45rem, 5.5vw, 1.85rem);
    margin-bottom: 0.6rem;
  }
  .section-subtitle {
    font-size: 0.95rem;
    margin-bottom: 2rem;
    padding: 0 0.25rem;
  }

  /* Header */
  .header {
    --header-h: 60px;
  }
  .header-inner {
    gap: 0.4rem;
  }
  .logo {
    font-size: 1.05rem;
  }
  .header-actions {
    gap: 0.35rem;
  }
  .icon-btn {
    width: 40px;
    height: 40px;
  }
  .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding: 1.75rem 0 2.25rem;
  }
  .hero-visual {
    height: 210px;
    margin-top: 0.35rem;
  }
  .hero-mark {
    width: min(280px, 85vw);
    height: min(195px, 55vw);
  }
  .hero-title {
    font-size: clamp(1.5rem, 6.2vw, 2rem);
  }
  .hero-title-wrapper {
    min-height: 3.6em;
  }
  .hero-sub {
    font-size: 0.95rem;
    margin-bottom: 1.35rem;
    line-height: 1.55;
  }
  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }
  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px; /* comfortable touch target */
  }
  .hero-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
  }

  /* Services */
  .services-grid {
    gap: 1rem;
  }
  .service-card {
    padding: 1.5rem 1.25rem;
  }
  .service-icon {
    width: 46px;
    height: 46px;
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }
  .service-card h3 {
    font-size: 1.1rem;
  }
  .service-card p {
    font-size: 0.9rem;
  }

  /* ========== PORTFOLIO (critical for mobile) ========== */
  .portfolio-grid {
    gap: 1.15rem;
  }
  .project-card {
    border-radius: 14px;
  }
  .project-img {
    height: 200px; /* slightly shorter on phone for better proportion */
  }
  .project-info {
    padding: 1rem 1.15rem 1.15rem;
  }
  .project-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    margin-bottom: 0.4rem;
  }
  .project-info h3 {
    font-size: 1.05rem;
    line-height: 1.35;
  }
  .project-info p {
    font-size: 0.78rem !important;
    line-height: 1.45 !important;
    margin-top: 0.3rem !important;
  }
  .project-overlay span {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
  }

  /* Process */
  .process-wrapper {
    gap: 1.75rem;
  }
  .process-stage {
    max-width: min(300px, 82vw);
    border-radius: 22px;
  }

  /* About */
  .about-grid {
    gap: 1.75rem;
  }
  .about-visual {
    max-width: 280px;
  }
  .about-stats {
    gap: 1rem;
  }
  .stat-item strong {
    font-size: 1.4rem;
  }

  /* Contact / Forms */
  .contact-grid {
    gap: 2rem;
  }
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px; /* prevents iOS zoom on focus */
    padding: 0.85rem 1rem;
    min-height: 48px;
  }
  .form-group textarea {
    min-height: 120px;
  }
  .form-submit {
    min-height: 50px;
    font-size: 1rem;
  }
  .contact-links a {
    padding: 0.6rem 0;
  }

  /* Pricing */
  .pricing-grid {
    gap: 1.15rem;
  }
  .pricing-card {
    padding: 1.5rem 1.25rem;
  }
  .pricing-price .amount {
    font-size: 1.75rem;
  }
  .pricing-features li {
    font-size: 0.88rem;
    padding: 0.4rem 0;
  }
  .pricing-toggle {
    gap: 0.75rem;
    margin-bottom: 2rem;
  }

  /* Blog */
  .blog-grid {
    gap: 1.15rem;
  }
  .blog-card-body {
    padding: 1.1rem 1.15rem;
  }

  /* Footer & utilities */
  .footer {
    padding: 1.1rem 0;
  }
  .footer p {
    font-size: 0.82rem;
    padding: 0 0.5rem;
  }
  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    right: 1.1rem;
  }
  [dir="rtl"] .back-to-top {
    right: auto;
    left: 1.1rem;
  }

  /* Mobile menu polish */
  .mobile-menu {
    width: min(300px, 88vw);
    padding: 4.5rem 1.25rem 2rem;
  }
  .mobile-menu a {
    padding: 0.95rem 0.9rem;
    font-size: 1rem;
    border-radius: 10px;
  }
}

/* Very small phones */
@media (max-width: 480px) {
  .container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .section {
    padding: 2.5rem 0;
  }
  .project-img {
    height: 185px;
  }
  .project-info {
    padding: 0.9rem 1rem 1rem;
  }
  .project-info h3 {
    font-size: 1rem;
  }
  .service-card {
    padding: 1.35rem 1.1rem;
  }
  .pricing-card {
    padding: 1.35rem 1.1rem;
  }
  .hero-ctas .btn {
    font-size: 0.92rem;
  }
}

@media (max-width: 380px) {
  .hero-visual { height: 175px; }
  .hero-mark {
    width: min(240px, 90vw);
    height: min(160px, 50vw);
  }
  .hero-badge { font-size: 0.72rem; padding: 0.28rem 0.7rem; }
  .logo { font-size: 0.95rem; }
  .project-img { height: 170px; }
  .section-title {
    font-size: 1.35rem;
  }
}

/* ============================================================
   Extra mobile safety – Senior polish pass
   ============================================================ */
html {
  overflow-x: hidden;
  max-width: 100vw;
}
body {
  overflow-x: hidden;
  max-width: 100vw;
}

@media (max-width: 767px) {
  /* Auth cards full width with breathing room */
  .auth-wrapper {
    padding: 1rem 0.85rem 2rem !important;
  }
  .auth-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.5rem 1.15rem !important;
    border-radius: 16px !important;
  }
  .auth-card h2 {
    font-size: 1.3rem !important;
  }
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px !important; /* iOS no-zoom */
    min-height: 48px;
  }
  .form-submit,
  .auth-card .btn {
    min-height: 48px;
    width: 100%;
  }

  /* Order form inside SPA */
  #page-dashboard .container,
  .dashboard .container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  /* Prevent tables from breaking layout */
  table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .header-actions .btn-sm,
  .header-actions .btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
  }
  .user-avatar {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.75rem !important;
  }
}
