/* ============================================================
   GCS Oman — V13 Animation System
   Layers on top of styles.css. Adds scroll-driven motion,
   service themes, advanced reveal variants, and themed
   hero stages for each of the 6 service categories.
   ============================================================ */

/* ---------- Skip to main content (a11y) ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10000;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--bg-2);
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 16px;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Scroll progress bar (top of viewport) ---------- */
.scroll-progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 9999;
  background: transparent; pointer-events: none;
}
.scroll-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 0 12px rgba(0, 188, 212, 0.55);
  transition: width 80ms linear;
}

/* ---------- Service color themes ----------
   Each theme exposes --svc-1 / --svc-2 / --svc-soft so child
   elements (rails, glows, accents) pick up the right color
   without touching the global brand. */
.theme-calibration   { --svc-1: #d4a017; --svc-2: #f0c64a; --svc-soft: #fdf3d2; --svc-ink: #5a3f00; }
.theme-ndt           { --svc-1: #00bcd4; --svc-2: #4dd0e1; --svc-soft: #cef3f8; --svc-ink: #003c44; }
.theme-inspection    { --svc-1: #2d6a4f; --svc-2: #52946b; --svc-soft: #d4e9dc; --svc-ink: #0e2a1f; }
.theme-pressure      { --svc-1: #ef4444; --svc-2: #f87171; --svc-soft: #fde2e2; --svc-ink: #5a0e0e; }
.theme-welding       { --svc-1: #ff6b35; --svc-2: #ff944d; --svc-soft: #ffe1d2; --svc-ink: #5a1900; }
.theme-training      { --svc-1: #6366f1; --svc-2: #818cf8; --svc-soft: #e0e3ff; --svc-ink: #1e1f5a; }

/* ============================================================
   1. Service Stage — themed hero replacement / enhancement
   ============================================================ */
.svc-stage {
  position: relative;
  padding: clamp(70px, 9vw, 130px) 0 clamp(60px, 7vw, 110px);
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 90% 0%, var(--svc-soft) 0%, transparent 60%),
    radial-gradient(700px 420px at 0% 100%, color-mix(in srgb, var(--svc-1) 14%, transparent) 0%, transparent 65%),
    var(--bg);
}
.svc-stage::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--svc-1) 9%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--svc-1) 9%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 30% 30%, #000 0%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
  animation: stage-grid-drift 32s linear infinite;
}
@keyframes stage-grid-drift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 64px 64px, 64px 64px; }
}
.svc-stage > .container { position: relative; z-index: 2; }

.svc-stage-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
}
@media (max-width: 900px) {
  .svc-stage-grid { grid-template-columns: 1fr; }
}
.svc-stage .breadcrumb { margin-bottom: 28px; opacity: 0; transform: translateY(8px); animation: fadeUp 0.7s var(--ease) 0.1s forwards; }
.svc-stage .eyebrow {
  background: color-mix(in srgb, var(--svc-1) 12%, transparent);
  color: var(--svc-1);
  opacity: 0; transform: translateY(8px);
  animation: fadeUp 0.7s var(--ease) 0.2s forwards;
}
.svc-stage h1 {
  margin-top: 18px; margin-bottom: 22px;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.9s var(--ease) 0.35s forwards;
}
.svc-stage h1 .accent-text { color: var(--svc-1); }
.svc-stage .lead {
  opacity: 0; transform: translateY(16px);
  animation: fadeUp 0.9s var(--ease) 0.55s forwards;
}
.svc-stage .actions {
  display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap;
  opacity: 0; transform: translateY(16px);
  animation: fadeUp 0.9s var(--ease) 0.7s forwards;
}
.svc-stage .btn-accent { background: var(--svc-1); }
.svc-stage .btn-accent:hover { background: var(--svc-2); box-shadow: 0 16px 32px color-mix(in srgb, var(--svc-1) 35%, transparent); }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Stat ribbon under stage hero text */
.svc-stage-stats {
  display: flex; flex-wrap: wrap; gap: 28px 44px;
  margin-top: 38px; padding-top: 28px;
  border-top: 1px solid var(--line);
  opacity: 0; transform: translateY(16px);
  animation: fadeUp 0.9s var(--ease) 0.9s forwards;
}
.svc-stage-stats .ss-item .num {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  color: var(--svc-1);
  line-height: 1;
}
.svc-stage-stats .ss-item .lbl {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 6px;
}

/* ============================================================
   2. Service Visual — animated SVG scene (right column)
   Shared frame; per-theme motion handled by .anim-* below.
   ============================================================ */
.svc-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--svc-1) 22%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg-2), var(--svc-soft));
  border: 1px solid color-mix(in srgb, var(--svc-1) 18%, var(--line));
  box-shadow:
    0 30px 80px color-mix(in srgb, var(--svc-1) 18%, transparent),
    inset 0 0 0 1px rgba(255,255,255,0.6);
  display: grid; place-items: center;
  overflow: hidden;
}
.svc-visual::before {
  content: ""; position: absolute; inset: -2px;
  background: conic-gradient(from 0deg, transparent 0deg, color-mix(in srgb, var(--svc-1) 35%, transparent) 90deg, transparent 180deg);
  animation: ring-rotate 10s linear infinite;
  filter: blur(20px); opacity: 0.5; z-index: 0;
}
.svc-visual > * { position: relative; z-index: 1; }
@keyframes ring-rotate { to { transform: rotate(360deg); } }

.svc-visual svg { width: 88%; height: 88%; max-width: 480px; }
.svc-visual .badge {
  position: absolute; bottom: 20px; left: 20px;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--svc-ink);
  border: 1px solid rgba(255,255,255,0.9);
  z-index: 2;
}
.svc-visual .live-pill {
  position: absolute; top: 20px; right: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--svc-ink);
  z-index: 2;
}
.svc-visual .live-pill::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 10px #22c55e;
  animation: pulse-dot 1.6s ease-in-out infinite;
}

