/* ==========================================================================
   MOBILE.CSS, Stripe-quality mobile reflow for the Radian Arc site
   ──────────────────────────────────────────────────────────────────────────
   Triggers at ≤ 820px (responsive-scale.js disables its zoom hack below this).
   Sub-breakpoint at ≤ 480px tightens for narrow phones.

   Strategy:
     • Real layout reflow, not a shrunken desktop. Position:absolute wrappers
       become relative normal-flow blocks. Multi-column grids collapse. Fixed
       module heights become auto.
     • Fluid typography via clamp(), large headlines stay readable (~34–48px)
       instead of zooming to 17px.
     • Decorative widgets that don't translate (3D globe, scrolling game walls,
       12-column gantt charts, chatbot dock) get hidden on mobile and replaced
       with summary text where appropriate.
     • Generous 20–24px gutters everywhere; cards stack with 16px gaps.
     • Hamburger nav (mobile-nav.js injects the button; this file styles both
       the trigger and the full-screen drawer).

   Loaded AFTER all per-page <style> blocks via <link rel="stylesheet">
   at the end of <head>, so cascade beats inline page styles. Where a rule
   must beat an inline style attribute or another !important, we use
   !important, applied surgically, not blanket.
   ========================================================================== */


/* ── HAMBURGER BUTTON ─────────────────────────────────────────────────────
   Injected into .brandbar on every page by mobile-nav.js. Hidden on desktop;
   visible at ≤820px. Styled to feel like a Stripe-style minimal icon button.
   ─────────────────────────────────────────────────────────────────────── */
