/**
 * Markityze - Modern Marketing Agency
 * Design System: White + Lavender Palette
 * Premium, Minimalist, Conversion-Focused
 */

:root {
  /* Primary Colors */
  --primary-lavender: #7C3AED;
  --primary-lavender-light: #A78BFA;
  --primary-lavender-lighter: #DDD6FE;
  --primary-white: #FFFFFF;
  --primary-white-smoke: #F9F7FF;
  
  /* Accent Colors */
  --accent-purple: #6D28D9;
  --accent-slate: #64748B;
  --accent-slate-light: #E2E8F0;
  --accent-gray: #F1F5F9;
  
  /* Text Colors */
  --text-dark: #1E293B;
  --text-gray: #475569;
  --text-light: #94A3B8;
  
  /* Background Gradients */
  --gradient-primary: linear-gradient(135deg, #7C3AED 0%, #A78BFA 100%);
  --gradient-light: linear-gradient(135deg, #F9F7FF 0%, #F3E8FF 100%);
  --gradient-dark: linear-gradient(135deg, #6D28D9 0%, #7C3AED 100%);
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  --spacing-3xl: 5rem;
  
  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body: 'Arimo', sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--text-dark);
  background-color: var(--primary-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
video,
iframe {
  max-width: 100%;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  color: var(--text-dark);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: 1.375rem;
}

p {
  color: var(--text-gray);
  line-height: 1.7;
  margin-bottom: var(--spacing-md);
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.section-padding {
  padding: var(--spacing-3xl) var(--spacing-lg);
}

/* ===== PREMIUM GLASS SYSTEM ===== */
.glass-surface {
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(124, 58, 237, 0.08) inset,
    0 12px 34px rgba(30, 41, 59, 0.12),
    0 4px 16px rgba(124, 58, 237, 0.08);
}

.glass-surface-hover {
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}

.glass-surface-hover:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 58, 237, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 -1px 0 rgba(124, 58, 237, 0.12) inset,
    0 18px 44px rgba(30, 41, 59, 0.16),
    0 10px 28px rgba(124, 58, 237, 0.14);
}

@media (max-width: 768px) {
  .section-padding {
    padding: var(--spacing-2xl) var(--spacing-md);
  }
}

/* ===== HEADER / NAVIGATION ===== */
.header {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px) saturate(190%);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  padding: 1.1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(124, 58, 237, 0.13);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset,
              0 2px 20px rgba(124, 58, 237, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(36px) saturate(220%);
  -webkit-backdrop-filter: blur(36px) saturate(220%);
  border-bottom-color: rgba(124, 58, 237, 0.22);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset,
              0 8px 32px rgba(124, 58, 237, 0.12),
              0 2px 8px rgba(30, 41, 59, 0.06);
  padding: 0.7rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--spacing-lg);
  gap: 1rem;
  position: relative;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: var(--font-weight-bold);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.4));
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  align-items: center;
}

.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.08);
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-dark);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

body.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links > li > a:not(.btn) {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  font-size: 0.92rem;
  position: relative;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-links > li > a:not(.btn)::after {
  display: none;
}

.nav-links > li > a:not(.btn):hover {
  color: var(--primary-lavender);
  background: rgba(124, 58, 237, 0.07);
}

/* ===== SERVICES MEGA DROPDOWN ===== */
.has-dropdown {
  position: relative;
}

/* hover bridge between trigger and panel */
.has-dropdown::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 18px;
}

.has-dropdown > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.has-dropdown > a::after {
  display: none !important;
}

.dropdown-arrow {
  font-size: 0.6rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 1px;
  opacity: 0.65;
}

.has-dropdown:hover .dropdown-arrow,
.has-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