/* ============================================================
   3. Per-service motion classes — apply inside .svc-visual SVGs
   ============================================================ */

/* Calibration — dial sweep, tick highlight, micrometer slide */
.anim-dial-sweep {
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  animation: dial-sweep 5s var(--ease) infinite;
}
@keyframes dial-sweep {
  0%   { transform: rotate(-135deg); }
  35%  { transform: rotate(40deg); }
  50%  { transform: rotate(35deg); }
  60%  { transform: rotate(95deg); }
  100% { transform: rotate(-135deg); }
}
.anim-tick-pulse line {
  stroke-opacity: 0.35;
  animation: tick-pulse 5s linear infinite;
}
.anim-tick-pulse line:nth-child(1)  { animation-delay: 0.0s; }
.anim-tick-pulse line:nth-child(2)  { animation-delay: 0.1s; }
.anim-tick-pulse line:nth-child(3)  { animation-delay: 0.2s; }
.anim-tick-pulse line:nth-child(4)  { animation-delay: 0.3s; }
.anim-tick-pulse line:nth-child(5)  { animation-delay: 0.4s; }
.anim-tick-pulse line:nth-child(6)  { animation-delay: 0.5s; }
.anim-tick-pulse line:nth-child(7)  { animation-delay: 0.6s; }
.anim-tick-pulse line:nth-child(8)  { animation-delay: 0.7s; }
.anim-tick-pulse line:nth-child(9)  { animation-delay: 0.8s; }
.anim-tick-pulse line:nth-child(10) { animation-delay: 0.9s; }
.anim-tick-pulse line:nth-child(11) { animation-delay: 1.0s; }
.anim-tick-pulse line:nth-child(12) { animation-delay: 1.1s; }
@keyframes tick-pulse {
  0%, 100% { stroke-opacity: 0.35; }
  50%      { stroke-opacity: 1; }
}
.anim-micrometer {
  animation: micrometer-slide 4s var(--ease-bounce) infinite alternate;
}
@keyframes micrometer-slide {
  to { transform: translateX(28px); }
}

/* NDT — ultrasonic ripples, scan line traversal */
.anim-ripple {
  fill: none;
  stroke: var(--svc-1);
  stroke-width: 1.5;
  opacity: 0;
  animation: ripple-out 2.8s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.anim-ripple:nth-child(1) { animation-delay: 0s; }
.anim-ripple:nth-child(2) { animation-delay: 0.7s; }
.anim-ripple:nth-child(3) { animation-delay: 1.4s; }
.anim-ripple:nth-child(4) { animation-delay: 2.1s; }
@keyframes ripple-out {
  0%   { transform: scale(0.2); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}
.anim-scanline {
  animation: scan-x 3.4s ease-in-out infinite alternate;
}
@keyframes scan-x {
  0%   { transform: translateX(-30%); }
  100% { transform: translateX(30%); }
}

/* Inspection — crane jib pan + cable lift + checkmark draw */
.anim-jib {
  transform-origin: 30% 95%;
  animation: jib-pan 7s var(--ease) infinite alternate;
}
@keyframes jib-pan {
  0%   { transform: rotate(-22deg); }
  100% { transform: rotate(20deg); }
}
.anim-cable-lift {
  animation: cable-lift 4s var(--ease) infinite alternate;
}
@keyframes cable-lift {
  0%   { transform: translateY(40px); }
  100% { transform: translateY(-15px); }
}
.anim-check-draw path {
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: draw 2.4s var(--ease) infinite;
}
@keyframes draw {
  0%   { stroke-dashoffset: 60; }
  60%  { stroke-dashoffset: 0; }
  85%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -60; }
}

/* Pressure Vessel — expanding pressure rings + needle climb */
.anim-pressure-ring {
  fill: none; stroke: var(--svc-1);
  stroke-width: 2; opacity: 0;
  transform-box: fill-box; transform-origin: center;
  animation: pressure-out 3.4s ease-out infinite;
}
.anim-pressure-ring:nth-child(2) { animation-delay: 0.6s; }
.anim-pressure-ring:nth-child(3) { animation-delay: 1.2s; }
.anim-pressure-ring:nth-child(4) { animation-delay: 1.8s; }
@keyframes pressure-out {
  0%   { transform: scale(0.4); opacity: 0; stroke-width: 4; }
  20%  { opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; stroke-width: 0.5; }
}
.anim-pressure-needle {
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  animation: pressure-climb 4.5s cubic-bezier(0.7, 0, 0.4, 1) infinite;
}
@keyframes pressure-climb {
  0%   { transform: rotate(-90deg); }
  60%  { transform: rotate(85deg); }
  72%  { transform: rotate(70deg); }
  100% { transform: rotate(-90deg); }
}

/* Welding — spark trail + arc flash + bead growth */
.anim-arc-flash {
  transform-box: fill-box; transform-origin: center;
  animation: arc-flash 2.2s ease-in-out infinite;
}
@keyframes arc-flash {
  0%, 100% { opacity: 0.2; transform: scale(0.6); filter: blur(2px); }
  10%      { opacity: 1; transform: scale(1.3); filter: blur(0.5px); }
  25%      { opacity: 0.8; transform: scale(1); }
}
.anim-spark {
  animation: spark-fly 1.6s ease-out infinite;
  opacity: 0;
}
.anim-spark:nth-child(1) { animation-delay: 0.0s; --sx: 30px; --sy: -28px; }
.anim-spark:nth-child(2) { animation-delay: 0.2s; --sx: 38px; --sy: -8px;  }
.anim-spark:nth-child(3) { animation-delay: 0.4s; --sx: 22px; --sy: -38px; }
.anim-spark:nth-child(4) { animation-delay: 0.6s; --sx: 42px; --sy: -22px; }
.anim-spark:nth-child(5) { animation-delay: 0.8s; --sx: 18px; --sy: -16px; }
.anim-spark:nth-child(6) { animation-delay: 1.0s; --sx: 34px; --sy: -34px; }
@keyframes spark-fly {
  0%   { opacity: 0; transform: translate(0,0) scale(0.5); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--sx, 30px), var(--sy, -30px)) scale(0.1); }
}
.anim-bead {
  stroke-dasharray: 220; stroke-dashoffset: 220;
  animation: bead-grow 4s var(--ease) infinite;
}
@keyframes bead-grow {
  0%, 10%  { stroke-dashoffset: 220; }
  60%      { stroke-dashoffset: 0; }
  90%      { stroke-dashoffset: 0; opacity: 1; }
  100%     { stroke-dashoffset: 0; opacity: 0; }
}

