/* ═══════════════════════════════════════════════════════
   App Development – Immersive Scroll Experience
   Scoped styles for /services/app-development
   ═══════════════════════════════════════════════════════ */

/* ── Scroll Progress Bar ────────────────────────────── */
.ad-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 9999;
  pointer-events: none;
  transition: none;
}

/* ── Smooth Scroll (CSS-based) ───────────────────────── */
html.ad-smooth {
  scroll-behavior: smooth;
}

/* ── Hero Section ───────────────────────────────────── */
.ad-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.ad-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(124,92,255,.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 70% 60%, rgba(37,208,255,.08) 0%, transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.ad-hero > * {
  position: relative;
  z-index: 2;
}

.ad-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .03em;
  margin-bottom: 28px;
  position: relative;
}

.ad-hero-kicker .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 4px rgba(124,92,255,.14);
}

.ad-hero-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2.15rem, 5.6vw, 4.8rem);
  line-height: 1.14;
  letter-spacing: -.02em;
  max-width: 16ch;
  padding-inline: 4px;
  margin: 0 auto 28px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 40%, var(--accent2) 70%, var(--text) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: adGradientShift 6s ease-in-out infinite;
  position: relative;
}

@keyframes adGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.ad-hero-lead {
  font-size: clamp(16px, 2vw, 19px);
  color: #ffffff;
  max-width: 54ch;
  line-height: 1.6;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(4, 8, 16, 0.82), rgba(8, 13, 24, 0.62));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px 18px;
  backdrop-filter: blur(5px);
  text-shadow:
    0 3px 16px rgba(0, 0, 0, 0.62),
    0 0 18px rgba(37, 208, 255, 0.2);
  margin: 0 auto 40px;
  position: relative;
}

.ad-hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
}

.ad-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted2);
  font-size: 12px;
  letter-spacing: .05em;
  animation: adBounce 2s ease-in-out infinite;
}

.ad-scroll-hint svg {
  width: 20px;
  height: 20px;
  opacity: .6;
}

@keyframes adBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ── Hero Canvas / Interactive Shapes ──────────────── */
.ad-hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 1;
}

.no-js .ad-hero-canvas {
  display: none;
}


.ad-slide {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.ad-slide::before,
.ad-slide::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  pointer-events: none;
  z-index: 1;
}

.ad-slide::before {
  top: 0;
  background: linear-gradient(180deg, rgba(7, 10, 18, 0.68) 0%, rgba(7, 10, 18, 0) 100%);
}

.ad-slide::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(7, 10, 18, 0.74) 0%, rgba(7, 10, 18, 0) 100%);
}

.ad-slide-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
  min-height: 100vh;
  will-change: opacity, transform;
}

/* Alternating layout */
.ad-slide:nth-child(even) .ad-slide-inner {
  direction: rtl;
}
.ad-slide:nth-child(even) .ad-slide-inner > * {
  direction: ltr;
}

/* ── Slide Content Panel ───────────────────────────── */
.ad-slide-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px clamp(32px, 5vw, 80px);
  position: relative;
}

.ad-slide-content::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .06;
  pointer-events: none;
}

.ad-slide:nth-child(1) .ad-slide-content::before { background: var(--accent); }
.ad-slide:nth-child(2) .ad-slide-content::before { background: var(--accent2); }
.ad-slide:nth-child(3) .ad-slide-content::before { background: #3CF28A; }
.ad-slide:nth-child(4) .ad-slide-content::before { background: #FF6B6B; }
.ad-slide:nth-child(5) .ad-slide-content::before { background: #FFB347; }
.ad-slide:nth-child(6) .ad-slide-content::before { background: #E040FB; }

.ad-slide-number {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(4rem, 8vw, 7rem);
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px var(--stroke);
  line-height: 1;
  margin-bottom: 16px;
  position: relative;
}

.ad-slide-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  margin-bottom: 20px;
  color: var(--text);
  position: relative;
}

.ad-slide-desc {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 28px;
  max-width: 48ch;
  position: relative;
}

.ad-slide-features {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.ad-slide-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
}

.ad-slide-features li::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 3px rgba(124,92,255,.15);
}

.ad-slide-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent2);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: gap .2s ease, color .2s ease;
  position: relative;
}

