/* SupplyChainz on phones: every page. Loaded with media="(max-width: 767px)" and every rule is inside the same media
   query, so tablets and computers never apply any of it. Rules start with `html` so they win over each page's own
   styles at the same specificity. Behaviour that needs script (collapsing footer, header that steps aside while
   reading) is in phone.js and only acts on phones. */
@media (max-width: 767px) {

  /* ---------- header: steps aside while reading, back as soon as you scroll up ---------- */
  html .site-nav.fixed { transition: transform .32s cubic-bezier(.2, .7, .2, 1); will-change: transform; -webkit-backdrop-filter: blur(14px); }
  html nav.section-bar { transition: transform .32s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
  html.scz-down .site-nav.fixed { transform: translateY(-110%); }
  /* the section bar moves up into the header's place, so only the slim bar stays while reading */
  html.scz-down nav.section-bar { transform: translateY(calc(-62px - env(safe-area-inset-top, 0px))); }

  /* ---------- section bars with text links (AIoT, Applied AI, Deep Tech, SalzPoint, ServizPoint): one line, the links
     spread out when they fit; when they do not, the row scrolls sideways and fades at the edge (phone.js marks it) ---------- */
  html nav.section-bar { left: 0; right: 0; max-width: 100vw; overflow: hidden; }
  html nav.section-bar ul:not(.dsc-react) {
    width: 100%; max-width: 100%; box-sizing: border-box; flex-wrap: nowrap;
    justify-content: space-between; gap: 18px; padding: 4px 16px; font-size: 14px; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  html nav.section-bar ul:not(.dsc-react)::-webkit-scrollbar { display: none; }
  html nav.section-bar ul:not(.dsc-react) > li.section-bar-theme { display: none; }
  html nav.section-bar ul:not(.dsc-react) a { display: inline-block; padding: 7px 0; }
  html nav.section-bar ul.scz-more { justify-content: flex-start; -webkit-mask-image: linear-gradient(90deg, #000 84%, transparent); mask-image: linear-gradient(90deg, #000 84%, transparent); }
  html nav.section-bar ul.scz-more.scz-mid { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12% 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12% 88%, transparent); }
  html nav.section-bar ul.scz-more.scz-end { -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%); mask-image: linear-gradient(90deg, transparent, #000 16%); }

  /* ---------- menu: a full-screen sheet instead of a small dropdown ---------- */
  html body .site-nav details.menu summary { padding: 9px 16px; font-size: 15px; }
  /* the header's blur makes it the frame for fixed children, so the sheet hangs from the header's bottom edge and
     takes the rest of the screen's height */
  html body .site-nav details.menu .drop {
    position: fixed; left: 0; right: 0; top: 100%; bottom: auto; height: calc(100dvh - 62px - env(safe-area-inset-top, 0px)); width: auto; max-width: none;
    margin: 0; border-radius: 0; border: 0; box-shadow: none; overflow-y: auto; overscroll-behavior: contain;
    padding: 18px 24px calc(28px + env(safe-area-inset-bottom, 0px)); gap: 2px;
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
    background: #050b1a;
    animation: scz-sheet .28s cubic-bezier(.2, .7, .2, 1);
  }
  html body .site-nav:not(.fixed) details.menu .drop { top: calc(62px + env(safe-area-inset-top, 0px)); }
  html body .site-nav details.menu .drop a.l { font-size: 24px; font-weight: 600; letter-spacing: -.01em; padding: 13px 4px; border-radius: 10px; }
  html body .site-nav details.menu .drop a.l[aria-current] { color: #f4f6fb; background: none; box-shadow: inset 3px 0 0 #EA7532; padding-left: 14px; }
  html body .site-nav details.menu .drop hr { margin: 14px 0; }
  html body .site-nav details.menu .drop a.l.cta { margin-top: 22px; justify-content: center; font-size: 17px; padding: 15px; border-radius: 14px; }
  html body .site-nav details.menu:not([open]) .drop { display: none; }   /* some browsers lay out a closed menu's sheet */
  html.scz-menu-open, html.scz-menu-open body { overflow: hidden; }

  /* ---------- cookie banner: a compact sheet on the bottom edge, the same on every page ---------- */
  html .scz-cc {
    left: 0; right: 0; bottom: 0; max-width: none; border-radius: 18px 18px 0 0; border-width: 1px 0 0;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
    font: 12.5px/1.45 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); background: rgba(8, 16, 36, .94);
  }
  html .scz-cc h2 { display: none; }
  html body .scz-cc p { margin: 0; font-size: 12.5px; line-height: 1.45; max-width: none; }   /* some pages enlarge every paragraph */
  html .scz-cc .row { margin-top: 10px; gap: 8px; flex-wrap: nowrap; }
  html .scz-cc .row button { flex: 1; font-size: 14px; padding: 11px 10px; border-radius: 12px; }

  /* ---------- footer: groups fold away (phone.js opens them), contact and legal lines stay ---------- */
  html.scz-phone .site-foot .sf-wrap { padding: 8px 20px 18px; }
  html.scz-phone .site-foot .sf-top { display: block; }
  html.scz-phone .site-foot .sf-top > nav { border-bottom: 1px solid rgba(173, 196, 238, .14); }
  html.scz-phone .site-foot .sf-top h2 {
    max-width: none; width: auto;   /* Applied AI limits every h2 to 20 characters; footer headings span the row */
    margin: 0; padding: 15px 2px; display: flex; align-items: center; justify-content: space-between; cursor: pointer;
    font-size: 12px; -webkit-tap-highlight-color: transparent;
  }
  html.scz-phone .site-foot .sf-top h2::after {
    content: ''; width: 8px; height: 8px; margin-right: 4px; border: solid #8d9bb5; border-width: 0 1.6px 1.6px 0;
    transform: translateY(-3px) rotate(45deg); transition: transform .25s ease;
  }
  html.scz-phone .site-foot .sf-top nav.sf-open h2::after { transform: translateY(2px) rotate(-135deg); }
  html.scz-phone .site-foot .sf-top nav:not(.sf-open) ul { display: none; }
  html.scz-phone .site-foot .sf-top nav ul { gap: 2px; padding: 0 0 12px; }
  html.scz-phone .site-foot .sf-top nav ul a { display: block; padding: 8px 2px; font-size: 16px; }
  html .site-foot .sf-reach { margin-top: 18px; gap: 10px 20px; font-size: 14px; }
  html .site-foot .sf-reach > span { order: 3; flex-basis: 100%; font-size: 13px; }
  html .site-foot .sf-in { margin-left: auto; }
  html .site-foot .sf-copy { margin-top: 16px; padding-top: 14px; font-size: 12px; line-height: 1.5; }

  /* ---------- site home: the stage is exactly the header plus the whole film across the phone's width, nothing above
     or below it, so the footer follows straight under the film. The four verticals stay tappable on the last scene. */
  /* --scz-film (phone.js): the film's height, enlarged to fill the space above the footer, at most 1.25x so all four
     verticals stay in frame (the sides are cropped up to ~10% each) */
  html .stage { height: calc(62px + env(safe-area-inset-top, 0px) + var(--scz-film, 56.25vw)); }
  html .stage video { top: calc(62px + env(safe-area-inset-top, 0px)); bottom: auto; height: var(--scz-film, 56.25vw); object-fit: cover; object-position: 49.5% 50%; }
  /* Skip intro and pause in the film's top corner, clear of the wordmark at its foot */
  html .stage .controls { top: calc(62px + env(safe-area-inset-top, 0px) + 10px); bottom: auto; right: 10px; }
  html .stage .controls button { padding: 6px 12px; font-size: 12px; background: rgba(4, 9, 22, .45); }
  html .stage .controls button.icon { width: 28px; height: 28px; padding: 0; }
  /* the home page is shorter than a phone screen: the footer stretches to the bottom edge, so the page ends with it */
  html body:has(> main.stage) { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
  html body:has(> main.stage) > .site-foot { flex: 1 0 auto; }

  /* ---------- Deep Tech, the two photo chapters (RF sensing, Robotics): the photo takes the top of the screen and fades
     into the page behind the words, instead of covering a whole tall screen (which showed a quarter of a 16:9 photo,
     enlarged far past its resolution) ---------- */
  html #rf-chapter > .sticky > .reveal-melt, html #robotics-chapter > .sticky > .reveal-melt {
    bottom: auto; height: 62svh;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent);
  }

  /* ---------- About: tighter panels; each leader is a compact card (whole square photo, name and role beside it,
     the bio under them) instead of a full-width photo and a screen and a half per person ---------- */
  html .ab-sec { padding-top: 12px; padding-bottom: 12px; }
  html #top.ab-sec { padding-top: calc(80px + env(safe-area-inset-top, 0px)); }   /* the opening panel starts below the header */
  html .ab-panel { padding: 24px 18px; }
  html .ab-head { margin-bottom: 22px; }
  html .ab-people { gap: 12px; }
  html .ab-person { display: grid; grid-template-columns: 92px 1fr; column-gap: 14px; row-gap: 2px; align-items: end; padding: 16px; }
  html .ab-person .ab-portrait { grid-row: 1 / span 2; width: 92px; height: 92px; border-radius: 14px; overflow: hidden; align-self: start; }
  html .ab-person .ab-portrait img { width: 100%; height: 100%; object-fit: contain; }
  html .ab-person .ab-person-body { display: contents; }
  html .ab-person h3 { grid-column: 2; grid-row: 1; margin: 0; font-size: 18px; line-height: 1.2; align-self: end; }
  html .ab-person .ab-role { grid-column: 2; grid-row: 2; align-self: start; margin: 4px 0 0; font-size: 11.5px; }
  html .ab-person .ab-bio { grid-column: 1 / -1; grid-row: 3; margin-top: 14px; font-size: 14.5px; }
  html .ab-person .ab-person-foot { grid-column: 1 / -1; grid-row: 4; margin-top: 8px; }
  html .ab-offices { gap: 10px; }
  html .ab-office { padding: 16px 18px; }
  html .ab-map { margin-bottom: 12px; }

  /* ---------- Careers: starts under the header (154px of top padding left a band), the four Life photos as a 2 x 2
     grid instead of four full-width photos one under another ---------- */
  html .cr-main { padding-top: calc(78px + env(safe-area-inset-top, 0px)); }
  html .cr-collage { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: auto; gap: 8px; height: auto; }
  html .cr-collage .cr-tile { width: auto; height: auto; aspect-ratio: 4 / 3.2; grid-column: auto; grid-row: auto; margin: 0; }
  html .cr-collage .cr-tile img { width: 100%; height: 100%; object-fit: cover; }
  html .cr-collage .cr-photo-label { left: 6px; right: auto; bottom: 6px; max-width: calc(100% - 12px); padding: 4px 8px; gap: 5px; }
  html .cr-collage .cr-photo-label b { font-size: 11px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html .cr-collage .cr-photo-tag { top: 6px; right: 6px; width: 24px; height: 24px; padding: 5px; }
}
