/* ===== QTrend for Advertising – Professional styles ===== */
:root {
  /* Brand: electric purple, black, white (aligned with QTrend marketing assets) */
  --purple: #7B2CBF;
  --purple-dark: #5B21B6;
  --purple-deep: #3B0764;
  --purple-light: #9D4EDD;
  --purple-muted: #A78BFA;
  --purple-soft: #EDE9FE;
  --purple-glow: rgba(123, 44, 191, 0.45);

  /* Semantic tokens (legacy names kept so existing rules stay valid) */
  --maroon: var(--purple);
  --maroon-dark: var(--purple-dark);
  --maroon-light: var(--purple-light);
  --gold: #C4B5FD;
  --gold-light: #E9D5FF;
  --teal: var(--purple);
  --teal-light: var(--purple-light);
  --coral: var(--purple-muted);
  --coral-light: var(--gold-light);
  --indigo: var(--purple);
  --indigo-light: var(--purple-muted);
  --emerald: var(--purple);

  --cream: #FAF8FF;
  --cream-dark: #EDE9FE;
  --charcoal: #0F0F12;
  --gray: #52525B;
  --gray-light: #A1A1AA;
  --white: #FFFFFF;
  /* Surfaces (cards, modals) — separate from --white text on brand/hero */
  --card: #FFFFFF;
  --card-hover-tint: rgba(237, 233, 254, 0.85);
  --glass: rgba(255, 255, 255, 0.84);
  --glass-border: rgba(0, 0, 0, 0.06);
  --metric-tile: rgba(248, 246, 243, 0.9);

  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1);
  --shadow-colored: 0 12px 40px rgba(91, 33, 182, 0.22);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark theme overrides */
:root[data-theme="dark"] {
  --cream: #0c0a12;
  --cream-dark: #252030;
  --charcoal: #F4F4F5;
  --gray: #A1A1AA;
  --gray-light: #D4D4D8;
  /* Keep true white for text on gradients, hero, buttons */
  --white: #FFFFFF;
  --card: #16131f;
  --card-hover-tint: rgba(123, 44, 191, 0.12);
  --glass: rgba(22, 19, 31, 0.92);
  --glass-border: rgba(167, 139, 250, 0.12);
  --metric-tile: rgba(30, 24, 42, 0.95);
  --purple-soft: #1E1033;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Reduce bandwidth and motion-heavy backgrounds */
  .hero-video,
  .service-videos video {
    display: none !important;
  }
  .hero--blog .blog-hero-slide {
    animation: none !important;
    opacity: 0;
  }
  .hero--blog .blog-hero-slide-1 {
    opacity: 1;
  }
  .hero--contact .contact-hero-slide {
    animation: none !important;
    opacity: 0;
    transform: none !important;
  }
  .hero--contact .contact-hero-slide-1 {
    opacity: 1;
  }
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--charcoal);
  background: linear-gradient(165deg, #f8f5ff 0%, #fafafa 42%, #ede9fe 100%);
  background-attachment: scroll;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html,
body {
  width: 100%;
}
html[data-theme="dark"] body {
  background: radial-gradient(ellipse 120% 80% at 50% 0%, #1a0a2e 0%, #050508 55%, #000000 100%);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(250, 248, 255, 0.94) 0%, rgba(237, 233, 254, 0.9) 45%, rgba(250, 250, 250, 0.95) 100%);
  pointer-events: none;
  z-index: 0;
}
html[data-theme="dark"] body::before {
  background: linear-gradient(180deg, rgba(12, 10, 18, 0.85) 0%, rgba(5, 5, 8, 0.92) 100%);
}
body > * {
  position: relative;
  z-index: 1;
}

/* Improve initial render by skipping offscreen layout/paint */
main > section,
footer {
  content-visibility: auto;
  contain-intrinsic-size: 900px;
}
/* Arabic / RTL: use font that supports Arabic */
[dir="rtl"] body {
  font-family: 'Tajawal', 'Plus Jakarta Sans', system-ui, sans-serif;
}
[dir="rtl"] .logo,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 {
  font-family: 'Tajawal', 'Outfit', sans-serif;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}
video,
iframe,
canvas,
svg {
  max-width: 100%;
}

a {
  color: var(--maroon);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--maroon-dark);
}

.phone-inline {
  unicode-bidi: isolate;
}
.phone-inline--ltr {
  direction: ltr;
}
.phone-inline--rtl {
  direction: rtl;
  unicode-bidi: isolate-override;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, var(--space-lg));
}

