/* ShieldTech — SECTION KIT (Direction A, editorial).
   Not one template repeated: a kit of section types cycled down every page so
   no two consecutive sections share a shape, unified by one grid, one type
   scale, one accent. Colors/fonts unchanged (shield #0070f8, light #5cb8ff).

   The cycle, by position in the page:
     A · SPREAD        wide asymmetric, text left, card grid intact
     B · MEASURE       narrow centered column, decarded hairline rows
     C · FULL-BLEED    edge-to-edge width, figure-forward
     D · INDEX         sticky header + hairline list, generous rows
*/

/* ── SHARED TYPE SCALE ─────────────────────────────────────────────────── */
main h1 { font-size: clamp(42px, 7vw, 112px) !important; font-weight: 500 !important; line-height: 0.95 !important; letter-spacing: -0.04em !important; }
main h2 { font-size: clamp(29px, 3.9vw, 56px) !important; font-weight: 500 !important; line-height: 1.03 !important; letter-spacing: -0.032em !important; }
main h3 { font-weight: 500 !important; letter-spacing: -0.016em !important; }
main h1 em, main h2 em { font-style: normal; }
main p { font-weight: 300; line-height: 1.68; }
main p:not([style*="max-width"]) { max-width: 62ch; }

/* ── NUMBERED OPENERS (shared spine) ─────────────────────────────────── */
@media (min-width: 1700px) {
  main > section[data-screen-label]::before {
    content: counter(shieldsec, decimal-leading-zero);
    position: absolute; left: clamp(6px, 1.4vw, 26px); top: clamp(58px, 9vh, 118px);
    font-family: 'Schibsted Grotesk', sans-serif; font-size: clamp(34px, 3.4vw, 62px);
    font-weight: 600; line-height: 0.8; letter-spacing: -0.05em;
    color: transparent; -webkit-text-stroke: 1px rgba(159,208,255,0.3);
    pointer-events: none; user-select: none; z-index: 1;
  }
}

/* ══ THE CYCLE ═══════════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  /* A · SPREAD — wide, asymmetric, cards kept for density */
  main > section[data-screen-label]:nth-of-type(4n+1) > div[style*="max-width"]:not([data-hero-clear]) {
    max-width: 1480px !important;
    padding-top: clamp(60px, 8.5vh, 116px) !important;
    padding-bottom: clamp(60px, 8.5vh, 116px) !important;
  }

  /* B · MEASURE — narrow centered column, card chrome dropped.

     This position is for a SHORT list read as a single readable column. It is
     selected positionally (section 2, 6, 10, 14…), which means it also catches
     large card grids that happen to land there — an 18-card grid collapsed to 18
     full-width rows and ran the page to 2600px.

     So the treatment is gated on child count: a grid with 7 or more children is a
     grid, not a list, and keeps its own columns. `.st-keep-grid` is the explicit
     opt-out for anything the count test gets wrong. The two older
     `minmax(...230px/210px)` exclusions below were ad-hoc patches for this same
     problem; the count test is what generalises. */
  main > section[data-screen-label]:nth-of-type(4n+2) > div[style*="max-width"]:not(:has(div[style*="minmax(min(100%, 230px)"])):not(:has(div[style*="minmax(min(100%, 210px)"])):not(:has(div[style*="grid-template-columns"] > :nth-child(7))):not(:has(.st-keep-grid)) {
    max-width: 1480px !important;
    padding-top: clamp(64px, 9.5vh, 132px) !important;
    padding-bottom: clamp(64px, 9.5vh, 132px) !important;
  }
  main > section[data-screen-label]:nth-of-type(4n+2) h2 { max-width: 30ch; }
  @supports selector(:has(*)) {
    main > section[data-screen-label]:nth-of-type(4n+2) div[style*="grid-template-columns"]:has(> a h3):not(:has(> :nth-child(7))):not(.st-keep-grid),
    main > section[data-screen-label]:nth-of-type(4n+2) div[style*="grid-template-columns"]:has(> article h3):not(:has(> :nth-child(7))):not(.st-keep-grid),
    main > section[data-screen-label]:nth-of-type(4n+2) div[style*="grid-template-columns"]:has(> div > h3):not(:has(> :nth-child(7))):not(.st-keep-grid) {
      grid-template-columns: 1fr !important; row-gap: 0 !important;
    }
  }

  /* C · FULL-BLEED — edge to edge, figure-forward */
  main > section[data-screen-label]:nth-of-type(4n+3) > div[style*="max-width"]:not([data-hero-clear]) {
    max-width: none !important;
    padding-left: clamp(20px, 4vw, 64px) !important;
    padding-right: clamp(20px, 4vw, 64px) !important;
    padding-top: clamp(56px, 8vh, 104px) !important;
    padding-bottom: clamp(56px, 8vh, 104px) !important;
  }
  main > section[data-screen-label]:nth-of-type(4n+3) figure { border-radius: 24px; }
  main > section[data-screen-label]:nth-of-type(4n+3) h2 { max-width: 26ch; }

  /* D · INDEX — mid width, tall rows, decarded */
  main > section[data-screen-label]:nth-of-type(4n) > div[style*="max-width"]:not([data-hero-clear]) {
    max-width: 1480px !important;
    padding-top: clamp(62px, 9vh, 124px) !important;
    padding-bottom: clamp(62px, 9vh, 124px) !important;
  }
  main > section[data-screen-label]:nth-of-type(4n) div[style*="grid-template-columns"]:not(:has(> a[data-tile])) {
    row-gap: 0 !important;
  }
}

