/* ═══════════════════════════════════════════
   EXLO — Dual Studio Design System (Tech + Digital)
   ═══════════════════════════════════════════ */

/* ---- BASE ---- */
html { scroll-behavior: initial; }
body {
  font-family: 'Inter', sans-serif;
  cursor: none; 
  overflow-x: hidden;
  background-color: #050505; /* Deepest black */
}
#root { min-height: 100vh; display: flex; flex-direction: column; }

@media (pointer: coarse) {
  body { cursor: auto; }
  #custom-cursor { display: none !important; }
}

/* ---- PREMIUM NOISE/GRAIN ---- */
.noise-bg {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ---- CUSTOM CURSOR ---- */
#custom-cursor {
  position: fixed; top: 0; left: 0; width: 8px; height: 8px;
  background-color: #00D1B2; border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate3d(-50%, -50%, 0);
  transition: width 0.25s ease-out, height 0.25s ease-out, background-color 0.25s ease, border 0.25s ease, box-shadow 0.25s ease;
  mix-blend-mode: difference;
}
#custom-cursor.hover {
  width: 24px; height: 24px; 
  background-color: rgba(0, 209, 178, 0.15); 
  border: 1.5px solid #00D1B2;
  box-shadow: 0 0 10px rgba(0, 209, 178, 0.4);
  mix-blend-mode: normal;
}
#custom-cursor.active { 
  transform: translate3d(-50%, -50%, 0) scale(0.65); 
  background-color: #5B2EFF;
  box-shadow: 0 0 16px #00D1B2;
}
.hover-label { display: none; }

/* ---- GLOBAL BUTTON & CLICK INTERACTIONS ---- */
button, a, input, select, textarea, .btn, .magnetic-btn {
  -webkit-tap-highlight-color: transparent;
}

button:active, a:active, .btn:active, .magnetic-btn:active {
  transform: scale(0.96) !important;
}

/* ---- THEME-MATCHED MOUSE CLICK RIPPLE ANIMATION ---- */
.click-ripple {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  border: 2px solid #00D1B2;
  box-shadow: 0 0 20px rgba(91, 46, 255, 0.7), inset 0 0 12px rgba(0, 209, 178, 0.6);
  animation: themeClickPulse 0.55s cubic-bezier(0.1, 0.85, 0.25, 1) forwards;
}

@keyframes themeClickPulse {
  0% {
    width: 8px;
    height: 8px;
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.5);
    border-color: #00D1B2;
  }
  50% {
    border-color: #5B2EFF;
    box-shadow: 0 0 25px rgba(0, 209, 178, 0.9), inset 0 0 15px rgba(91, 46, 255, 0.8);
  }
  100% {
    width: 65px;
    height: 65px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.4);
    border-color: #00D1B2;
  }
}

/* ---- PRELOADER STROKE ANIMATIONS ---- */
.preloader-path {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: logoTrace 1.4s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
}

@keyframes logoTrace {
  0% {
    stroke-dashoffset: 300;
  }
  50% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -300;
  }
}

.preloader-glow {
  box-shadow: none;
}