/* ===== Header ===== */
.header {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  border-radius: 999px;
  border: 1px solid rgba(123, 44, 191, 0.12);
  box-shadow: 0 16px 40px rgba(15, 15, 18, 0.08);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
html[data-theme="dark"] .header {
  background: rgba(18, 12, 28, 0.92);
  border-color: rgba(167, 139, 250, 0.2);
}
.header.scrolled {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  height: auto;
  padding: 0.75rem 1.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--charcoal);
  text-decoration: none;
}
.logo:hover {
  color: var(--charcoal);
}
.logo-mark {
  height: 42px;
  width: auto;
  display: block;
}
.logo-text-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.logo-wordmark {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-light), var(--purple-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-tagline {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--gray);
}
[dir="rtl"] .logo-text-group {
  align-items: flex-end;
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-lg);
}
.nav a {
  color: var(--charcoal);
  font-family: 'Outfit', var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 0.2rem 0;
  transition: color var(--transition), transform 0.18s ease, text-shadow 0.18s ease;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--purple-light));
  border-radius: var(--radius-full);
  transition: width var(--transition);
}
.nav a:hover::after {
  width: 100%;
}
.nav a:hover {
  color: var(--maroon);
  transform: translateY(-1px);
  text-shadow: 0 0 18px rgba(123, 44, 191, 0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.theme-switch {
  padding: 0.4rem 0.6rem;
  font-family: 'Tajawal', var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(15, 23, 42, 0.03);
  color: var(--gray);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform 0.15s ease;
}
.theme-switch:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--charcoal);
  transform: translateY(-1px);
}
html[data-theme="dark"] .theme-switch {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.5);
  color: #E5E7EB;
}
.header-cta {
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(123, 44, 191, 0.35);
  background: rgba(123, 44, 191, 0.08);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Tajawal', var(--font-body);
  color: var(--maroon);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.15s ease;
}
.header-cta:hover {
  background: rgba(123, 44, 191, 0.16);
  border-color: var(--maroon);
  transform: translateY(-1px);
}
.lang-switch {
  padding: 0.4rem 0.75rem;
  font-family: 'Tajawal', var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--maroon);
  background: rgba(123, 44, 191, 0.1);
  border: 1px solid rgba(123, 44, 191, 0.28);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.lang-switch:hover {
  background: rgba(123, 44, 191, 0.18);
  border-color: var(--maroon);
}
[dir="ltr"] .header-actions {
  order: 1;
}
[dir="rtl"] .header-inner .nav {
  order: 2;
}
[dir="rtl"] .header-actions {
  order: 3;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--charcoal);
  border-radius: var(--radius-full);
}

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 150;
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--card);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--cream-dark);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
  }
  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav ul {
    flex-direction: column;
    gap: var(--space-sm);
  }
  .nav-toggle {
    display: flex;
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transform-origin: center;
  transition: background var(--transition), color var(--transition), transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px) scale(1.02);
}
.btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16) !important;
}
.btn-primary {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-light));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(91, 33, 182, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--maroon-dark), var(--maroon));
  color: var(--white);
  box-shadow: 0 8px 24px rgba(91, 33, 182, 0.45);
}
.btn-secondary {
  background: transparent;
  color: var(--maroon);
  border: 2px solid var(--maroon);
}
.btn-secondary:hover {
  background: var(--maroon);
  color: var(--white);
}
.btn-full {
  width: 100%;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  align-items: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 64px + var(--space-2xl))
    clamp(1rem, 4vw, var(--space-lg))
    calc(env(safe-area-inset-bottom, 0px) + var(--space-2xl));
  opacity: 0;
  transform: translateY(12px);
  animation: pageFadeIn 0.7s var(--ease-out-expo) 0.05s forwards;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