.ad-slide-link:hover {
  gap: 14px;
  color: var(--text);
}

.ad-slide-link svg {
  width: 16px;
  height: 16px;
  transition: transform .2s ease;
}

.ad-slide-link:hover svg {
  transform: translateX(4px);
}

/* ── Slide Image Panel ─────────────────────────────── */
.ad-slide-visual {
  position: relative;
  overflow: hidden;
}

.ad-parallax-wrap {
  position: absolute;
  inset: -20vh 0;
  height: 140vh;
}

.ad-parallax-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.ad-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(7,10,18,.6) 0%,
    rgba(7,10,18,.2) 50%,
    rgba(7,10,18,.4) 100%
  );
  pointer-events: none;
}

/* ── Process Section ────────────────────────────────── */
.ad-process {
  padding: 120px 24px;
  position: relative;
}

.ad-process::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 30% 30%, rgba(124,92,255,.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 70% 70%, rgba(37,208,255,.06) 0%, transparent 60%);
  pointer-events: none;
}

.ad-process-header {
  text-align: center;
  max-width: var(--max);
  margin: 0 auto 64px;
  position: relative;
}

.ad-process-header h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 16px;
}

.ad-process-header p {
  color: var(--muted);
  font-size: 17px;
  max-width: 52ch;
  margin: 0 auto;
}

.ad-process-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
}

.ad-process-step {
  position: relative;
  padding: 32px 24px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(12px);
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .5s ease, transform .5s ease, border-color .3s ease, box-shadow .3s ease;
}

.ad-process-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ad-process-step:hover {
  border-color: rgba(124,92,255,.3);
  box-shadow: 0 8px 32px rgba(124,92,255,.1);
}

.ad-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #06101B;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 16px;
}

.ad-step-title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 10px;
}

.ad-step-desc {
  font-size: 14px;
  color: var(--muted2);
  line-height: 1.55;
}

/* ── Tech Stack Ticker ──────────────────────────────── */
.ad-tech-strip {
  padding: 48px 0;
  overflow: hidden;
  position: relative;
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
}

.ad-tech-track {
  display: flex;
  gap: 48px;
  animation: adTicker 30s linear infinite;
  width: max-content;
}

.ad-tech-item {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--muted2);
  white-space: nowrap;
  letter-spacing: .02em;
}

@keyframes adTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── FAQ + CTA (uses global styles, just spacing) ──── */
.ad-faq-section {
  padding: 96px 24px;
}

.ad-cta-section {
  padding: 96px 24px;
  text-align: center;
}

.ad-cta-section h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 16px;
}

.ad-cta-section p {
  color: var(--muted);
  font-size: 17px;
  max-width: 48ch;
  margin: 0 auto 32px;
}

.ad-cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── GSAP SplitText characters ──────────────────────── */
html.ad-anim-ready .ad-hero-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(60px) rotateX(-40deg);
  transform-origin: bottom center;
}

