/* =======================================
   ECHO — mobile.css
   Loaded last — overrides everything
   Breakpoints: 768px tablet, 480px phone
   ======================================= */


/* ======================================
   MOBILE NAV OVERLAY
   The nav__links ul lives inside header
   which has its own stacking context.
   We escape it by cloning the overlay
   to body level via JS (see main.js),
   but as a CSS-only fallback we use
   maximum specificity here.
====================================== */

@media (max-width: 768px) {

  /* -- Hide desktop-only elements -- */
  .mega-menu,
  .mega-menu__shimmer { display: none !important; }

  .nav__toggle { display: flex !important; }


  /* -- Logo at top of mobile nav -- */
  .nav__mobile-bg::after {
    content: 'échO' !important;
    position: absolute !important;
    top: 2rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-family: 'Cormorant Garamond', 'Cormorant Fallback', serif !important;
    font-size: 1.8rem !important;
    font-style: italic !important;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.75) !important;
    letter-spacing: 0.01em !important;
    pointer-events: none !important;
    z-index: 3 !important;
    white-space: nowrap !important;
  }

  /* Push location tag down to sit below the logo */
  .nav__mobile-tag {
    margin-top: 1rem !important;
  }

  /* -- Nav overlay -- */
  html body header .nav__links,
  #navLinks {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-1 * (100vw - 100%) / 2) !important;
    height: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 5.5rem 2rem 2.75rem !important;
    border: none !important;
    background-color: #0e0a1a !important;
    background-image: none !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    z-index: 9000 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.35s ease, visibility 0.35s ease !important;
    transform: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
  }

  html body header .nav__links.open,
  #navLinks.open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
  }

  /* -- Toggle above overlay -- */
  .nav__toggle {
    position: relative !important;
    z-index: 9100 !important;
  }

  /* Open state — make X white */
  .nav__toggle.open span {
    background-color: #ffffff !important;
  }

  /* -- Location tag -- */
  .nav__mobile-tag {
    display: block !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    color: rgba(155, 109, 255, 0.55) !important;
    margin-bottom: 1.5rem !important;
    margin-top: 0.5rem !important;
    position: relative !important;
    z-index: 2 !important;
  }

  /* -- Nav list items -- */
  #navLinks li,
  .nav__links li {
    opacity: 0 !important;
    transform: translateY(16px) !important;
    transition: opacity 0.4s ease, transform 0.4s ease !important;
    width: 100% !important;
    text-align: center !important;
    position: relative !important;
    z-index: 2 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #navLinks.open li,
  .nav__links.open li {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Stagger delays */
  .nav__links.open li:nth-child(1) { transition-delay: 0.05s !important; }
  .nav__links.open li:nth-child(2) { transition-delay: 0.12s !important; }
  .nav__links.open li:nth-child(3) { transition-delay: 0.19s !important; }
  .nav__links.open li:nth-child(4) { transition-delay: 0.26s !important; }
  .nav__links.open li:nth-child(5) { transition-delay: 0.33s !important; }
  .nav__links.open li:nth-child(6) { transition-delay: 0.40s !important; }
  .nav__links.open li:nth-child(7) { transition-delay: 0.47s !important; }

  /* social + CTA anchor to the bottom of the drawer;
     #navLinks-scoped so it beats `#navLinks li` (1-0-1) on margin/width */
  #navLinks .nav__social {
    width: auto !important;
    margin: auto auto 0 !important;   /* top:auto pushes it (and the CTA) down */
    justify-content: center !important;
    gap: 1.6rem !important;
    padding-top: 1.25rem !important;
  }
  #navLinks .nav__social-link { width: 44px !important; height: 44px !important; }
  #navLinks .nav__social-link svg { width: 18px !important; height: 18px !important; }

  /* -- Nav link text -- */
  .nav__links a:not(.btn),
  .nav__mega-btn {
    font-family: 'Cormorant Garamond', 'Cormorant Fallback', serif !important;
    font-size: clamp(1.7rem, 6.5vw, 2.2rem) !important;
    font-style: italic !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.88) !important;
    padding: 0.4rem 0 !important;
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    background: none !important;
    border: none !important;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4) !important;
    transition: color 0.2s ease !important;
    line-height: 1.2 !important;
  }

  .nav__links a:not(.btn):hover,
  .nav__mega-btn:hover {
    color: #9b6dff !important;
  }

  /* -- CTA button -- */
  /* #navLinks-scoped margin so it beats `#navLinks li { margin:0 }` (1-0-1) */
  #navLinks .nav__cta { margin-top: 1.5rem !important; }
  .nav__links .btn.nav__cta,
  .nav__links .nav__cta {
    font-size: 1rem !important;
    font-family: 'DM Sans', 'DM Sans Fallback', sans-serif !important;
    font-style: normal !important;
    display: inline-block !important;
    width: auto !important;
    border: 1px solid rgba(155, 109, 255, 0.45) !important;
    background: rgba(91, 43, 224, 0.12) !important;
    color: #efe9ff !important;
    padding: 0.75rem 2rem !important;
    border-radius: 100px !important;
  }

  /* -- Mobile rings background -- */
  .nav__mobile-bg {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 0 !important;
    overflow: hidden !important;
  }

  /* Ambient glow */
  .nav__mobile-bg::before {
    content: '' !important;
    position: absolute !important;
    top: 65% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 500px !important;
    height: 500px !important;
    background: radial-gradient(circle, rgba(91, 43, 224, 0.35) 0%, rgba(155, 109, 255, 0.1) 40%, transparent 70%) !important;
    pointer-events: none !important;
    animation: mobileNavGlow 5s ease-in-out infinite !important;
  }

  @keyframes mobileNavGlow {
    0%,100% { transform: translate(-50%, -50%) scale(1);   opacity: 0.8; }
    50%      { transform: translate(-50%, -50%) scale(1.2); opacity: 0.5; }
  }

  .nav__mobile-ring {
    position: absolute !important;
    border-radius: 50% !important;
    top: 65% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 20px !important;
    height: 20px !important;
    opacity: 0 !important;
  }

  .nav__mobile-ring-label {
    position: absolute !important;
    top: 70% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-family: 'Cormorant Garamond', 'Cormorant Fallback', serif !important;
    font-size: 1.1rem !important;
    font-style: italic !important;
    font-weight: 700 !important;
    color: rgba(155, 109, 255, 0.45) !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    transition: opacity 0.8s ease 0.4s !important;
    pointer-events: none !important;
  }

  .nav__links.open .nav__mobile-ring-label {
    opacity: 0 !important;
  }

  /* Ring pulse animations — only fire when nav is open */
  .nav__links.open .nav__mobile-ring--1 {
    border: 1px solid rgba(155, 109, 255, 0.9) !important;
    animation: mobileRingOut 4s ease-out infinite 0s !important;
  }
  .nav__links.open .nav__mobile-ring--2 {
    border: 1px solid rgba(155, 109, 255, 0.65) !important;
    animation: mobileRingOut 4s ease-out infinite 1s !important;
  }
  .nav__links.open .nav__mobile-ring--3 {
    border: 0.75px solid rgba(91, 43, 224, 0.5) !important;
    animation: mobileRingOut 4s ease-out infinite 2s !important;
  }
  .nav__links.open .nav__mobile-ring--4 {
    border: 0.75px solid rgba(91, 43, 224, 0.3) !important;
    animation: mobileRingOut 4s ease-out infinite 3s !important;
  }

  @keyframes mobileRingOut {
    0%   { opacity: 0;   transform: translate(-50%, -50%) scale(1);  }
    5%   { opacity: 1;                                                }
    70%  { opacity: 0.3;                                              }
    100% { opacity: 0;   transform: translate(-50%, -50%) scale(22); }
  }

  /* -- Services accordion -- */
  .nav__links .nav__mobile-services {
    border-left: 1px solid rgba(155, 109, 255, 0.25) !important;
    padding-left: 1.25rem !important;
    margin: 0.35rem auto 0.35rem !important;
    text-align: left !important;
    max-width: 200px !important;
  }
  .nav__links .nav__mobile-services li {
    padding: 0 !important;
    text-align: left !important;
    width: auto !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .nav__links .nav__mobile-services a {
    color: rgba(205, 182, 255, 0.8) !important;
    font-size: 1rem !important;
    font-style: normal !important;
    font-family: 'DM Sans', 'DM Sans Fallback', sans-serif !important;
    font-weight: 400 !important;
    padding: 0 !important;
    text-align: left !important;
    text-shadow: none !important;
    /* 44px tap target without enlarging the type */
    display: flex !important;
    align-items: center !important;
    min-height: 44px !important;
  }
  .nav__links .nav__mobile-services a:hover {
    color: rgba(155, 109, 255, 0.9) !important;
  }
  .nav__links .nav__mobile-services-all a {
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.04em !important;
  }

  /* View all services link — fix rendering */
  .nav__links .nav__mobile-services-all {
    margin-top: 0.25rem !important;
    padding-top: 0.35rem !important;
    border-top: 1px solid rgba(255,255,255,0.06) !important;
  }
  .nav__links .nav__mobile-services-all a {
    white-space: nowrap !important;
    display: flex !important;
  }


  /* Services arrow rotation */
  .nav__arrow {
    display: inline-block !important;
    transition: transform 0.3s ease !important;
  }
  .nav__item--mega.open .nav__arrow {
    transform: rotate(180deg) !important;
  }

  /* Mega btn styling on dark bg */
  .nav__mega-btn {
    cursor: pointer !important;
    background: none !important;
    border: none !important;
  }
  .nav__mega-btn.active,
  .nav__item--mega.open .nav__mega-btn {
    color: #9b6dff !important;
  }

} /* end @media 768px */