/* Inner pages: hero art is often a full graphic with text — show whole image (no heavy crop) */
.hero--subpage .hero-bg {
  background: linear-gradient(160deg, #0a0612 0%, #1a0a2e 50%, #0f0a18 100%);
}
.hero--subpage .hero-bg img {
  object-fit: contain;
  object-position: center center;
}
/* Services page hero uses uploaded poster artwork; force full image visibility. */
#services-hero .hero-bg img {
  object-fit: cover;
  object-position: center center;
}
/* About page hero should fill edge-to-edge. */
#about-hero .hero-bg img {
  object-fit: cover;
  object-position: center center;
}
/* Work page hero should fill edge-to-edge. */
#work-hero .hero-bg img {
  object-fit: cover;
  object-position: 20% 58%;
}
/* Contact page hero should show the full image. */
#contact-hero .hero-bg img {
  object-fit: cover;
  object-position: center 62%;
}
.hero--contact .contact-hero-slide {
  opacity: 0;
  transform: translateX(12%) scale(1.03);
  animation: contactHeroSlideCycle 18s infinite ease-in-out;
}
.hero--contact .contact-hero-slide-1 {
  animation-delay: 0s;
}
.hero--contact .contact-hero-slide-2 {
  animation-delay: 6s;
}
.hero--contact .contact-hero-slide-3 {
  animation-delay: 12s;
}
/* Blog hero uses full-bleed artwork */
.hero--blog .hero-bg img {
  object-fit: cover;
}
.hero--blog .blog-hero-slide {
  opacity: 0;
  animation: blogHeroCycle 18s infinite ease-in-out;
}
.hero--blog .blog-hero-slide-1 {
  animation-delay: 0s;
}
.hero--blog .blog-hero-slide-2 {
  animation-delay: 6s;
}
.hero--blog .blog-hero-slide-3 {
  animation-delay: 12s;
}
.hero-bg img,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-video {
  filter: brightness(0.85);
  opacity: 0;
  animation: heroVideoCycle 16s infinite ease-in-out;
}
.hero-video-1 {
  animation-delay: 0s;
}
.hero-video-2 {
  animation-delay: 8s;
}

/* Mobile performance: one hero video is enough */
@media (max-width: 768px) {
  .hero-video-2 {
    display: none;
  }
  /* Also avoid loading extra looping videos on mobile */
  .service-video-card video {
    display: none;
  }
}

@keyframes heroVideoCycle {
  0%   { opacity: 1; }
  40%  { opacity: 1; }
  50%  { opacity: 0; }
  90%  { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes blogHeroCycle {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  28%  { opacity: 1; }
  36%  { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes contactHeroSlideCycle {
  0%   { opacity: 0; transform: translateX(12%) scale(1.03); }
  10%  { opacity: 1; transform: translateX(0) scale(1); }
  30%  { opacity: 1; transform: translateX(-3%) scale(1.01); }
  40%  { opacity: 0; transform: translateX(-10%) scale(1.02); }
  100% { opacity: 0; transform: translateX(-10%) scale(1.02); }
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 7, 100, 0.92) 0%, rgba(91, 33, 182, 0.55) 45%, rgba(10, 10, 12, 0.88) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: var(--white);
  max-width: 640px;
}
.hero-content .hero-badge {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.1s both;
}
.hero-content h1 {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.25s both;
}
.hero-content .hero-lead {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.4s both;
}
.hero-content .hero-cta {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.55s both;
}
.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(167, 139, 250, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: var(--space-md);
  letter-spacing: 0.02em;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-md);
}
.hero h1 em {
  background: linear-gradient(135deg, var(--gold-light), var(--purple-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: normal;
}
.hero-lead {
  font-size: 1.15rem;
  opacity: 0.95;
  margin: 0 0 var(--space-xl);
  max-width: 520px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.hero-cta .btn-primary {
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  color: var(--white);
  box-shadow: 0 4px 24px rgba(91, 33, 182, 0.45);
}
.hero-cta .btn-primary:hover {
  background: linear-gradient(135deg, var(--purple-muted), var(--purple-light));
  color: var(--white);
  box-shadow: 0 8px 32px rgba(123, 44, 191, 0.5);
  transform: translateY(-2px);
}
.hero-cta .btn-secondary {
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--white);
}
.hero-cta .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.hero-scroll {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(233, 213, 255, 0.95), transparent);
  border-radius: var(--radius-full);
  animation: scrollPulse 2s ease-in-out infinite;
}
/* Soft section separator band */
.section-divider {
  position: relative;
  height: 56px;
  margin: -24px 0;
  overflow: hidden;
}
.section-divider::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(123, 44, 191, 0.1), transparent 60%),
    radial-gradient(900px 260px at 10% 0%, rgba(167, 139, 250, 0.14), transparent 70%),
    radial-gradient(900px 260px at 90% 100%, rgba(91, 33, 182, 0.12), transparent 70%),
    linear-gradient(to right, rgba(250, 248, 255, 0.96), rgba(237, 233, 254, 0.96));
  transform: skewY(-3deg);
  transform-origin: center;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0.5; transform: scaleY(0.6); }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Scroll reveal (animations run when .in-view is added by JS) ===== */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ===== Section common ===== */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
}
.section-badge {
  display: inline-block;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--maroon), var(--indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--charcoal);
  margin: 0 0 var(--space-sm);
}
.section-lead {
  color: var(--gray);
  margin: 0;
  font-size: 1.05rem;
}