/* Training — branching path + node pulse + certificate unfurl */
.anim-path-draw {
  stroke-dasharray: 600; stroke-dashoffset: 600;
  animation: path-draw 5s var(--ease) infinite;
}
@keyframes path-draw {
  0%, 8%   { stroke-dashoffset: 600; }
  60%      { stroke-dashoffset: 0; }
  92%      { stroke-dashoffset: 0; }
  100%     { stroke-dashoffset: -600; }
}
.anim-node {
  transform-box: fill-box; transform-origin: center;
  animation: node-pop 5s var(--ease) infinite;
  opacity: 0;
}
.anim-node:nth-child(1) { animation-delay: 0.8s; }
.anim-node:nth-child(2) { animation-delay: 1.6s; }
.anim-node:nth-child(3) { animation-delay: 2.4s; }
.anim-node:nth-child(4) { animation-delay: 3.2s; }
@keyframes node-pop {
  0%   { opacity: 0; transform: scale(0); }
  8%   { opacity: 1; transform: scale(1.3); }
  16%  { transform: scale(1); }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1); }
}
.anim-cert {
  transform-box: fill-box; transform-origin: center bottom;
  animation: cert-unfurl 5s var(--ease) infinite;
}
@keyframes cert-unfurl {
  0%, 10% { transform: scaleY(0.05); opacity: 0; }
  35%     { transform: scaleY(1.05); opacity: 1; }
  45%     { transform: scaleY(1); }
  90%     { opacity: 1; }
  100%    { opacity: 0; transform: scaleY(0.05); }
}

/* ============================================================
   4. Scroll-driven enhancements
   ============================================================ */

/* Mask reveal — clip-path slides open as element enters */
[data-reveal-mask] {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.1s var(--ease);
}
[data-reveal-mask].in { clip-path: inset(0 0 0 0); }
[data-reveal-mask="up"]   { clip-path: inset(100% 0 0 0); }
[data-reveal-mask="up"].in   { clip-path: inset(0 0 0 0); }
[data-reveal-mask="down"] { clip-path: inset(0 0 100% 0); }
[data-reveal-mask="down"].in { clip-path: inset(0 0 0 0); }

/* SVG path draw on viewport entry */
[data-draw] path,
[data-draw] line,
[data-draw] polyline,
[data-draw] circle,
[data-draw] rect {
  stroke-dasharray: var(--len, 600);
  stroke-dashoffset: var(--len, 600);
  transition: stroke-dashoffset 1.6s var(--ease);
}
[data-draw].in path,
[data-draw].in line,
[data-draw].in polyline,
[data-draw].in circle,
[data-draw].in rect {
  stroke-dashoffset: 0;
}

/* Text split reveal — words rise from below per .word */
.split-words .word {
  display: inline-block;
  opacity: 0; transform: translateY(110%);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.split-words.in .word { opacity: 1; transform: translateY(0); }
.split-words.in .word:nth-child(1)  { transition-delay: 0.05s; }
.split-words.in .word:nth-child(2)  { transition-delay: 0.10s; }
.split-words.in .word:nth-child(3)  { transition-delay: 0.15s; }
.split-words.in .word:nth-child(4)  { transition-delay: 0.20s; }
.split-words.in .word:nth-child(5)  { transition-delay: 0.25s; }
.split-words.in .word:nth-child(6)  { transition-delay: 0.30s; }
.split-words.in .word:nth-child(7)  { transition-delay: 0.35s; }
.split-words.in .word:nth-child(8)  { transition-delay: 0.40s; }
.split-words.in .word:nth-child(9)  { transition-delay: 0.45s; }
.split-words.in .word:nth-child(10) { transition-delay: 0.50s; }
.split-words.in .word:nth-child(11) { transition-delay: 0.55s; }
.split-words.in .word:nth-child(12) { transition-delay: 0.60s; }

/* Parallax — JS sets --p (-1..1) based on element's distance from viewport center */
[data-parallax] {
  will-change: transform;
  transform: translate3d(0, calc(var(--p, 0) * var(--p-strength, 50px)), 0);
}

/* 3D tilt — JS toggles .is-tilting and sets --rx, --ry */
[data-tilt] {
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.4s var(--ease);
  will-change: transform;
}
[data-tilt].is-tilting { transition: transform 0.06s linear; }

/* Bar fill on viewport entry */
[data-bar] { position: relative; height: 6px; background: color-mix(in srgb, var(--svc-1, var(--primary)) 12%, transparent); border-radius: var(--r-pill); overflow: hidden; }
[data-bar]::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--bar, 60%);
  background: linear-gradient(90deg, var(--svc-1, var(--primary)), var(--svc-2, var(--accent)));
  border-radius: var(--r-pill);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.4s var(--ease);
}
[data-bar].in::after { transform: scaleX(1); }

