/* @import Google Fonts directly inside CSS for maximum cleanliness */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&display=swap');

:root { 
  --primary-brick: #c2410c; 
  --text-apple-dark: #1d1d1f; 
  --text-apple-gray: #86868b;
  --bg-apple-light: #f5f5f7; 
  --border-light: rgba(0,0,0,0.05);
}

body { 
  font-family: 'Cairo', sans-serif; 
  background-color: var(--bg-apple-light); 
  color: var(--text-apple-dark);
  overflow-x: hidden;
  position: relative;
  line-height: 1.6; 
}

.apple-transition { transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); }

.hero-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--primary-brick) 0.5px, transparent 0.5px);
  background-size: 30px 30px;
  opacity: 0.04;
  z-index: 0;
}

/* 💡 Unified Image Marquee */
.unified-marquee { width: 100%; overflow: hidden; padding: 20px 0; display: flex; white-space: nowrap; }
.marquee-content-wrapper { display: flex; animation: scrollImages 50s linear infinite; gap: 20px; }
.marquee-item-card { width: 260px; height: 180px; border-radius: 2rem; overflow: hidden; flex-shrink: 0; border: 1px solid var(--border-light); background: #f5f5f7; box-shadow: 0 10px 20px rgba(0,0,0,0.03); }
.marquee-item-card img { width: 100%; height: 100%; object-fit: cover; }
.portfolio-item-card { width: 320px; height: 320px; border-radius: 2.5rem; }

@keyframes scrollImages { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* 💡 Buttons */
.btn-apple {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 36px; border-radius: 999px; font-weight: 900; font-size: 1.1rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary { background: var(--text-apple-dark); color: white; }
.btn-primary:hover { background: #333336; transform: scale(1.02); }
.btn-accent { background: var(--primary-brick); color: white; }
.btn-accent:hover { background: #9a3412; transform: translateY(-3px); box-shadow: 0 10px 20px rgba(194, 65, 12, 0.2); }

/* Scroll Reveal */
.reveal-up { opacity: 0; transform: translateY(40px); transition: all 1s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-up.is-visible { opacity: 1; transform: translateY(0); }

/* Custom Slider Utilities */
.slider-track { display: flex; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

/* 💡 Unified Hero Background Canvas & Header Clearance */
#hero-section,
.hero-section-container {
  background-color: #F7F5F6 !important;
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
}

#hero-avatar-container {
  background-color: #F7F5F6 !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  width: 100%;
  height: 100%;
}

.hero-avatar-wrapper {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  width: 100%;
  height: 100%;
}

.hero-section-container .hero-pattern {
  display: none !important;
}

.hero-section-container {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-color: #F7F5F6 !important;
  box-sizing: border-box;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Desktop: Header (85px clearance) + Hero + Stats (80px) = 100vh fit */
@media (min-width: 1024px) {
  .hero-section-container {
    padding-top: 85px;
    padding-bottom: 0 !important;
    min-height: calc(100vh - 80px);
    height: calc(100vh - 80px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
  }

  .stats-section-container {
    height: 80px;
    max-height: 80px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
  }

  #hero-avatar-container,
  .hero-avatar-container {
    max-height: min(84vh, 700px) !important;
  }
}

/* Short height screens fallback */
@media (min-width: 1024px) and (max-height: 699px) {
  .hero-section-container {
    height: calc(100vh - 70px);
    min-height: 520px;
    padding-bottom: 0 !important;
  }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-section-container {
    padding-top: 80px;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    min-height: 100svh;
    min-height: 100dvh;
    height: 100svh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
  }
  .hero-avatar-wrapper {
    width: 100%;
    height: auto !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* Mobile: dynamic 100svh fit with stacked layout */
@media (max-width: 767px) {
  .hero-section-container {
    min-height: 100svh;
    min-height: 100dvh;
    height: 100svh;
    height: 100dvh;
    padding-top: 68px;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
    overflow: hidden;
  }
  .hero-avatar-wrapper {
    width: 100%;
    height: auto !important;
    margin: 0 auto;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  .hero-avatar-container {
    width: 100%;
    height: 100%;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* Mobile & Tablet Hero Optimization (<= 1023px) */
@media (max-width: 1023px) {
  .hero-section-container {
    justify-content: flex-end !important;
  }

  .hero-content-grid {
    justify-content: flex-end !important;
    gap: 28px !important;
  }

  .hero-text-block {
    margin-top: auto !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }

  .hero-badge-pill {
    font-size: 9.5px !important;
    padding: 2px 10px !important;
    letter-spacing: 0.02em !important;
  }

  .hero-description {
    font-size: 0.825rem !important;
    line-height: 1.5 !important;
    -webkit-line-clamp: unset !important;
    display: block !important;
    max-height: none !important;
  }

  .hero-cta-group {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    gap: 8px !important;
  }

  .hero-btn-primary {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px !important;
  }

  .hero-btn-secondary {
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px !important;
  }

  .hero-avatar-col {
    flex: 0 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    width: 100% !important;
    align-self: center !important;
  }

  .hero-avatar-wrapper {
    height: auto !important;
    flex: 0 1 auto !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}

.hero-avatar-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  line-height: 0;
}

.hero-avatar-wrapper:hover {
  transform: none !important;
  box-shadow: none !important;
}

.hero-avatar-container {
  position: relative;
  width: 100%;
  height: 100%;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  background-color: #F7F5F6 !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
}

.avatar-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center !important;
  pointer-events: none;
  transition: none !important;
  user-select: none;
  -webkit-user-drag: none;
}

/* ==========================================================================
   Interactive Eye-Tracking Cursor Follower (Art Director Target)
   ========================================================================== */
.hero-cursor-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  margin-left: -23px;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  z-index: 40 !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.hero-cursor-ring * {
  pointer-events: none !important;
}

.hero-cursor-ring-visual {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(234, 88, 12, 0.6);
  background: radial-gradient(circle, rgba(234, 88, 12, 0.15) 0%, transparent 70%);
  box-shadow: 0 0 15px rgba(234, 88, 12, 0.2), inset 0 0 8px rgba(234, 88, 12, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.5);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.hero-cursor-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #ea580c;
  box-shadow: 0 0 6px rgba(234, 88, 12, 0.9);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}

/* Active State (Inside Hero) */
.hero-cursor-ring.is-active {
  opacity: 1;
  visibility: visible;
}

.hero-cursor-ring.is-active .hero-cursor-ring-visual {
  transform: scale(1);
}

/* Hovering Buttons / Interactive Elements */
.hero-cursor-ring.is-hovering-btn .hero-cursor-ring-visual {
  transform: scale(1.3);
  border-color: rgba(234, 88, 12, 0.9);
  background: radial-gradient(circle, rgba(234, 88, 12, 0.25) 0%, transparent 75%);
  box-shadow: 0 0 22px rgba(234, 88, 12, 0.4), inset 0 0 12px rgba(234, 88, 12, 0.2);
}

.hero-cursor-ring.is-hovering-btn .hero-cursor-dot {
  transform: scale(1.25);
  background-color: #f97316;
}

/* Strictly disable on touch / coarse pointer devices */
@media (hover: none) or (pointer: coarse) {
  .hero-cursor-ring {
    display: none !important;
  }
}
