/* ==========================================================================
   The phone layer — everything that changes below 768px, loaded last on
   every page so it reads as one place to look.

   Three ideas run through it:
   - Type set for a hand-held screen: body text a step heavier and tighter,
     headings bigger and tighter, so a page reads in a glance, not a scan.
   - Rows that swipe instead of lists that stack: cards and the map
     move sideways under the thumb, with a meter showing where you are.
   - Fewer, larger moves: the hero becomes a poster, the menu a full screen
     of large rows, and photos are pasted up as they arrive.
   ========================================================================== */

@media (max-width: 767px) {

  :root { --section-y: 80px; }

  /* --- Type ------------------------------------------------------------- */
  /* Light 300 body text breaks up on small, bright screens: 400 holds. */
  body { line-height: 1.6; }
  body, .t-body, .t-body-l { font-weight: 400; }
  .t-body   { font-size: 15px; line-height: 1.55; }
  .t-body-l { font-size: 16px; line-height: 1.55; }
  .t-h2      { font-size: clamp(30px, 8.7vw, 36px); }
  .t-display { font-size: clamp(34px, 10.3vw, 42px); }
  .t-h3      { font-size: 20px; }
  .t-fig     { font-size: clamp(34px, 10vw, 42px); }
  .eyebrow   { font-size: 12px; }

  /* --- Header: the brief stays one tap away ----------------------------- */
  .nav .btn {
    display: inline-flex;
    height: 34px; padding-inline: 12px;
    font-size: 12px; letter-spacing: .01em;
  }
  .nav .btn svg { display: none; }
  .nav__logo img { height: 30px; }
  .nav__right { gap: 8px; }

  /* --- Reading line ----------------------------------------------------- */

  /* --- Swipe rows ------------------------------------------------------- */
  /* One rhythm for every row that moves sideways: cards 78% of the screen,
     the next one peeking in, snapped to the text edge. */
  .deck {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .deck::-webkit-scrollbar { display: none; }
  .swipe-meter {
    display: block;
    position: relative;
    height: 2px;
    margin-top: var(--s-5);
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
  }
  .swipe-meter[hidden] { display: none; }
  .swipe-meter span {
    position: absolute; inset: 0 auto 0 0;
    background: var(--red);
    border-radius: inherit;
    transition: transform 120ms linear;
  }

  /* The deck: a card per discipline, drawing on top, words under it */
  .deck__card {
    flex: 0 0 78%;
    display: flex; flex-direction: column; gap: var(--s-4);
    scroll-snap-align: start;
  }
  .deck__art { padding: 14%; }
  .deck__cap { gap: 10px; }
  .deck__t { font-size: 20px; }
  .deck__copy .deck__text { font-size: 15px; color: var(--text-dim); }


  /* A touch gives a little, like a button */
  .card:active, .deck__card:active { scale: .985; }

  /* --- Section heads ----------------------------------------------------- */
  .vision__head, .corridor__head, .rail__head, .book__head, .flagship__head {
    gap: var(--s-4);
    margin-bottom: var(--s-6);
  }

  /* --- Home · hero: title, one sentence and the buttons at the foot of the photo */
  .hero {
    justify-content: flex-end;
    padding-block: 112px calc(72px + env(safe-area-inset-bottom, 0px));   /* the buttons sit up from the edge, clear of the phone's own bar */
  }
  .hero__scrim {
    background:
      linear-gradient(180deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.1) 26%, rgba(0,0,0,.5) 52%, rgba(0,0,0,.94) 78%, #000 100%);
  }
  .hero--video .hero__scrim {
    background: linear-gradient(180deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 58%, rgba(0,0,0,.85) 100%);
  }
  .hero__inner { gap: var(--s-4); }
  /* Two lines; "THE POWER OF", the wider one, fits a 360px phone at 40px */
  .hero__title { font-size: clamp(36px, 11.3vw, 46px); }
  .hero__more { display: none; }
  .hero__lede { color: var(--text-soft); max-width: 34ch; }
  /* The two buttons small and side by side at the left, as on a desktop */
  .hero__actions {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: var(--s-2);
  }
  .hero__actions .btn { height: 40px; padding-inline: 16px; font-size: 13px; }
  .hero__actions .btn svg { display: none; }

  /* --- Home · flagship -------------------------------------------------- */
  .flagship__tags { display: none; }   /* the sectors are listed again below */
  .flagship__cap { inset: auto 16px 14px; }
  .flagship__loc { font-size: 13px; }
  .figs { gap: 12px; }
  .fig { padding: 20px; }
  .fig__label { font-size: 14px; }
  .fig__note { font-size: 12.5px; }

  /* --- Home · the roads: the aerial map, with a word on moving it ------- */
  .corridor__hint {
    display: flex; align-items: center; gap: 10px;
    margin-top: var(--s-3);
    font-size: 12.5px;
    color: var(--text-mute);
  }
  .corridor__hint::before {
    content: "";
    width: 18px; height: 1px;
    background: var(--red);
  }
  .corridor__mlist { display: none; }
  #ddMapMore { display: inline-flex; margin-top: var(--s-5); }

  /* --- Home · let's build ----------------------------------------------- */
  .cta { padding-block: 96px; }
  .cta__actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 80px; }
  .cta__actions .btn { justify-content: center; }

  /* --- Inner pages ------------------------------------------------------ */
  .phead { padding-top: 112px; }
  /* Portfolio figures: two by two, not three and a straggler */
  .phead__stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6) var(--s-4); }

  /* Filter chips and plan steps: one line that swipes, not a wrapped pile.
     The row fades out at the right edge to say there is more. */
  .toolbar__filters, .steps {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
  }
  .toolbar__filters::-webkit-scrollbar, .steps::-webkit-scrollbar { display: none; }
  .toolbar__filters > *, .steps > * { flex: none; }

  /* Vision · principles: a calm list with hairlines instead of a stack of boxes */
  .pillars { gap: 0; }
  .pillar {
    padding: var(--s-5) 0;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid var(--line);
  }
  .pillar:last-child { border-bottom: 1px solid var(--line); }
  .pillar:hover { box-shadow: none; background: none; }

  /* Site page: the flagship label clears the name above it */
  #sFlag { margin-top: var(--s-3); }
}

/* The narrowest phones (360px): the bar's button gives up a little room so
   the menu button stays on screen */
@media (max-width: 380px) {
  .nav .btn { padding-inline: 10px; font-size: 11.5px; }
  .nav__logo img { height: 26px; }
  .nav__right { gap: 4px; }
  .hero__actions .btn { padding-inline: 13px; font-size: 12.5px; }
}
