/* Shielda — mobile / tablet layer. Loaded by every V4.1 page after device.js.

   The pages are laid out with inline styles for a 1100px+ desktop. This sheet re-flows them for
   narrower viewports by matching those inline styles with attribute selectors, so no page markup
   had to change. Every rule is !important because inline styles always win otherwise.

   Breakpoints
     <= 1179px  tablet / narrow desktop: 4-column grids become 2, fixed side columns stack
     <=  760px  phone: everything is one column, type and spacing scale down

   Device classes (set by device.js, independent of viewport width)
     html.dev-mobile / .dev-tablet / .dev-desktop, html.in-touch / .in-mouse
     Used here only for behaviour that depends on the device rather than the window:
     no custom cursor, no 3D tilt, no magnetic buttons on touch screens. */

/* ============ All sizes ============ */
img, video, svg { max-width: 100%; }
input, select, textarea { max-width: 100%; box-sizing: border-box; }
/* the search pill: the input may shrink below its placeholder width, so the result count stays inside the pill */
.tk-search { min-width: 0; }
.tk-search input { min-width: 0; width: 0; text-overflow: ellipsis; }

/* Touch devices: desktop-only effects off, whatever the window size. */
html.in-touch #fx-canvas { display: none !important; }
html.in-touch .tilt, html.in-touch .magnet { transform: none !important; }
html.in-touch .tilt.reveal:not(.in) { transform: translateY(18px) !important; }
html.in-touch .card:hover, html.in-touch .shot:hover, html.in-touch .pane.on:hover { transform: none !important; }
html.in-touch .lineup { -webkit-overflow-scrolling: touch; }