/* ===== Service Videos (home) ===== */
.service-videos {
  padding: var(--space-3xl) 0 var(--space-xl);
}
.service-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--space-lg);
}
.service-video-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.service-video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.service-video-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--space-md);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: var(--white);
}
.service-video-caption h3 {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 1rem;
}
.service-video-caption p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.95;
}

/* ===== Services ===== */
.services {
  padding: var(--space-3xl) 0;
  background: linear-gradient(145deg, rgba(250, 248, 255, 0.99) 0%, rgba(237, 233, 254, 0.96) 50%, rgba(245, 243, 255, 0.99) 100%);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-lg);
}
.service-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--purple);
  transform-origin: center;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition), background 0.4s var(--ease-out-expo);
}
.service-card:hover {
  box-shadow: 0 20px 48px rgba(123, 44, 191, 0.22);
  transform: translateY(-8px) scale(1.01);
  background: radial-gradient(circle at top left, var(--card-hover-tint), transparent 55%), var(--card);
}
.service-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
/* Promo artwork: dark frame behind image (image fills frame with cover) */
.service-image--promo {
  background: linear-gradient(160deg, #0a0612 0%, #1a0a2e 50%, #0f0a18 100%);
}
.service-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s var(--ease-out-expo);
}
.service-image--promo img {
  object-fit: cover;
}
/* Stock photos: full-bleed cover + purple/black tint to match QTrend palette */
.service-image--stock {
  background: #0a0612;
}
.service-image--stock::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    145deg,
    rgba(91, 33, 182, 0.38) 0%,
    rgba(10, 6, 18, 0.15) 42%,
    rgba(0, 0, 0, 0.5) 100%
  );
}
.service-image--stock img {
  z-index: 0;
  filter: saturate(0.88) contrast(1.08) brightness(0.95);
}
.service-card:hover .service-image img {
  transform: scale(1.08);
}
.service-body {
  padding: var(--space-lg);
}
.service-body h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--charcoal);
  margin: 0 0 var(--space-xs);
  transition: color var(--transition);
}
.service-card:hover .service-body h3 { color: var(--purple); }
.service-body p {
  color: var(--gray);
  margin: 0;
  font-size: 0.95rem;
}

/* ===== Marquee ===== */
.marquee {
  padding: var(--space-md) 0;
  background: linear-gradient(90deg, var(--purple-deep) 0%, var(--purple) 45%, var(--purple-light) 100%);
  background-size: 200% 100%;
  animation: marqueeBg 8s ease-in-out infinite alternate;
  color: var(--white);
  overflow: hidden;
}
@keyframes marqueeBg {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.marquee-track {
  display: flex;
  gap: var(--space-xl);
  animation: marquee 25s linear infinite;
  white-space: nowrap;
}
.marquee-track span {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
  opacity: 0.95;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== About ===== */
.about {
  padding: var(--space-3xl) 0;
  background: linear-gradient(125deg, rgba(250, 248, 255, 0.98) 0%, rgba(237, 233, 254, 0.94) 55%, rgba(245, 243, 255, 0.98) 100%);
}
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}
.about-media {
  position: relative;
}
.about-media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: transform 0.6s var(--ease-out-expo);
}
.about:hover .about-media img {
  transform: scale(1.02);
}
.about-accent {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 60%;
  height: 60%;
  background: linear-gradient(135deg, var(--purple), var(--purple-muted));
  opacity: 0.22;
  border-radius: var(--radius-lg);
  z-index: -1;
  transition: transform 0.5s var(--ease-out-expo);
}
.about:hover .about-accent {
  transform: scale(1.05);
}
.about-content .section-badge {
  margin-bottom: var(--space-sm);
}
.about-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--charcoal);
  margin: 0 0 var(--space-md);
}
.about-content p {
  color: var(--gray);
  margin: 0 0 var(--space-md);
}
.about-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-lg);
}
.about-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: var(--space-xs);
  color: var(--charcoal);
}
.about-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  border-radius: 50%;
  transition: transform var(--transition);
}
.about-list li:hover::before {
  transform: scale(1.3);
}
@media (max-width: 900px) {
  .about-inner {
    grid-template-columns: 1fr;
  }
  .about-media {
    order: -1;
  }
}

/* ===== Why QTrend band ===== */
.why {
  padding: var(--space-3xl) 0;
  background: linear-gradient(135deg, rgba(245, 243, 255, 0.95) 0%, rgba(237, 233, 254, 0.92) 100%);
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
}
.why-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(123, 44, 191, 0.1);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.why-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 var(--space-xs);
}
.why-card p {
  margin: 0;
  color: var(--gray);
  font-size: 0.95rem;
}
.why-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  border-color: rgba(123, 44, 191, 0.35);
}