/* ============================================================
   5. Service Card glow on hover (homepage upgrade)
   ============================================================ */
.svc-card { isolation: isolate; }
.svc-card::before {
  content: ""; position: absolute; inset: -1px;
  background: radial-gradient(400px 200px at var(--mx, 50%) var(--my, 50%),
              color-mix(in srgb, var(--svc-1, var(--primary)) 25%, transparent), transparent 70%);
  border-radius: inherit;
  opacity: 0; transition: opacity 0.4s var(--ease);
  pointer-events: none; z-index: 0;
}
.svc-card:hover::before { opacity: 1; }
.svc-card > * { position: relative; z-index: 1; }
.svc-card.theme-calibration { --svc-1: #d4a017; --svc-2: #f0c64a; }
.svc-card.theme-ndt         { --svc-1: #00bcd4; --svc-2: #4dd0e1; }
.svc-card.theme-inspection  { --svc-1: #2d6a4f; --svc-2: #52946b; }
.svc-card.theme-pressure    { --svc-1: #ef4444; --svc-2: #f87171; }
.svc-card.theme-welding     { --svc-1: #ff6b35; --svc-2: #ff944d; }
.svc-card.theme-training    { --svc-1: #6366f1; --svc-2: #818cf8; }
.svc-card .icn { transition: transform 0.5s var(--ease), color 0.4s var(--ease), background 0.4s var(--ease); }
.svc-card:hover .icn {
  background: var(--svc-1, var(--primary));
  color: #fff;
  transform: rotate(-8deg) scale(1.1);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--svc-1, var(--primary)) 35%, transparent);
}
.svc-card:hover h3 { color: var(--svc-1, var(--primary)); }

/* ============================================================
   6. Process timeline — vertical rail with growing line
   ============================================================ */
.svc-process {
  position: relative;
  padding-left: 48px;
}
.svc-process::before {
  content: ""; position: absolute; left: 18px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom,
    var(--svc-1, var(--primary)) 0%,
    var(--svc-1, var(--primary)) var(--rail, 0%),
    color-mix(in srgb, var(--svc-1, var(--primary)) 14%, transparent) var(--rail, 0%),
    color-mix(in srgb, var(--svc-1, var(--primary)) 14%, transparent) 100%);
  border-radius: 2px;
}
.svc-process .pstep {
  position: relative; padding: 18px 0 32px;
}
.svc-process .pstep::before {
  content: ""; position: absolute; left: -38px; top: 24px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--svc-1, var(--primary));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--svc-1, var(--primary)) 14%, transparent);
  transition: transform 0.4s var(--ease);
}
.svc-process .pstep.in::before {
  background: var(--svc-1, var(--primary));
  transform: scale(1.15);
}
.svc-process .pstep h3 { font-size: 1.15rem; margin-bottom: 6px; }
.svc-process .pstep .step-tag {
  font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--svc-1, var(--primary)); margin-bottom: 4px;
  display: block;
}

/* ============================================================
   7. Service sub-grid (cards on landing pages) refresh
   ============================================================ */
.svc-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.svc-mini-card {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 26px 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.svc-mini-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--svc-1), var(--svc-2));
  transform: scaleY(0); transform-origin: top;
  transition: transform 0.6s var(--ease);
}
.svc-mini-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--svc-1, var(--primary)) 40%, var(--line));
  box-shadow: 0 24px 50px color-mix(in srgb, var(--svc-1, var(--primary)) 14%, transparent);
}
.svc-mini-card:hover::before { transform: scaleY(1); }
.svc-mini-card .mini-h {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--ink);
  display: flex; align-items: center; gap: 12px;
}
.svc-mini-card .mini-h .mini-num {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--svc-1, var(--primary));
  background: color-mix(in srgb, var(--svc-1, var(--primary)) 12%, transparent);
  padding: 4px 8px; border-radius: 4px;
}
.svc-mini-card p { color: var(--mute); font-size: 0.92rem; }
.svc-mini-card .mini-cta {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--svc-1, var(--primary));
}
.svc-mini-card .mini-cta svg { width: 14px; height: 14px; transition: transform 0.4s var(--ease); }
.svc-mini-card:hover .mini-cta svg { transform: translateX(5px); }

/* ============================================================
   8. Section: "Why this service" feature row
   ============================================================ */
.svc-feature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.svc-feat {
  padding: 24px;
  border-radius: var(--r-md);
  background: var(--bg-2);
  border: 1px solid var(--line);
  position: relative;
  transition: border-color 0.5s var(--ease), transform 0.5s var(--ease);
}
.svc-feat:hover {
  border-color: color-mix(in srgb, var(--svc-1, var(--primary)) 40%, var(--line));
  transform: translateY(-3px);
}
.svc-feat .feat-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--svc-1, var(--primary)) 15%, transparent);
  color: var(--svc-1, var(--primary));
  margin-bottom: 16px;
  transition: transform 0.5s var(--ease);
}
.svc-feat:hover .feat-icon { transform: rotate(-8deg) scale(1.08); }
.svc-feat h3 { margin-bottom: 6px; }
.svc-feat p { color: var(--mute); font-size: 0.92rem; }

/* ============================================================
   9. Themed CTA banner (per service)
   ============================================================ */