.ad-hero-title .char.is-revealed {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

/* ── Slide content entrance (GSAP-driven) ──────────── */
html.ad-anim-ready .ad-slide-content > * {
  opacity: 0;
  transform: translateY(30px);
}

.ad-slide-content > .is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .ad-hero {
    min-height: clamp(620px, 92svh, 840px);
    padding: 112px 24px 72px;
  }

  .ad-hero-title {
    font-size: clamp(2rem, 7.2vw, 3.35rem);
    line-height: 1.16;
    letter-spacing: -.015em;
    max-width: 15ch;
    margin-bottom: 22px;
  }

  .ad-hero-lead {
    font-size: clamp(15px, 2.6vw, 18px);
    line-height: 1.7;
    max-width: 50ch;
    margin-bottom: 30px;
  }

  .ad-slide-inner {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .ad-slide:nth-child(even) .ad-slide-inner {
    direction: ltr;
  }

  .ad-slide-visual {
    height: 50vh;
  }

  .ad-parallax-wrap {
    inset: -10vh 0;
    height: 120vh;
  }

  .ad-slide-content {
    padding: 48px 24px;
  }

  .ad-process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ad-slide-number {
    font-size: 3rem;
  }
}

@media (max-width: 640px) {
  /* ── Hero ── */
  .ad-hero {
    min-height: clamp(560px, 90svh, 760px);
    padding: 96px 18px 62px;
  }

  .ad-hero-kicker {
    font-size: 12px;
    padding: 8px 14px;
    margin-bottom: 18px;
  }

  .ad-hero-title {
    font-size: clamp(1.7rem, 8.8vw, 2.6rem);
    line-height: 1.2;
    max-width: 14ch;
    margin-bottom: 18px;
  }

  .ad-hero-lead {
    font-size: clamp(14px, 4.2vw, 16px);
    line-height: 1.72;
    max-width: 36ch;
    margin-bottom: 24px;
  }

  .ad-hero-ctas {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 12px;
  }

  .ad-hero-ctas .btn {
    width: 100%;
    max-width: 300px;
    text-align: center;
    justify-content: center;
  }

  .ad-scroll-hint {
    bottom: 18px;
    font-size: 11px;
  }

  /* ── Slide cards ── */
  .ad-slide {
    min-height: auto;
    display: block;
    padding: 12px 16px;
    overflow: visible;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .ad-slide.is-visible {
    opacity: 1;
    transform: none;
  }

  .ad-slide::before,
  .ad-slide::after {
    display: none;
  }

  .ad-slide-inner {
    display: flex;
    flex-direction: column;
    min-height: auto;
    width: 100%;
    will-change: auto;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
  }

  .ad-slide:nth-child(even) .ad-slide-inner {
    direction: ltr;
  }

  /* Remove the colored tint backdrop — looks heavy on full-width mobile */
  .ad-slide-content::before {
    display: none;
  }

  /* Show images on mobile inside card */
  .ad-slide-visual {
    display: block;
    height: 220px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }

  .ad-slide-visual .ad-parallax-wrap {
    position: absolute;
    inset: 0;
    height: 100%;
  }

  .ad-slide-visual .ad-parallax-img {
    will-change: auto;
  }

  .ad-slide-content {
    padding: 20px 20px 28px;
  }

  .ad-slide-number {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }

  .ad-slide-title {
    font-size: clamp(1.3rem, 5vw, 1.6rem);
    margin-bottom: 10px;
    line-height: 1.2;
  }

  .ad-slide-desc {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    max-width: none;
  }

  .ad-slide-features {
    gap: 8px;
    margin-bottom: 20px;
  }

  .ad-slide-features li {
    font-size: 13px;
  }

  .ad-slide-link {
    font-size: 14px;
  }

  /* ── Process ── */
  .ad-process {
    padding: 64px 16px;
  }

  .ad-process-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ad-process-step {
    padding: 20px 18px;
    text-align: left;
  }

  /* ── FAQ / CTA ── */
  .ad-faq-section {
    padding: 64px 16px;
  }

  .ad-cta-section {
    padding: 64px 16px;
  }

  .ad-cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .ad-cta-buttons .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
}

/* ── Reduced Motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ad-hero-title {
    animation: none;
  }

  .ad-hero-title .char {
    opacity: 1 !important;
    transform: none !important;
  }

  .ad-slide-content > * {
    opacity: 1 !important;
    transform: none !important;
  }

  .ad-process-step {
    opacity: 1 !important;
    transform: none !important;
  }

  .ad-tech-track {
    animation: none;
  }

  .ad-scroll-hint {
    animation: none;
  }
}

/* ── Fallback when JS disabled ──────────────────────── */
.no-js .ad-hero-title .char,
.no-js .ad-slide-content > *,
.no-js .ad-process-step {
  opacity: 1;
  transform: none;
}
