/* ==========================================================================
   Trident Plumbers - site chrome shared by BOTH page stacks:
   the classic pages link it as /assets/css/chrome.css, the Next.js pages import it in app/layout.tsx.
   Header (components/Navbar.tsx = classic/src/partials/header.html), the Commercial Solutions and region
   pop-ups (native popovers), the phone menu (a modal <dialog> drawer), page-to-page view transitions,
   the article reading progress bar, scroll reveals and browser UI theming.
   Behaviour: components/site-ui.ts (bundled into the classic main.js by classic/build.mjs).
   Plain CSS on purpose (no nesting): it goes through two different build pipelines.
   ========================================================================== */

:root {
  --ink: #081634; --ink-900: #0d1e46; --ink-800: #142a5c; --ink-700: #1d3a78;
  --signal: #2b77bb; --signal-400: #4d95d6; --red: #e42624; --red-hover: #f03b39;
  --slate-200: #e2e8f0; --slate-300: #cbd5e1; --slate-400: #94a3b8; --slate-500: #64748b; --slate-700: #334155; --slate-800: #1e293b;
  --radius-sm: 6px; --radius: 12px;
  --shadow-panel: 0 0 0 1px rgba(148, 163, 184, .08), 0 30px 60px -30px rgba(0, 0, 0, .8);
  --shadow-glow: 0 0 0 1px rgba(43, 119, 187, .45), 0 10px 40px -10px rgba(43, 119, 187, .6);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  /* spring easing for hover lifts (overshoots a little, then settles); a plain curve where linear() is unknown */
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);

  /* Browser UI in the site's dark theme: form controls, pickers and scrollbars */
  color-scheme: dark;
  accent-color: var(--signal);
  --scrollbar-thumb: #64748b;   /* 3.4:1 against the track, 3.7:1 against the page */
  --scrollbar-track: #0d1e46;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root { --ease-spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017 19.4%, 1.067, 1.099 24.3%, 1.108 26%, 1.103 28.1%, 1.077 31.4%, 1.006 39.1%, .983 43.9%, .981 49.2%, .997 63.1%, 1.002 72.4%, 1); }
}
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border: 3px solid var(--scrollbar-track); border-radius: 8px; }
  ::-webkit-scrollbar-track { background: var(--scrollbar-track); }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Balanced headings and orphan-free paragraphs (both ignored where unsupported) */
main :where(h1, h2, h3, h4) { text-wrap: balance; }
main :where(p, li, blockquote, figcaption, dd) { text-wrap: pretty; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; isolation: isolate; view-transition-name: site-header; }
/* Two background layers: the soft gradient over the page banner, and the solid blurred bar shown once the
   page scrolls. With scroll-driven animations the swap follows the scroll position on the compositor;
   elsewhere site-ui.ts adds .is-solid after 12px of scrolling (same as before). */
.site-header::before, .site-header::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; transition: opacity .3s var(--ease); }
.site-header::before { background-image: linear-gradient(to bottom, rgba(8, 22, 52, .8), transparent); }
.site-header::after {
  opacity: 0; border-bottom: 1px solid rgba(30, 41, 59, .8); background-color: rgba(8, 22, 52, .85);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.site-header.is-solid::before { opacity: 0; }
.site-header.is-solid::after { opacity: 1; }
@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  .site-header::before { animation: header-gradient-out linear both; animation-timeline: scroll(block root); animation-range: 0 40px; }
  .site-header::after { animation: header-solid-in linear both; animation-timeline: scroll(block root); animation-range: 0 40px; }
}
@keyframes header-solid-in { to { opacity: 1; } }
@keyframes header-gradient-out { to { opacity: 0; } }

.site-nav { display: flex; height: 72px; align-items: center; justify-content: space-between; gap: 16px; }