.svc-cta {
  position: relative;
  padding: clamp(48px, 6vw, 72px);
  border-radius: var(--r-lg);
  background:
    radial-gradient(700px 400px at 90% -10%, color-mix(in srgb, var(--svc-1) 35%, transparent), transparent 70%),
    linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 100%);
  color: #fff;
  overflow: hidden;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.svc-cta::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--svc-1) 30%, transparent) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shimmer 6s linear infinite;
  pointer-events: none;
}
@keyframes shimmer {
  to { transform: translateX(100%); }
}
.svc-cta h2 { color: #fff; margin: 0 0 8px; }
.svc-cta p { color: rgba(255,255,255,0.78); margin: 0; max-width: 540px; }
.svc-cta .btn { background: var(--svc-1); color: #fff; }
.svc-cta .btn:hover { background: var(--svc-2); transform: translateY(-3px); box-shadow: 0 18px 40px color-mix(in srgb, var(--svc-1) 50%, transparent); }

/* ============================================================
   10. Marquee accent — themed
   ============================================================ */
.marquee.themed { background: var(--svc-soft); border-color: color-mix(in srgb, var(--svc-1) 18%, var(--line)); }
.marquee.themed .marquee-track > span { color: var(--svc-ink); }
.marquee.themed .marquee-track > span::after { background: var(--svc-1); }

/* ============================================================
   11. Cred / location card extras
   ============================================================ */
.cred-badge { transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.cred-badge:hover { transform: translateY(-4px); box-shadow: 0 22px 48px rgba(40,30,10,0.12); }
.cred-badge .seal { transition: transform 0.5s var(--ease-bounce); }
.cred-badge:hover .seal { transform: scale(1.06) rotate(-3deg); }

/* ============================================================
   12. Sub-page theme adoption (Phase 2)
   When the legacy .page-hero / .cta-banner / .equipment-frame
   markup is wrapped in a .theme-X parent, recolor accents to
   match the service.
   ============================================================ */
[class*="theme-"] .page-hero {
  position: relative;
  background:
    radial-gradient(700px 400px at 92% -10%, var(--svc-soft, transparent) 0%, transparent 65%),
    radial-gradient(540px 360px at -5% 110%, color-mix(in srgb, var(--svc-1) 12%, transparent) 0%, transparent 70%),
    var(--bg);
  overflow: hidden;
}
[class*="theme-"] .page-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--svc-1) 8%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--svc-1) 8%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 25% 25%, #000 0%, transparent 70%);
  opacity: 0.55;
  pointer-events: none;
}
[class*="theme-"] .page-hero > .container { position: relative; z-index: 2; }

[class*="theme-"] .page-hero .eyebrow {
  background: color-mix(in srgb, var(--svc-1) 12%, transparent);
  color: var(--svc-1);
}
[class*="theme-"] .page-hero .eyebrow::before { background: var(--svc-1); }
[class*="theme-"] .page-hero .accent-text { color: var(--svc-1); }
[class*="theme-"] .page-hero .btn-accent { background: var(--svc-1); }
[class*="theme-"] .page-hero .btn-accent:hover {
  background: var(--svc-2);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--svc-1) 35%, transparent);
}
[class*="theme-"] .page-hero .btn-outline:hover { background: var(--svc-1); border-color: var(--svc-1); color: #fff; }
[class*="theme-"] .breadcrumb a:hover { color: var(--svc-1); }

/* Equipment frame on sub-pages: themed border + halo */
[class*="theme-"] .equipment-frame {
  position: relative;
  border-color: color-mix(in srgb, var(--svc-1) 22%, var(--line)) !important;
  box-shadow:
    0 30px 80px color-mix(in srgb, var(--svc-1) 18%, transparent),
    inset 0 0 0 1px rgba(255,255,255,0.6) !important;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--svc-1) 16%, transparent), transparent 60%),
    var(--bg-2) !important;
}
[class*="theme-"] .equipment-frame::after {
  content: ""; position: absolute; inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, transparent 0deg, color-mix(in srgb, var(--svc-1) 28%, transparent) 90deg, transparent 180deg);
  filter: blur(20px); opacity: 0.45; z-index: -1;
  animation: ring-rotate 12s linear infinite;
}
[class*="theme-"] .equipment-status {
  background: color-mix(in srgb, var(--svc-1) 14%, transparent) !important;
  color: var(--svc-1) !important;
}

/* Sub-card hover accent on sub-pages */
[class*="theme-"] .sub-card { transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease); }
[class*="theme-"] .sub-card:hover {
  border-color: color-mix(in srgb, var(--svc-1) 35%, var(--line));
  box-shadow: 0 22px 48px color-mix(in srgb, var(--svc-1) 12%, transparent);
}
[class*="theme-"] .sub-card:hover h3 { color: var(--svc-1); }
[class*="theme-"] .sub-card .ico { color: var(--svc-1); }

/* Method cards hover */
[class*="theme-"] .method-card { transition: transform 0.5s var(--ease), border-color 0.5s var(--ease); }
[class*="theme-"] .method-card:hover { border-color: color-mix(in srgb, var(--svc-1) 35%, var(--line)); transform: translateY(-3px); }
[class*="theme-"] .method-card .m-icn { color: var(--svc-1); transition: transform 0.5s var(--ease); }
[class*="theme-"] .method-card:hover .m-icn { transform: rotate(-8deg) scale(1.08); }

/* FAQ themed accent */
[class*="theme-"] .faq-item summary:hover { color: var(--svc-1); }
[class*="theme-"] .faq-item[open] .faq-icon { color: var(--svc-1); }
[class*="theme-"] .faq-item[open] summary { color: var(--svc-1); }

/* Course-grid themed (training sub-pages) */
[class*="theme-"] .course-item.linked:hover { border-color: color-mix(in srgb, var(--svc-1) 40%, var(--line)); }
[class*="theme-"] .course-item .ci-num { color: var(--svc-1); }
[class*="theme-"] .course-item.linked .badge { color: var(--svc-1); }