/* ── DE-CARDING, only in the B and D positions ────────────────────────── */
@supports selector(:has(*)) {
  main > section:nth-of-type(4n+2) div[style*="grid-template-columns"] > a[style*="border-radius: 18px"]:has(h3),
  main > section:nth-of-type(4n+2) div[style*="grid-template-columns"] > div[style*="border-radius: 18px"]:has(h3),
  main > section:nth-of-type(4n+2) div[style*="grid-template-columns"] > article:has(h3),
  main > section:nth-of-type(4n) div[style*="grid-template-columns"] > a[style*="border-radius: 18px"]:has(h3),
  main > section:nth-of-type(4n) div[style*="grid-template-columns"] > div[style*="border-radius: 18px"]:has(h3),
  main > section:nth-of-type(4n) div[style*="grid-template-columns"] > article:has(h3) {
    background: none !important; background-image: none !important;
    border: 0 !important;
    border-radius: 0 !important; box-shadow: none !important;
    padding: 28px 30px 32px 0 !important;
  }
  @media (hover: hover) and (min-width: 900px) {
    main > section:nth-of-type(4n+2) div[style*="grid-template-columns"] > a:has(h3):hover,
    main > section:nth-of-type(4n) div[style*="grid-template-columns"] > a:has(h3):hover {
      transform: none !important; box-shadow: none !important;
      background: linear-gradient(180deg, rgba(92,184,255,0.05), transparent 62%) !important;
    }
  }
  /* kickers become hanging indices in decarded positions */
  main > section:nth-of-type(4n+2) div[style*="grid-template-columns"] > a:has(h3) > div:first-child,
  main > section:nth-of-type(4n) div[style*="grid-template-columns"] > a:has(h3) > div:first-child {
    font-size: 9.5px !important; letter-spacing: 2.4px !important; color: #4a9df5 !important;
  }
  @media (max-width: 768px) {
    main > section:nth-of-type(4n+2) div[style*="grid-template-columns"] > a:has(h3) > div:first-child,
    main > section:nth-of-type(4n) div[style*="grid-template-columns"] > a:has(h3) > div:first-child { font-size: 11px !important; letter-spacing: 2.2px !important; }
  }

  /* accordions: hairline everywhere, they are lists by nature */
  main details:has(summary) {
    background: none !important; background-image: none !important;
    border: 0 !important; border-top: 1px solid rgba(255,255,255,0.11) !important;
    border-radius: 0 !important; box-shadow: none !important;
  }
  main details > summary { padding-left: 0 !important; padding-right: 4px !important; }
  main details > div { padding-left: 0 !important; }
}

/* ── PULL QUOTES ──────────────────────────────────────────────────────── */
main blockquote {
  border-left: 0 !important; background: none !important; border-radius: 0 !important;
  padding: 22px 0 0 !important; margin-top: 14px !important; font-style: normal !important;
  border-top: 1px solid rgba(92,184,255,0.35) !important;
}
main blockquote, main blockquote p {
  font-family: 'Schibsted Grotesk', sans-serif !important;
  font-size: clamp(19px, 1.7vw, 26px) !important; font-weight: 400 !important;
  line-height: 1.28 !important; letter-spacing: -0.02em !important; color: #f6f9ff !important;
  max-width: 34ch;
}