.mobile-hamb{
  display:none;
  width:44px;height:44px;
  align-items:center;justify-content:center;
  background:transparent;
  border:1px solid var(--ink-3,#2a2c31);
  border-radius:10px;
  color:var(--text-hi,#fff);
  cursor:pointer;
  padding:0;
  transition:border-color .15s ease,background .15s ease;
}
.mobile-hamb:hover{border-color:var(--accent,#FFC629);background:rgba(255,198,41,0.06)}
.mobile-hamb svg{display:block}


/* ── MOBILE DRAWER (full-screen menu) ─────────────────────────────────────
   Appended to <body>. Hidden by default; .is-open reveals.
   ─────────────────────────────────────────────────────────────────────── */
.mobile-drawer{
  position:fixed;inset:0;
  z-index:9999;
  pointer-events:none;
  opacity:0;
  transition:opacity .22s ease;
}
.mobile-drawer.is-open{opacity:1;pointer-events:auto}
.mobile-drawer .md-backdrop{
  position:absolute;inset:0;
  background:rgba(6,6,9,0.78);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.mobile-drawer .md-sheet{
  position:absolute;inset:0;
  background:linear-gradient(180deg,#0a0a0b 0%, #08080a 100%);
  display:flex;flex-direction:column;
  padding:0;
  transform:translateY(-12px);
  transition:transform .26s cubic-bezier(.22,1,.36,1);
}
.mobile-drawer.is-open .md-sheet{transform:translateY(0)}
.mobile-drawer .md-top{
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 20px;
  border-bottom:1px solid var(--ink-2,#1a1b1e);
}
.mobile-drawer .md-mark img{height:24px;width:auto;display:block}
.mobile-drawer .md-close{
  width:44px;height:44px;
  display:inline-flex;align-items:center;justify-content:center;
  background:transparent;
  border:1px solid var(--ink-3,#2a2c31);
  border-radius:10px;
  color:var(--text-hi,#fff);
  cursor:pointer;padding:0;
}
.mobile-drawer .md-links{
  display:flex;flex-direction:column;
  padding:32px 24px 24px;
  gap:4px;
  flex:1;
}
.mobile-drawer .md-links a{
  font-family:"Space Grotesk",sans-serif;
  font-size:24px;font-weight:500;letter-spacing:-0.01em;
  color:var(--text-hi,#fff);
  text-decoration:none;
  padding:14px 0;
  border-bottom:1px solid var(--ink-2,#1a1b1e);
  display:flex;align-items:center;justify-content:space-between;
  transition:color .15s ease;
}
.mobile-drawer .md-links a::after{
  content:"→";
  color:var(--text-mute,#6b6d75);
  font-size:18px;
  transition:transform .15s ease,color .15s ease;
}
.mobile-drawer .md-links a:hover{color:var(--accent,#FFC629)}
.mobile-drawer .md-links a:hover::after{color:var(--accent,#FFC629);transform:translateX(4px)}
.mobile-drawer .md-links a.cur{color:var(--accent,#FFC629)}
.mobile-drawer .md-foot{
  padding:24px;
  border-top:1px solid var(--ink-2,#1a1b1e);
  display:flex;flex-direction:column;gap:14px;
}
.mobile-drawer .md-cta{
  display:inline-flex;align-items:center;justify-content:center;
  padding:16px 24px;
  background:var(--accent,#FFC629);
  color:#0a0a0b;
  border-radius:10px;
  font-family:"Space Grotesk",sans-serif;
  font-size:15px;font-weight:600;letter-spacing:-0.01em;
  text-decoration:none;
  transition:transform .15s ease;
}
.mobile-drawer .md-cta:hover{transform:translateY(-1px)}
.mobile-drawer .md-meta{
  font-family:"JetBrains Mono",monospace;
  font-size:11px;letter-spacing:0.12em;text-transform:uppercase;
  color:var(--text-mute,#6b6d75);
  text-align:center;
}


/* ══════════════════════════════════════════════════════════════════════════
   ≤ 820px, MOBILE LAYOUT TAKES OVER
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 820px){

  /* ── FRAME & GLOBAL CONTAINER ─────────────────────────────────────────── */
  .frame{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    margin:0 !important;
    overflow-x:hidden !important;
  }
  /* Kill the desktop vertical-guides pseudo-element (1820px-fixed positions). */
  .frame::before{display:none !important}

  /* ── ALL MODULES → AUTO HEIGHT, NORMAL FLOW ──────────────────────────── */
  .frame > .module,
  .module--hero,.module--strip,.module--globe,.module--cat,
  .module--gtm,.module--com,.module--closer,.module--foot,
  .module--amd,.module--stack,.module--rack,.module--fed,
  .module--coverage,.module--beyond,
  .m01,.m02,.m03,.m04,.m4b,.m05,.m06,.m07,.m08,.m09,.m-foot{
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    padding:0 !important;
    position:relative !important;
  }

  /* ── BRANDBAR → FLEX TOP STRIP (logo + hamburger) ─────────────────────── */
  .brandbar{
    position:sticky !important;
    top:0 !important;left:0 !important;right:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:12px !important;
    padding:14px 20px !important;
    background:rgba(8,8,10,0.92) !important;
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
    border-bottom:1px solid var(--ink-2,#1a1b1e);
    z-index:100 !important;
    height:auto !important;
    width:auto !important;
  }
  .brandbar .mark img{height:24px !important}
  .brandbar .nav{display:none !important}
  .brandbar .bar-right{display:none !important}
  .mobile-hamb{display:inline-flex}

  /* ── UNIVERSAL WRAPPER NORMALIZATION ──────────────────────────────────
     Every page builds its modules with an inner .*-wrap div that's
     position:absolute; inset: 100px 160px ...; display:grid.
     On mobile, these all become normal-flow blocks with 20px gutters.
     ─────────────────────────────────────────────────────────────────── */
  .gwrap,.cat-wrap,.gtm-wrap,.com-wrap,.closer,
  .m01-wrap,.m02-wrap,.m03-wrap,.m04-wrap,.m4b-wrap,
  .m05-wrap,.m06-wrap,.m07-wrap,.m08-wrap,.m09-wrap,
  .hero,.amd,.stack,.rack-mod,.fed,.cov,.beyond,
  .m08-inner,.strip-inner{
    position:relative !important;
    inset:auto !important;
    top:auto !important;right:auto !important;bottom:auto !important;left:auto !important;
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    padding:56px 20px !important;
    display:block !important;
    grid-template-columns:1fr !important;
    grid-template-rows:auto !important;
    gap:32px !important;
    align-items:stretch !important;
  }

  /* Heads (eyebrow row above two-column grids) collapse to single column too */
  .gtm-headrow,.m02-head,.m03-head,.m04-head,.m4b-head,.m05-head,
  .m06-head,.m07-head,.m08-head,.m09-head,.cl-left,.cl-right{
    display:block !important;
    grid-template-columns:1fr !important;
    gap:20px !important;
    padding:0 !important;
    margin-bottom:32px !important;
  }
  /* Kill the decorative vertical rule between head columns */
  .gtm-headrow::before,.gtm-headrow::after,
  .m04-head::before,.m04-head::after,
  .m05-head::before,.m05-head::after,
  .m06-head::before,.m06-head::after,
  .m07-head::before,.m07-head::after,
  .m08-head::before,.m08-head::after,
  .m02-head::before,.m02-head::after,
  .m03-head::before,.m03-head::after,
  .m4b-head::before,.m4b-head::after,
  .m09-head::before,.m09-head::after{display:none !important}

  /* Sub-paragraphs in heads, remove the 72px top padding that pushed them
     down on desktop (they used to align to the headline baseline). */
  .gtm-headrow .gtm-sub,
  .m02-sub,.m03-sub,.m04-sub,.m4b-sub,.m05-sub,
  .m06-sub,.m07-sub,.m08-sub,.m09-sub{
    padding-top:0 !important;
    max-width:100% !important;
    margin-bottom:0 !important;
  }


  /* ══════════════════════════════════════════════════════════════════════
     FLUID TYPOGRAPHY, clamp() everywhere, no fixed huge sizes
     ══════════════════════════════════════════════════════════════════════ */

  /* Massive hero h1, was 84–92px on desktop. */
  .hero-h1,.m01 h1,.hero h1,
  .module--hero h1,.module--hero .hero-h1{
    font-size:clamp(34px, 9.5vw, 52px) !important;
    line-height:1.05 !important;
    letter-spacing:-0.02em !important;
    margin-bottom:20px !important;
  }

  /* Section h2, was 56–72px. */
  .g-h2,.cat-h2,.gtm-h2,.com-h2,.cl-h2,
  .m01-h1,.m02 h2,.m02-head h2,.m03 h2,.m03-head h2,
  .m04 h2,.m04-head h2,.m4b h2,
  .m05 h2,.m05-head h2,.m06 h2,.m06-head h2,
  .m07 h2,.m07-head h2,.m08 h2,.m08-head h2,
  .m09 h2,.m09-head h2,
  .amd-left h2,.stack-head h2,.rm-head h2,.fed h2,.cov h2,.beyond h2,
  .m02-h2,.m03-h2,.m04-h2,.m05-h2,.m06-h2,.m07-h2,.m08-h2,.m09-h2{
    font-size:clamp(30px, 7.5vw, 44px) !important;
    line-height:1.04 !important;
    letter-spacing:-0.02em !important;
    margin-bottom:16px !important;
    max-width:100% !important;
  }

  /* Sub-paragraphs / lead text */
  .hero-sub,.g-sub,.cat-sub,.gtm-sub,.com-sub,.cl-sub,
  .m01-sub,.m02-sub,.m03-sub,.m04-sub,.m4b-sub,.m05-sub,
  .m06-sub,.m07-sub,.m08-sub,.m09-sub{
    font-size:16px !important;
    line-height:1.55 !important;
    max-width:100% !important;
    margin-bottom:24px !important;
  }

  /* Card titles */
  .bucket .b-title,.bkt2 .bk-title,.bk3 .b3-title,
  .gSideCard .gs-title,.gHero .gh-title,
  .m02-panel h3,.m03-feat,.m04-card,.m07-card{
    /* baseline, specific overrides below if needed */
  }

  /* Kicker / eyebrow, already 10–12px, but clean spacing */
  .kicker{font-size:11px !important;letter-spacing:0.14em !important}
  .eyerow{flex-wrap:wrap !important;gap:16px !important;width:auto !important}


  /* ══════════════════════════════════════════════════════════════════════
     HIDE COMPLEX DESKTOP-ONLY WIDGETS ON MOBILE
     ══════════════════════════════════════════════════════════════════════ */

  /* 3D dotted globe (cloud-engine, home.html), huge, animated, doesn't reflow */
  .g-right canvas,.gHero .gh-stage,canvas#globe,
  .module--globe canvas,.module--coverage canvas{display:none !important}

  /* Scrolling game-cover walls, 5-column infinite scroll, can't compress */
  .cat-wall,.cat-col,.cat-track,.m01-reel,.m05-wall,
  .m08-inner .m08-strip,.m08-marquee{display:none !important}

  /* The chatbot dock (RCM = Radian Cloud Mage), too dense for phone */
  .rcm-dock,#rcm-dock,.rcm-bot{display:none !important}

  /* Decorative absolute-positioned visual blocks that float in the hero
     right column (phone mockups, animated panels). The page-specific
     visual columns get a single-image fallback or are hidden. */
  .g-right,.cat-right,.com-right,.cl-right{
    margin-top:24px !important;
  }

  /* Partner marquee (home), show as a compact static row instead of animated strip */
  .module--strip{padding:32px 20px !important}
  .strip-inner{padding:0 !important;gap:16px !important}
  .strip-track{animation:none !important;flex-wrap:wrap !important;justify-content:center !important}


  /* ══════════════════════════════════════════════════════════════════════
     MULTI-COLUMN GRIDS → SINGLE COLUMN (with select 2-col cases preserved)
     ══════════════════════════════════════════════════════════════════════ */

  /* Stats rows that read well as 2-col on phones */
  .meta,.hero-meta,.m01-stats,.g-stats,.cat-stats,.gtm-stats,.com-stats,
  .m02-spec .rows,.sd-specs,.m08-dash .rev,
  .m03-grid,.m03-split,.foot-brands{
    grid-template-columns:repeat(2,1fr) !important;
    gap:16px !important;
  }

  /* 3+ column grids → 1-col stack */
  .m03-features,.m03-channels,.m07-stack,
  .m04-grid,.m4b-ch-grid,.m06-bundles,.m09-row,
  .m05-filters,.m04-grid,.m07-grid,.m06-grid,.m05-grid,
  .gtmA-grid,.gtmB-grid,.mkt-mosaic,.mkt-mosaic-row2,.mkt-grid,
  .flowrow{
    grid-template-columns:1fr !important;
    grid-template-rows:auto !important;
    gap:14px !important;
  }

  /* Two-column hero / split layouts → 1-col stack */
  .m02-grid,.m03-top,.m08-grid,
  .gtmCombo,.gSide,.gtmC-stack,
  .closer{
    grid-template-columns:1fr !important;
    grid-template-rows:auto !important;
    gap:24px !important;
  }

  /* Funnel (4-stage horizontal) → vertical stack */
  .m02-funnel{
    grid-template-columns:1fr !important;
    gap:12px !important;
  }
  .m02-stage:first-child,.m02-stage:last-child{border-radius:10px !important}
  .m02-foot{display:none !important} /* 4-col footer of the funnel, redundant info */

  /* Timeline / gantt-style 4–5 column grids, collapse to vertical list */
  .m06-row,.m06-rows,.m06-quarters,.m06-gridlines,
  .m06-weeks,.m06-phases,
  .m07-row,.m07-months{
    display:flex !important;
    flex-direction:column !important;
    gap:10px !important;
    grid-template-columns:none !important;
  }

  /* commercials.html, 3-col plan grid, 4-col cards, ribbons, charts */
  .m03-grid{grid-template-columns:1fr !important;gap:14px !important}
  .m04-grid{grid-template-columns:1fr !important;gap:14px !important}
  .m05-ribbon{grid-template-columns:repeat(2,1fr) !important}
  .m05-chart .bar-group{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:8px !important;
    text-align:left !important;
  }
  .m06-grid,.m07-grid{grid-template-columns:1fr !important;gap:14px !important}
  .m08-row{
    grid-template-columns:1fr !important;
    gap:8px !important;
  }
  .m08-axis{display:none !important} /* horizontal axis on mobile is meaningless */
  .m02-panel li{
    grid-template-columns:1fr !important;
    gap:8px !important;
  }
  .m02-panel.econ li{grid-template-columns:1fr !important;gap:6px !important}
  .m02-panel{padding:28px 20px !important}
  .m02-panel h3{font-size:24px !important;margin-bottom:18px !important}

  /* m03 plan columns (commercials), keep min-height reasonable */
  .m03-col{min-height:0 !important;padding:28px 24px !important}

  /* cloud-engine.html, special grids */
  .stack-grid{grid-template-columns:1fr !important;gap:24px !important}
  .rm-grid{grid-template-columns:1fr !important;gap:20px !important}
  .bp-u.gpu .gpu-arr{grid-template-columns:repeat(4,1fr) !important}
  .cap-row{
    grid-template-columns:48px 1fr 70px !important;
    gap:10px !important;
    font-size:11px !important;
  }
  .bom-row{grid-template-columns:32px 1fr auto !important;gap:10px !important}
  .amd-fact{grid-template-columns:32px 1fr !important;gap:12px !important}

  /* m06 (commercials) chart card */
  .m06-chart{padding:28px 22px !important}

  /* m02 catalogue spec block (5-col bars) */
  .m02-eq .bars{grid-template-columns:repeat(5,1fr) !important;height:60px !important}

  /* m01 catalogue stats, 4-col → 2-col */
  .m01-stats{grid-template-columns:repeat(2,1fr) !important;padding-top:24px !important}

  /* Hero meta (cloud-engine 4-col) → 2-col */
  .hero-meta{grid-template-columns:repeat(2,1fr) !important;padding-top:24px !important;margin-top:28px !important}
  .hero-meta .num{font-size:22px !important}


  /* ══════════════════════════════════════════════════════════════════════
     CARDS, PANELS, BUTTONS, tighten padding, normalize sizes
     ══════════════════════════════════════════════════════════════════════ */
  .m01-stat,.cat-stats > div,.gtm-stats > div,.com-stats > div,
  .meta > div,.hero-meta > div{
    min-height:0 !important;
    padding:18px 16px !important;
  }
  .m01-stat .n,.cat-stats .gn,.gtm-stats .gn,.com-stats .gn,
  .meta .num,.g-stats .gn{
    font-size:26px !important;
  }

  /* Generic card padding */
  .m03-feat,.m04-card,.m06-bundle,.m07-card,.m09-foot .col,
  .bucket,.bkt2,.bk3,.gSideCard,.gHero,
  .m03-card,.m02-panel,.m04-flow,.m08-dash,.m07-cal{
    padding:24px 20px !important;
    min-height:0 !important;
  }

  /* Buttons, make them tap-friendly, full-width-ish on mobile */
  .btn,.btn-primary,.btn-ghost,.dl-btn{
    padding:14px 20px !important;
    font-size:14px !important;
    min-height:48px !important;
  }
  .btn-row{flex-wrap:wrap !important;gap:10px !important}
  .btn-row .btn{flex:1 1 calc(50% - 5px);text-align:center;justify-content:center;display:inline-flex;align-items:center}


  /* ══════════════════════════════════════════════════════════════════════
     FOOTER
     ══════════════════════════════════════════════════════════════════════ */
  .foot{
    padding:56px 20px 32px !important;
    gap:36px !important;
  }
  .foot-brands{
    grid-template-columns:1fr !important;
    gap:32px !important;
    justify-content:start !important;
  }
  .foot-col{gap:12px !important}
  .foot-col address{max-width:100% !important;font-size:13px !important}

  /* The bottom rail (5-col link grid in commercials) */
  .m09-foot{
    grid-template-columns:repeat(2,1fr) !important;
    gap:32px 20px !important;
    padding-top:32px !important;
  }
  .m09-foot .col.brandcol{grid-column:1 / -1}

  /* Footer end-strip (copyright + nav) */
  .foot-end{
    flex-direction:column !important;
    align-items:flex-start !important;
    gap:18px !important;
    padding:24px 0 0 !important;
  }
  .foot-end nav{
    flex-wrap:wrap !important;
    gap:14px 20px !important;
  }


  /* ══════════════════════════════════════════════════════════════════════
     HOME.HERO SPECIAL CASES
     ══════════════════════════════════════════════════════════════════════ */
  .module--hero{
    /* Hero on home page, keep the gradient background but stack content */
  }
  .module--hero .hero-h1{margin-top:8px !important}
  .module--hero .btn-row{margin-top:24px !important}

  /* Marketing/GTM big combo, its inner grid (1.12fr / 1fr) collapses,
     and the side buckets / mosaic become a vertical stack. */
  .gtmCombo > *,.gSide > *,.mkt-mosaic > *,.mkt-mosaic-row2 > *{
    width:100% !important;
  }

  /* gHero internal grid (copy + phone landscape) */
  .gHero{
    grid-template-columns:1fr !important;
    grid-template-rows:auto auto !important;
    padding:24px !important;
  }
  .gHero .gh-stage{max-width:100% !important;margin-top:16px !important}

  /* gSideCard internal grid (copy + media) */
  .gSideCard{
    grid-template-columns:1fr !important;
    padding:20px !important;
    gap:14px !important;
  }
  .gSideCard .gs-vis{height:160px !important}

  /* bk3 wide split card */
  .bk3{
    grid-template-columns:1fr !important;
    grid-template-rows:auto auto !important;
  }
  .bk3 .b3-copy{padding:24px !important}
  .bk3 .b3-stage{height:200px !important}

  /* mm-cell labels above cards (Stripe pattern in home) */
  .mm-cell{gap:8px !important}
  .mm-label{flex-wrap:wrap !important}
}


/* ══════════════════════════════════════════════════════════════════════════
   ≤ 480px, NARROW PHONE (iPhone SE, small Android)
   Further tighten: collapse remaining 2-cols, shrink hero a touch.
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px){
  .gwrap,.cat-wrap,.gtm-wrap,.com-wrap,.closer,
  .m01-wrap,.m02-wrap,.m03-wrap,.m04-wrap,.m4b-wrap,
  .m05-wrap,.m06-wrap,.m07-wrap,.m08-wrap,.m09-wrap,
  .hero,.amd,.stack,.rack-mod,.fed,.cov,.beyond,
  .m08-inner,.strip-inner,.foot{
    padding-left:16px !important;
    padding-right:16px !important;
    padding-top:48px !important;
    padding-bottom:48px !important;
  }
  /* Stats grids that survived as 2-col now collapse */
  .meta,.hero-meta,.m01-stats,.g-stats,.cat-stats,.gtm-stats,.com-stats,
  .m02-spec .rows,.sd-specs,.m08-dash .rev,
  .m03-grid,.m03-split,.foot-brands,.m09-foot,.m05-ribbon{
    grid-template-columns:1fr !important;
    gap:14px !important;
  }
  .m09-foot .col.brandcol{grid-column:1 / -1}
  .hero-h1,.m01 h1,.hero h1{font-size:clamp(28px, 8.5vw, 38px) !important}
  .g-h2,.cat-h2,.gtm-h2,.com-h2,.cl-h2,
  .m02 h2,.m03 h2,.m04 h2,.m05 h2,.m06 h2,.m07 h2,.m08 h2,.m09 h2,
  .amd-left h2,.stack-head h2,.rm-head h2{
    font-size:clamp(26px, 7vw, 36px) !important;
  }
  .btn-row .btn{flex:1 1 100%}
  .brandbar{padding:12px 16px !important}
  .brandbar .mark img{height:22px !important}
}