.text-gradient {
  background: linear-gradient(135deg, #5B2EFF, #00D1B2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4, h5, h6, .font-display { font-family: 'Space Grotesk', sans-serif; }

.t-display {
  font-size: clamp(3rem, 12vw, 12rem);
  font-weight: 700; line-height: 0.9;
  letter-spacing: -0.05em; text-transform: uppercase;
}
.t-heading {
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 600; line-height: 0.95; letter-spacing: -0.04em;
}

/* ---- ANIMATION UTILITIES ---- */
.clip-text { clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%); }
.line-wrap { overflow: hidden; display: inline-block; vertical-align: top; }
.word-wrap { overflow: hidden; display: inline-block; padding-right: 0.25em; margin-bottom: -0.2em; }
.word-inner { display: inline-block; transform: translateY(100%); }

.img-mask-container { overflow: hidden; position: relative; }
.img-mask { position: absolute; inset: 0; background: #050505; z-index: 10; transform-origin: top; }

/* ---- PRELOADER ---- */
#preloader { position: fixed; inset: 0; z-index: 99999; background: #050505; display: flex; align-items: center; justify-content: center; }

/* ---- LENIS ---- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
::-webkit-scrollbar { width: 0px; background: transparent; }

/* ---- SPLIT HOVER (Dual Services) ---- */
.svc-row { position: relative; cursor: pointer; border-bottom: 1px solid rgba(245,245,240,0.1); }
.svc-row:first-child { border-top: 1px solid rgba(245,245,240,0.1); }
.svc-img {
  position: absolute; top: 50%; right: 10%; transform: translateY(-50%) scale(0.8);
  width: 300px; height: 200px; object-fit: cover; opacity: 0; pointer-events: none;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1); z-index: 5;
}
.svc-row:hover .svc-img { opacity: 1; transform: translateY(-50%) scale(1); }
.svc-row:hover h3 { color: #00D1B2; padding-left: 20px; }
.svc-row h3 { transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); }

/* ---- LOGO ANIMATION OPTIONS ---- */

/* 1. Trace */
.anim-trace { stroke-dasharray: 200; animation: infinityTrace 4s linear infinite; }
@keyframes infinityTrace { 0% { stroke-dashoffset: 400; } 100% { stroke-dashoffset: 0; } }

/* 2. Liquid Flow */
.anim-liquid { stroke-dasharray: 10 300; animation: infinityLiquid 3s ease-in-out infinite; }
@keyframes infinityLiquid { 
  0% { stroke-dasharray: 10 300; stroke-dashoffset: 400; } 
  50% { stroke-dasharray: 150 150; stroke-dashoffset: 200; } 
  100% { stroke-dasharray: 10 300; stroke-dashoffset: 0; } 
}

/* 3. Broken Neon */
.anim-neon { animation: infinityNeon 4s infinite; }
@keyframes infinityNeon {
  0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% { opacity: 1; filter: drop-shadow(0 0 10px rgba(0,209,178,0.8)); }
  20%, 21.999%, 63%, 63.999%, 65%, 69.999% { opacity: 0.1; filter: none; }
}

/* 4. Elastic Snap */
.anim-elastic { transform-origin: center; animation: infinityElastic 4s infinite; }
@keyframes infinityElastic {
  0%, 80%, 100% { transform: scale(1); }
  90% { transform: scale(0.85); animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); }
}

/* 5. Heartbeat */
.anim-heartbeat { transform-origin: center; animation: infinityHeartbeat 2.5s infinite; }
@keyframes infinityHeartbeat {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(91,46,255,0)); }
  10% { transform: scale(1.15); filter: drop-shadow(0 0 10px rgba(91,46,255,0.8)); }
  20% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(91,46,255,0)); }
  30% { transform: scale(1.15); filter: drop-shadow(0 0 10px rgba(0,209,178,0.8)); }
  40% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(0,209,178,0)); }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE — Native App Experience
   ═══════════════════════════════════════════════════════════ */

/* ---- Utility: hide on mobile, show on desktop ---- */
.desktop-only { display: none; }
@media (min-width: 1024px) { .desktop-only { display: block; } }
.mobile-only { display: block; }
@media (min-width: 1024px) { .mobile-only { display: none !important; } }
.tablet-up { display: none; }
@media (min-width: 768px) { .tablet-up { display: block; } }