/* Logo on a white tile (components/Logo.tsx) */
.logo-tile {
  display: inline-flex; flex: none; align-items: center; border-radius: 8px; background: #fff; padding: 6px 12px;
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .6); transition: box-shadow .15s var(--ease);
}
.logo-tile:hover { box-shadow: var(--shadow-glow); }
.logo-tile img { display: block; height: 36px; width: auto; max-width: none; }
@media (min-width: 640px) { .logo-tile img { height: 40px; } }

.nav-links { display: none; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 1024px) { .nav-links { display: flex; } }
.nav-link {
  position: relative; display: block; white-space: nowrap; border-radius: var(--radius-sm); padding: 8px 10px; border: 0; background: transparent;
  font: inherit; font-size: 14px; line-height: 20px; color: var(--slate-300); cursor: pointer; transition: color .15s var(--ease);
}
.nav-link:hover { color: #fff; }
.nav-line {
  position: absolute; left: 12px; right: 12px; bottom: -2px; height: 1px; transform-origin: left; transform: scaleX(0);
  background: var(--red); transition: transform .3s var(--ease);
}
.nav-link:hover .nav-line, .nav-link:focus-visible .nav-line { transform: scaleX(1); }

/* Commercial Solutions: a button followed by its popover list */
.nav-dd { position: relative; }
.nav-dd-toggle { display: flex; align-items: center; gap: 4px; anchor-name: --commercial-menu; }
.nav-dd-toggle[aria-expanded="true"] { color: #fff; }
.nav-dd-chevron { width: 14px; height: 14px; flex: none; transition: rotate .15s var(--ease), color .15s var(--ease); }
.nav-dd-toggle[aria-expanded="true"] .nav-dd-chevron { rotate: 180deg; color: var(--signal); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
@media (min-width: 640px) { .nav-actions { gap: 12px; } }
.nav-phone { display: none; align-items: center; gap: 8px; white-space: nowrap; font-size: 14px; line-height: 20px; color: var(--slate-300); transition: color .15s var(--ease); }
.nav-phone:hover { color: var(--signal); }
.nav-phone .lucide { width: 16px; height: 16px; flex: none; }
.nav-phone-label { font-size: 12px; line-height: 16px; letter-spacing: .05em; text-transform: uppercase; color: var(--slate-500); }
@media (min-width: 1536px) { .nav-phone { display: flex; } }

.region { position: relative; }
.region-btn {
  display: flex; align-items: center; gap: 8px; border-radius: var(--radius-sm); border: 1px solid rgba(51, 65, 85, .8);
  background: rgba(13, 30, 70, .6); padding: 8px 12px; font: inherit; font-size: 14px; line-height: 20px; color: var(--slate-200);
  cursor: pointer; transition: border-color .15s var(--ease); anchor-name: --region-menu;
}
.region-btn:hover, .region-btn[aria-expanded="true"] { border-color: rgba(43, 119, 187, .7); }
.region-pin { width: 16px; height: 16px; flex: none; color: var(--signal); }
.region-flag { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 16px; letter-spacing: .1em; }
.region-country { display: none; }
@media (min-width: 1280px) { .region-country { display: inline; } }
.region-chevron { width: 16px; height: 16px; flex: none; transition: rotate .15s var(--ease); }
.region-btn[aria-expanded="true"] .region-chevron { rotate: 180deg; }

.nav-start { display: none; white-space: nowrap; }
@media (min-width: 640px) { .nav-start { display: inline-flex; } }
.nav-start .lucide, .mm-ctas .lucide { width: 16px; height: 16px; flex: none; }
.nav-burger {
  display: grid; height: 40px; width: 40px; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--slate-700);
  background: transparent; color: #fff; cursor: pointer; transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.nav-burger:hover { border-color: var(--signal-400); }
.nav-burger .lucide { width: 20px; height: 20px; }
@media (min-width: 1024px) { .nav-burger { display: none; } }

/* ---------- The two pop-ups (top layer), tethered to their buttons with anchor positioning ---------- */
.nav-dd-menu, .region-menu {
  position: fixed; box-sizing: border-box; height: auto; margin: 0; overflow: visible;
  border-radius: var(--radius); border: 1px solid rgba(51, 65, 85, .8); background: rgba(13, 30, 70, .95); color: var(--slate-300);
  box-shadow: var(--shadow-panel); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  /* exit state, and how it animates in and out of the top layer */
  opacity: 0;
  transition-property: opacity, translate, scale, display, overlay;
  transition-duration: .16s;
  transition-timing-function: ease-in;
  transition-behavior: allow-discrete;
}
.nav-dd-menu { width: 320px; max-width: calc(100vw - 32px); padding: 6px; }
.region-menu { width: 240px; padding: 4px; transform-origin: top right; }
@media (prefers-reduced-motion: no-preference) {
  .nav-dd-menu, .region-menu { translate: 0 -6px; }
  .region-menu { scale: .98; }
}
.nav-dd-menu:popover-open, .region-menu:popover-open, .nav-dd-menu.is-open, .region-menu.is-open { opacity: 1; translate: 0 0; scale: 1; transition-timing-function: ease-out; }
@starting-style {
  .nav-dd-menu:popover-open, .region-menu:popover-open { opacity: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  @starting-style {
    .nav-dd-menu:popover-open, .region-menu:popover-open { translate: 0 -6px; }
    .region-menu:popover-open { scale: .98; }
  }
}
/* a bridge over the 8px gap, so moving the pointer from the button into the list keeps it open */
.nav-dd-menu::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 10px; }
@supports (position-area: block-end) {
  .nav-dd-menu { position-anchor: --commercial-menu; inset: auto; margin: 8px 0 0; position-area: block-end span-inline-end; position-try-fallbacks: flip-inline; }
  .region-menu { position-anchor: --region-menu; inset: auto; margin: 8px 0 0; position-area: block-end span-inline-start; position-try-fallbacks: flip-inline; }
}
@supports not (position-area: block-end) {
  /* no anchor positioning: site-ui.ts places the list under its button when it opens */
  .nav-dd-menu, .region-menu { inset: auto; margin: 0; }
}

.nav-dd-all {
  display: flex; align-items: center; justify-content: space-between; border-radius: 8px; padding: 10px 12px;
  font-size: 14px; font-weight: 600; line-height: 20px; color: #fff; transition: background-color .15s var(--ease);
}
.nav-dd-all:hover, .nav-dd-all:focus-visible { background: var(--ink-700); }
.nav-dd-all .lucide { width: 16px; height: 16px; flex: none; color: var(--signal); transition: translate .2s var(--ease); }
.nav-dd-list { list-style: none; margin: 4px 0 0; padding: 4px 0 0; border-top: 1px solid var(--slate-800); }
.nav-dd-link {
  display: block; border-radius: 8px; padding: 8px 12px; font-size: 14px; line-height: 20px; color: var(--slate-300);
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.nav-dd-link:hover, .nav-dd-link:focus-visible { background: var(--ink-700); color: #fff; }
.nav-dd-link[aria-current="page"] { color: #fff; }

.region-list { list-style: none; margin: 0; padding: 0; }
.region-opt {
  display: flex; width: 100%; align-items: center; gap: 12px; border-radius: 8px; padding: 10px 12px; text-align: left;
  font-size: 14px; line-height: 20px; color: var(--slate-200); transition: background-color .15s var(--ease);
}
.region-opt:hover, .region-opt:focus-visible { background: var(--ink-700); }
.region-opt-flag {
  display: grid; flex: none; height: 28px; width: 36px; place-items: center; border-radius: 4px; border: 1px solid var(--slate-700);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; letter-spacing: .1em; color: var(--signal);
}
.region-opt-text { flex: 1; }
.region-opt-country { display: block; font-weight: 500; color: #fff; }
.region-opt-meta { display: block; font-size: 12px; line-height: 16px; color: var(--slate-400); }
.region-opt-check { display: none; width: 16px; height: 16px; flex: none; color: var(--signal); }
.region-opt[aria-current] .region-opt-check { display: block; }

/* ==========================================================================
   Phone and tablet menu: a modal <dialog> drawer that slides in from the right.
   The sheet sits in a horizontal scroll-snap scroller (closed stop | open stop), so it can be swiped away
   natively; the backdrop dim follows the swipe through a scroll-driven animation.
   ========================================================================== */
.drawer {
  --drawer-width: min(22rem, 86vw, 100vw - 24px);
  --drawer-backdrop: 0;
  position: fixed; inset: 0; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--slate-300); overflow: visible;
}
.drawer:modal { overscroll-behavior: contain; }
.drawer::backdrop { background: rgb(3, 9, 24); opacity: calc(var(--drawer-backdrop) * .72); overflow: hidden; overscroll-behavior: contain; }
.drawer-scroller {
  position: relative; display: grid; grid-template-columns: 100% var(--drawer-width); height: 100%;
  overflow-x: scroll; overflow-y: hidden; overscroll-behavior: none; scrollbar-width: none; scroll-snap-type: x mandatory;
}
.drawer-scroller::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: no-preference) { .drawer-scroller { scroll-behavior: smooth; } }
/* the empty "closed" stop: the dimmed area beside the sheet */
.drawer-scroller::before { content: ""; scroll-snap-align: start; }
.drawer-sheet {
  display: flex; flex-direction: column; height: 100vh; height: 100svh; overflow-y: auto; overscroll-behavior: contain; scroll-snap-align: end;
  background: var(--ink); border-left: 1px solid var(--slate-800); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .8);
  scrollbar-color: var(--scrollbar-thumb) var(--ink);
}
.drawer-head {
  position: sticky; top: 0; z-index: 1; display: flex; flex: none; height: 72px; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--slate-800); background: rgba(8, 22, 52, .92);
}
.drawer-title {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 400; letter-spacing: .25em; text-transform: uppercase; color: var(--signal-400);
}
.drawer-title::before { content: ""; width: 24px; height: 1px; background: var(--red); }
.drawer-close { display: grid; height: 40px; width: 40px; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--slate-700); background: transparent; color: #fff; cursor: pointer; }
.drawer-close:hover { border-color: var(--signal-400); }
.drawer-close .lucide { width: 20px; height: 20px; }
@supports (animation-timeline: scroll()) {
  @property --drawer-backdrop { syntax: "<number>"; inherits: true; initial-value: 0; }
  .drawer { timeline-scope: --drawer-fade; animation: drawer-backdrop linear both; animation-timeline: --drawer-fade; }
  .drawer-scroller { scroll-timeline: --drawer-fade x; }
  @keyframes drawer-backdrop { from { --drawer-backdrop: 0; } to { --drawer-backdrop: 1; } }
}

.mm-list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 16px 20px 32px; list-style: none; }
@media (prefers-reduced-motion: no-preference) {
  .drawer[open] .mm-item { animation: mm-item .5s var(--ease-out) both; animation-delay: calc(.06s + var(--i, 0) * .04s); }
}
@keyframes mm-item { from { opacity: 0; translate: 24px 0; } }
.mm-link { display: block; border-radius: 8px; padding: 12px; font-size: 18px; line-height: 28px; color: #fff; transition: background-color .15s var(--ease); }
.mm-link:hover, .mm-link:focus-visible { background: var(--ink-800); }
.mm-link[aria-current="page"] { background: rgba(43, 119, 187, .14); }
.mm-commercial { margin-top: 8px; border-radius: 8px; border: 1px solid var(--slate-800); padding: 12px; }
.mm-commercial-title { display: block; font-size: 18px; line-height: 28px; color: #fff; }
.mm-sublist { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.mm-sub { display: block; border-radius: 4px; padding: 6px 8px; font-size: 14px; line-height: 20px; color: var(--slate-400); transition: color .15s var(--ease); }
.mm-sub:hover, .mm-sub:focus-visible, .mm-sub[aria-current="page"] { color: var(--signal-400); }
.mm-ctas { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.mm-ctas > a { justify-content: center; }

/* ==========================================================================
   Cards: a spring in the hover lift, and a soft light that follows the pointer with a lit edge around it
   (site-ui.ts feeds the pointer position). Classic cards by class name, Next.js cards with .glow-card.
   ========================================================================== */
main :is(.post-card, .cs-card, .rs-card, .related-card, .deliver-card, .ct-box, .cp-card, .team-card, .glow-card) {
  position: relative; isolation: isolate;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), background-color .3s var(--ease), transform .6s var(--ease-spring);
}
main :is(.post-card, .cs-card, .rs-card, .related-card, .deliver-card, .ct-box, .cp-card, .team-card, .glow-card)::before,
main :is(.post-card, .cs-card, .rs-card, .related-card, .deliver-card, .ct-box, .cp-card, .team-card, .glow-card)::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s var(--ease);
}
/* the light, under the card's content */
main :is(.post-card, .cs-card, .rs-card, .related-card, .deliver-card, .ct-box, .cp-card, .team-card, .glow-card)::before {
  z-index: -1;
  background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 0%), rgba(77, 149, 214, .16), transparent 45%);
}
/* the lit edge: a 1px ring masked out of the same light */
main :is(.post-card, .cs-card, .rs-card, .related-card, .deliver-card, .ct-box, .cp-card, .team-card, .glow-card)::after {
  z-index: 2; padding: 1px;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), rgba(125, 211, 252, .7), rgba(77, 149, 214, .18) 45%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
@media (hover: hover) {
  main :is(.post-card, .cs-card, .rs-card, .related-card, .deliver-card, .ct-box, .cp-card, .team-card, .glow-card):hover::before,
  main :is(.post-card, .cs-card, .rs-card, .related-card, .deliver-card, .ct-box, .cp-card, .team-card, .glow-card):hover::after { opacity: 1; }
}
/* keyboard: the lit edge also shows when a link inside the card has focus */
main :is(.post-card, .cs-card, .rs-card, .related-card, .deliver-card, .ct-box, .cp-card, .team-card, .glow-card):has(:focus-visible)::after { opacity: 1; }

/* Next.js cards that lift with a spring on hover (BentoGrid, Metrics) */
.hover-spring { transition: transform .6s var(--ease-spring), background-color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hover-spring:hover { transform: scale(var(--hover-scale, 1.025)); }
}

/* Content that is swapped in place (3D model details, scope preview): fades in when it changes */
.swap-in { transition: opacity .35s var(--ease-out), translate .45s var(--ease-out); }
@starting-style { .swap-in { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  @starting-style { .swap-in { translate: 0 10px; } }
}

/* Lines that draw themselves (the regional map): with the scroll position where supported, else on load */
.draw-line { stroke-dasharray: 1; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .draw-line { animation: draw-line 1.6s ease-in-out both; animation-delay: calc(.3s + var(--i, 0) * .35s); }
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .draw-scope { view-timeline: --draw-scope block; }
    .draw-line {
      animation: draw-line linear both; animation-timeline: --draw-scope;
      animation-range: entry calc(30% + var(--i, 0) * 15%) cover calc(48% + var(--i, 0) * 8%);
    }
  }
}
@keyframes draw-line { from { stroke-dashoffset: 1; } }

/* Sideways scrollers (model tabs on phones, still materials strip): the edges fade only where more content is
   hidden in that direction, driven by the scroller's own scroll position. */
@supports (animation-timeline: scroll()) {
  @property --fade-start { syntax: "<length>"; inherits: false; initial-value: 0px; }
  @property --fade-end { syntax: "<length>"; inherits: false; initial-value: 0px; }
  .scroll-fade-x {
    --fade-size: 2.5rem;
    mask:
      linear-gradient(#000, #000) no-clip subtract,
      linear-gradient(to right, #000, transparent) 0 0 / var(--fade-start) 100% no-repeat no-clip,
      linear-gradient(to right, transparent, #000) 100% 0 / var(--fade-end) 100% no-repeat no-clip;
    animation: fade-start-in linear both, fade-end-out linear both;
    animation-timeline: scroll(self inline);
    animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%;
  }
}
@keyframes fade-start-in { to { --fade-start: var(--fade-size); } }
@keyframes fade-end-out { from { --fade-end: var(--fade-size); } }

/* Enlarged drawing (Kenya page): a native modal dialog that fades and scales in and out of the top layer */
.lightbox {
  max-width: min(72rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 8px; margin: auto;
  border: 0; background: transparent; color: inherit; overflow: visible;
  opacity: 0;
  transition-property: opacity, scale, display, overlay;
  transition-duration: .25s;
  transition-timing-function: var(--ease-out);
  transition-behavior: allow-discrete;
}
.lightbox[open] { opacity: 1; scale: 1; }
@starting-style { .lightbox[open] { opacity: 0; } }
.lightbox:modal { overscroll-behavior: contain; }
.lightbox::backdrop {
  background-color: rgba(8, 22, 52, 0); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); overflow: hidden; overscroll-behavior: contain;
  transition-property: background-color, display, overlay; transition-duration: .25s; transition-behavior: allow-discrete;
}
.lightbox[open]::backdrop { background-color: rgba(8, 22, 52, .9); }
@starting-style { .lightbox[open]::backdrop { background-color: rgba(8, 22, 52, 0); } }
@media (prefers-reduced-motion: no-preference) {
  .lightbox { scale: .96; }
  @starting-style { .lightbox[open] { scale: .96; } }
}

/* ==========================================================================
   Page-to-page transitions (cross-document view transitions; Chromium and Safari 18.2+).
   The header keeps its own name, so it stays put while the page underneath cross-fades and drifts
   in the direction of travel (deeper into the site: from the right; back up: from the left).
   ========================================================================== */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
::view-transition-group(root) { animation-duration: .42s; animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation: vt-fade-out .22s var(--ease) both; }
::view-transition-new(root) { animation: vt-fade-in .42s var(--ease-out) both; }
html:active-view-transition-type(forward)::view-transition-old(root) { animation-name: vt-out-left; }
html:active-view-transition-type(forward)::view-transition-new(root) { animation-name: vt-in-right; }
html:active-view-transition-type(backward)::view-transition-old(root) { animation-name: vt-out-right; }
html:active-view-transition-type(backward)::view-transition-new(root) { animation-name: vt-in-left; }
::view-transition-group(site-header) { animation-duration: .3s; }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; translate: 0 14px; } }
@keyframes vt-out-left { to { opacity: 0; translate: -40px 0; } }
@keyframes vt-in-right { from { opacity: 0; translate: 56px 0; } }
@keyframes vt-out-right { to { opacity: 0; translate: 40px 0; } }
@keyframes vt-in-left { from { opacity: 0; translate: -56px 0; } }

/* ==========================================================================
   Reading progress (articles): a hairline under the header that fills as the page scrolls.
   Decorative, so browsers without scroll-driven animations simply do not show it.
   ========================================================================== */
.read-progress { display: none; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .read-progress {
      display: block; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
      background: linear-gradient(to right, var(--red), var(--signal-400)); transform-origin: 0 50%;
      animation: read-progress linear both; animation-timeline: scroll(block root);
    }
  }
}
@keyframes read-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ==========================================================================
   Scroll reveals: blocks rise and fade in as they enter the viewport, driven by the scroll position
   (view timelines) where supported. site-ui.ts gives other browsers the old IntersectionObserver
   fade (data-reveal + .is-in). Nothing moves for reduced motion.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .sd-reveal {
      animation: sd-reveal linear both;
      animation-timeline: view();
      animation-range: entry calc(var(--i, 0) * 28px) entry calc(200px + var(--i, 0) * 28px);
    }
  }
}
@keyframes sd-reveal { from { opacity: 0; translate: 0 32px; } }
[data-reveal] { opacity: 0; transform: translateY(18px); }
[data-reveal].is-in { opacity: 1; transform: none; transition: opacity .6s var(--ease-out), transform .7s var(--ease-out); }
@media print {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .read-progress { display: none !important; }
}

