/* ==========================================================================
   ABLENTRA — mobile-pro layer (loaded LAST on every page)
   Purpose: one authoritative responsive layer. It replaces the fragile
   "!important vs !important" patches that made phone layouts break.
   Rules here are scoped to phones/tablets unless stated otherwise.
   ========================================================================== */

/* ---------- 0. Global guards (all viewports) ---------- */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overflow-wrap:break-word}
img,video,svg{max-width:100%}
h1,h2,h3,h4{overflow-wrap:normal;word-break:normal;hyphens:manual;text-wrap:balance}
p,li{overflow-wrap:break-word;word-break:normal}
/* a grid child may never force the page wider than the screen */
.wrap>*,.split>*,.split-media>*,[class*="-grid"]>*{min-width:0}

/* ---------- 1. Scroll reveal that can never leave content hidden ----------
   abl-reveal.js adds .abl-rv ONLY to elements that are below the fold at load
   and have layout; it adds .abl-in when they scroll into view.              */
html .abl-rv:not(.abl-in){opacity:0!important;transform:translate3d(0,22px,0)!important;filter:blur(6px)!important}
html .abl-rv{transition:opacity .65s cubic-bezier(.2,.7,.2,1),transform .65s cubic-bezier(.2,.7,.2,1),filter .65s cubic-bezier(.2,.7,.2,1);transition-delay:var(--abl-d,0ms)}
html .abl-rv.abl-in{opacity:1!important;transform:none!important;filter:blur(0)!important}
@media (prefers-reduced-motion:reduce){
  html .abl-rv:not(.abl-in){opacity:1!important;transform:none!important;filter:none!important}
  html .abl-rv{transition:none}
}

/* ---------- 2. Hero video (all viewports) ---------- */
.hero-video-toggle{display:none!important}            /* no pause button: video is a muted decorative loop */
.home-hero .hero-frame[data-hero-frame]{aspect-ratio:var(--hero-ar,16/10)!important;max-height:none!important;height:auto!important}
.hero-frame .hero-video,.hero-video{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;border-radius:inherit;overflow:hidden;
  background:linear-gradient(135deg,#17181a,#2a2c30);isolation:isolate}
.hero-video-el{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 40%;display:block;
  opacity:0;transition:opacity .5s ease}
.hero-video.is-ready .hero-video-el{opacity:1}
.hero-video:not(.is-ready)::after{content:"";position:absolute;inset:0;
  background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.08) 50%,transparent 70%);
  background-size:220% 100%;animation:abl-shimmer 1.6s linear infinite}
@keyframes abl-shimmer{from{background-position:120% 0}to{background-position:-120% 0}}
.hero-video.is-fallback::after,.hero-video.is-still::after{display:none}
@media (prefers-reduced-motion:reduce){.hero-video:not(.is-ready)::after{animation:none}}

/* ==========================================================================
   TABLET + PHONE  (<= 1023px)
   ========================================================================== */
@media (max-width:1023px){
  .home-hero .hero-frame{transform:none!important}
  .stage5-split>div:first-child,.p2-mistakes-grid>div:first-child{position:static!important}
}

/* ==========================================================================
   PHONE  (<= 767px)
   ========================================================================== */
