/* home-mobile.css — comprehensive mobile optimization (overrides home.css + v2/v3/v4) */

/* ═══ GLOBAL OVERFLOW GUARDRAIL ═══
   Kills horizontal scroll sitewide. `overflow-x: clip` is stronger than hidden
   — content truly cannot escape the container's box (hidden still allows
   programmatic scroll which some browsers/CSS effects triggered). */
html, body {
  overflow-x: clip !important;
  max-width: 100vw;
}
body { position: relative; }

/* Every major section — constrain to viewport width so stray wide children
   (3D transforms, absolute-positioned blobs, orbit cards) can't bleed past. */
.hero, .marquee, .section, .impact, .testimonial, .why, .faq, .cta, .footer, .globe-section {
  max-width: 100vw;
  overflow-x: clip;
}

/* ═══ HAMBURGER BUTTON ═══ */
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  color: var(--fg-2);
  cursor: pointer;
  align-items: center; justify-content: center;
  padding: 0;
  transition: color .2s, border-color .2s;
}
.nav-burger:hover { color: var(--fg); border-color: var(--fg-4); }
.nav-burger svg { width: 20px; height: 20px; }
.nav-burger .icon-x { display: none; }
.nav-burger.open .icon-menu { display: none; }
.nav-burger.open .icon-x { display: block; }

/* ═══ MOBILE DRAWER ═══ */
.nav-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(360px, 92vw);    /* wider — drawer covers most of the screen */
  height: 100dvh;
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  z-index: 90;
  padding: 88px 24px 32px;
  display: flex; flex-direction: column;
  overflow-y: auto;
  box-shadow: -20px 0 60px -10px rgba(0,0,0,0.6);
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer ul { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 2px; }
.nav-drawer li a {
  display: block;
  padding: 14px 14px;
  font-size: 16px; font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
  border-radius: 8px;
  border-bottom: 1px solid var(--line-2);
  transition: background .18s, color .18s;
}
.nav-drawer li a:hover,
.nav-drawer li a:active { background: color-mix(in oklab, var(--fg) 5%, transparent); color: var(--acc); }
.nav-drawer .drawer-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 24px; border-top: 1px solid var(--line); }
.nav-drawer .drawer-actions .btn { width: 100%; justify-content: center; padding: 14px 18px; font-size: 14px; }
.nav-drawer .drawer-actions .nav-login {
  text-align: center;
  padding: 13px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--fg);
}