/* ==========================================================================
   NCA and ISO badges (components/CredentialBadges.tsx and credentialsHtml in classic/build.mjs).
   A round seal with a double ring in the badge's colour, the mark and the certificate line.
   ========================================================================== */
.cred-list { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.cred {
  --cred: #4d95d6; --cred-soft: rgba(77, 149, 214, .14);
  display: flex; align-items: center; gap: 14px; min-width: 0; padding: 10px 18px 10px 10px;
  border: 1px solid #1e293b; border-radius: 16px; background: rgba(13, 30, 70, .6);
}
.cred-nca { --cred: #e42624; --cred-soft: rgba(228, 38, 36, .14); }
.cred-seal {
  position: relative; flex: none; display: grid; place-items: center; align-content: center; gap: 1px;
  width: 56px; height: 56px; border-radius: 50%; color: var(--cred);
  border: 2px solid var(--cred); background: radial-gradient(circle at 30% 25%, var(--cred-soft), #081634 70%);
  box-shadow: inset 0 0 0 3px #081634, inset 0 0 0 4px var(--cred-soft), 0 6px 18px -8px var(--cred);
}
.cred-ico { width: 18px; height: 18px; }
.cred-mark { font: 700 8.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; color: #fff; white-space: nowrap; }
.cred-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cred-title { font-size: 14px; font-weight: 600; line-height: 1.3; color: #fff; }
.cred-body { font-size: 14px; line-height: 1.6; color: #cbd5e1; }
.cred-ref { font: 400 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; color: #94a3b8; }

/* footer row, on every page */
.footer-creds { padding-bottom: 28px; }

/* full band: two large cards */
.cred-list.is-full { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cred-list.is-full .cred { align-items: flex-start; gap: 20px; padding: 24px; border-radius: 18px; transition: border-color .3s ease, box-shadow .3s ease; }
.cred-list.is-full .cred:hover { border-color: var(--cred); box-shadow: 0 18px 50px -28px var(--cred); }
.cred-list.is-full .cred-seal { width: 88px; height: 88px; gap: 3px; border-width: 3px; box-shadow: inset 0 0 0 5px #081634, inset 0 0 0 7px var(--cred-soft), 0 10px 30px -12px var(--cred); }
.cred-list.is-full .cred-ico { width: 28px; height: 28px; }
.cred-list.is-full .cred-mark { font-size: 11.5px; }
.cred-list.is-full .cred-text { gap: 8px; }
.cred-list.is-full .cred-title { font-size: 19px; }
.cred-list.is-full .cred-ref { margin-top: 2px; }
@media (max-width: 767px) {
  .cred-list.is-full { grid-template-columns: 1fr; }
  .cred-list.is-full .cred { padding: 18px; gap: 16px; }
  .cred-list.is-full .cred-seal { width: 68px; height: 68px; }
  .cred-list.is-full .cred-ico { width: 22px; height: 22px; }
  .cred-list.is-full .cred-mark { font-size: 9.5px; }
}
.cred-band { position: relative; padding-block: 64px; border-bottom: 1px solid rgba(30, 41, 59, .8); background: linear-gradient(to bottom, rgba(13, 30, 70, .45), transparent); }
.cred-band-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 40px; align-items: center; }
.cred-band-title { margin: 14px 0 0; font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; color: #fff; }
.cred-band-title span { color: #2b77bb; }
@media (max-width: 1023px) { .cred-band-inner { grid-template-columns: 1fr; gap: 28px; } }
@media (min-width: 640px) { .cred-band { padding-block: 88px; } .cred-band-title { font-size: 36px; } }
