/* RISE — mobile layout corrections. Inline styles stay the source of truth;
   these media rules only collapse desktop geometry on small screens. */

/* fr tracks must be allowed to shrink below their content's min-content width,
   or image-slot placeholders blow the grid out past the viewport. */
image-slot, img { min-width: 0; }

/* On touch screens the image slots must not swallow a scroll gesture.
   Dragging images in still works on any mouse/trackpad device. */
@media (pointer: coarse) {
  image-slot { touch-action: pan-y !important; pointer-events: none !important; }
}
[style*="grid-template-columns"] > * { min-width: 0; }

@media (max-width: 1024px) {
  nav, header, section, footer, main {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  section { padding-top: 64px !important; padding-bottom: 64px !important; }

  /* every multi-column grid becomes a single column */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  [style*="min-width"] { min-width: 0 !important; }
  [style*="max-width: 1320px"],
  [style*="max-width: 1100px"],
  [style*="max-width: 900px"],
  [style*="max-width: 640px"],
  [style*="max-width: 620px"],
  [style*="max-width: 560px"],
  [style*="max-width: 520px"],
  [style*="max-width: 480px"] { max-width: 100% !important; }

  /* negative pull-ups under the ghost words */
  [style*="vw auto 0"] { margin-top: 0 !important; }

  /* fixed side columns (form imagery, proof rail) */
  [style*="width: 320px"],
  [style*="width: 340px"] { width: 100% !important; }
  [style*="min-height: 480px"] { min-height: 240px !important; }

  /* roomy desktop card padding */
  [style*="padding: 40px 44px"],
  [style*="padding: 34px 44px"],
  [style*="padding: 72px 64px"],
  [style*="padding: 64px 56px"],
  [style*="padding: 40px 48px"],
  [style*="padding: 26px 28px"] { padding: 26px 22px !important; }
  [style*="padding: 0 44px 34px"] { padding: 0 22px 26px !important; }

  /* two-row nav: logo + CTA, then the links beneath */
  nav {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    row-gap: 10px;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  nav > a { order: 1; }
  nav > div:last-child { order: 2; }
  nav > div:first-child {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px !important;
    font-size: 12px !important;
  }

  /* the funnel header keeps its three-up bar */
  header[data-screen-label="Funnel header"] {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    padding: 10px 16px !important;
  }
  header[data-screen-label="Funnel header"] > div:last-child { font-size: 10px !important; }

  /* ghost display words — must fit the viewport, not be clipped */
  [aria-hidden="true"][style*="white-space: nowrap"] {
    font-size: 13.5vw !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: clip;
  }

  /* the floating quote card beside the hero portrait */
  [style*="position: absolute"][style*="left: -32px"] {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    margin: 16px 0 0 !important;
  }

  [style*="justify-content: space-between"] { flex-wrap: wrap !important; }
  img, iframe { max-width: 100% !important; }
}

@media (max-width: 600px) {
  h1 { font-size: 33px !important; line-height: 1.04 !important; }
  h2 { font-size: 27px !important; line-height: 1.08 !important; }
  [style*="clamp(72px"], [style*="clamp(88px"] { font-size: 62px !important; }
  [style*="clamp(32px"], [style*="clamp(28px"] { font-size: 26px !important; }
  section { padding-top: 52px !important; padding-bottom: 52px !important; }
  main { padding-top: 32px !important; }
}
