/* Phase 7 — mobile spacing, scroll reveals, contact polish */

/* ── Hero — restore side margins; equal CTAs side by side ── */
@media (max-width: 900px) {
  :root {
    --container-x: clamp(28px, 7vw, 44px);
  }

  .hero.hero-single .container.hero-inner.hero-shell {
    padding-left: var(--container-x) !important;
    padding-right: var(--container-x) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .hero-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .hero-actions .btn {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-content: center !important;
    text-align: center !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 0.72rem !important;
    white-space: nowrap;
  }

  /* Selected work — taller media, inherits hero shell gutters */
  .hero-selected-work {
    width: 100% !important;
    margin-top: clamp(20px, 4vw, 32px) !important;
    --hero-spotlight-h: 540px;
  }

  .hero-spotlight-panel {
    grid-template-rows: minmax(260px, 44vw) minmax(0, 1fr) !important;
  }

  .hero-spotlight-copy {
    padding: clamp(18px, 4vw, 28px) !important;
  }
}

/* Hero + selected work — fade up on load */
.hero-selected-work,
.hero-cta-secondary {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero.hero-single.in .hero-selected-work {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.34s;
}

.hero.hero-single.in .hero-cta-secondary {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.52s;
}

/* ── Client logos — more vertical breathing room ── */
@media (max-width: 900px) {
  #clients.clients.section {
    padding: clamp(40px, 8vw, 64px) 0 !important;
    margin: 0 !important;
  }

  #clients .marquee-row {
    margin: clamp(12px, 3vw, 20px) 0 !important;
  }

  #clients .marquee-track {
    gap: clamp(48px, 10vw, 72px) !important;
  }
}

/* ── Markets — mobile: horizontal pills + detail card below ── */
@media (max-width: 900px) {
  #who-we-work-with.markets-section-wrap.section {
    padding: clamp(48px, 8vw, 72px) 0 !important;
  }

  #who-we-work-with.markets-section-wrap.section > .container {
    padding-left: var(--container-x) !important;
    padding-right: var(--container-x) !important;
  }

  #who-we-work-with .markets-compact {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: visible !important;
  }

  #markets-strip.markets-strip,
  .markets-strip {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 56px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scroll-padding-left: var(--container-x);
    scroll-padding-right: var(--container-x);
    padding: 16px var(--container-x) 32px !important;
    margin: 0 calc(-1 * var(--container-x)) !important;
    width: calc(100% + 2 * var(--container-x)) !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box !important;
  }

  #markets-strip.markets-strip::-webkit-scrollbar,
  .markets-strip::-webkit-scrollbar {
    display: none;
  }

  #markets-strip .market-chip,
  .market-chip {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: max-content !important;
    padding: 12px 16px !important;
    border-radius: 999px !important;
    scroll-snap-align: start;
    white-space: nowrap;
    text-align: left !important;
    transform: none !important;
  }

  #markets-strip .market-chip .market-chip-short {
    display: none !important;
  }

  #markets-strip .market-chip .market-chip-label {
    font-size: 0.92rem !important;
    white-space: nowrap;
  }

  #markets-strip .market-chip.is-active {
    box-shadow: 0 8px 24px rgba(255, 45, 45, 0.22);
    position: relative;
    z-index: 1;
  }

  #who-we-work-with.markets-section-wrap.section,
  #who-we-work-with.markets-section-wrap.section > .container {
    overflow: visible !important;
  }

  #who-we-work-with .market-detail {
    margin-top: 0 !important;
    text-align: left !important;
    padding: clamp(18px, 4vw, 24px) !important;
    border: 1px solid var(--border) !important;
    border-left: 3px solid var(--brand) !important;
    border-radius: var(--ref-radius-md, 14px) !important;
    background: var(--bg-surface) !important;
    min-height: 0 !important;
    transition: opacity 0.28s ease, transform 0.28s ease;
  }

  #who-we-work-with .market-detail.is-switching {
    opacity: 0;
    transform: translateY(8px);
  }

  #who-we-work-with .market-detail-label {
    font-size: clamp(1.35rem, 5vw, 1.75rem) !important;
    margin-bottom: 10px !important;
  }

  #who-we-work-with .market-detail-text {
    font-size: 0.98rem !important;
    line-height: 1.58 !important;
    max-width: none !important;
  }
}

/* Market chips — scroll fade-up */
#markets-strip .market-chip {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    background 0.25s ease;
}

#markets-strip .market-chip.in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Where we go deep — scroll reveals ── */
#services-gallery[data-animate] {
  opacity: 1 !important;
  transform: none !important;
}

#services-gallery .service-slide {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

#services-gallery .service-slide.in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Specialities → Work that ships — more separation ── */
@media (max-width: 900px) {
  #services-gallery.section {
    padding-bottom: clamp(48px, 9vw, 80px) !important;
  }

  #work-title.section-title-block-wrap,
  #work-title.work-title-section {
    margin-top: clamp(24px, 5vw, 48px) !important;
  }

  #work-title .section-title-block {
    padding-top: clamp(48px, 8vw, 72px) !important;
  }
}

/* ── Work cards — less outer padding, readable inner text ── */
@media (max-width: 900px) {
  #work .work-card {
    padding: 10px !important;
  }

  #work .work-card .work-meta {
    padding: 14px 6px 8px !important;
    text-align: left !important;
  }

  #work .work-card .work-meta .work-name,
  #work .work-card .work-meta .work-type,
  #work .work-card .work-meta .work-desc {
    text-align: left !important;
  }
}