/* ======================================
   HOMEPAGE — mobile
====================================== */

@media (max-width: 768px) {

  /* Hero */
  .hero { padding-top: 5rem; }
  .hero__headline { font-size: clamp(2rem, 8vw, 3.2rem) !important; }
  .hero__sub { font-size: 0.9rem; max-width: 100%; }
  .hero__cta { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .hero__cta .btn { width: 100%; text-align: center; justify-content: center; }
  .hero__depth { display: none !important; }
  .blob { display: none !important; }

  /* Service rows — visuals stay visible and animate on scroll-enter */
  .svc-rows { border-radius: 10px; }
  .svc-row {
    grid-template-columns: 1fr 28px;
    gap: 1rem;
    padding: 1.5rem;
  }
  .svc-row__visual {
    display: block !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 340px !important;
    margin-top: 0.25rem !important;
  }
  .svc-row__title { font-size: 1.3rem; }
  .svc-row__desc { font-size: 0.82rem; }

  /* Work cards */
  
  
  
  

  /* About */
  

  /* Contact */
  .contact__inner { grid-template-columns: 1fr; gap: 2rem; }

}

@media (max-width: 480px) {

  /* Hero */
  
  .hero__mantra { font-size: 0.78rem; text-align: center; }

  /* Service rows */
  .svc-row {
    grid-template-columns: 1fr;
    padding: 1.25rem;
    position: relative;
  }
  .svc-row__arrow { position: absolute; top: 1.25rem; right: 1.25rem; }
  .svc-row__left { flex-direction: column; gap: 0.4rem; }
  .svc-tag { font-size: 0.72rem; padding: 0.2rem 0.55rem; }
  
  
  

  /* Section typography */
  .section-title { font-size: clamp(1.6rem, 7vw, 2.4rem) !important; }
  .section { padding: clamp(3rem, 8vw, 5rem) 0; }

  /* Inputs — prevent iOS zoom */
  input, select, textarea { font-size: 16px !important; }

}


/* ======================================
   SERVICE PAGES — mobile
====================================== */

@media (max-width: 768px) {

  .service-hero { padding-top: 5.5rem; min-height: auto; padding-bottom: 3rem; }
  .service-hero__title { font-size: clamp(1.8rem, 7vw, 3rem) !important; }
  .service-hero__sub { font-size: 0.88rem; }

  /* Process steps */
  .process__steps { grid-template-columns: 1fr 1fr; }

  /* For-who */
  .for-who__grid { grid-template-columns: 1fr; gap: 2rem; }

  /* Timeline */
  
  
  

  /* Service CTA */
  .service-cta__inner { flex-direction: column; text-align: center; align-items: center; gap: 1.5rem; }
  .service-cta__title { font-size: clamp(1.4rem, 5vw, 2rem) !important; }

  /* Dark signature visuals — all go single column */
  

  

  /* Services hub page */
  
  

  /* KPIs */
  

}

@media (max-width: 480px) {

  .process__steps { grid-template-columns: 1fr !important; }
  .process__step { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 1.5rem; }
  .process__step:last-child { border-bottom: none; }

  

  
  
  

  


}


/* ======================================
   ABOUT PAGE — mobile
====================================== */


@media (max-width: 480px) {
  .about-hero__headline { font-size: clamp(3rem, 14vw, 7rem) !important; }
  .about-manifesto__quote { font-size: clamp(1.4rem, 5vw, 2.2rem) !important; }
  
  
  .about-cta__inner { padding: 2rem 1.25rem; }
  
  
}


/* ======================================
   FOOTER — mobile
====================================== */

@media (max-width: 768px) {
  .footer__top { grid-template-columns: 1fr; gap: 2rem; }
  .footer__cta { align-items: flex-start; }
}

@media (max-width: 480px) {
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .footer__legal { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
  .footer__legal a { font-size: 0.72rem; }
  .footer__copy { font-size: 0.72rem; }
  .scroll-top { bottom: 1.25rem; right: 1.25rem; width: 38px; height: 38px; font-size: 0.95rem; }
}


/* ======================================
   GLOBAL MOBILE UTILITIES
====================================== */

@media (max-width: 768px) {
  /* Prevent any horizontal overflow */
  body { overflow-x: hidden; }

  /* Container padding tighter on small screens */
  .container { padding: 0 1.25rem; }

  /* Section spacing reduced */
  .section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
}

@media (max-width: 480px) {
  /* Disable body::after global rings on mobile (performance) */
  body::after { display: none !important; }

  /* Tighter container */
  .container { padding: 0 1rem; }
}


/* ======================================
   GLOBAL READABILITY IMPROVEMENTS
   Loaded last — applies everywhere
====================================== */

/* Body text — bump weight and tighten line-height on small text */
body {
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Section labels — currently too faint */
.section-label,
.policy__label,
.not-found__label {
  opacity: 0.85 !important;
}

/* Body copy — wherever --text-muted is used as paragraph colour */
.service-detail__lead,
.faq__answer p,
.about__text p,
.contact__left p,
.policy p,
.policy li,
.footer__tagline {
  font-weight: 400 !important;
}

/* Uppercase labels — letter-spacing makes thin weights even harder to read */
.section-label,
[class*="__label"],
[class*="__tag"],
[class*="__num"] {
  font-weight: 500;
}

/* Positioning spectrum label (Image 1) */
[class*="spectrum"] p,
[class*="spectrum"] span {
  opacity: 0.9 !important;
  font-weight: 500 !important;
}

/* "Without strategy / With strategy" panel labels */
[class*="__panel"] .label,
[class*="panel__label"] {
  opacity: 0.85 !important;
  letter-spacing: 0.08em !important;
}

/* FAQ answer text specifically */
.faq__answer {
  color: var(--text) !important;
}
.faq__answer p {
  color: var(--text) !important;
  opacity: 0.72 !important;
  font-size: 0.95rem !important;
  line-height: 1.8 !important;
}

/* For-who cards body text */


/* "Probably not for you" card */
.for-who__not li,
.for-who__not p {
  color: var(--text) !important;
  opacity: 0.65 !important;
}


/* ══════════════════════════════════════
   READABILITY PASS 2 — body-copy floor
   Loaded last: no paragraph a visitor is
   expected to READ renders under ~16px.
   Small caps labels/chips stay small by design.
══════════════════════════════════════ */

/* primary reading copy → 0.95rem floor (≈16.2px at 17px root) */
.hero__sub,
.section-lead,
.svc-row__desc,
.about__text p,
.contact__left p,
.service-hero__sub,
.service-detail__lead,
.sf-item__text,
.for-who__text,
.for-who__not li,
.process__step-desc,
.svcx-body,
.svcx-step__desc,
.svcx-tldr,
.pm-pillar__text,
.ga4-problem__lead,
.ga4-privacy__lead,
.ga4-proof-tech__lead,
.ga-statement__body,
.ma-statement__body,
.faq__answer p,
.sc-sub,
.sc-lead__sub {
  font-size: max(0.95rem, 1em) !important;
  line-height: 1.7 !important;
}

/* secondary copy (card meta, pack lists, next-steps) → 0.85rem floor */
.svcx-related span,
.ga4-pack li,
.ga4-pack__for,
.contact__next li,
.form-consent,
.sc-lead__consent {
  font-size: max(0.85rem, 1em) !important;
}


/* ======================================
   PHONE FIXES — overflow, tap targets, small text
====================================== */
@media (max-width: 540px) {
  /* long CTA labels wrap instead of widening the page */
  .btn {
    white-space: normal;
    max-width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* footer links: same rhythm, taller tap area */
  .footer__nav-col { gap: 0; }
  .footer__nav-col a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
  .footer__legal a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer__social-link { width: 44px; height: 44px; }
  .footer__legal { row-gap: 0; }
  .footer__legal a { display: inline-block; padding: 0.35rem 0; }

  /* breadcrumb + secondary hero links: 24px+ tap height */
  .service-back,
  .an-hero__secondary,
  .batch-hero__secondary,
  .cr-hero__secondary,
  .ga4-hero__secondary,
  .pm-hero__secondary,
  .st-hero__secondary {
    display: inline-block;
    padding-block: 0.35rem;
  }

  /* reading labels → 11px floor */
  body .section-label,
body .svcx-step__get,
body .svcx-step__time,
body .svcx-get,
body .svc-tag,
body .instrument-caption {
    font-size: 0.72rem;
  }

  /* mock-UI micro labels below 10px → 10px floor */
  body .mpx-route__label,
  body .ga-result__ad-badge,
  body .dash-tile__label,
  body .st-map__axis,
  body .mpx-chip {
    font-size: 0.72rem;
  }
}
