/* =========================================================
   Dry Powder — Responsive overrides for mobile / tablet.
   Targets inline-styled React components via [style*=...] attribute
   selectors so we don't need to refactor every component.
   ========================================================= */

/* -------- Tablet (≤ 980 px) ------------------------------------------ */
@media (max-width: 980px) {
  :root {
    --container-pad: 24px;
  }

  /* 4-col grids → 2-col */
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* 3-col grids → 1-col stack */
  [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  /* Head rows with 1.1fr / 1fr layout → stack */
  [style*="grid-template-columns: 1.1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"][style*="gap: 64px"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* Reduce vertical breathing */
  [style*="padding: 96px 0"] { padding: 72px 0 !important; }
  [style*="padding: 88px"]   { padding-top: 64px !important; }

  /* Hero headline metas + CTA row wrap nicely already via flexWrap; no change */
}

/* -------- Phone (≤ 720 px) ------------------------------------------ */
@media (max-width: 720px) {
  :root {
    --container-pad: 18px;
    --sp-11: 64px;
    --sp-12: 80px;
  }

  /* All multi-col grids → 1 column ---------------------------------- */
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1.1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* KPI strip: stacks vertically, borderRight on tiles becomes borderBottom */
  [style*="border: 1px solid var(--border)"][style*="border-radius: var(--r-md)"][style*="overflow: hidden"]
    > div[style*="border-right: 1px solid"] {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
  }
  [style*="border: 1px solid var(--border)"][style*="border-radius: var(--r-md)"][style*="overflow: hidden"]
    > div:last-child {
    border-bottom: none !important;
  }

  /* Audience / Process / similar segmented rows: drop borderRight, use borderTop on items 2+ */
  [style*="border-top: 1px solid var(--ink-1000)"] > div[style*="border-right: 1px solid"] {
    border-right: none !important;
  }

  /* Calculator: range input becomes thicker for thumb */
  input[type="range"] { height: 28px; }

  /* Reduce section padding further on phone */
  [style*="padding: 96px 0"] { padding: 56px 0 !important; }
  [style*="padding: 88px"]   { padding-top: 48px !important; padding-bottom: 48px !important; }

  /* Reduce gap inside heads and grids */
  [style*="gap: 64px"]  { gap: 24px !important; }
  [style*="gap: 48px"]  { gap: 20px !important; }
  [style*="gap: 40px"]  { gap: 20px !important; }
  [style*="gap: 32px"]  { gap: 18px !important; }

  /* Nav: hide nav links + status pill, keep wordmark + CTA */
  [data-nav-links] { display: none !important; }
  [data-nav-status] { display: none !important; }
  [data-nav-cta-row] { gap: 8px !important; }

  /* Hero: cap headline so it doesn't blow out small screens */
  h1[style*="clamp(56px, 9vw, 132px)"] {
    font-size: 44px !important;
    line-height: 0.96 !important;
  }

  /* Big display H2s in sections — cap on phone */
  h2[style*="clamp(36px, 5.5vw, 76px)"],
  h2[style*="clamp(36px, 5vw, 60px)"],
  h2[style*="clamp(48px, 7vw, 96px)"] {
    font-size: 34px !important;
    line-height: 0.96 !important;
  }

  /* Filter chips wrap; ensure they stay scrollable */
  [style*="display: flex"][style*="flex-wrap: wrap"] { row-gap: 8px; }

  /* Pricing card price */
  [style*="font-size: 44px"][style*="letter-spacing: -0.02em"] {
    font-size: 36px !important;
  }

  /* Calculator output value */
  [style*="font-size: 36px"][style*="letter-spacing: -0.01em"] {
    font-size: 28px !important;
  }

  /* CaseStudy stats row: smaller gap so 3 stats still fit in a row */
  [style*="display: flex"][style*="gap: 28px"][style*="padding-top: 14px"] {
    gap: 18px !important;
  }

  /* Footer: stack columns + wordmark */
  [data-footer-top] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 28px !important;
  }
  [data-footer-cols] {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px 32px !important;
    width: 100%;
  }
  [data-footer-bot] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  /* CTA section row: stack left text + button column */
  section[style*="background: var(--ink-1000)"] > div[style*="flex-wrap: wrap"] {
    gap: 28px !important;
  }

  /* Audience card min-height softer on small screens */
  [data-audience-card] { min-height: 0 !important; }

  /* Process step right-border removal handled above */

  /* FAQ trigger: shrink the leading index column */
  [data-faq-trigger] {
    grid-template-columns: 28px 1fr 28px !important;
    gap: 12px !important;
  }
  [data-faq-panel] {
    grid-template-columns: 28px 1fr 28px !important;
    gap: 12px !important;
  }

  /* Modal: tighter padding */
  [data-modal-card] {
    padding: 24px 22px !important;
  }
  [data-modal-row] {
    grid-template-columns: 1fr !important;
  }
}

/* -------- Tiny phones (≤ 380 px) ----------------------------------- */
@media (max-width: 380px) {
  :root { --container-pad: 14px; }
  h1[style*="clamp(56px, 9vw, 132px)"] { font-size: 38px !important; }
}