/* ===== GLASS MEGA MENU ===== */
.mega-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-16px) scale(0.98);
  width: 1060px;
  max-width: 96vw;

  /* Deep frosted glass */
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(26px) saturate(165%) brightness(1.02);
  -webkit-backdrop-filter: blur(26px) saturate(165%) brightness(1.02);

  /* Glass border */
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-bottom-color: rgba(124, 58, 237, 0.24);
  border-radius: 24px;

  /* Multi-layer shadow for depth */
  box-shadow:
    0 4px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(124, 58, 237, 0.08) inset,
    0 32px 72px rgba(30, 41, 59, 0.22),
    0 10px 30px rgba(124, 58, 237, 0.12),
    0 2px 10px rgba(124, 58, 237, 0.08);

  padding: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.3s;
  z-index: 9990;
}

/* Gradient top accent strip */
.mega-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #7C3AED 0%, #A78BFA 50%, #EC4899 100%);
  border-radius: 24px 24px 0 0;
  z-index: 1;
}

/* Subtle inner shimmer */
.mega-menu::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.has-dropdown:hover .mega-menu,
.has-dropdown.open .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Notch arrow */
.mega-menu-arrow {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.85);
  border-left: 1px solid rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 3px 0 0 0;
}

.mega-menu-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 28px 28px 24px;
  position: relative;
  z-index: 1;
}

/* Glass column card separators */
.mega-col {
  padding: 16px 18px;
  border-radius: 16px;
  transition: background 0.2s ease;
  position: relative;
}

.mega-col:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(124,58,237,0.15) 30%, rgba(124,58,237,0.15) 70%, transparent);
}

.mega-col-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary-lavender);
  margin-bottom: 12px;
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(167,139,250,0.06));
  border-radius: 8px;
  border: 1px solid rgba(124, 58, 237, 0.15);
  white-space: nowrap;
}

.mega-menu .mega-col a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  font-size: 0.84rem;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  border-radius: 9px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  line-height: 1.3;
}

.mega-menu .mega-col a::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.3);
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

.mega-menu .mega-col a:hover {
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary-lavender);
  transform: translateX(4px);
  box-shadow:
    0 2px 12px rgba(124, 58, 237, 0.1),
    inset 0 1px 0 rgba(255,255,255,0.8);
}

.mega-menu .mega-col a:hover::before {
  background: var(--primary-lavender);
  transform: scale(1.4);
}

/* suppress the default nav underline inside mega-menu */
.mega-menu .mega-col a::after {
  display: none !important;
}

/* Bottom footer bar in mega menu */
.mega-menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px 18px;
  border-top: 1px solid rgba(124, 58, 237, 0.1);
  background: linear-gradient(180deg, transparent, rgba(124,58,237,0.03));
  position: relative;
  z-index: 1;
}

.mega-menu-footer p {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0;
}

.mega-menu-footer a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-lavender);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: rgba(124, 58, 237, 0.08);
  border-radius: 20px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.mega-menu-footer a:hover {
  background: rgba(124, 58, 237, 0.15);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
  transform: translateX(2px);
}

.mega-menu-footer a::after {
  display: none !important;
}

/* ===== MEGA MENU RESPONSIVE ===== */
@media (max-width: 1100px) {
  .mega-menu {
    width: 700px;
  }
  .mega-menu-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .mega-menu {
    position: static;
    transform: none !important;
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(30,41,59,0.12);
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    display: none;
    margin-top: 8px;
  }
  .has-dropdown.open .mega-menu {
    display: block;
  }
  .mega-menu::before {
    display: none;
  }
  .mega-menu-arrow {
    display: none;
  }
  .mega-menu-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 16px;
  }
  .mega-col::after {
    display: none;
  }
  .mega-menu-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 12px 16px;
  }
}