/* ═══════════════════════════════════════════════
   MOBILE STYLES (max-width: 767px)
   ═══════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* ---- Global Mobile Overrides ---- */
  body { cursor: auto; -webkit-overflow-scrolling: touch; }
  #custom-cursor { display: none !important; }
  .click-ripple { display: none !important; }

  /* Ensure all touch targets are at least 44px */
  a, button, .magnetic-btn, .hover-target {
    min-height: 44px;
    min-width: 44px;
  }

  /* ---- Section 1: HERO — App-Style Stacked Layout ---- */
  .hero-section-mobile {
    height: auto !important;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: env(safe-area-inset-bottom, 20px);
  }

  /* Hide floating cards and code blocks on mobile */
  .hero-float-left,
  .hero-float-right { display: none !important; }

  /* Mobile hero text sizing */
  .hero-section-mobile h1 {
    font-size: clamp(48px, 14vw, 72px) !important;
    line-height: 0.9 !important;
  }

  .hero-section-mobile .hero-text-reveal p {
    font-size: 14px !important;
    letter-spacing: 0.15em !important;
    line-height: 1.6 !important;
  }

  /* Mobile hero CTA */
  .hero-mobile-cta {
    width: 72px !important;
    height: 72px !important;
  }

  /* ---- Section 2: Hybrid Statement ---- */
  .scrub-text h2 {
    font-size: 28px !important;
    line-height: 1.25 !important;
    text-align: center !important;
  }

  /* ---- Section 3: Impact Metrics — 2×2 App Grid ---- */
  .metrics-grid-mobile {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    padding: 0 4px !important;
  }

  .metrics-grid-mobile > div {
    border-left: none !important;
    border-radius: 20px !important;
    padding: 20px !important;
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    text-align: center !important;
    padding-left: 20px !important;
  }

  .metrics-grid-mobile h3 {
    font-size: 40px !important;
    justify-content: center;
  }

  .metrics-grid-mobile p {
    font-size: 11px !important;
    letter-spacing: 0.12em !important;
    text-align: center;
  }

  /* ---- Section 4: Software Engineering — Stacked Cards ---- */
  .services-section-mobile .tilt-card {
    border-radius: 20px !important;
    padding: 24px !important;
  }

  .services-section-mobile .tilt-card h3 {
    font-size: 22px !important;
  }

  .services-section-mobile .tilt-card p {
    font-size: 14px !important;
  }

  /* ---- Section 5: Agency — Stacked App Cards ---- */
  .agency-bento-mobile {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .agency-bento-mobile > div {
    border-radius: 20px !important;
    min-height: auto !important;
  }

  .agency-bento-mobile .tilt-card {
    min-height: 300px !important;
  }

  /* Platform marquee mobile */
  .platform-marquee-mobile {
    border-radius: 16px !important;
    padding: 16px 0 !important;
  }

  .platform-marquee-mobile span {
    font-size: 20px !important;
  }

  /* ---- Section 6: Process Timeline — Left-aligned app style ---- */
  .process-mobile .process-step {
    margin-bottom: 40px !important;
    padding-left: 48px !important;
  }

  .process-mobile h3 {
    font-size: 24px !important;
    line-height: 1.1 !important;
  }

  .process-mobile p {
    font-size: 14px !important;
  }

  /* ---- Section 7: Testimonials — Card style ---- */
  .testimonial-mobile {
    min-height: 60vh !important;
    padding-top: 80px !important;
    padding-bottom: 80px !important;
  }

  .testimonial-mobile h2 {
    font-size: 22px !important;
    line-height: 1.3 !important;
    margin-bottom: 32px !important;
  }

  .testimonial-mobile .testimonial-author {
    flex-direction: column !important;
    padding: 12px !important;
    padding-right: 12px !important;
    border-radius: 20px !important;
    gap: 12px !important;
  }

  .testimonial-mobile .testimonial-author > div:last-child {
    text-align: center !important;
  }

  /* Background quote smaller on mobile */
  .testimonial-mobile .bg-quote {
    font-size: 200px !important;
  }

  /* ---- Section 8: Work — Vertical scroll on mobile ---- */
  .work-section-mobile {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    padding: 80px 0 40px !important;
  }

  .work-scroll-mobile {
    flex-direction: column !important;
    height: auto !important;
    padding: 0 20px !important;
    gap: 24px !important;
    white-space: normal !important;
    padding-top: 20px !important;
  }

  .work-scroll-mobile > div {
    width: 100% !important;
    flex-shrink: 1 !important;
  }

  .work-scroll-mobile .img-mask-container {
    aspect-ratio: 3/4 !important;
    border-radius: 20px !important;
  }

  .work-scroll-mobile h3 {
    font-size: 28px !important;
  }

  /* ---- Section 9: Technologies Marquee ---- */
  .tech-marquee-mobile span {
    font-size: 28px !important;
  }

  /* ---- Section 10: CTA — Mobile friendly ---- */
  .cta-section-mobile {
    min-height: 80vh !important;
    padding-top: 80px !important;
    padding-bottom: 80px !important;
  }

  .cta-section-mobile h2:first-of-type {
    font-size: 10vw !important;
  }

  .cta-section-mobile h2:nth-of-type(2) {
    font-size: 14vw !important;
    margin-bottom: 24px !important;
  }

  .cta-section-mobile p {
    font-size: 16px !important;
    margin-bottom: 48px !important;
  }

  /* Rotating text ring smaller on mobile */
  .cta-section-mobile .rotating-ring {
    width: 200px !important;
    height: 200px !important;
  }

  /* Mobile CTA button */
  .cta-section-mobile .cta-pill-btn {
    padding: 18px 32px !important;
    font-size: 12px !important;
    border-radius: 50px !important;
  }

  /* ---- Preloader Mobile ---- */
  #preloader .preloader-char {
    font-size: 48px !important;
  }

  /* ---- Smooth iOS momentum scrolling ---- */
  .lenis.lenis-smooth {
    -webkit-overflow-scrolling: touch;
  }

  /* ---- Mobile App-Style Card Shadows ---- */
  .app-card-shadow {
    box-shadow: 0 2px 16px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
  }

  /* ---- Disable 3D tilt on touch ---- */
  .tilt-card {
    transform: none !important;
  }

  /* ---- Mobile section spacing ---- */
  section { 
    border-radius: 0;
  }

  /* Disable mix-blend-difference on mobile for CTA */
  .mix-blend-difference {
    mix-blend-mode: normal !important;
  }
}