@media (max-width:767px){

  /* --- 3. Layout rhythm: shorter pages, same hierarchy --- */
  .section{padding-block:clamp(2.25rem,9vw,3rem)!important}
  .wrap{padding-inline:max(1.1rem,env(safe-area-inset-left))!important}
  .h-section{font-size:clamp(1.6rem,7.2vw,2rem)!important;line-height:1.12!important}
  .lede{font-size:1.02rem!important;line-height:1.6!important}
  .kicker{margin-bottom:.9rem!important}
  .page-hero{padding-top:6.25rem!important;padding-bottom:1.75rem!important}
  .page-hero h1,.h-display{font-size:clamp(2rem,9.4vw,2.6rem)!important;line-height:1.06!important}

  /* --- 4. Cards that were squeezed into thin columns: always 1 column --- */
  .prob-grid,#problems .prob-grid,.include-grid,.post-grid,.work-grid,.studio-grid,.model-grid,.job-cards,
  .val-grid,.rel-grid,.feat-list,.ind-incl,.p2-grid,.hub-grid,.p2-hub-grid,.cred-grid,.cs-grid,.mini-steps{
    grid-template-columns:1fr!important;gap:.85rem!important}
  .prob-card,.ind-incl-card{padding:1.15rem 1.15rem 1.25rem!important}
  .prob-card h3,.ind-incl-card h3{font-size:1.1rem!important;line-height:1.25!important}
  .prob-card p,.ind-incl-card p{font-size:.95rem!important;line-height:1.55!important}

  /* trust strip under the hero: 1 column, icon + text rows (was 2 cramped columns) */
  .ind-trust ul{grid-template-columns:1fr!important;gap:.4rem!important}
  .ind-trust li{padding:.7rem .15rem!important;border-bottom:1px solid var(--line,#e6e3de)}
  .ind-trust li:last-child{border-bottom:0}
  .ind-trust li span{font-size:.9rem!important}

  /* --- 5. Stacking / sticky card effects are desktop-only: no overlap, no ghosting --- */
  .abl-stack-group.abl-stack-ready>*,
  .home .svc-cards>.svc-card,.home .svc-card.launch-panel-buried,
  .qstack>*,.q-card{position:relative!important;top:auto!important;transform:none!important;filter:none!important;
    will-change:auto!important;opacity:1!important}
  .abl-stack-group.abl-stack-ready>*:not(:last-child){margin-bottom:1rem!important}

  /* service cards on home: compact, consistent corners */
  .home .svc-cards>.svc-card{border-radius:20px!important}
  .svc-card-img,.svc-card-img img{border-radius:0!important;aspect-ratio:16/9!important}
  .svc-cards .svc-card .svc-card-body h3{font-size:clamp(1.5rem,6.6vw,1.8rem)!important}
  .svc-card-body{padding:1.1rem 1.15rem 1.2rem!important}

  /* disciplines / "one team" cards: tidy equal corners */
  .disc-sec-compact .disc-card img{aspect-ratio:16/9!important;border-radius:0!important}

  /* --- 6. Process: five stacked, readable steps (no scroll-jacking) --- */
  .proc{margin:0 .5rem!important}
  .proc-stick{padding:2rem 1rem 1.25rem!important}
  .proc-card{aspect-ratio:16/9!important}
  .proc-card img{width:100%!important;height:100%!important;object-fit:cover!important}
  .proc-step .proc-text h3{font-size:1.2rem!important}

  /* --- 7. Buttons and tap targets --- */
  .cta-row{display:flex;flex-direction:column;align-items:stretch;gap:.65rem!important}
  .cta-row .btn,.btn{min-height:48px;justify-content:center}
  .site-footer a,.fcol li a{min-height:40px;display:flex;align-items:center}
  .site-footer .footer-legal a{display:inline-flex}
  .nav-toggle, .menu-toggle {min-width:44px;min-height:44px}

  /* --- 8. Horizontal scrollers done properly (tables, filters, chips) --- */
  .compare-sec .compare-grid,.compare-grid,.table-wrap,.quote-breakdown{
    overflow-x:auto;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity;overscroll-behavior-x:contain}
  .filter-bar,.blog-filters,.filters{display:flex;gap:.5rem;overflow-x:auto;scroll-snap-type:x proximity;
    padding-bottom:.4rem;scrollbar-width:none}
  .filter-bar::-webkit-scrollbar,.blog-filters::-webkit-scrollbar,.filters::-webkit-scrollbar{display:none}
  .filter-btn{flex:none;scroll-snap-align:start}

  /* --- 9. Hero (home): video sits tight under the CTAs, pills stay below it --- */
  .home-hero .hero-grid{gap:1.5rem!important}
  .home-hero .hero-visual{margin-top:.25rem}
  .home-hero .hero-frame[data-hero-frame]{aspect-ratio:var(--hero-ar,4/3)!important;border-radius:18px}
  .hero-review-check{gap:.4rem!important}

  /* --- 10. Footer wordmark must never create sideways scroll --- */
  .site-footer{overflow:hidden}

  /* --- 11. Hover-only effects off on touch --- */
  .prob-card:hover,.svc-card:hover,.ind-card:hover,.sv-core:hover,.ix-card:hover{transform:none!important}
}

/* ==========================================================================
   SMALL PHONES (<= 380px)
   ========================================================================== */
@media (max-width:380px){
  .page-hero h1,.h-display{font-size:1.85rem!important}
  .btn{padding-inline:1rem}
}

/* ==========================================================================
   DESKTOP polish (>= 1024px)
   ========================================================================== */

/* ---------- Interactive explorers: node/tab rows scroll sideways instead of stacking 5 tall buttons ---------- */
@media (max-width:767px){
  .plumb-nodes{display:flex!important;flex-direction:row!important;gap:.5rem!important;overflow-x:auto;scroll-snap-type:x proximity;
    padding:.1rem .1rem .5rem;scrollbar-width:none;-webkit-overflow-scrolling:touch;
    /* M-C1 FIX 2026-11-08 (mobile QA): 616px strip in a 323px viewport hid 3 of 5 tabs with no cue. Right-edge fade mask signals more tabs; strip stays swipeable. */
    -webkit-mask-image:linear-gradient(to right,#000 calc(100% - 44px),transparent 100%);mask-image:linear-gradient(to right,#000 calc(100% - 44px),transparent 100%)}
  .plumb-nodes::-webkit-scrollbar{display:none}
  .plumb-node{flex:none!important;width:auto!important;white-space:nowrap;scroll-snap-align:start;min-height:44px;padding-inline:1.1rem!important}
}

/* ==========================================================================
   TEAM 4 (2026-11-02) — service-page mobile QA: sticky anchor-nav pills were
   min-height:40px (site-core-a.css), below the 44px minimum touch target.
   Scoped to mobile only; desktop untouched.
   ========================================================================== */
@media (max-width:767px){
  .anchor-nav a{min-height:44px!important}
}

/* ==========================================================================
   ISSUE A (2026-11-02) — mobile buttons too big (owner: "btn kafi bare")
   Owner's standing rule (2026-10-22): COMPACT on phones — small padding,
   smaller font, keep the 44px minimum touch target. All overrides scoped to
   phones only; desktop button styles are NOT touched.
   Cascade this beats (all mobile-inherited):
   - site-core-b.css:131  .btn{padding:.85rem 1.6rem!important;font-size:.98rem!important} (all viewports)
   - site-core-b.css:160  .footer-cta-actions .btn{padding:.85rem 1.6rem!important}
   - site-core-c3.css:48   .mobile-menu nav a.btn{padding:.85rem 1rem!important;font-size:1rem!important}
   - site-core-c3.css:301  .page-hero … .cta-row .btn{font-size:.86rem!important;padding:.75rem .55rem!important;min-height:48px}
   - site-core-a.css (@900px) .btn{min-height:46px} and (@760px) .cta-row .btn,form .btn{min-height:48px}
   - ablentra-mobile-pro.css §7 .cta-row .btn,.btn{min-height:48px} (this file, earlier)
   Note: nav "Free website review" CTA (.header-ctas .btn-accent) is display:none
   on phones already (ablentra-fixes-bundle.css) — nothing to compact there.
   Form inputs keep 16px font (iOS zoom guard, site-core-a.css) — NOT reduced.
   ========================================================================== */
@media (max-width:767px){
  /* Hero CTAs, section CTA buttons, form submit buttons, audit-band form button,
     footer CTA buttons, mobile-menu CTA — one compact standard */
  .btn, .footer-cta-actions .btn, .audit-band-final .audit-form .btn, form .btn, .cta-row .btn {
    min-height:44px!important;
    padding:.65rem 1.1rem!important;
    font-size:.88rem!important;
  }
  /* page-hero CTA row uses a higher-specificity rule in site-core-c3.css —
     replicate its selector verbatim (later file + same specificity wins) */
  .page-hero .wrap:has(.page-hero-visual)>.cta-row .btn,
  .page-hero .wrap:has(.services-hero-visual)>.cta-row .btn{
    min-height:44px!important;
    padding:.65rem .75rem!important;
    font-size:.86rem!important;
  }
  /* pill / filter buttons: already 44px-tall; tighten padding + font for consistency */
  .filter-btn{
    min-height:44px!important;
    padding:.55rem 1rem!important;
    font-size:.9rem!important;
  }
  /* button-adjacent spacing: buttons shouldn't dominate small screens */
  .cta-row{gap:.6rem!important}
  .footer-cta-actions{gap:.6rem!important}
}

/* ==========================================================================
   9. Mobile process timeline (2026-11-03 — Issue 6 rebuild)
   The single vertical spine runs behind the five numbered node badges on
   .proc-stage (structure in site-core-c3.css). proc-mobile.js lights the
   node in view (.is-on), marks completed ones (.is-done), and fills the
   spine via --pm-prog, all inside max-width:900px. Desktop untouched.
   ========================================================================== */
@media (max-width:900px){
  .proc-stage{--pm-prog:0}
  .proc-stage::before,.proc-stage::after{
    content:"";position:absolute;left:19px;top:calc(1.1rem + 20px);bottom:calc(1.1rem + 20px);
    width:2px;border-radius:2px;pointer-events:none;
  }
  .proc-stage::before{background:rgba(255,255,255,.14);z-index:0}
  .proc-stage::after{
    background:linear-gradient(180deg,#FF8A3D,#FF5A1F);
    box-shadow:0 0 10px rgba(255,90,31,.55);z-index:1;
    transform:scaleY(var(--pm-prog,0));transform-origin:top center;
    transition:transform .6s cubic-bezier(.22,1,.36,1);
  }
  /* final word on the node badge type: beats the global fixes-bundle font-size/color overrides */
  .proc-num{font-size:.95rem!important;font-weight:800!important;line-height:1!important;color:#fff!important}
  .proc-num.is-on{
    border-color:#FF5A1F!important;background:#FF5A1F!important;color:#fff!important;
    box-shadow:0 0 0 5px rgba(255,90,31,.18),0 0 18px rgba(255,90,31,.5)!important;
  }
  .proc-num.is-done{
    border-color:rgba(255,90,31,.65)!important;background:rgba(255,90,31,.14)!important;color:#FF8A3D!important;
  }
}
@media (prefers-reduced-motion:reduce){
  .proc-stage::after{transition:none}
}