/* ===== HERO SECTION ===== */
.hero {
  background: #000;
  padding: var(--spacing-3xl) var(--spacing-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: transparent;
  border-radius: 50%;
  animation: float 20s ease-in-out infinite;
  display: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: transparent;
  border-radius: 50%;
  animation: float 25s ease-in-out infinite reverse;
  display: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 720px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out;
}

.hero h1 {
  margin-bottom: var(--spacing-md);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: var(--spacing-lg);
  line-height: 1.8;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-base);
  font-size: 1rem;
  text-align: center;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--primary-white);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
  background: var(--primary-white);
  color: var(--primary-lavender);
  border: 2px solid var(--primary-lavender);
}

.btn-secondary:hover {
  background: var(--primary-lavender);
  color: var(--primary-white);
  transform: translateY(-2px);
}

.btn-group {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--spacing-lg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 768px) {
  .btn-group {
    flex-direction: column;
  }
}

/* ===== CARD STYLES ===== */
.card {
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(124, 58, 237, 0.06) inset,
    0 10px 30px rgba(30, 41, 59, 0.1),
    0 4px 14px rgba(124, 58, 237, 0.08);
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 -1px 0 rgba(124, 58, 237, 0.12) inset,
    0 16px 42px rgba(30, 41, 59, 0.16),
    0 8px 24px rgba(124, 58, 237, 0.14);
  border-color: rgba(124, 58, 237, 0.28);
}

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  background: var(--gradient-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: var(--spacing-md);
}

.card h3 {
  margin-bottom: var(--spacing-sm);
}

.card p {
  font-size: 0.95rem;
}

/* ===== SERVICES GRID ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-2xl);
}

/* ===== CLIENT LOGO CAROUSEL ===== */
#portfolio-logos {
  padding-top: var(--spacing-2xl);
  padding-bottom: var(--spacing-2xl);
}

#portfolio-logos + #services {
  padding-top: calc(var(--spacing-2xl) + 0.8rem);
}

.logo-carousel {
  --carousel-duration: 26s;
  --carousel-direction: normal;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  padding: 1.2rem;
  position: relative;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.logo-carousel::before,
.logo-carousel::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(60px, 8vw, 120px);
  pointer-events: none;
  z-index: 2;
}

.logo-carousel::before {
  left: 0;
  background: linear-gradient(to right, rgba(249, 247, 255, 0.95), rgba(249, 247, 255, 0));
}

.logo-carousel::after {
  right: 0;
  background: linear-gradient(to left, rgba(249, 247, 255, 0.95), rgba(249, 247, 255, 0));
}

.logo-track {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: max-content;
  animation: logoMarquee var(--carousel-duration) linear infinite;
  animation-direction: var(--carousel-direction);
  transform-style: preserve-3d;
}

.logo-carousel:hover .logo-track {
  animation-play-state: paused;
}

.logo-carousel.wheel-active:hover .logo-track,
.logo-carousel.wheel-active .logo-track {
  animation-play-state: running;
}

.brand-logo {
  --rx: 0deg;
  --ry: 0deg;
  min-width: 170px;
  height: 78px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(124, 58, 237, 0.16);
  box-shadow:
    0 12px 22px rgba(30, 41, 59, 0.12),
    0 4px 14px rgba(124, 58, 237, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  transform: translateZ(28px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 220ms ease, border-color var(--transition-fast), box-shadow 220ms ease;
}

.brand-logo i {
  font-size: 1.15rem;
  color: var(--primary-lavender);
}

.brand-logo:hover {
  transform: translateY(-4px) translateZ(40px) rotateX(calc(var(--rx) * 0.6)) rotateY(calc(var(--ry) * 0.6));
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow:
    0 18px 32px rgba(30, 41, 59, 0.18),
    0 10px 22px rgba(124, 58, 237, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.96) inset;
}

.brand-logo span {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  font-weight: var(--font-weight-bold);
  color: rgba(30, 41, 59, 0.78);
  white-space: nowrap;
}

.logo-carousel.wheel-active .brand-logo {
  animation: wheelNudge 0.45s ease;
}

.logo-carousel.is-3d .brand-logo:nth-child(3n) {
  transform: translateZ(34px) rotateX(var(--rx)) rotateY(var(--ry));
}

.logo-carousel.is-3d .brand-logo:nth-child(4n) {
  transform: translateZ(22px) rotateX(var(--rx)) rotateY(var(--ry));
}

@media (max-width: 768px) {
  #portfolio-logos {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
  }

  #portfolio-logos + #services {
    padding-top: var(--spacing-2xl);
  }

  .brand-logo {
    min-width: 145px;
    height: 64px;
  }

  .brand-logo i {
    font-size: 1rem;
  }

  .brand-logo span {
    font-size: 0.86rem;
  }

  .logo-track {
    animation-duration: 20s;
  }
}