/* ── In the wild — left-aligned copy ── */
@media (max-width: 900px) {
  #projects-title.section-title-block-wrap,
  #projects-title.projects-title-section {
    text-align: left !important;
  }

  #projects-title .section-title-block,
  #projects-title .container.section-title-block {
    text-align: left !important;
    align-items: flex-start !important;
    padding-bottom: clamp(28px, 5vw, 40px) !important;
  }

  #projects-title .section-title-kicker,
  #projects-title .section-title-heading,
  #projects-title .section-title-lead,
  #projects-title h2 {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #projects-mobile.projects-mobile.section {
    padding-top: 0 !important;
  }

  .project-curated-meta {
    text-align: left !important;
    left: clamp(12px, 3vw, 18px) !important;
    right: clamp(12px, 3vw, 18px) !important;
    bottom: clamp(12px, 3vw, 18px) !important;
  }

  .project-curated-meta h3,
  .project-curated-meta p {
    text-align: left !important;
  }
}

/* ── Website tabs — mobile section title (matches other section blocks) ── */
.projects-webview-intro.section-title-block {
  padding-top: clamp(40px, 7vw, 56px) !important;
  padding-bottom: clamp(20px, 4vw, 28px) !important;
  text-align: left !important;
}

.projects-webview-intro .section-title-kicker,
.projects-webview-intro .section-title-heading,
.projects-webview-intro .section-title-lead {
  text-align: left !important;
}

@media (min-width: 901px) {
  .projects-webview-intro.mobile-only {
    display: none !important;
  }
}

/* ── How we work — larger step numbers, left aligned on mobile ── */
@media (max-width: 900px) {
  #process.section .steps li,
  #process.section .steps li h3,
  #process.section .steps li p,
  #process.section .steps li > div,
  #process.section .steps li .step-num {
    text-align: left !important;
  }

  #process.section .steps li h3::after {
    margin-left: 0 !important;
    margin-right: auto !important;
  }

  #process .steps li .step-num {
    font-family: "Bebas Neue", Impact, system-ui, sans-serif !important;
    font-size: clamp(2.5rem, 10vw, 3.25rem) !important;
    line-height: 1 !important;
    letter-spacing: 0.04em !important;
    margin-bottom: 10px !important;
  }

  #process .steps li {
    padding: clamp(22px, 5vw, 28px) !important;
  }

  #process .steps li h3 {
    font-size: clamp(1.05rem, 4vw, 1.2rem) !important;
  }
}

/* ── Contact form — flat, no glow ── */
.contact-form,
.contact-form:hover,
.contact-form:focus-within {
  box-shadow: none !important;
  filter: none !important;
}

.dark-mode .contact-form,
body:not(.dark-mode) .contact-form {
  box-shadow: none !important;
}

/* Email underline — enters from left, exits to the right */
.contact-method span {
  background-position: right bottom !important;
  background-size: 0% 1px !important;
  transition: background-size 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background-position 0.35s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.contact-method:hover span {
  background-position: left bottom !important;
  background-size: 100% 1px !important;
}

@media (prefers-reduced-motion: reduce) {
  .hero-selected-work,
  .hero-cta-secondary,
  #markets-strip .market-chip,
  #services-gallery .service-slide {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Keep specialities visible on mobile (legacy rule hid it) */
@media (max-width: 900px) {
  #specialities-title.specialities-title-section,
  #specialities-title.section-title-block-wrap {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Kill legacy centered title bands + borders (work title stays centered) */
  #projects-title.projects-title-section,
  #projects-title.section-title-block-wrap,
  #services-title.services-title-section,
  #services-title.section-title-block-wrap,
  #specialities-title.specialities-title-section,
  #specialities-title.section-title-block-wrap,
  #process-title.process-title-section,
  #process-title.section-title-block-wrap,
  #reviews-title.reviews-title-section,
  #reviews-title.section-title-block-wrap,
  #contact-title.contact-title-section,
  #contact-title.section-title-block-wrap {
    display: block !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: var(--bg) !important;
  }

  #work-title.work-title-section,
  #work-title.section-title-block-wrap {
    display: block !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: var(--bg) !important;
  }

  #projects-mobile.section.mobile-only {
    padding: 0 var(--container-x) clamp(40px, 8vw, 64px) !important;
    margin: 0 !important;
  }
}

/* Section title + gallery — consistent side margins on mobile */
@media (max-width: 900px) {
  .section-title-block-wrap .section-title-block,
  .section-title-block-wrap .container.section-title-block {
    padding-left: var(--container-x) !important;
    padding-right: var(--container-x) !important;
  }

  #specialities-title .section-title-block {
    padding-bottom: clamp(24px, 5vw, 36px) !important;
  }

  /* What we deliver — pull first card closer to title on mobile */
  #services-title .section-title-block,
  #services-title .container.section-title-block {
    padding-bottom: 10px !important;
  }

  #services.deliver-section.section,
  #services.deliver-section.deliver-section--significa.section {
    padding-top: 0 !important;
  }

  .deliver-section--significa .deliver-row:first-child {
    padding-top: 12px !important;
  }
}