/* CTA banner adopts theme on sub-pages too */
[class*="theme-"] .cta-banner {
  position: relative;
  background:
    radial-gradient(700px 400px at 90% -10%, color-mix(in srgb, var(--svc-1) 35%, transparent), transparent 70%),
    linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 100%) !important;
  color: #fff;
  overflow: hidden;
}
[class*="theme-"] .cta-banner::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--svc-1) 30%, transparent) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shimmer 6s linear infinite;
  pointer-events: none;
}
[class*="theme-"] .cta-banner > * { position: relative; z-index: 1; }
[class*="theme-"] .cta-banner h2 { color: #fff; }
[class*="theme-"] .cta-banner p { color: rgba(255,255,255,0.78); }
[class*="theme-"] .cta-banner .btn-accent { background: var(--svc-1); }
[class*="theme-"] .cta-banner .btn-accent:hover {
  background: var(--svc-2);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--svc-1) 50%, transparent);
}

/* ============================================================
   13. Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .svc-stage::before,
  .svc-visual::before,
  .anim-dial-sweep, .anim-tick-pulse line, .anim-micrometer,
  .anim-ripple, .anim-scanline,
  .anim-jib, .anim-cable-lift, .anim-check-draw path,
  .anim-pressure-ring, .anim-pressure-needle,
  .anim-arc-flash, .anim-spark, .anim-bead,
  .anim-path-draw, .anim-node, .anim-cert,
  .svc-cta::after,
  .marquee-track,
  [class*="theme-"] .cta-banner::after,
  [class*="theme-"] .equipment-frame::after {
    animation: none !important;
  }
  [data-parallax] { transform: none !important; }
  .split-words .word, [data-reveal-mask] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  [data-draw] path, [data-draw] line, [data-draw] polyline, [data-draw] circle, [data-draw] rect {
    stroke-dashoffset: 0 !important;
  }
}

/* ============================================================
   Card-title h3s — keep the visual look of the old h4
   ============================================================ */
.cred-badge h3, .sub-card h3, .step h3, .method-card h3,
.info-row h3, .map-card .map-head h3, .gallery-item .info h3,
.svc-process .pstep h3, .svc-feat h3, .footer-col h3 {
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0;
  line-height: 1.3;
  color: var(--ink);
}
.cred-badge h3 { font-size: 1rem; }
.sub-card h3 { font-size: 1.05rem; }
.step h3, .method-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.svc-process .pstep h3 { font-size: 1.15rem; margin-bottom: 6px; }
.svc-feat h3 { margin-bottom: 6px; }
.course-item h4 {
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  letter-spacing: 0;
  line-height: 1.3;
  margin: 0;
}

/* ============================================================
   Cookie consent banner (V9)
   ============================================================ */
/* ---------- Cookie banner — slim bar ---------- */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9990;
  background: var(--ink);
  color: rgba(255,255,255,0.88);
  padding: 12px 24px;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  pointer-events: none;
}
.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cookie-banner-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}
.cookie-banner-text {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.5;
}
.cookie-banner-text a {
  color: var(--accent);
  text-decoration: underline;
  white-space: nowrap;
}
.cookie-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.cookie-btn {
  padding: 7px 16px;
  font-size: 0.82rem;
  white-space: nowrap;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-family: var(--f-body);
  font-weight: 500;
  transition: opacity 0.2s;
}
.cookie-btn:hover { opacity: 0.85; }
.cookie-btn-accept {
  background: var(--accent);
  color: var(--ink);
}
.cookie-btn-reject {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
}
@media (max-width: 600px) {
  .cookie-banner { padding: 10px 16px; }
  .cookie-banner-text { font-size: 0.8rem; }
  .cookie-banner-actions { width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition: none; }
}

/* ============================================================
   V10 Mobile UX upgrades
   - 44x44 minimum tap targets
   - Compact hero on mobile
   - More breathing room between paragraphs
   - Wider footer tap targets, looser menu spacing
   ============================================================ */
@media (max-width: 768px) {
  /* Body — slightly more comfortable line-height and paragraph spacing on small screens */
  body { font-size: 16px; line-height: 1.7; }
  p { margin-bottom: 1.15em; }

  /* Mobile menu items — bigger hit area */
  .nav-menu li > a {
    padding: 14px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 1.05rem;
  }
  .submenu li > a { padding: 12px 16px; min-height: 44px; }

  /* Topbar links — bigger hit area */
  .topbar a { padding: 6px 4px; display: inline-block; min-height: 36px; line-height: 24px; }

  /* CTA buttons — full size on small screens */
  .btn { padding: 14px 22px; min-height: 48px; font-size: 1rem; }

  /* Hero slider — reduce height to leave room for content above the fold */
  .hero-slider { min-height: 460px; height: 76vh; max-height: 720px; }
  .hero-slide-content { bottom: 64px; padding-top: 80px; }
  .hero-slide-title { font-size: clamp(2.1rem, 7.5vw, 3.4rem); margin-bottom: 22px; }
  .hero-slide-subtitle { font-size: 1rem; margin-bottom: 22px; max-width: 100%; }
  .hero-slide-content .actions { gap: 10px; flex-wrap: wrap; }
  .hero-slide-content .btn { width: 100%; justify-content: center; }
  .slider-stats { display: none; } /* hide decorative stats on phones */
  .slider-controls { bottom: 16px; }

  /* Section padding tightened */
  section { padding: 56px 0; }
  .section-head { margin-bottom: 36px; }

  /* WhatsApp FAB — bigger, easier to tap. Position lives on the fixed
     .fab-wrap, never on the relative .fab button (offsets would shift it
     into the popup menu). */
  .fab { width: 56px; height: 56px; }
  .fab-wrap { bottom: 16px; right: 16px; }

  /* Footer links — taller tap targets */
  .footer-col ul li a { padding: 6px 0; display: inline-block; min-height: 36px; line-height: 24px; }

  /* Topbar info — stack with more breathing room */
  .topbar-info, .topbar-meta { gap: 14px; }

  /* Cookie banner — fully responsive (already covered earlier but reaffirm) */
  .cookie-banner-actions .cookie-btn { min-height: 48px; }

  /* Cards — more separation */
  .svc-card, .sub-card, .method-card, .cred-badge, .svc-mini-card { padding: 22px 20px; }
}