/* ============ Tablet and below (<= 1179px) ============ */
@media (max-width: 1179px) {
  html, body { overflow-x: hidden; }
  body { overflow-x: clip; }

  /* the page wrapper is locked to 1100px on desktop */
  [style*="min-width: 1100px"] { min-width: 0 !important; }

  /* content containers: narrower side gutters */
  [style*="max-width: 1280px"], [style*="max-width: 1600px"], #searchbar > div { padding-left: 28px !important; padding-right: 28px !important; }
  #topbar > div { padding-left: 24px !important; padding-right: 24px !important; }

  /* 4-up grids -> 2-up */
  [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }

  /* grids with a fixed-width column stack */
  [style*="grid-template-columns: 420px 1fr"],
  [style*="grid-template-columns: 440px 1fr"],
  [style*="grid-template-columns: 1fr 440px"],
  [style*="grid-template-columns: 1fr 560px"] { grid-template-columns: 1fr !important; gap: 36px !important; }

  /* Platform architecture row (core | line | flow | line | connect | line | your systems) stacks with vertical connectors */
  [style*="grid-template-columns: 2.1fr 36px"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns: 2.1fr 36px"] > [style*="display: flex; align-items: center;"] { justify-content: center !important; }
  [style*="grid-template-columns: 2.1fr 36px"] > [style*="display: flex; align-items: center;"] > div { width: 2px !important; height: 32px !important; }

  /* Why Shielda: the green card no longer overlaps the grey one */
  [style*="margin-left: -48px"] { margin-left: 0 !important; margin-top: 24px !important; }
  [style*="padding: 36px 88px 10px 40px"] { padding: 32px 32px 8px 32px !important; }

  /* big display type */
  [style*="font-size: clamp(48px, 6.2vw, 96px)"] { font-size: clamp(40px, 7.5vw, 72px) !important; }
  [style*="font-size: 60px"] { font-size: 48px !important; }
  [style*="font-size: 52px"] { font-size: 44px !important; }
  [style*="font-size: 170px"] { font-size: 110px !important; }
  .bigmq > div { font-size: 100px !important; }
  .chap-num { font-size: 24vh !important; right: 28px !important; }

  /* side rail + scroll cue are desktop furniture */
  #rail { display: none !important; }

  /* horizontal product lineup */
  .lineup { padding: 4px 28px 28px !important; }
  .lu { flex: 0 0 360px !important; }
  .piccol { width: 100% !important; }
  .chap-panel { width: 100% !important; }

  /* Hardware comparison slider */
  [style*="height: 620px"] { height: 480px !important; }

  /* takeover menu */
  .tk-grid { grid-template-columns: 1fr !important; gap: 40px !important; padding: 96px 28px 40px 28px !important; }
  .tk-side { padding-top: 0 !important; }
  #skip-intro { right: 24px !important; }
}

/* ============ Phone (<= 760px) ============ */
@media (max-width: 760px) {
  /* containers and section rhythm */
  [style*="max-width: 1280px"], [style*="max-width: 1600px"] { padding-left: 20px !important; padding-right: 20px !important; }
  #topbar > div { padding-left: 16px !important; padding-right: 10px !important; height: 60px !important; }
  #topbar img { height: 22px !important; }
  #topbar span[style*="font-size: 20px"] { font-size: 17px !important; }
  [style*="padding-top: 68px"] { padding-top: 60px !important; }
  /* search: a full-height panel under the top bar (the phone keyboard leaves little room, so results scroll inside it) */
  #searchbar { top: 60px !important; bottom: 0 !important; max-height: none !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
  body.search-open #searchbar { background: rgba(6,8,10,0.96) !important; }
  #searchbar > div { padding: 14px 16px 24px 16px !important; }
  #searchbar .tk-search { padding: 10px 16px !important; }
  #searchbar .sb-links, body.has-q #searchbar .sb-links { max-height: none !important; overflow: visible !important; }
  .tk-search input { font-size: 16px !important; }

  [style*="padding: 104px 40px"] { padding-top: 64px !important; padding-bottom: 64px !important; }
  [style*="padding: 96px 40px"] { padding-top: 60px !important; padding-bottom: 60px !important; }
  [style*="padding: 88px 40px"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  [style*="padding: 72px 40px"] { padding-top: 48px !important; padding-bottom: 48px !important; }
  [style*="padding: 64px 40px 96px 40px"] { padding-top: 48px !important; padding-bottom: 60px !important; }
  [style*="padding: 140px 40px"] { padding-top: 80px !important; padding-bottom: 80px !important; }
  [style*="padding: 136px 40px"] { padding-top: 104px !important; padding-bottom: 56px !important; }
  [style*="padding: 120px 40px 96px 40px"] { padding-top: 96px !important; padding-bottom: 56px !important; }
  [style*="padding: 40px 40px 96px 40px"] { padding-top: 32px !important; padding-bottom: 60px !important; }
  [style*="padding: 0 40px 72px 40px"] { padding-bottom: 48px !important; }
  [style*="padding: 0 40px 96px 40px"] { padding-bottom: 60px !important; }
  [style*="padding: 88px 0"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  [style*="padding: 44px 0"] { padding-top: 32px !important; padding-bottom: 32px !important; }
  [style*="padding: 56px 56px 52px 56px"] { padding: 28px 22px 28px 22px !important; }
  [style*="padding: 40px;"] { padding: 24px 20px !important; }
  [style*="padding: 30px 32px 32px 32px"] { padding: 22px 18px 22px 18px !important; }
  [style*="padding: 30px 28px"] { padding: 22px 18px !important; }
  [style*="padding: 32px 28px"] { padding: 22px 18px !important; }
  [style*="padding: 36px 88px 10px 40px"] { padding: 24px 20px 6px 20px !important; }
  [style*="padding: 40px 40px 56px 40px"] { padding: 32px 20px 36px 20px !important; }
  [style*="margin-top: 56px"] { margin-top: 36px !important; }

  /* every multi-column grid becomes one column… */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  /* …except small in-row grids (IF / THEN rules on the Platform page) */
  [style*="grid-template-columns: 1fr 28px 1fr"] { grid-template-columns: 1fr 28px 1fr !important; }
  [style*="grid-template-columns: 1.35fr 1fr"], [style*="grid-template-columns: 1.1fr 1fr"],
  [style*="grid-template-columns: 5fr 6fr"], [style*="grid-template-columns: 6fr 5fr"],
  [style*="grid-template-columns: 1fr 1fr"] { gap: 20px !important; }
  [style*="grid-template-columns: repeat(4, 1fr)"] { gap: 12px !important; }
  [style*="grid-template-columns: repeat(4, 1fr)"][style*="gap: 1px"] { gap: 1px !important; }

  /* Solutions use-case cards: video block above / below the text, shorter */
  [style*="min-height: 420px"] { min-height: 240px !important; }
  [style*="border-radius: 20px"] { border-radius: 14px !important; }

  /* Hardware comparison slider */
  [style*="height: 620px"] { height: 340px !important; }
  [style*="display: flex; align-items: flex-end; justify-content: space-between; gap: 48px"] { flex-direction: column !important; align-items: flex-start !important; gap: 14px !important; margin-bottom: 28px !important; }
  /* the two labels no longer fit side by side: standard camera top-left, Shielda VOD bottom-right */
  [style*="position: absolute; top: 20px; left: 24px"], [style*="position: absolute; top: 20px; right: 24px"] { font-size: 11px !important; padding: 6px 10px !important; }
  [style*="position: absolute; top: 20px; left: 24px"] { top: 12px !important; left: 12px !important; }
  [style*="position: absolute; top: 20px; right: 24px"] { top: auto !important; bottom: 12px !important; right: 12px !important; }

  /* rows of anchor buttons wrap (bullet rows such as "+ Updates included" must not: the marker would sit alone on a line) */
  [style*="display: flex; gap: 12px; justify-content: center"] { flex-wrap: wrap !important; }

  /* display type */
  [style*="font-size: clamp(48px, 6.2vw, 96px)"] { font-size: clamp(34px, 10.5vw, 46px) !important; line-height: 1.06 !important; }
  [style*="font-size: clamp(44px, 4.6vw, 64px)"] { font-size: clamp(30px, 8.5vw, 38px) !important; }
  [style*="font-size: clamp(40px, 5vw, 72px)"] { font-size: clamp(28px, 8vw, 36px) !important; }
  [style*="font-size: 60px"] { font-size: 36px !important; }
  [style*="font-size: 52px"] { font-size: 34px !important; }
  [style*="font-size: 44px"] { font-size: 30px !important; }
  [style*="font-size: 42px"] { font-size: 29px !important; }
  [style*="font-size: 40px"] { font-size: 28px !important; }
  [style*="font-size: 38px"] { font-size: 27px !important; }
  [style*="font-size: 34px"] { font-size: 26px !important; }
  [style*="font-size: 30px"] { font-size: 24px !important; }
  [style*="font-size: 28px"] { font-size: 22px !important; }
  [style*="font-size: 24px"] { font-size: 21px !important; }
  [style*="font-size: 22px"] { font-size: 20px !important; }
  [style*="font-size: 19px"] { font-size: 16px !important; }
  [style*="font-size: 18px"] { font-size: 16px !important; }
  [style*="font-size: 17px"] { font-size: 15.5px !important; }
  [style*="font-size: 170px"] { font-size: 72px !important; }
  .bigmq > div { font-size: 64px !important; }
  .stat { font-size: 42px !important; }
  .lu-t { font-size: 20px !important; }

  /* homepage hero */
  [style*="min-height: 100vh"] { min-height: 100svh !important; }
  #hero-content { padding: 120px 20px 48px 20px !important; gap: 24px !important; }
  #hero-content > div[style*="max-width: 820px"] { max-width: none !important; }
  #hero-content [style*="margin-top: 26px"] { margin-top: 18px !important; }
  #skip-intro { right: 16px !important; top: 76px !important; }
  .scrollcue { display: none !important; }

  /* pedigree logo marquee */
  .mq-track[style*="gap: 84px"] { gap: 48px !important; }
  .mq-track[style*="gap: 84px"] img { transform: scale(0.8); }

  /* buttons */
  .btn-primary, .btn-ghost { padding: 12px 22px !important; font-size: 14.5px !important; }
  .lu-btn { width: 40px !important; height: 40px !important; }

  /* product lineup / film strip / chapter furniture */
  .lineup { padding: 4px 20px 24px !important; gap: 12px !important; }
  .lu, .lu-wide { flex: 0 0 82vw !important; }
  .film .shot { height: 200px !important; }
  .chap-num { display: none !important; }
  .chap-hud { inset: 72px 12px 12px 12px !important; }

  /* takeover menu */
  .tk-grid { padding: 84px 20px 32px 20px !important; gap: 32px !important; min-height: 100vh !important; min-height: 100svh !important; }
  .tk-link { grid-template-columns: 30px 1fr 24px !important; gap: 12px !important; padding: 14px 0 !important; }
  .tk-d { display: none !important; }
  .tk-t { font-size: 30px !important; }
  .tk-a { opacity: 1 !important; transform: none !important; font-size: 18px !important; }
  .tk-side [style*="font-size: 34px"] { font-size: 24px !important; }
  .tk-side [style*="margin-top: 44px"] { margin-top: 28px !important; }
  .sb-links .tk-t { font-size: 20px !important; }

  /* forms (16px stops iOS zooming into the field) */
  input, select, textarea { font-size: 16px !important; }
  #demo-form [style*="grid-template-columns: 1fr 1fr"] { gap: 14px !important; }

  /* Why Shielda cards */
  [style*="margin-left: -48px"] { margin-top: 20px !important; border-radius: 14px !important; }
  [style*="position: absolute; top: -14px; left: 40px"] { left: 20px !important; }

  /* footer */
  [style*="padding: 0 40px 40px 40px"] { padding-bottom: 28px !important; }
  [style*="padding-top: 24px; display: flex; justify-content: space-between"] { flex-direction: column !important; gap: 16px !important; font-size: 13px !important; }
  [style*="padding-top: 24px; display: flex; justify-content: space-between"] > span[style*="display: flex; gap: 24px"] { flex-wrap: wrap !important; gap: 10px 18px !important; }
}

/* ============ Portrait / narrow screens: homepage intro clip ============
   The logo clip is a wide 1280x563 frame with the symbol in the centre third. object-fit: cover on a
   portrait screen crops the symbol, so the clip is pulled back to ~240% of the viewport width (symbol
   ~80% of the width), centred, and its edges fade to the black hero background. */
@media (max-width: 760px), (max-width: 1179px) and (orientation: portrait) {
  #hero-intro {
    inset: auto !important; top: 50% !important; left: 50% !important;
    width: 240vw !important; height: auto !important; max-width: none !important; aspect-ratio: 1280 / 563;
    transform: translate(calc(-50% + 2.5vw), -54%); /* nudged a little right: the symbol sits slightly left of centre in the clip */
    object-fit: contain !important;
    -webkit-mask-image: radial-gradient(ellipse 48% 70% at 50% 50%, #000 55%, transparent 100%);
    mask-image: radial-gradient(ellipse 48% 70% at 50% 50%, #000 55%, transparent 100%);
  }
}

/* ============ Very small phones (<= 380px) ============ */
@media (max-width: 380px) {
  [style*="max-width: 1280px"], [style*="max-width: 1600px"] { padding-left: 16px !important; padding-right: 16px !important; }
  #hero-content { padding-left: 16px !important; padding-right: 16px !important; }
  .btn-primary, .btn-ghost { padding: 11px 18px !important; font-size: 14px !important; }
  .lu, .lu-wide { flex: 0 0 86vw !important; }
}
