/* ── _responsive-fix.css for tiredapi.co ─────────────────────────────
   This site previously had NEAR-ZERO media queries. This file adds the
   full responsive grid so the dev surface works on mobile.
   ─────────────────────────────────────────────────────────────────────── */

/* ── Container & padding ── */
@media (max-width: 640px) {
  .ti-island,
  section,
  .section,
  main,
  footer {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* ── Island nav: wrap below 640px ── */
@media (max-width: 759px) {
  .ti-island {
    flex-wrap: wrap !important;
    gap: 12px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    border-radius: 12px !important;
  }
  .ti-island__logo {
    flex-shrink: 0 !important;
  }
  .ti-island__links {
    order: 3 !important;
    width: 100% !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
  }
  .ti-island__cta {
    margin-left: auto !important;
  }
}

@media (max-width: 479px) {
  .ti-island {
    border-radius: 8px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .ti-island__logo {
    font-size: 16px !important;
  }
  .ti-island__links a {
    font-size: 13px !important;
  }
}

/* ── Hero ── */
@media (max-width: 899px) {
  /* Most likely hero selectors based on the "programmable" homepage */
  .hero,
  .ti-hero,
  section.hero {
    padding: 40px 20px 32px !important;
  }
  h1 {
    font-size: clamp(36px, 9vw, 64px) !important;
    line-height: 1 !important;
    letter-spacing: -0.02em !important;
  }
}

@media (max-width: 479px) {
  h1 {
    font-size: clamp(32px, 10vw, 48px) !important;
  }
}

/* ── Three-planes section — stack below 900px ── */
@media (max-width: 899px) {
  .planes,
  .three-up,
  .tier-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* ── 41-tools grid: 1-col mobile, 2-col tablet, 3-col desktop ── */
@media (max-width: 639px) {
  .tools-grid,
  .tool-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

@media (min-width: 640px) and (max-width: 899px) {
  .tools-grid,
  .tool-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── Code blocks: scroll horizontally instead of breaking layout ── */
@media (max-width: 640px) {
  pre,
  pre code {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    padding: 12px !important;
  }
}

/* ── Section headings ── */
@media (max-width: 640px) {
  h2,
  .section__title {
    font-size: clamp(24px, 6vw, 36px) !important;
    line-height: 1.2 !important;
  }
  h3 {
    font-size: clamp(18px, 5vw, 24px) !important;
  }
}

/* ── Tap-target minimums ── */
@media (max-width: 640px) {
  a,
  button,
  .btn {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
  }
  .ti-island__links a {
    min-height: 32px !important;  /* nav links can be smaller; not primary CTAs */
  }
}

/* ── Prevent horizontal scroll defensively ── */
@media (max-width: 640px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  img, video, iframe {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}