main figure[style*="border: 1px solid"] { border-color: rgba(255,255,255,0.09) !important; }

/* ── MOBILE: one column, same vocabulary, tuned scale ────────────────── */
@media (max-width: 768px) {
  main h1 { font-size: clamp(34px, 10.5vw, 52px) !important; line-height: 0.98 !important; }
  main h2 { font-size: clamp(25px, 7.4vw, 36px) !important; line-height: 1.06 !important; }
  main h3 { font-size: 19px !important; }
  main p { font-size: 14.5px !important; line-height: 1.66 !important; }
  main p:not([style*="max-width"]) { max-width: none; }
  @supports selector(:has(*)) {
    main div[style*="grid-template-columns"] > a[style*="border-radius: 18px"]:has(h3),
    main div[style*="grid-template-columns"] > div[style*="border-radius: 18px"]:has(h3),
    main div[style*="grid-template-columns"] > article:has(h3) {
      background: none !important; background-image: none !important;
      border: 0 !important;
      border-radius: 0 !important; box-shadow: none !important;
      padding: 20px 0 24px !important;
    }
  }
  main div[style*="grid-template-columns"] { column-gap: 0 !important; row-gap: 0 !important; }
  /* grids that stack an image/video/illustration above copy keep breathing room when they collapse to one column */
  @supports selector(:has(*)) {
    main div[style*="grid-template-columns"]:has(> * img), main div[style*="grid-template-columns"]:has(> * video),
    main div[style*="grid-template-columns"]:has(> * x-import), main div[style*="grid-template-columns"]:has(> * svg),
    main div[style*="grid-template-columns"]:has(> * [style*="aspect-ratio"]) { row-gap: 28px !important; }
    main div[style*="grid-template-columns"]:has(> a[data-tile]), main div[style*="grid-template-columns"]:has(> article) { row-gap: 0 !important; }
    /* a heading beside its intro paragraph (two-column lockups): when stacked they need their row gap back */
    main div[style*="grid-template-columns"]:has(> h2 + p), main div[style*="grid-template-columns"]:has(> h2 + div),
    main div[style*="grid-template-columns"]:has(> h3 + p), main div[style*="grid-template-columns"]:has(> h3 + ul), main div[style*="grid-template-columns"]:has(> h3 + div),
    main div[style*="grid-template-columns"]:has(> div > h2):not(:has(> article)):not(:has(> a[data-tile])) { row-gap: 18px !important; }
    /* stacked text cards with no card chrome left: keep them from fusing */
    main div[style*="grid-template-columns"]:has(> div > h3):not(:has(> article)):not(:has(> a[data-tile])):not(:has(> div[style*="border-radius: 18px"])) { row-gap: 14px !important; }
  }
  /* CTA lockups: heading flush against its paragraph */
  main section div[style*="flex-direction: column"] > h2 + p { margin-top: 14px !important; }
  /* device illustrations: more air before their label */
  main a[data-tile] > span:has(iso-device), main a[data-tile] > div:has(iso-device), main a[data-tile] > span:has(x-import) { margin-bottom: 10px !important; }
  main blockquote, main blockquote p { font-size: 19px !important; max-width: none; }
}

/* ── kit-C gutter, only at the width where the numeral is rendered ────── */
@media (min-width: 1700px) {
  main > section[data-screen-label]:nth-of-type(4n+3) > div[style*="max-width"]:not([data-hero-clear]) {
    padding-left: clamp(104px, 7vw, 150px) !important;
  }
}

