/* ==========================================================================
   MOBILE TEXT ADDITION
   Load AFTER bladerunner.css or bladerunner-sober.css:

     <link rel="stylesheet" href="bladerunner-sober.css">
     <link rel="stylesheet" href="bladerunner-mobile.css">

   On phones: larger type, text running the full width of the screen,
   and bigger tap targets. Desktop is untouched.
   ========================================================================== */

@media (max-width: 640px) {

  /* Bigger type scale, using the tokens both themes already share */
  :root {
    --step--1: 0.95rem;
    --step-0: 1.1875rem;
    --step-1: 1.55rem;
    --step-2: 2.15rem;
    --step-3: 2.6rem;
    --step-4: clamp(2.8rem, 14vw, 4.5rem);
    --measure: 100%;
  }

  body { line-height: 1.7; }

  /* Let text use the full width instead of stopping at a desktop line length */
  .container { width: calc(100% - 2rem); }
  p,
  .hero__lede { max-width: none; }

  /* Long headline words must wrap rather than push the page sideways */
  /* Headings: smaller, tighter, and less space around them */
  h1, h2, h3, h4 {
    margin-bottom: 0.4em;
    line-height: 1.15;
    letter-spacing: 0.05em;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  h1 { font-size: clamp(1.6rem, 7vw, 2rem); }
  h2 { font-size: clamp(1.3rem, 5.5vw, 1.55rem); }
  h3 { font-size: 1.2rem; }
  h4 { font-size: 1rem; }

  .hero { padding-block: 3rem 2.5rem; }
  .hero__title {
    font-size: clamp(2rem, 9.5vw, 2.75rem);
    line-height: 1.1;
    margin-bottom: 0.35em;
  }
  .hero__lede { font-size: 1.2rem; margin-bottom: 1.5rem; }

  /* Easier to hit with a thumb */
  .site-nav { gap: 0.25rem 1.5rem; }
  .site-nav a { padding: 0.55rem 0; font-size: 1.15rem; }

  .btn {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 1.2rem;
  }

  /* 16px minimum stops iOS Safari zooming in when a field is focused */
  label { font-size: 1.05rem; }
  input, textarea, select { padding: 0.9rem 1rem; font-size: 1rem; }

  /* Wide tables scroll sideways inside themselves, not the whole page */
  table, .data-table { display: block; overflow-x: auto; white-space: nowrap; }
  td, th { padding: 0.75rem 0.9rem; }

  .readout { font-size: 1rem; }

  /* Top bar (bladerunner-topbar.css): smaller links, so they all fit in one row
     with no sideways scrolling. The type size follows the screen width. */
  html ul.topbar {
    justify-content: space-between;
    gap: 0 0.5rem;
    padding-inline: 0.75rem;
    overflow: hidden;
  }

  html ul.topbar > li {
    flex: 0 1 auto;
    min-width: 0;
  }

  html ul.topbar a {
    padding: 0.4rem 0;
    font-size: clamp(0.62rem, 3.2vw, 0.85rem);
    letter-spacing: 0.06em;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