/* ===== Work ===== */
.work {
  padding: var(--space-3xl) 0;
  background: linear-gradient(160deg, rgba(245, 243, 255, 0.98) 0%, rgba(237, 233, 254, 0.95) 55%, rgba(250, 248, 255, 0.98) 100%);
}
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}
.work-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition), transform var(--transition);
}
.work-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.15);
}
.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out-expo);
}
.work-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-lg);
  color: var(--white);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out-expo);
}
.work-card:nth-child(1) .work-card-overlay {
  background: linear-gradient(to top, rgba(59, 7, 100, 0.94), transparent 60%);
}
.work-card:nth-child(2) .work-card-overlay {
  background: linear-gradient(to top, rgba(91, 33, 182, 0.92), transparent 60%);
}
.work-card:nth-child(3) .work-card-overlay {
  background: linear-gradient(to top, rgba(123, 44, 191, 0.9), transparent 60%);
}
.work-card:hover .work-card-overlay,
.work-card:focus-within .work-card-overlay {
  opacity: 1;
}
.work-card-overlay h3,
.work-card-overlay p {
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.4s var(--ease-out-expo) 0.1s, opacity 0.4s ease 0.1s;
}
.work-card:hover .work-card-overlay h3,
.work-card:hover .work-card-overlay p,
.work-card:focus-within .work-card-overlay h3,
.work-card:focus-within .work-card-overlay p {
  transform: translateY(0);
  opacity: 1;
}
.work-card:hover .work-card-overlay p,
.work-card:focus-within .work-card-overlay p {
  opacity: 0.92;
}
.work-card:hover img {
  transform: scale(1.08);
}
.work-card-overlay h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 2px;
}
.work-card-overlay p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}
@media (max-width: 768px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Blog ===== */
.blog {
  padding: var(--space-3xl) 0;
  background: var(--card);
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
}
.blog-card {
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: transform var(--transition), box-shadow var(--transition), background 0.35s var(--ease-out-expo);
}
.blog-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--maroon);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.blog-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin: 0;
}
.blog-card p {
  margin: 0;
  color: var(--gray);
  font-size: 0.95rem;
}
.blog-link {
  margin-top: var(--space-sm);
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  color: var(--indigo);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.blog-link:hover {
  color: var(--maroon);
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  background: radial-gradient(circle at top right, rgba(167, 139, 250, 0.22), transparent 55%), var(--cream);
}

/* ===== Contact ===== */
.contact {
  padding: var(--space-3xl) 0;
  background: linear-gradient(135deg, rgba(250, 248, 255, 0.97) 0%, rgba(237, 233, 254, 0.94) 50%, rgba(245, 243, 255, 0.97) 100%);
}
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
  max-width: 1000px;
  margin: 0 auto;
}
.contact-info h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--charcoal);
  margin: 0 0 var(--space-sm);
}
.contact-info p {
  color: var(--gray);
  margin: 0 0 var(--space-md);
}
.contact-details {
  margin-top: var(--space-lg);
}
.contact-details p {
  margin-bottom: var(--space-sm);
}
.contact-details a {
  color: var(--maroon);
  font-weight: 500;
}

.meeting-card {
  margin-top: var(--space-xl);
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(123, 44, 191, 0.15);
}
.meeting-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin: 0 0 var(--space-xs);
}
.meeting-card p {
  margin: 0 0 var(--space-sm);
  color: var(--gray);
  font-size: 0.95rem;
}
.meeting-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.meeting-form label {
  font-weight: 600;
  font-size: 0.85rem;
}
.meeting-form input,
.meeting-form select,
.meeting-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cream-dark);
  background: var(--cream);
  width: 100%;
}
.meeting-form input:focus,
.meeting-form select:focus,
.meeting-form textarea:focus {
  outline: none;
  border-color: var(--indigo);
  background: var(--card);
}
.meeting-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.meeting-inline-field {
  flex: 1;
  min-width: 0;
}