/* ===== TESTIMONIALS ===== */
.testimonial-card {
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  position: relative;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(124, 58, 237, 0.06) inset,
    0 10px 30px rgba(30, 41, 59, 0.1),
    0 4px 14px rgba(124, 58, 237, 0.08);
  transition: all var(--transition-base);
}

.testimonial-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 58, 237, 0.26);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 -1px 0 rgba(124, 58, 237, 0.12) inset,
    0 18px 44px rgba(30, 41, 59, 0.16),
    0 8px 24px rgba(124, 58, 237, 0.14);
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: var(--spacing-md);
  font-size: 4rem;
  color: var(--primary-lavender-light);
  font-family: var(--font-display);
}

.testimonial-text {
  color: var(--text-dark);
  margin-bottom: var(--spacing-md);
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.author-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-white);
  font-weight: var(--font-weight-bold);
}

.author-info h4 {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.author-info p {
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-light);
}

/* ===== CTA SECTION ===== */
.cta-section {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.7), rgba(167, 139, 250, 0.66));
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--primary-white);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-3xl) var(--spacing-lg);
  text-align: center;
  margin: var(--spacing-3xl) 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.42) inset,
    0 -1px 0 rgba(124, 58, 237, 0.18) inset,
    0 16px 44px rgba(30, 41, 59, 0.18),
    0 8px 22px rgba(124, 58, 237, 0.18);
}

.cta-section h2 {
  color: var(--primary-white);
  margin-bottom: var(--spacing-md);
}

.cta-section p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto var(--spacing-lg);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logoMarquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes wheelNudge {
  0% {
    box-shadow:
      0 12px 22px rgba(30, 41, 59, 0.12),
      0 4px 14px rgba(124, 58, 237, 0.12),
      0 1px 0 rgba(255, 255, 255, 0.9) inset;
  }
  40% {
    box-shadow:
      0 20px 34px rgba(30, 41, 59, 0.2),
      0 10px 24px rgba(124, 58, 237, 0.18),
      0 1px 0 rgba(255, 255, 255, 0.96) inset;
  }
  100% {
    box-shadow:
      0 12px 22px rgba(30, 41, 59, 0.12),
      0 4px 14px rgba(124, 58, 237, 0.12),
      0 1px 0 rgba(255, 255, 255, 0.9) inset;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-track {
    animation: none;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fade-in {
  animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-delay {
  animation: fadeInUp 0.8s ease-out;
  opacity: 0;
}

.animate-fade-in-delay:nth-child(1) { animation-delay: 0.1s; animation-fill-mode: forwards; }
.animate-fade-in-delay:nth-child(2) { animation-delay: 0.2s; animation-fill-mode: forwards; }
.animate-fade-in-delay:nth-child(3) { animation-delay: 0.3s; animation-fill-mode: forwards; }
.animate-fade-in-delay:nth-child(4) { animation-delay: 0.4s; animation-fill-mode: forwards; }

/* ===== FOOTER ===== */
.footer {
  background: linear-gradient(140deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  border-top: 1px solid rgba(167, 139, 250, 0.22);
  color: var(--primary-white);
  padding: var(--spacing-3xl) var(--spacing-lg);
  margin-top: var(--spacing-3xl);
}

.footer-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(167, 139, 250, 0.16);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 14px 36px rgba(0, 0, 0, 0.2);
}

.footer-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-2xl);
  margin-bottom: var(--spacing-2xl);
}

.footer-section h4 {
  color: var(--primary-white);
  margin-bottom: var(--spacing-md);
}

.footer-section a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: block;
  margin-bottom: var(--spacing-sm);
}

.footer-section a:hover {
  color: var(--primary-white);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.7);
}

