/* ==========================================================================
   REBELL ENGINEERS — responsive layer
   ---------------------------------------------------------------------------
   Mobile is re-laid-out, not merely stacked. Breakpoints follow the device
   widths the site is actually used on: 1440 / 1280 / 1024 / 768 / 600 / 480 /
   390 / 360. Nothing here may cause horizontal overflow.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Very wide screens — hold the measure, grow the gutters
   -------------------------------------------------------------------------- */
@media (min-width: 1600px) {
  :root { --shell: min(1280px, 88%); }
}

/* --------------------------------------------------------------------------
   1280px and below — tighten the header before it crowds
   -------------------------------------------------------------------------- */
@media (max-width: 1280px) {
  .menu { gap: 0.1rem; }
  .menu a,
  .menu button { font-size: 0.9rem; padding-inline: 0.15rem; }
  .bar__in { gap: 0.9rem; }
}

/* --------------------------------------------------------------------------
   1080px and below — the desktop menu no longer fits
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  html { scroll-padding-top: 90px; }

  .menu,
  .sheet { display: none; }
  .bars { display: block; }
  .panel { display: block; }
  .bar__in > .act { display: none; }
  .bar__in { min-height: 72px; }
  .bar.is-tight .bar__in { min-height: 64px; }
  /* clears the utility strip plus the header */
  .panel { padding-top: 7.5rem; }

  .pd-nav { top: 72px; }
  .head { grid-template-columns: 1fr; gap: 1rem; }
  .head h2 { max-width: 26ch; }
  .duo,
  .duo--l,
  .duo--r { grid-template-columns: 1fr; }
  .duo--flip > *:first-child { order: 0; }
  .pd-grid,
  .pd-top { grid-template-columns: 1fr; }
  .foot__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger { columns: 2; }
}

/* --------------------------------------------------------------------------
   1024px — tablet landscape
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero { min-height: clamp(520px, 74vh, 720px); }
  .row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    row-gap: 0.35rem;
  }
  .row__of { grid-column: 2 / -1; }
  .row__go { display: none; }
}

/* --------------------------------------------------------------------------
   768px — tablet portrait
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root { --shell: min(1170px, 90%); }

  .util__in { justify-content: center; gap: 0.9rem; font-size: 0.76rem; }
  .util__in span { display: none; }

  .hero { min-height: clamp(480px, 78vh, 640px); }
  .hero__say { padding-block: 4rem 6.5rem; }
  .hero h1 { max-width: 20ch; }
  .hero__kick { font-size: 0.72rem; letter-spacing: 0.2em; }
  .hero__cap { display: none; }

  .caps__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .tally__r { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .tally__l { text-align: left; max-width: none; }

  .call__in { flex-direction: column; align-items: flex-start; }
  .call .act { width: 100%; justify-content: center; }

  .plates { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .lb-p { left: 4px; }
  .lb-n { right: 4px; }
  .lb-x { top: -52px; }
}

/* --------------------------------------------------------------------------
   600px — large phones
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  html { scroll-padding-top: 76px; }

  .bar__in { min-height: 64px; }
  .bar.is-tight .bar__in { min-height: 58px; }
  .mark img { height: 44px; }
  .mark__t { display: none; }        /* the mark already carries the name */
  .panel { padding-top: 7rem; }
  .pd-nav { top: 64px; }

  .hero { min-height: clamp(460px, 80vh, 600px); }
  .open__do { gap: 0.6rem; }
  .open__do .act { flex: 1 1 100%; justify-content: center; }
  .hero__bar__in { justify-content: space-between; min-height: 56px; }
  .hero__dots button { padding: 0.5rem 0.45rem; font-size: 0.76rem; }

  .caps__list { grid-template-columns: 1fr; }

  .reel__nav { display: none; }      /* a swipe is the natural control here */
  .reel__top .railhint { font-size: 0.7rem; }
  .reel__top .railhint::after { content: " — swipe"; }
  .reel .bcard { width: min(80vw, 320px); }

  .build { grid-template-columns: 1fr; }
  .bcard__body { padding: 1.1rem; }

  .sector { width: min(80vw, 300px); }

  .ledger { columns: 1; }
  .foot__cols { grid-template-columns: 1fr; }
  .foot__end { justify-content: flex-start; }
  .foot__end ul { gap: 0.9rem; }

  .panelised { padding: 1.2rem; }
  .pd-grid--even { grid-template-columns: 1fr; }

  /* Specification tables become stacked label/value pairs */
  .spec,
  .spec tbody,
  .spec tr,
  .spec th,
  .spec td { display: block; width: 100%; }
  .spec tr { border-bottom: 1px solid var(--border); padding: 0.2rem 0; }
  .spec tr:last-child { border-bottom: 0; }
  .spec th { background: none; padding-bottom: 0.15rem; border-bottom: 0; }
  .spec td { padding-top: 0; border-bottom: 0; color: var(--muted); }
}

/* --------------------------------------------------------------------------
   480px and below — small phones
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  :root { --shell: min(1170px, 91%); }

  .act { padding: 0.85rem 1.2rem; font-size: 0.88rem; }
  .hero__arrows button { width: 38px; height: 36px; }
  .row { grid-template-columns: 38px minmax(0, 1fr); row-gap: 0.3rem; }
  .row__cap { grid-column: 2; justify-self: start; }
  .tags li span,
  .tags li a { font-size: 0.83rem; padding: 0.36rem 0.7rem; }
  .plates { grid-template-columns: 1fr; }
  .up { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

/* --------------------------------------------------------------------------
   360px — the narrowest target
   -------------------------------------------------------------------------- */
@media (max-width: 380px) {
  .util__in a { font-size: 0.72rem; }
  .reel .bcard { width: 84vw; }
  .sector { width: 84vw; }
  .foot__word { font-size: 2.2rem; }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  .util, .bar, .panel, .hero__bar, .up, .prog, .call, .pd-nav { display: none !important; }
  body { color: #000; }
  .zone--ink, .top, .foot { background: #fff !important; color: #000 !important; }
}