/* Meeting modal */
.meeting-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
}
.meeting-modal.is-open {
  display: block;
}
.meeting-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.meeting-dialog {
  position: relative;
  max-width: 480px;
  margin: 5vh auto;
  padding: var(--space-lg);
  padding-top: calc(var(--space-lg) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--charcoal);
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.meeting-close {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 0.75rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--charcoal);
  padding: 0.25rem;
}
@media (max-width: 600px) {
  .meeting-inline {
    flex-direction: column;
  }
  .meeting-dialog {
    margin: 0;
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    border-radius: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}


.contact-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: var(--card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(91, 33, 182, 0.1);
  border: 1px solid rgba(123, 44, 191, 0.1);
  transition: box-shadow var(--transition), transform var(--transition);
  width: 100%;
}
.contact-form:focus-within {
  box-shadow: 0 16px 48px rgba(123, 44, 191, 0.18);
}
.contact-form label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--charcoal);
}
.contact-form input,
.contact-form textarea,
.contact-form select {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  padding: 0.75rem 1rem;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--charcoal);
  width: 100%;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.contact-form select {
  cursor: pointer;
  appearance: auto;
  min-height: 3rem;
}
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: var(--indigo);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(123, 44, 191, 0.2);
}
.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}
.contact-form .btn-full {
  margin-top: var(--space-xs);
}
@media (max-width: 768px) {
  .contact-inner {
    grid-template-columns: 1fr;
  }
}

/* ===== Footer ===== */
.footer {
  padding: var(--space-xl) 0;
  padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #0f0f12 0%, #050508 100%);
  color: var(--gray-light);
  font-size: 0.9rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-lg);
  align-items: center;
}
.footer-brand .logo {
  color: #ffffff;
}
.footer-brand .logo-q {
  color: var(--purple-muted);
}
.footer-brand .logo-tagline {
  color: var(--gray-light);
}
.footer-brand p {
  margin: var(--space-xs) 0 0;
  max-width: 280px;
}
.footer-links {
  display: flex;
  gap: var(--space-md);
}
.footer-links a {
  color: var(--gray-light);
}
.footer-links a:hover {
  color: #ffffff;
}
.footer-social {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-top: var(--space-sm);
}
.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  color: var(--gray-light);
  background: rgba(255, 255, 255, 0.07);
  transition: color var(--transition), background var(--transition), transform var(--transition);
}
.footer-social-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}
.footer-social-link:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.85);
  outline-offset: 2px;
}
.footer-social-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}
.footer-copy {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}
@media (max-width: 600px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-brand p {
    margin-left: auto;
    margin-right: auto;
  }
  .footer-links {
    justify-content: center;
  }
  .footer-social {
    justify-content: center;
  }
}

/* ===== RTL (Arabic) layout overrides ===== */
[dir="rtl"] .about-list li {
  padding-left: 0;
  padding-right: 1.5rem;
}
[dir="rtl"] .about-list li::before {
  left: auto;
  right: 0;
}
[dir="rtl"] .nav a::after {
  left: auto;
  right: 0;
}
[dir="rtl"] .about-accent {
  right: auto;
  left: -20px;
  bottom: -20px;
}
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .header-actions {
    margin-left: auto;
  }
  [dir="rtl"] .header-actions {
    margin-left: 0;
    margin-right: auto;
  }
}

/* ===== Sub-pages (About / Work / Blog / Contact) ===== */
.hero--subpage {
  min-height: 72vh;
  min-height: 72dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 64px + var(--space-xl)) clamp(1rem, 4vw, var(--space-lg)) calc(env(safe-area-inset-bottom, 0px) + var(--space-2xl));
}
.hero--subpage .hero-lead {
  max-width: 62ch;
}

.about-page-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-2xl);
  align-items: center;
}
.about-page-media img {
  width: 100%;
  min-height: 220px;
  height: auto;
  max-height: min(520px, 70vh);
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.about-page-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-md);
}

.stats {
  padding: var(--space-2xl) 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}
.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}
.stat-number {
  margin: 0 0 0.25rem;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--maroon), var(--indigo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  margin: 0;
  color: var(--gray);
}

.work-cases {
  display: grid;
  gap: var(--space-lg);
}
.work-gallery {
  padding: var(--space-3xl) 0;
  background: linear-gradient(145deg, rgba(250, 248, 255, 0.98) 0%, rgba(237, 233, 254, 0.95) 100%);
}
.work-gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-md);
  align-items: stretch;
}
.work-gallery-item {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(123, 44, 191, 0.14);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.work-gallery-item img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--ease-out-expo);
}
.work-gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 42px rgba(123, 44, 191, 0.2);
  border-color: rgba(123, 44, 191, 0.34);
}
.work-gallery-item:hover img {
  transform: scale(1.03);
}
.case-card {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: var(--space-lg);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}
.case-media img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}
.case-body {
  padding: var(--space-lg);
}
.case-tag {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(123, 44, 191, 0.12);
  color: var(--indigo);
  font-weight: 700;
  font-size: 0.85rem;
}
.case-sub {
  margin: 0.25rem 0 0;
  color: var(--gray);
}
.case-metrics {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}
.case-metrics li {
  background: var(--metric-tile);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
}
.case-metrics strong {
  display: block;
  font-size: 1.1rem;
}
.case-actions {
  margin-top: var(--space-md);
}