.nav-overlay {
  position: fixed; inset: 0; z-index: 89;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.nav-overlay.open { opacity: 1; pointer-events: auto; }

body.drawer-open { overflow: hidden; position: fixed; width: 100%; }

/* ═══ BELOW 880px — show hamburger, hide inline nav ═══ */
@media (max-width: 880px) {
  .nav-burger { display: inline-flex; }
  .nav-links { display: none; }
  .nav-actions .nav-login,
  .nav-actions .btn-primary { display: none; }
  .nav { padding: 14px var(--pad-x); }
  .nav-logo { font-size: 15px; }
}

/* ═══ BELOW 760px — tighten hero + typography ═══ */
@media (max-width: 760px) {
  /* hero — force single column + no padding overflow */
  .hero { padding-top: 120px !important; padding-bottom: 64px; min-height: auto !important; padding-left: var(--pad-x) !important; padding-right: var(--pad-x) !important; }
  .hero-inner {
    grid-template-columns: 1fr !important;   /* belt-and-braces vs home-v2's !important */
    gap: 40px !important;
    max-width: 100%;
  }
  .hero-left, .hero-right { min-width: 0; max-width: 100%; }

  /* Kill the word-reveal animation on mobile. The translateY + rotateX + blur
     keyframes briefly push letters off-viewport during animation, triggering
     transient horizontal scroll. Mobile doesn't need the flourish. */
  .hero-title .w {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
    display: inline !important;       /* was inline-block — simpler word wrap */
  }
  .hero-title {
    font-size: clamp(38px, 9vw, 52px) !important;
    letter-spacing: -0.03em !important;
    line-height: 1.05 !important;
    text-wrap: balance;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .hero-sub { font-size: 15.5px; margin-bottom: 28px; max-width: 100%; }
  .eyebrow { font-size: 11.5px; margin-bottom: 20px; }
  .hero-orb {
    width: 320px !important; height: 320px !important;
    top: -60px !important; left: -80px !important;     /* tightened so orb doesn't extend past viewport */
  }
  .hero-cta { flex-wrap: wrap; }
  .hero-cta .btn { padding: 12px 18px; font-size: 13px; }
  .hero-proof { padding-top: 20px; gap: 12px; flex-wrap: wrap; }
  .proof-text { font-size: 12px; min-width: 0; }

  /* scene / dash */
  .scene-flow { display: none; }
  .scene-globe::before { width: 280px !important; height: 280px !important; }
  .sg-ring { width: 240px !important; height: 240px !important; }
  .sg-ring.r2 { width: 190px !important; height: 190px !important; }
  .sg-ring.r3 { width: 150px !important; height: 150px !important; }
  .sg-ring.r4 { width: 260px !important; height: 70px !important; }
  .sg-ring.r5 { width: 290px !important; height: 55px !important; }
  .sg-core { width: 60px !important; height: 60px !important; }
  .dash { max-width: 100% !important; }
  .dash-head { padding: 12px 14px; }
  .dash-label { font-size: 11px; }
  .dash-meta { font-size: 11px; gap: 6px; }
  .dash-lanes { padding: 10px 8px 12px; }
  .lane { grid-template-columns: 24px 82px 1fr 52px; gap: 8px; padding: 6px 8px; }
  .lane-avatar { width: 20px; height: 20px; font-size: 10px; border-radius: 5px; }
  .lane-name { font-size: 12px; }
  .lane-val { font-size: 11.5px; }
  .dash-winner { margin: 4px 8px 10px; padding: 12px 14px; }
  .dash-winner-val { font-size: 22px; }
  .dash-winner-avatar { width: 28px; height: 28px; font-size: 12px; border-radius: 7px; }
  .dash-winner-name { font-size: 12.5px; }
  .dash-winner-lift { font-size: 11px; }
  .dash-foot-item { padding: 12px 10px; }
  .dash-foot-label { font-size: 9.5px; }
  .dash-foot-val { font-size: 15px; }
  .dash-caption { font-size: 11.5px; }

  /* marquee */
  .marquee { padding: 32px 0 40px; }
  .marquee-label { font-size: 10.5px; margin-bottom: 18px; }
  .mq-item { font-size: 14px; }
  .marquee-inner { gap: 24px; padding-right: 24px; }

  /* section base */
  .section { padding: 72px var(--pad-x); }
  .section-head { margin-bottom: 44px; }
  .section-title { font-size: clamp(30px, 7.2vw, 40px) !important; line-height: 1.1 !important; }
  .section-sub { font-size: 15px; }
  .section-eyebrow { font-size: 10.5px; margin-bottom: 14px; }

  /* solutions */
  .sol-grid { gap: 12px !important; }
  .sol-card { padding: 28px 22px 24px !important; min-height: auto; }
  .sol-icon { width: 42px !important; height: 42px !important; margin-bottom: 18px; }
  .sol-icon svg { width: 20px !important; height: 20px !important; }
  .sol-title { font-size: 17px; }
  .sol-desc { font-size: 13.5px; margin-bottom: 18px; }
  .sol-mini-val { font-size: 18px; }

  /* network radar */
  .globe-section { padding: 72px var(--pad-x) !important; gap: 40px !important; }
  .ntw-wrap { max-width: 340px; }
  .ntw-core { width: 90px; height: 90px; margin-top: -45px; margin-left: -45px; }
  .ntw-core img { width: 28px; height: 28px; }
  .ntw-core-label { font-size: 9.5px; }
  .ntw-core-label span { font-size: 8px; }
  .ntw-chip { font-size: 9px; padding: 3px 6px; gap: 4px; }
  .ntw-t1 { font-size: 9.5px; padding: 4px 7px; }
  .ntw-chip .ntw-bid { font-size: 8.5px; padding: 1px 4px; }
  .ntw-ticker { font-size: 10px; padding: 6px 10px; gap: 6px; }
  .ntw-tick-val { font-size: 11.5px; min-width: 44px; }
  .ntw-tick-label { font-size: 9px; padding: 2px 6px; }
  .ntw-tick-meta { font-size: 9.5px; }
  .globe-metrics { grid-template-columns: 1fr 1fr !important; gap: 10px; margin-top: 28px; }
  .gm-card { padding: 16px 18px; }
  .gm-val { font-size: 22px; }
  .gm-label { font-size: 10.5px; }

  /* process */
  .proc-layout { gap: 40px !important; }
  .proc-step { padding: 20px 20px 20px 56px !important; grid-template-columns: 1fr !important; }
  .proc-step .proc-num { top: 22px !important; left: 20px !important; }
  .proc-title { font-size: 16px; }
  .proc-desc { font-size: 13.5px; }
  .proc-time { justify-self: start; margin-top: 8px; font-size: 11px; }

  /* impact */
  .impact { padding: 64px var(--pad-x) !important; gap: 32px !important; }
  .impact-item { padding: 32px 24px !important; }
  .impact-val { font-size: clamp(54px, 14vw, 84px) !important; }
  .impact-val sup { font-size: 0.42em; }
  .impact-val .unit { font-size: 0.38em; }
  .impact-label { font-size: 13px; }
  .impact-desc { font-size: 12.5px; }

  /* testimonial */
  .testimonial { padding: 72px var(--pad-x) !important; gap: 32px !important; }
  .testimonial::before { font-size: 160px !important; top: 20px !important; }
  .testi-quote { font-size: clamp(22px, 5.5vw, 30px) !important; line-height: 1.3 !important; }
  .testi-av { width: 40px; height: 40px; font-size: 12px; }

  /* why */
  .why { padding: 72px var(--pad-x); }
  .why-grid { gap: 12px !important; margin-top: 40px; }
  .why-card { padding: 24px 20px !important; }
  .why-icon { width: 38px !important; height: 38px !important; margin-bottom: 18px; }
  .why-icon svg { width: 18px !important; height: 18px !important; }
  .why-title { font-size: 14.5px; }
  .why-desc { font-size: 12.5px; }

  /* faq */
  .faq { padding: 72px var(--pad-x); }
  .faq-head { margin-bottom: 36px; }
  .faq-q { font-size: 14.5px; padding: 20px 0; gap: 14px; }
  .faq-a-inner { font-size: 13.5px; padding-bottom: 22px; }

  /* cta */
  .cta { padding: 80px var(--pad-x); }
  .cta-title { font-size: clamp(36px, 9vw, 56px) !important; }
  .cta-sub { font-size: 15px; margin-bottom: 28px; }

  /* footer */
  .footer { padding: 48px var(--pad-x) 32px; }
  .ft-top { grid-template-columns: 1fr 1fr !important; gap: 28px !important; margin-bottom: 40px; }
  .ft-brand { grid-column: 1 / -1; font-size: 13px; max-width: none; }
  .ft-col h6 { font-size: 11px; margin-bottom: 12px; }
  .ft-col a { font-size: 13px; }
  .ft-bot { font-size: 11.5px; padding-top: 22px; }
}

/* ═══ BELOW 480px — extra tightening for small phones ═══ */
@media (max-width: 480px) {
  :root { --pad-x: 18px; }
  .nav { padding: 12px var(--pad-x); }
  .nav-wordmark { height: 28px; }
  .nav-mark { width: 30px; height: 30px; }

  .hero { padding-top: 100px !important; }
  .hero-title { font-size: clamp(32px, 9.5vw, 42px) !important; }
  .hero-cta { gap: 8px; flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; width: 100%; }
  .hero-sub { font-size: 14.5px; }
  .proof-av { width: 26px; height: 26px; font-size: 9px; }
  .hero-orb { width: 280px !important; height: 280px !important; left: -60px !important; }

  /* hide dash caption on very small to save space */
  .dash-caption { display: none; }

  /* stack network copy + viz vertically with radar on top */
  .globe-section { grid-template-columns: 1fr !important; }
  .ntw-wrap { max-width: 280px; order: -1; }

  /* stack impact stats */
  .impact { grid-template-columns: 1fr !important; }

  /* why grid 2-col even on small */
  .why-grid { grid-template-columns: 1fr !important; }

  /* hide mesh-bg blobs for perf on small devices */
  .mesh-bg::before, .mesh-bg::after { opacity: 0.18 !important; filter: blur(80px) !important; }
  .noise-layer { opacity: 0.02; }
}

/* ═══ BELOW 380px — tiny phones ═══ */
@media (max-width: 380px) {
  .hero-title { font-size: 30px !important; }
  .section-title { font-size: 26px !important; }
  .impact-val { font-size: 48px !important; }
  .cta-title { font-size: 32px !important; }
  .ft-top { grid-template-columns: 1fr !important; }
}

/* ═══ TOUCH — kill hover lifts that feel bad on touch ═══ */
@media (hover: none) {
  .sol-card:hover { transform: none !important; }
  .impact-item:hover { transform: none !important; }
  .why-card:hover { transform: none !important; }
  .proc-step:hover { transform: none !important; }
  .gm-card:hover { transform: none !important; }
  .hero-right:hover .dash { transform: none !important; }
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .mesh-bg::before, .mesh-bg::after { animation: none !important; }
  .hero-title .w { opacity: 1 !important; transform: none !important; filter: none !important; }
}