/* ── case-study articles keep a single row instead of orphaning one ───── */
@media (min-width: 900px) {
  @supports selector(:has(*)) {
    main div[style*="grid-template-columns"]:has(> article:nth-child(3)):not(:has(> article:nth-child(4))):not(#how *) {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
  }
}

/* ── 4-item tile walls divide evenly instead of orphaning one ─────────── */
@supports selector(:has(*)) {
  @media (min-width: 769px) and (max-width: 1060px) {
    main div[style*="grid-template-columns"]:has(> div:nth-child(4)):not(:has(> div:nth-child(5))):not(:has(h3)) {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
  }
}

/* ── STICKY COLUMNS ONLY WHILE THE GRID IS ACTUALLY TWO COLUMNS ────────────
   The contact-form and service-scope sections pin their left column at
   top: 96px. Those grids are repeat(auto-fit, minmax(min(100%, 340-400px), 1fr)),
   so below roughly 1100px they collapse to ONE column — and a pinned element in a
   single column stays parked while the content beneath scrolls up under it,
   overlapping it by the full height of the pinned block. Pinning is a
   two-column affordance; drop it when there is only one. */
@media (max-width: 1100px) {
  main [style*="position: sticky; top: 96px"] {
    position: static !important;
    top: auto !important;
  }
}

/* service "How it works" demo rows: two large windows per row, never three narrow ones */
main #how div[style*="grid-template-columns"]:has(> article) { grid-template-columns: minmax(0, 1fr) !important; gap: clamp(48px, 7vw, 96px) !important; }
main #how div[style*="grid-template-columns"]:has(> article) > article { display: grid !important; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) !important; gap: clamp(24px, 4vw, 64px) !important; align-items: center !important; }
main #how div[style*="grid-template-columns"]:has(> article) > article > :first-child { min-width: 0; }
main #how div[style*="grid-template-columns"]:has(> article) > article:nth-child(even) > :first-child { order: 2; }
main #how div[style*="grid-template-columns"]:has(> article) > article:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) !important; }
@media (max-width: 820px) { main #how div[style*="grid-template-columns"]:has(> article) > article, main #how div[style*="grid-template-columns"]:has(> article) > article:nth-child(even) { grid-template-columns: minmax(0, 1fr) !important; } main #how div[style*="grid-template-columns"]:has(> article) > article:nth-child(even) > :first-child { order: 0; } }

/* Glass cards: anything using the translucent gloss card treatment gets a frosted blur of what's behind it,
   so the animated section backgrounds read as soft light through the card, not as busy detail. */
main [style*="linear-gradient(160deg, rgba(255,255,255,0.0"],
main [style*="linear-gradient(160deg, rgba(255, 255, 255, 0.0"],
main [style*="background: rgba(255,255,255,0.0"],
main [style*="background: rgba(255, 255, 255, 0.0"],
main [style*="background: rgba(5,7,12,0."],
main [style*="background: rgba(2,4,9,0."],
main [style*="background: rgba(255,255,255,0.1"],
main [style*="background: rgba(92,184,255,0.0"],
main [style*="background: rgba(5, 7, 12, 0."],
main details[style*="border: 1px solid rgba(255,255,255"] {
  -webkit-backdrop-filter: blur(14px) saturate(1.25) !important;
  backdrop-filter: blur(14px) saturate(1.25) !important;
}

/* the blur must never apply to full-section hero scrims or overlays that cover media */
main [data-h1a-scrim], main [style*="position: absolute; inset: 0"][style*="background: rgba(2,4,9"], main [style*="position: absolute; inset: 0"][style*="background: rgba(5,7,12"] { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* ── MEDIA FRAMES: thin light-blue edge with a very faint glow on every picture, video and demo window ── */
@supports selector(:has(*)) {
  main [data-wipe],
  main figure:not([data-h1a] *):not([data-ed="hero"] *),
  main div[style*="border-radius"][style*="overflow: hidden"]:has(> img, > video, > canvas, > x-import, > stream-video, > svc-demo, > ai-demo):not([data-h1a] *):not([data-st-bg] *):not(header *),
  main a[style*="border-radius"][style*="overflow: hidden"]:has(> img, > video):not(header *) {
    border: 1px solid rgba(92,184,255,0.32) !important;
    box-shadow: 0 0 0 1px rgba(92,184,255,0.05), 0 0 22px rgba(0,112,248,0.12), 0 24px 60px rgba(0,0,0,0.45) !important;
  }
  main section[data-cine] figure, main [data-cine] > div > figure { border: 0 !important; box-shadow: none !important; }
}

/* demo rows are not cards: no top rule, no tint, no blur panel */
main #how article, main #how article > div:not([data-wipe]) { border: 0 !important; background: none !important; background-image: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border-radius: 0 !important; }