.bottom-fade-target {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(2px);
  transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
  will-change: opacity, transform, filter;
}

.bottom-fade-target.bottom-fade-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* ===== GLASS UTILITY BLOCKS FOR INLINE CONTENT ===== */
.about-highlight-card {
  background: rgba(255, 255, 255, 0.52) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(124, 58, 237, 0.08) inset,
    0 12px 34px rgba(30, 41, 59, 0.12),
    0 4px 16px rgba(124, 58, 237, 0.08);
}

.contact-form-glass {
  background: rgba(255, 255, 255, 0.58) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(124, 58, 237, 0.08) inset,
    0 12px 34px rgba(30, 41, 59, 0.12),
    0 4px 16px rgba(124, 58, 237, 0.08) !important;
}

.contact-meta-grid > div {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  padding: 1rem 0.75rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 8px 22px rgba(30, 41, 59, 0.08);
}

.contact-form-glass input,
.contact-form-glass textarea,
.contact-form-glass button {
  font-size: 16px;
}

.contact-form-glass input,
.contact-form-glass textarea {
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.contact-form-glass input:focus,
.contact-form-glass textarea:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  body.nav-open {
    overflow: hidden;
  }

  .header {
    top: 0;
    padding-top: max(1rem, env(safe-area-inset-top));
  }

  .nav-container {
    padding: 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(124, 58, 237, 0.14);
    box-shadow: 0 18px 44px rgba(30, 41, 59, 0.14), 0 8px 24px rgba(124, 58, 237, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
    max-height: calc(100vh - 7rem - env(safe-area-inset-bottom));
    max-height: calc(100svh - 7rem - env(safe-area-inset-bottom));
    overflow: auto;
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links > li,
  .nav-links > li > a,
  .nav-links .btn {
    width: 100%;
  }

  .nav-links > li > a:not(.btn),
  .nav-links > li > .btn {
    justify-content: space-between;
    display: flex;
    align-items: center;
    padding: 0.9rem 1rem;
  }

  .btn {
    width: 100%;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-content {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .hero {
    padding: var(--spacing-2xl) var(--spacing-md);
    min-height: calc(100svh - env(safe-area-inset-top));
  }
  
  .section-padding {
    padding: var(--spacing-2xl) var(--spacing-md);
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.7;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card,
  .testimonial-card,
  .cta-section,
  .contact-form-glass,
  .about-highlight-card {
    padding: 1.25rem !important;
  }

  .footer {
    padding-bottom: calc(var(--spacing-2xl) + env(safe-area-inset-bottom));
  }
}

@media (max-width: 575px) {
  .logo {
    font-size: 1.45rem;
  }

  .btn-group {
    gap: 0.75rem;
  }

  .card-icon {
    width: 52px;
    height: 52px;
    font-size: 1.45rem;
  }

  .testimonial-author {
    align-items: flex-start;
  }

  .contact-meta-grid {
    grid-template-columns: 1fr;
  }
}

@supports (-webkit-touch-callout: none) {
  .hero {
    min-height: -webkit-fill-available;
  }
}

@media (hover: none), (pointer: coarse) {
  .logo:hover,
  .card:hover,
  .testimonial-card:hover,
  .btn-primary:hover,
  .btn-secondary:hover,
  .brand-logo:hover {
    transform: none;
    filter: none;
  }
}

/* Global slide-in on scroll */
.slide-in-on-scroll {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}

.slide-in-on-scroll.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .slide-in-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}