/* Phone-only refinements */
@media (max-width: 480px) {
  h1 { font-size: clamp(2.1rem, 8vw, 2.8rem); }
  h2 { font-size: clamp(1.7rem, 6vw, 2.1rem); }
  .container { padding: 0 18px; }
  .hero-slider { min-height: 420px; height: 72vh; }
  .topbar-meta { display: none; } /* hide secondary meta on phones */
}

/* Ensure all interactive elements have visible focus */
@media (any-hover: none) {
  /* Touch-first devices — slightly thicker tap-target outline */
  a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
  }
}

/* ============================================================
   V10 Trust strip + Industries grid
   ============================================================ */
.trust-strip {
  padding: 28px 0;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.trust-strip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: center;
}
.trust-strip-grid li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-left: 1px solid var(--line);
}
.trust-strip-grid li:first-child { border-left: 0; }
.trust-num {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 500;
  color: var(--primary);
  line-height: 1;
}
.trust-lbl {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
@media (max-width: 720px) {
  .trust-strip-grid li { border-left: 0; border-bottom: 1px solid var(--line); padding: 10px 0; }
  .trust-strip-grid li:last-child { border-bottom: 0; }
}

/* Industries served grid */
.industry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.industry-grid li {
  position: relative;
  padding: 26px 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.industry-grid li:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  box-shadow: 0 24px 50px color-mix(in srgb, var(--primary) 10%, transparent);
}
.industry-grid .ind-icn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  border-radius: 12px;
  margin-bottom: 14px;
  transition: transform 0.5s var(--ease);
}
.industry-grid li:hover .ind-icn { transform: rotate(-6deg) scale(1.05); }
.industry-grid .ind-icn svg { width: 24px; height: 24px; }
.industry-grid h3 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.2rem;
  margin: 0 0 6px;
  color: var(--ink);
}
.industry-grid p {
  color: var(--mute);
  font-size: 0.92rem;
  margin: 0;
  line-height: 1.55;
}

/* ============================================================
   Website Design Improvement + Testing spec — V13.3 additions
   ============================================================ */