.process-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}
.process-step {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.process-step strong {
  display: block;
  font-family: var(--font-heading);
  margin-bottom: 0.35rem;
}
.process-step span {
  color: var(--gray);
}

.blog-list {
  display: grid;
  gap: var(--space-lg);
}
.blog-post {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-lg);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}
.blog-post-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}
.blog-post-body {
  padding: var(--space-lg);
}
.blog-post-actions {
  margin-top: var(--space-sm);
}

.newsletter {
  padding: var(--space-2xl) 0 var(--space-3xl);
}
.newsletter-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-lg);
  align-items: center;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(123, 44, 191, 0.16), transparent 55%),
    radial-gradient(1200px 600px at 80% 90%, rgba(91, 33, 182, 0.14), transparent 55%),
    var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}
.newsletter-form {
  display: flex;
  gap: var(--space-sm);
}
.newsletter-form input {
  flex: 1;
}

.contact-page {
  padding: var(--space-3xl) 0;
  background: linear-gradient(135deg, rgba(250, 248, 255, 0.97) 0%, rgba(237, 233, 254, 0.94) 50%, rgba(245, 243, 255, 0.97) 100%);
}
.contact-page-inner {
  display: grid;
  gap: var(--space-lg);
}
.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
.contact-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.contact-card-title {
  margin: 0 0 0.25rem;
  color: var(--gray-light);
  font-weight: 700;
}
.contact-card-value {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--charcoal);
  text-decoration: none;
}
.contact-card-sub {
  margin: 0.5rem 0 0;
  color: var(--gray);
}
.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  border-color: rgba(123, 44, 191, 0.28);
}
.contact-form--wide {
  max-width: 720px;
  width: 100%;
  margin-inline: auto;
  margin-top: var(--space-md);
  padding: var(--space-xl);
  gap: var(--space-md);
}
.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md) var(--space-lg);
}
.contact-form-grid .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.field--full {
  grid-column: 1 / -1;
}
.form-note {
  margin: var(--space-md) 0 0;
  color: var(--gray);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}
