/* ════════════════════════════════════════════════════════════════════
   responsive.css — shared phone / tablet layer for all Tomosu pages
   (iOS Safari, Android Chrome, iPad & Android tablets)

   Loaded LAST in <head> so it overrides each page's inline <style>.
   ════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE LAYER — phones & tablets (iOS / Android)

   Root cause of the reported cut-off: grid/flex items default to
   `min-width: auto`, so a column could not shrink below its
   min-content width. Nowrap CTA buttons pinned the hero column open
   at ~466px; `.hero { overflow: hidden }` then clipped it. Below
   ~430px the page was wider than the screen on every phone.
   ══════════════════════════════════════════════════════════════════ */

/* No page should ever scroll sideways. `clip` rather than `hidden`
   so the sticky nav keeps sticking. */
html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  max-width: 100%;
}

@supports not (overflow: clip) {
  body {
    overflow-x: hidden;
  }
}

img,
video,
canvas,
iframe {
  max-width: 100%;
}

/* ── Mobile nav: hamburger + drawer ──
   Below 980px every nav link used to be `display: none` with nothing
   to replace it, so phone users had no navigation at all. */
.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 8px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-burger span+span {
  margin-top: 4px;
}

.nav-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  background: rgba(255, 255, 255, 0.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 76px 22px calc(28px + env(safe-area-inset-bottom));
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a,
.mobile-menu button {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 15px 2px;
  cursor: pointer;
}

.mobile-menu .mm-section {
  font-family: 'Space Grotesk', var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 22px 2px 6px;
  border: none;
}

.mobile-menu .mm-cta {
  margin-top: 22px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 100px;
  text-align: center;
  font-weight: 600;
  padding: 15px 20px;
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .nav-burger {
    display: flex;
    flex-direction: column;
  }

  /* The old desktop link row is fully replaced by the drawer */
  .nav-links {
    display: none;
  }

  /* Keep the bar above the drawer (150) but below the modals (200,
     1000) so the burger stays tappable as the close button. */
  .nav {
    z-index: 160;
  }
}

/* Nothing floating should sit on top of the open drawer */
body.menu-open #chatLauncher,
body.menu-open .chat-launcher {
  display: none !important;
}

@media (max-width: 600px) {

  /* The nowrap tagline alone was ~190px — a top cause of nav cut-off */
  .nav-tagline {
    display: none;
  }

  .nav-cta {
    font-size: 12px;
    padding: 9px 14px;
  }
}

@media (max-width: 430px) {
  .nav-download {
    display: none;
  }

  .nav-cta {
    font-size: 11.5px;
    padding: 8px 12px;
  }
}

@media (max-width: 359px) {

  /* Only on the very narrowest phones does the pill stop fitting
     beside brand + burger; the drawer still carries "Book a call". */
  .nav-cta {
    display: none;
  }
}

/* Let every layout column collapse instead of holding the page open. */
.hero-grid2>*,
.lede-split>*,
.diff-grid>*,
.buyers>*,
.idx-grid>*,
.incidents-grid>*,
.roi-grid>*,
.stats-grid>*,
.pillars>*,
.timeline>*,
.steps>*,
.flow-grid>*,
.serve-grid>*,
.preview-grid>*,
.preview-indexes>*,
.not-grid>*,
.ps-grid>*,
.metrics-strip>*,
.lane-body>*,
.download-wrap>* {
  min-width: 0;
}

/* ── Tablets: iPad portrait, Android tabs ── */
@media (max-width: 1024px) {
  .container {
    padding-left: 28px;
    padding-right: 28px;
  }

  .pillars,
  .idx-grid,
  .stats-grid,
  .incidents-grid,
  .preview-indexes,
  .serve-grid,
  .iw-metrics,
  .iw-snaps {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline,
  .steps,
  .flow-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Large phones / small tablets ── */
@media (max-width: 768px) {
  .container {
    padding-left: 22px;
    padding-right: 22px;
  }

  .lede-split,
  .diff-grid,
  .buyers,
  .roi-grid,
  .not-grid,
  .ps-grid,
  .preview-grid,
  .lane-body,
  .download-wrap,
  .iw-cockpit {
    grid-template-columns: 1fr;
  }

  /* CTA rows wrap instead of forcing the column wider than the screen */
  .hero-cta-bar,
  .hero-l .hero-cta-bar {
    flex-wrap: wrap;
    padding-bottom: 32px;
  }

  .hw-flow {
    flex-direction: column;
    gap: 18px;
  }

  .hw-arrow {
    transform: rotate(90deg);
    margin: 0;
    align-self: flex-start;
  }
}

/* ── Phones ── */
@media (max-width: 600px) {
  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .pillars,
  .idx-grid,
  .stats-grid,
  .incidents-grid,
  .preview-indexes,
  .serve-grid,
  .timeline,
  .steps,
  .flow-grid,
  .metrics-strip,
  .iw-metrics,
  .iw-snaps {
    grid-template-columns: 1fr;
  }

  /* Stacked, full-width CTAs — reliably tappable */
  .hero-cta-bar,
  .hero-l .hero-cta-bar {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .hero-cta-bar .btn-primary,
  .hero-cta-bar .btn-secondary,
  .hero-l .hero-cta-bar .btn-primary,
  .hero-l .hero-cta-bar .btn-secondary {
    width: 100%;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    padding: 14px 18px;
  }

  .hero-l h1 {
    font-size: clamp(27px, 8vw, 34px);
  }

  .hero-kicker {
    white-space: normal;
  }

  .outcome-row {
    gap: 10px;
    font-size: 14px;
  }

  /* Long unbroken strings (URLs, IDs) must not push the page wide */
  h1,
  h2,
  h3,
  p,
  li,
  td,
  th,
  a,
  span {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  /* Wide content scrolls inside itself, never on the page body */
  table,
  pre {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 16px keeps iOS Safari from zooming in on focus */
  input,
  select,
  textarea {
    font-size: 16px;
    max-width: 100%;
  }
}

/* ── Small phones: iPhone SE, Galaxy S at 360px, 320px ── */
@media (max-width: 400px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .nav-inner {
    padding: 12px 14px;
  }

  .hero-l h1 {
    font-size: 26px;
  }

  .hero-kicker {
    font-size: 11px;
    line-height: 1.45;
  }
}

/* ── Cross-page fixes ──────────────────────────────────────────────── */

/* blogs/styles.css uses minmax(420px, 1fr): the 420px floor is a hard
   minimum, so every card stayed 420px wide on a 375px phone. min() lets
   the track fall back to the container width. */
.blog-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
}

@media (max-width: 720px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

/* Same pattern anywhere else auto-fit is used */
.stat-row,
.post-meta-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

/* impact.html dashboard: fixed-width cockpit/tab/ROI rails */
@media (max-width: 900px) {

  .control-deck,
  .chart-stage,
  .tabs-container,
  .roi-panel,
  .card {
    max-width: 100%;
    min-width: 0;
  }

  .tabs-container {
    flex-wrap: wrap;
  }

  .tab-btn {
    min-width: 0;
    flex: 1 1 100%;
  }

  .tab-sub {
    display: none;
  }

  .roi-panel {
    grid-template-columns: 1fr;
  }
}

/* Long prose pages (privacy, terms, blog posts) */
@media (max-width: 600px) {

  .legal-body table,
  .post-body table,
  table {
    font-size: 13px;
  }

  .post-body pre,
  .post-body code {
    font-size: 12.5px;
  }
}