/* ═══════════════════════════════════════════════
   TABLET STYLES (768px - 1023px)
   ═══════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {

  /* ---- Global Tablet ---- */
  body { cursor: auto; }
  #custom-cursor { display: none !important; }

  /* ---- Section 1: Hero — Tablet balanced ---- */
  .hero-float-left { 
    right: auto !important;
    left: 24px !important;
    bottom: 120px !important;
    width: 200px !important;
  }

  .hero-float-right {
    display: none !important;
  }

  /* ---- Section 3: Metrics — 2×2 tablet grid ---- */
  .metrics-grid-tablet {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }

  .metrics-grid-tablet > div {
    padding: 24px !important;
    border-radius: 20px !important;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-left: 2px solid currentColor !important;
  }

  .metrics-grid-tablet h3 {
    font-size: 56px !important;
  }

  /* ---- Section 4: Services — Full width stacked ---- */
  .services-section-tablet .tilt-card {
    padding: 32px !important;
    border-radius: 24px !important;
  }

  /* ---- Section 5: Agency — 2-column bento ---- */
  .agency-bento-tablet {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }

  .agency-bento-tablet > div:first-child {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    min-height: 400px !important;
  }

  /* ---- Section 6: Process — Centered timeline ---- */
  .process-tablet h3 {
    font-size: 32px !important;
  }

  /* ---- Section 7: Testimonials ---- */
  .testimonial-tablet h2 {
    font-size: 36px !important;
  }

  /* ---- Section 8: Work — Tablet horizontal scroll ---- */
  .work-section-tablet .work-card {
    width: 65vw !important;
  }

  /* ---- Section 10: CTA ---- */
  .cta-section-tablet h2:first-of-type {
    font-size: 72px !important;
  }

  .cta-section-tablet h2:nth-of-type(2) {
    font-size: 100px !important;
  }

  /* ---- Disable tilt on tablet too ---- */
  .tilt-card {
    transform: none !important;
  }

  /* Disable mix-blend-difference on tablet for CTA */
  .mix-blend-difference {
    mix-blend-mode: normal !important;
  }
}

/* ═══════════════════════════════════════════════
   SHARED MOBILE + TABLET ANIMATIONS
   ═══════════════════════════════════════════════ */
@media (max-width: 1023px) {

  /* Subtle fade-in-up for mobile reveals instead of complex parallax */
  @keyframes mobileReveal {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .mobile-reveal {
    animation: mobileReveal 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  }

  /* App-style card press effect */
  .tilt-card:active,
  .app-card:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
  }

  /* Smooth gradient border animation for active cards */
  @keyframes gradientBorderPulse {
    0%, 100% { border-color: rgba(0, 209, 178, 0.15); }
    50% { border-color: rgba(91, 46, 255, 0.25); }
  }

  .active-card-border {
    animation: gradientBorderPulse 3s ease-in-out infinite;
  }

  /* Status dot pulse - more subtle on mobile */
  @keyframes mobilePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
  }

  /* Platform marquee speed adjustment for touch */
  .platform-marquee-mobile .flex.w-max {
    animation-duration: 20s !important;
  }

  /* Mobile-optimized smooth scroll indicator */
  @keyframes scrollIndicator {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(8px); opacity: 0.5; }
    100% { transform: translateY(0); opacity: 1; }
  }

  .scroll-indicator {
    animation: scrollIndicator 2s ease-in-out infinite;
  }

  /* Ensure safe area insets on notched devices */
  .safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 20px);
  }

  .safe-area-top {
    padding-top: env(safe-area-inset-top, 0px);
  }
}