/* prefers-contrast: more — bump borders and link weights for high-contrast users */
@media (prefers-contrast: more) {
  :root {
    --line: #000000;
    --mute: #1a1a1a;
  }
  a, .btn-outline, .btn-accent {
    text-decoration-thickness: 2px;
  }
  .nav a, .footer-col a {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  *:focus-visible {
    outline: 3px solid currentColor !important;
    outline-offset: 3px !important;
  }
}

/* Screen-reader-only utility */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Suppress tap highlight on touch devices (spec: -webkit-tap-highlight-color) */
html {
  -webkit-tap-highlight-color: transparent;
}

/* Dynamic viewport units for hero slider (iOS Safari 100vh / address-bar fix).
   Falls back to vh declarations in styles.css on older browsers via @supports. */
@supports (height: 100dvh) {
  .hero-slider { height: 90dvh; }
}
@media (max-width: 768px) {
  @supports (height: 100dvh) {
    .hero-slider { height: 76dvh; }
  }
}
@media (max-width: 480px) {
  @supports (height: 100dvh) {
    .hero-slider { height: 72dvh; }
  }
}

/* ============================================================
   V13.4 — Device-visibility pass
   ============================================================ */

/* Maps: every .map-iframe gets responsive width regardless of parent.
   The original rule (.map-card .map-iframe) only covered card-wrapped iframes. */
.map-iframe {
  width: 100%;
  height: 320px;
  border: 0;
  display: block;
  border-radius: 16px;
}
@media (max-width: 640px) {
  .map-iframe { height: 260px; }
}

/* Iframes without a class default to responsive */
iframe {
  max-width: 100%;
}

/* Mobile typography legibility — bump tiny labels/badges so they don't fall under
   12px on small screens (WCAG comfortable-reading floor). */
@media (max-width: 640px) {
  .eyebrow,
  .hero-trust,
  .cred-badge p,
  .cat-head .count,
  .svc-card .num,
  .footer-col h3,
  .footer-bottom,
  .info-row h3 {
    font-size: 0.82rem; /* ~13.1px */
  }
  .topbar-info,
  .topbar-meta,
  .form-group label {
    font-size: 0.85rem; /* ~13.6px */
  }
  /* Form inputs must be at least 16px on iOS to prevent input-zoom */
  input, textarea, select {
    font-size: max(16px, 1rem) !important;
  }
}

/* Phone — heading scaling for better readability above the fold */
@media (max-width: 480px) {
  .page-hero h1 {
    font-size: clamp(1.75rem, 5.5vw + 0.6rem, 2.4rem);
    line-height: 1.18;
    letter-spacing: -0.01em;
  }
  .hero-slide-title,
  h1 {
    font-size: clamp(1.85rem, 6vw + 0.5rem, 2.8rem);
    line-height: 1.15;
  }
  h2 {
    font-size: clamp(1.45rem, 4.5vw + 0.4rem, 2rem);
    line-height: 1.22;
  }
  .lead {
    font-size: 1rem;
    line-height: 1.6;
  }
  /* Tighter container padding on the smallest phones so cards use full width */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Tablet — guarantee 2-col grids switch on cleanly */
@media (min-width: 640px) and (max-width: 1023px) {
  .svc-grid,
  .sub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Desktop comfort — cap reading line length on long-form body copy. The .lead
   element gets a sensible ch-based max to avoid stretched lines on 1920+ */
@media (min-width: 1280px) {
  .page-hero .lead,
  .section-head p {
    max-width: 65ch;
  }
  .section-head.center p {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Safe-area for iPhone notch/home-indicator — applied only on the FAB so existing
   header/topbar/footer padding stays untouched */
@supports (padding: max(0px)) {
  .fab-wrap {
    bottom: max(env(safe-area-inset-bottom), 28px);
    right: max(env(safe-area-inset-right), 28px);
  }
}

/* Long-word safety on paragraph body copy ONLY — never on headings (would break titles) */
p, .lead, .footer-bottom span {
  overflow-wrap: break-word;
}

/* Horizontal-scroll guard — body alone doesn't reliably clip position:fixed children.
   The mobile nav-menu sits off-screen and was leaking into scroll-width at tablet
   widths (768–1023). Pinning overflow-x on html clips it cleanly. */
html {
  overflow-x: hidden;
}

/* Mobile menu backdrop is inert until the mobile breakpoint activates it */
.nav-overlay { display: none; }

/* ============================================================
   MOBILE REFINEMENTS (≤768px) — authoritative, loaded last.
   Consolidated header bar, slide-in menu, and hero-slider fixes.
   High-specificity selectors where they must beat base component
   rules (e.g. `.hero-slide .hero-slide-title`).
   ============================================================ */
@media (max-width: 768px) {

  /* ---- Top contact bar: slim, single line, never clipped ---- */
  .topbar { padding: 5px 0; font-size: 0.72rem; overflow: visible; white-space: nowrap; }
  .topbar .container { flex-wrap: nowrap; }
  .topbar .topbar-info { flex-wrap: nowrap; justify-content: center; column-gap: 18px; row-gap: 0; }
  .topbar .topbar-info > * + *::before { content: none !important; margin: 0 !important; }
  .topbar .topbar-info a { min-height: 0; padding: 2px 0; }
  .topbar .topbar-info > a:nth-child(2) { display: none; } /* hide secondary (Technical) number */

  /* ---- Header: keep hamburger above the panel so it doubles as the close (X) ---- */
  .menu-toggle { position: relative; z-index: 70; }

  /* ---- Dim backdrop behind the slide-in menu (injected into the header) ---- */
  .nav-overlay {
    display: block;
    position: fixed; inset: 0;
    background: rgba(14, 42, 31, 0.5);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden;
    transition: opacity .35s var(--ease), visibility .35s var(--ease);
    z-index: 58;
  }
  .nav-overlay.open { opacity: 1; visibility: visible; }

  /* ---- Slide-in menu panel: clean, modern, touch-friendly ---- */
  .nav-menu { width: min(86%, 360px); padding: 84px 22px 36px; box-shadow: -24px 0 70px rgba(0,0,0,.28); }
  .nav-menu > li { border-bottom: 1px solid var(--line); }
  .nav-menu > li:last-child { border-bottom: none; }
  .nav-menu > li > a {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 52px; padding: 14px 6px; font-size: 1.06rem; font-weight: 500;
    border-radius: 10px;
  }
  .nav-menu > li > a:active { background: var(--bg-tint); }
  .nav-menu .submenu {
    position: static; transform: none; box-shadow: none; visibility: visible; opacity: 1;
    background: transparent; min-width: 0; margin: 0 0 6px; padding: 2px 0 2px 14px;
    border-left: 2px solid var(--line);
  }
  .nav-menu .submenu li { border: none; }
  .nav-menu .submenu a {
    display: flex; align-items: center; min-height: 44px;
    padding: 10px 8px; font-size: 0.95rem; font-weight: 400; color: var(--ink); opacity: .72;
  }
  .nav-menu .submenu a:active { opacity: 1; color: var(--primary); }

  /* ---- Hero slider: fit the space under the sticky header so the dots stay
     above the fold; content centred without overlapping the header ---- */
  .hero-slider { height: calc(100dvh - 136px); min-height: 520px; max-height: 760px; }
  .hero-slide-content { bottom: 72px; padding: 0 22px; }
  .hero-slider .hero-slide .hero-slide-title {
    font-size: clamp(1.85rem, 8vw, 2.6rem); line-height: 1.07; margin: 0 0 16px; max-width: 100%;
  }
  .hero-slide .hero-slide-content .eyebrow { margin-bottom: 14px; }
  .hero-slide .hero-slide-subtitle { font-size: 0.95rem; line-height: 1.5; margin: 0 0 20px; max-width: 100%; }
  .hero-slide .hero-slide-content .actions { gap: 10px; }
  .hero-slide .hero-slide-content .actions .btn { width: 100%; justify-content: center; }

  /* controls → centred dots (swipe is enabled; counter & arrows hidden to declutter) */
  .hero-slider .slider-controls { left: 0; right: 0; bottom: 18px; padding: 0 18px; justify-content: center; align-items: center; gap: 0; }
  .hero-slider .slider-counter { display: none; }
  .hero-slider .slider-arrows { display: none; }
  .hero-slider .slider-dots { justify-content: center; flex-wrap: nowrap; gap: 8px; }
  .hero-slider .slider-dot { width: 20px; height: 4px; }
  .slider-stats { display: none; }
}

/* Very narrow phones: drop email too so the contact bar stays one line */
@media (max-width: 360px) {
  .topbar .topbar-info > a:nth-child(3) { display: none; }
}