.contact-cta {
  padding: var(--space-2xl) 0 var(--space-3xl);
}
.contact-cta-inner {
  text-align: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

/* Prevent grid/flex children from forcing horizontal overflow */
.header-inner,
.hero-content,
.about-page-inner,
.stats-grid,
.work-gallery-grid,
.case-card,
.case-metrics,
.process-steps,
.blog-post,
.newsletter-inner,
.contact-cards,
.contact-form-grid {
  min-width: 0;
}
.header-inner > *,
.hero-content > *,
.about-page-inner > *,
.stats-grid > *,
.work-gallery-grid > *,
.case-card > *,
.case-metrics > *,
.process-steps > *,
.blog-post > *,
.newsletter-inner > *,
.contact-cards > *,
.contact-form-grid > * {
  min-width: 0;
}

@media (max-width: 980px) {
  .about-page-inner,
  .case-card,
  .blog-post,
  .newsletter-inner {
    grid-template-columns: 1fr;
  }
  .case-media img {
    min-height: 240px;
  }
  .blog-post-media img {
    min-height: 220px;
  }
  .work-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .process-steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-cards {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .process-steps {
    grid-template-columns: 1fr;
  }
  .hero--subpage {
    min-height: 64vh;
    min-height: 64dvh;
  }
  .case-media img,
  .blog-post-media img,
  .work-gallery-item img {
    min-height: 180px;
  }
  .work-gallery-grid {
    grid-template-columns: 1fr;
  }
  .case-metrics {
    grid-template-columns: 1fr;
  }
  .newsletter-form {
    flex-direction: column;
  }
  .contact-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Dark theme — full-page surfaces (sections stay cohesive) ===== */
html[data-theme="dark"] body {
  background: radial-gradient(ellipse 120% 85% at 50% 0%, #1a0a2e 0%, #0a0812 50%, #000000 100%);
}
html[data-theme="dark"] body::before {
  background: linear-gradient(180deg, rgba(8, 6, 14, 0.9) 0%, rgba(5, 5, 8, 0.97) 100%);
}
html[data-theme="dark"] .services {
  background: linear-gradient(145deg, rgba(14, 12, 22, 0.98) 0%, rgba(8, 6, 14, 0.99) 100%);
}
html[data-theme="dark"] .about {
  background: linear-gradient(125deg, rgba(12, 10, 20, 0.98) 0%, rgba(8, 6, 14, 0.99) 100%);
}
html[data-theme="dark"] .why {
  background: linear-gradient(135deg, rgba(14, 12, 24, 0.96) 0%, rgba(8, 6, 16, 0.98) 100%);
}
html[data-theme="dark"] .work {
  background: linear-gradient(160deg, rgba(12, 10, 22, 0.98) 0%, rgba(6, 5, 12, 0.99) 100%);
}
html[data-theme="dark"] .contact {
  background: linear-gradient(135deg, rgba(14, 12, 22, 0.97) 0%, rgba(8, 6, 14, 0.98) 100%);
}
html[data-theme="dark"] .contact-page {
  background: linear-gradient(135deg, rgba(14, 12, 22, 0.97) 0%, rgba(8, 6, 14, 0.98) 100%);
}
html[data-theme="dark"] .section-divider::before {
  background:
    linear-gradient(135deg, rgba(123, 44, 191, 0.14), transparent 60%),
    radial-gradient(900px 260px at 10% 0%, rgba(91, 33, 182, 0.16), transparent 70%),
    radial-gradient(900px 260px at 90% 100%, rgba(59, 7, 100, 0.14), transparent 70%),
    linear-gradient(to right, rgba(18, 14, 28, 0.96), rgba(12, 10, 20, 0.96));
}
html[data-theme="dark"] .header {
  background: rgba(14, 12, 22, 0.94);
  border-color: rgba(167, 139, 250, 0.2);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .header.scrolled {
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .service-videos {
  background: transparent;
}

/* ===== Responsive — phones & small viewports ===== */
@media (max-width: 480px) {
  .header {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    border-radius: var(--radius-lg);
  }
  .header-inner {
    padding: 0.5rem 0.85rem;
    min-height: 56px;
    height: auto;
  }
  .logo-mark {
    height: 34px;
  }
  .logo-wordmark {
    font-size: 0.92rem;
  }
  .header-actions {
    gap: 0.35rem;
  }
  .logo-tagline {
    display: none;
  }
  .header-cta {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
  }
  .theme-switch,
  .lang-switch {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }
  .hero h1 {
    font-size: clamp(1.65rem, 8vw, 2.5rem);
  }
  .hero-lead {
    font-size: 1rem;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }
  .hero-scroll {
    bottom: calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
  }
  .container {
    padding-left: clamp(0.75rem, 4vw, 1.25rem);
    padding-right: clamp(0.75rem, 4vw, 1.25rem);
  }
  .section-header {
    margin-bottom: var(--space-xl);
  }
  .marquee-track span {
    font-size: 0.85rem;
  }
  .why-grid {
    grid-template-columns: 1fr;
  }
  .work-grid {
    grid-template-columns: 1fr;
  }
  .whatsapp-float {
    width: 50px;
    height: 50px;
    bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px)) !important;
    left: calc(0.7rem + env(safe-area-inset-left, 0px)) !important;
  }
}

/* Extra-small phones: prioritize navigation controls and avoid crowding */
@media (max-width: 360px) {
  .header-cta {
    display: none;
  }
  .logo-text-group {
    display: none;
  }
  .header-inner {
    padding-inline: 0.7rem;
  }
}

@media (min-width: 769px) {
  .header-inner {
    flex-wrap: nowrap;
  }
}

/* ===== Spam honeypot (FormSubmit) ===== */
.form-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ===== Floating WhatsApp (bottom-left) + Chatbase AI (bottom-right) =====
   Physical sides stay the same in LTR/RTL so the two entry points never stack. */
.whatsapp-float {
  position: fixed;
  z-index: 1700;
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)) !important;
  left: calc(0.9rem + env(safe-area-inset-left, 0px)) !important;
  right: auto !important;
  inset-inline-end: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Chatbase embed defaults can drift with RTL; pin bubble + panel to viewport bottom-right */
html.has-chatbase #chatbase-bubble-button {
  left: auto !important;
  right: calc(0.9rem + env(safe-area-inset-right, 0px)) !important;
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)) !important;
}

/* Open panel: keep aligned to the right edge; vertical position stays managed by the embed */
html.has-chatbase #chatbase-bubble-window {
  left: auto !important;
  right: calc(0.9rem + env(safe-area-inset-right, 0px)) !important;
}
.whatsapp-float:hover {
  transform: scale(1.07);
  box-shadow: 0 12px 36px rgba(37, 211, 102, 0.5);
  color: #ffffff;
}
.whatsapp-float:focus-visible {
  outline: 2px solid var(--purple-light);
  outline-offset: 3px;
}
html[data-theme="dark"] .whatsapp-float {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
