/* =========================================================
   PromptMed UI System
   Clean baseline + retained utility classes from existing markup
   ========================================================= */

:root {
  --pm-blue-900: #001a66;
  --pm-blue-800: #002080;
  --pm-blue-700: #003399;
  --pm-blue-50: #f5f9ff;
  --pm-green: #00cd00;
  --pm-green-2: #00e600;
  --pm-green-soft: rgba(0, 230, 0, 0.2);
  /* Accessible green for text/links sitting on white or near-white panels.
     --pm-green (#00cd00) is only ~1.7:1 on white; this is ~5.2:1. */
  --pm-green-ink: #067a2e;
  /* Button/solid green that carries WHITE text. The brand --pm-green is far too
     light for that: white on #00cd00 is 2.16:1, well below the 4.5:1 minimum.
     This deeper green reads as the same brand colour at ~4.9:1. Keep --pm-green
     for accents, glows and dividers that carry no text. */
  --pm-green-solid: #00822e;
  --pm-green-solid-hover: #00992f;
  --pm-text: #ffffff;
  --pm-text-muted: rgba(255, 255, 255, 0.7);
  --pm-card-bg-dark: rgba(255, 255, 255, 0.07);
  --pm-card-bg-light: #ffffff;
  --pm-card-border-dark: rgba(255, 255, 255, 0.24);
  --pm-card-border-light: #dbeafe;
  --pm-type-scale: 1;
  --pm-body-size: clamp(1rem, 0.82rem + 0.52vw, 1.08rem);
  --pm-body-line: 1.74;
  --pm-heading-line: 1.24;
  --pm-heading-weight: 600;
  --radius-lg: 1.1rem;
  --radius-xl: 1.35rem;
  --radius-2xl: 1.5rem;
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.14);
  --shadow-float: 0 12px 35px rgba(0, 230, 0, 0.2);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --reveal-duration: 0.72s;
  --stagger-step: 70ms;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--pm-text);
  background: var(--pm-blue-900);
  font-size: var(--pm-body-size);
  line-height: var(--pm-body-line);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings and paragraphs inherit their colour from the surface they sit on.
   Do NOT hard-code a colour here: these elements appear on dark sections
   (bg-pm-blue-*), on white cards (bg-white / bg-white/95 / bg-slate-50) and on
   the green CTA banner. Setting a global light colour makes every heading on a
   light panel invisible, which is exactly the bug this replaced. */
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  color: inherit;
  line-height: var(--pm-heading-line);
  letter-spacing: -0.01em;
  font-weight: var(--pm-heading-weight);
}

p {
  line-height: var(--pm-body-line);
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--pm-green-2);
  outline-offset: 2px;
}

::selection {
  background: var(--pm-green-soft);
  color: #fff;
}

/* === scrollbars === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--pm-blue-900);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--pm-green), var(--pm-green-2));
  border-radius: 999px;
}

/* === shared layout shells === */
main {
  position: relative;
  /* Horizontal reveals start at translateX(±32px). Until they activate that
     overhang would widen the document, so clip it here. `clip` (not `hidden`)
     avoids turning main into a scroll container. */
  overflow-x: clip;
}

main > section,
main > footer,
main > div {
  position: relative;
}

/* === header / nav === */
#main-header {
  background: rgba(0, 26, 102, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#main-header.header-solid {
  background: rgba(0, 26, 102, 0.92) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.nav-link {
  position: relative;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  bottom: -0.3rem;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transform-origin: center;
  transform: scaleX(0);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

/* Underline slides out from the centre on hover as well as for the active page. */
.nav-link:hover::after,
.nav-link:focus-visible::after {
  background: linear-gradient(90deg, var(--pm-green), var(--pm-green-2));
  transform: scaleX(1);
}

.nav-link[aria-current='page'],
.nav-link.active {
  color: #ffffff !important;
}

.nav-link[aria-current='page']::after,
.nav-link.active::after {
  background: linear-gradient(90deg, var(--pm-green), var(--pm-green-2));
  transform: scaleX(1);
}

.hamburger {
  position: relative;
  z-index: 60;
  min-width: 44px;
  min-height: 44px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px 0;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -6px);
}

.mobile-menu {
  top: 0;
  right: 0;
  width: min(92vw, 320px);
  /* Translucent deep-blue fill matching the bg-pm-blue-deeper/98 utility
     in the markup: rgb(0 26 102 / 0.98) + blur, covering the full drawer. */
  background-color: rgb(0 26 102 / 0.98);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  min-height: 100vh;
  min-height: 100dvh;
  isolation: isolate;
  transform: translateX(110%);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu.active {
  transform: translateX(0);
}

/* Dedicated close button pinned inside the drawer (top-right, clear of the
   viewport edge so it can never be clipped like the morphed hamburger was).
   The drawer is fixed, so it is the positioning ancestor on every page. */
.mobile-menu-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease-out);
}

.mobile-menu-close:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.55);
}

.mobile-menu-close:active {
  transform: scale(0.94);
}

/* While the drawer is open the header hamburger fades out, leaving the
   in-drawer button as the single close affordance (no double-X overlap). */
#hamburger {
  transition: opacity 0.25s ease;
}

body.menu-open #hamburger {
  opacity: 0;
  pointer-events: none;
}

/* === mobile tap targets, footer rhythm + long-string safety === */
p a,
li a {
  overflow-wrap: break-word;
}

@media (max-width: 900px) {
  footer .grid {
    gap: 1.5rem;
    row-gap: 2rem;
  }

  footer ul a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 0;
  }

  textarea.form-input {
    min-height: 120px;
  }
}

@media (max-width: 768px) {
  /* Fixed-pixel glow blobs are expensive off-canvas on phone GPUs. */
  .blob {
    width: 260px !important;
    height: 260px !important;
    filter: blur(50px);
  }

  /* Hero eyebrow pill: allow wrapping + centering on narrow screens. */
  #hero .inline-flex.rounded-full {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    max-width: 100%;
  }

  /* Wide-tracked kickers would overflow or strand widows at 360px. */
  .page-hero [class*='tracking-[0.2em]'] {
    letter-spacing: 0.12em;
  }
}

@media (max-width: 480px) {
  #scroll-top {
    bottom: 1rem;
    right: 1rem;
  }

  /* Process diagram text is illegible at 328px and the step lists already
     convey the content — remove it (and its wrapper spacing) on phones. */
  .reveal-scale:has(> img[src*='how-it-works']),
  img[src*='how-it-works'] {
    display: none;
  }
}

.mobile-menu a {
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
  transition: color 0.2s ease, opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.js .mobile-menu a {
  opacity: 0;
  transform: translateX(18px);
}

/* Links fan in one after another once the drawer is open. */
.js .mobile-menu.active a {
  opacity: 1;
  transform: translateX(0);
  transition-delay: calc(var(--i, 0) * 45ms + 120ms);
}

.mobile-menu a:hover,
.mobile-menu a:focus-visible {
  color: #ffffff;
}

.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* === buttons === */
.btn-green,
.btn-outline,
.btn-orange {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  border-radius: 0.85rem;
  font-weight: 600;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease,
    transform 0.25s var(--ease-out);
}

.btn-green {
  background: var(--pm-green-solid);
  color: #fff;
  border: 0;
  box-shadow: 0 4px 12px rgba(0, 130, 46, 0.28);
}

.btn-green:hover {
  background: var(--pm-green-solid-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 130, 46, 0.42);
}

.btn-green:active,
.btn-outline:active,
.btn-orange:active {
  transform: translateY(0);
}

/* Sheen that sweeps across the button on hover. */
.btn-green::after,
.btn-outline::after,
.btn-orange::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  pointer-events: none;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  opacity: 0;
}

.btn-green:hover::after,
.btn-outline:hover::after,
.btn-orange:hover::after {
  opacity: 1;
  animation: btn-sheen 0.7s var(--ease-out);
}

.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.72);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
  transform: translateY(-2px);
}

.btn-orange {
  background: #ff8c2f;
  color: #fff;
  border: 0;
  box-shadow: 0 4px 12px rgba(255, 140, 47, 0.32);
}

.btn-orange:hover {
  background: #f57900;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 140, 47, 0.42);
}

/* Inert app-store CTAs still look and focus like buttons; the click is a no-op
   until APP_STORE_URLS is filled in scripts.js. */
a[data-app-link] {
  cursor: pointer;
}

#scroll-top {
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

#scroll-top:hover {
  transform: translateY(-4px) scale(1.06);
}

/* Reading-progress bar injected by scripts.js. */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--pm-green), var(--pm-green-2));
  z-index: 60;
  pointer-events: none;
}


/* === minimal typography defaults === */
.font-space,
.font-space.font-space {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}

/* Text colour is owned by the Tailwind utility on each element/container
   (text-white, text-white/75, text-slate-900, text-slate-600, ...). Nothing is
   overridden here — a blanket "force white inside section" rule used to live at
   this spot and it broke every light panel. */

/* Links inside light panels need the darker green to stay readable. */
.bg-white a.text-pm-green,
.bg-white a.text-pm-green-light,
.bg-white\/95 a.text-pm-green,
.bg-white\/95 a.text-pm-green-light,
.bg-slate-50 a.text-pm-green,
a.link-on-light {
  color: var(--pm-green-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(6, 122, 46, 0.4);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.bg-white a.text-pm-green:hover,
.bg-white\/95 a.text-pm-green:hover,
.bg-slate-50 a.text-pm-green:hover,
a.link-on-light:hover {
  color: #045c22;
  text-decoration-color: currentColor;
}
/* === content cards / surfaces === */
.glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.glass-card {
  position: relative;
  background: var(--pm-card-bg-dark);
  border: 1px solid var(--pm-card-border-dark);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease,
    background-color 0.3s ease;
}

/* Green glow that fades in behind the card edge on hover. */
.glass-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(120% 120% at 50% 0%, rgba(0, 230, 0, 0.16), transparent 60%);
}

.glass-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 230, 0, 0.5);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 230, 0, 0.14);
}

.glass-card:hover::before {
  opacity: 1;
}

.bg-white .glass-card:hover,
.glass-card.bg-white:hover {
  border-color: #93c5fd;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
}

.glass-card .service-icon {
  margin-bottom: 1rem;
}

.bg-white .glass-card,
.glass-card.bg-white {
  background: #ffffff;
  border-color: var(--pm-card-border-light);
  color: #0f172a;
}

.bg-white .glass-card:hover,
.glass-card.bg-white:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}


.service-icon {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  /* Deeper green so the white icon strokes clear 3:1 against the tile. */
  background: linear-gradient(135deg, var(--pm-green-solid), #00a63a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.35s ease, border-radius 0.35s ease;
}

.glass-card:hover .service-icon {
  transform: translateY(-3px) scale(1.08) rotate(-6deg);
  border-radius: 20px;
  box-shadow: 0 12px 26px rgba(0, 205, 0, 0.34);
}

.service-icon svg {
  transition: transform 0.35s var(--ease-out);
}

.glass-card:hover .service-icon svg {
  transform: scale(1.1);
}

/* === sections / titles === */
.hero-title {
  line-height: 1.08;
  letter-spacing: -0.015em;
  font-size: clamp(2.2rem, 5vw, 4rem);
  margin-top: 0;
  font-weight: 600;
}

main section h1,
main section h2,
main section h3 {
  font-weight: 600;
}

.section-divider {
  width: 76px;
  height: 4px;
  border-radius: 999px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(90deg, var(--pm-green), var(--pm-green-2));
  transform-origin: center;
  transition: transform 0.8s var(--ease-out) 0.15s;
}

.js .section-divider {
  transform: scaleX(0);
}

/* Draws outward once its section scrolls into view. */
.js .section-divider.is-drawn {
  transform: scaleX(1);
}

/* Scrim over page-hero photography.
   This is deliberately plain CSS rather than Tailwind gradient utilities: the
   Play CDN does not emit opacity-modified gradient stops for the custom palette
   (`from-pm-blue-deeper/95` resolved to background-image:none), which left the
   hero photos completely un-dimmed and the white headings unreadable. */
.page-hero__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg,
      rgba(0, 16, 52, 0.95) 0%,
      rgba(0, 26, 102, 0.91) 50%,
      rgba(0, 45, 138, 0.86) 100%);
}

/* Extra darkening directly behind the heading block. */
.page-hero__overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 12, 40, 0.55) 0%, rgba(0, 12, 40, 0.15) 45%, rgba(0, 12, 40, 0.5) 100%);
}

.green-accent-top {
  position: relative;
}

.green-accent-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pm-green), var(--pm-green-2), var(--pm-green));
}

/* === list / badges / metadata === */
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0.9rem;
}

.check-list li .check-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pm-green-solid);
}

.star-rating {
  display: inline-flex;
  gap: 4px;
}

.star-rating svg {
  width: 20px;
  height: 20px;
  fill: var(--pm-green);
}

.coverage-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  white-space: nowrap;
  padding: 12px 18px;
  border: 1px solid rgba(0, 230, 0, 0.35);
  background: rgba(0, 230, 0, 0.1);
  color: var(--pm-green-2);
  font-size: 0.875rem;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease,
    transform 0.25s var(--ease-spring), box-shadow 0.25s ease;
}

.coverage-tag:hover {
  background: rgba(0, 230, 0, 0.22);
  border-color: rgba(0, 230, 0, 0.7);
  color: #ffffff;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 20px rgba(0, 205, 0, 0.22);
}

/* On phones the coverage grid collapses to one column and the pills
   (justify-self-start) hug the left, leaving the right side empty.
   Stretch them full width with centered labels instead. */
@media (max-width: 639px) {
  .coverage-tag {
    justify-self: stretch;
    justify-content: center;
  }
}

.quote-mark {
  font-size: 3.7rem;
  line-height: 1;
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--pm-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === map + status === */
.uk-map-container {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
}

.uk-map-container svg {
  width: 100%;
  height: auto;
}

.city-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--pm-green-2);
  position: absolute;
  box-shadow: 0 0 10px rgba(0, 230, 0, 0.7);
  animation: dot-pulse 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 220ms);
}

/* Expanding radar ring behind each coverage dot. */
.city-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1px solid rgba(0, 230, 0, 0.6);
  animation: dot-ring 2.4s ease-out infinite;
  animation-delay: inherit;
}

.counter-value {
  font-variant-numeric: tabular-nums;
}

/* === inputs / forms === */
.form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}

.form-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
  color: #0f172a;
  padding: 13px 14px;
  font-size: 0.96rem;
  line-height: 1.35;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  font-family: inherit;
}

.form-input::placeholder {
  color: rgba(15, 23, 42, 0.55);
}

.form-input:focus {
  border-color: var(--pm-green);
  box-shadow: 0 0 0 4px rgba(0, 205, 0, 0.15);
  outline: none;
}

.form-input.error {
  border-color: #ef4444;
  background-color: #fff5f5;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.error-msg {
  margin: 0.35rem 0 0;
  color: #ef4444;
  font-size: 0.85rem;
}

/* === animation utilities === */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(2.5deg); }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 16px rgba(0, 230, 0, 0.25), 0 0 40px rgba(0, 230, 0, 0.08);
  }
  50% {
    box-shadow: 0 0 24px rgba(0, 230, 0, 0.4), 0 0 60px rgba(0, 230, 0, 0.18);
  }
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(10px); opacity: 0.45; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-left {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fade-in-right {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
  0% { background-position: -180% 0; }
  100% { background-position: 180% 0; }
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes dot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
  }
}

@keyframes dot-ring {
  0% { transform: scale(0.7); opacity: 0.9; }
  80%, 100% { transform: scale(2.6); opacity: 0; }
}

@keyframes btn-sheen {
  from { left: -60%; }
  to { left: 130%; }
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(28px, -22px) scale(1.08); }
  66% { transform: translate(-20px, 18px) scale(0.95); }
}

/* === animation utility classes === */
/* Decorative, looping motion only runs when the visitor has not asked for
   reduced motion. Content-revealing transitions live outside this block so the
   reduced-motion fallback can simply show everything. */
@media (prefers-reduced-motion: no-preference) {
  .animate-float {
    animation: float 6s ease-in-out infinite;
  }

  .animate-pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
  }

  .animate-scroll-bounce {
    animation: scroll-bounce 2s ease-in-out infinite;
  }

  .animate-shimmer {
    background: linear-gradient(
      100deg,
      transparent 20%,
      rgba(255, 255, 255, 0.07) 45%,
      rgba(0, 230, 0, 0.12) 50%,
      rgba(255, 255, 255, 0.07) 55%,
      transparent 80%
    );
    background-size: 200% 100%;
    animation: shimmer 7s linear infinite;
  }

  .animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 9s ease infinite;
  }

  .animate-blob {
    animation: blob-drift 18s ease-in-out infinite;
  }
}

/* === scroll reveals === */
/* scripts.js observes these and adds .active when they enter the viewport.
   Every "starts hidden" rule below is gated on html.js — that class is set by a
   one-line inline script in each page's <head>. If JavaScript is unavailable or
   fails, none of these rules apply and the content is simply visible. */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
  transition: opacity var(--reveal-duration) var(--ease-out),
    transform var(--reveal-duration) var(--ease-out),
    filter var(--reveal-duration) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger-step));
}

.js .reveal,
.js .reveal-left,
.js .reveal-right,
.js .reveal-scale {
  opacity: 0;
  will-change: opacity, transform;
}

.js .reveal { transform: translateY(28px); }
.js .reveal-left { transform: translateX(-32px); }
.js .reveal-right { transform: translateX(32px); }
.js .reveal-scale { transform: scale(0.94); }
.js .reveal-blur { filter: blur(8px); }

.reveal.active,
.reveal-left.active,
.reveal-right.active,
.reveal-scale.active {
  opacity: 1;
  transform: none;
  filter: none;
  will-change: auto;
}

/* Fixed delay classes kept for markup that already uses them. */
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* === image reveal === */
/* Wraps an <img>; the picture wipes up and settles out of a slight zoom once
   the file has decoded (scripts.js adds .is-loaded). */
.img-reveal {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  background: rgba(255, 255, 255, 0.05);
  transition: clip-path 0.9s var(--ease-out);
}

.js .img-reveal {
  clip-path: inset(0 0 100% 0);
}

.js .img-reveal.is-loaded {
  clip-path: inset(0 0 0 0);
}

.img-reveal img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease-out);
}

.js .img-reveal img {
  transform: scale(1.09);
}

.js .img-reveal.is-loaded img {
  transform: scale(1);
}

/* Slow zoom on hover for linked/feature imagery. */
.img-zoom img {
  transition: transform 0.7s var(--ease-out);
}

.img-zoom:hover img {
  transform: scale(1.06);
}

/* === SVG line drawing === */
/* Any stroked path inside a [data-draw] SVG animates itself in when the SVG
   scrolls into view. --len must comfortably exceed the real path length. */
.js [data-draw] .draw-path {
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
  transition: stroke-dashoffset 2s var(--ease-out);
}

.js [data-draw].is-drawn .draw-path {
  stroke-dashoffset: 0;
}

.js [data-draw] .draw-fade {
  opacity: 0;
  transition: opacity 0.6s ease;
  transition-delay: calc(var(--i, 0) * 140ms + 600ms);
}

.js [data-draw].is-drawn .draw-fade {
  opacity: 1;
}

/* === marquee === */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  gap: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .marquee__track {
    animation: marquee-scroll 32s linear infinite;
  }

  .marquee:hover .marquee__track {
    animation-play-state: paused;
  }
}

/* Decorative blurred colour blobs behind dark hero sections. */
.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.5;
  pointer-events: none;
}

.parallax-bg {
  will-change: transform;
}

@media (max-width: 900px) {
  .glass-card,
  .bg-white .glass-card {
    padding: 1.25rem;
  }

  main .grid.gap-6,
  main .grid.gap-8,
  main .grid.gap-7,
  main .grid.gap-10,
  main .grid.gap-4 {
    gap: 1.25rem;
    row-gap: 1.3rem;
  }

  .glass-card p,
  .glass-card li,
  .form-input {
    line-height: 1.8;
  }

  .glass-card .service-icon {
    margin-bottom: 1rem;
  }
}
/* === responsive === */
@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-menu {
    width: min(100vw, 320px);
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .btn-green,
  .btn-outline,
  .btn-orange {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  /* Everything that motion would have revealed must be visible immediately. */
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-blur,
  .mobile-menu a {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .section-divider {
    transform: scaleX(1) !important;
  }

  .img-reveal {
    clip-path: none !important;
  }

  .img-reveal img {
    transform: none !important;
  }

  [data-draw] .draw-path {
    stroke-dashoffset: 0 !important;
  }

  [data-draw] .draw-fade {
    opacity: 1 !important;
  }

  .parallax-bg {
    transform: none !important;
  }

  #scroll-progress {
    display: none;
  }
}



/* === global responsive hardening === */
img,
svg,
video,
iframe,
canvas,
figure {
  max-width: 100%;
  height: auto;
}

main,
main section,
.mobile-menu {
  min-width: 0;
}

@media (max-width: 900px) {
  .mobile-menu a {
    min-height: 44px;
    padding: 0.45rem 0;
  }

  .glass-card,
  .bg-white .glass-card {
    padding: 1.25rem;
  }

  main .grid.gap-6,
  main .grid.gap-8,
  main .grid.gap-7,
  main .grid.gap-10,
  main .grid.gap-4 {
    gap: 1.25rem;
    row-gap: 1.3rem;
  }

  .glass-card p,
  .bg-white .glass-card p,
  .glass-card ul,
  .glass-card ol,
  .glass-card li {
    font-size: 1rem;
    line-height: 1.72;
  }

  .hero-title {
    letter-spacing: -0.012em;
    line-height: 1.12;
  }

  main section,
  .site-section {
    padding-top: clamp(1.8rem, 6vw, 3rem);
    padding-bottom: clamp(1.8rem, 6vw, 3rem);
  }

  .form-input {
    min-height: 48px;
  }

  .btn-green,
  .btn-outline,
  .btn-orange {
    min-height: 44px;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(1.8rem, 9.5vw, 2.7rem);
  }

  .max-w-7xl,
  .max-w-6xl {
    max-width: calc(100% - 1.75rem);
  }

  #hero {
    min-height: auto;
    padding-top: 5.5rem;
    padding-bottom: 3rem;
  }

  /* Tighter inner-page heroes on mobile: py-24 (6rem) leaves excess air
     under the fixed header on small screens. */
  .page-hero {
    padding-top: 5.5rem;
    padding-bottom: 3.5rem;
  }

  #hero .absolute.inset-0 > img {
    min-height: 120%;
  }

  main section h1,
  main section h2,
  main section h3 {
    text-wrap: balance;
  }

  main section h1 {
    font-size: clamp(1.9rem, 7.8vw, 2.6rem);
    line-height: 1.12;
  }

  main section h2 {
    font-size: clamp(1.5rem, 6.6vw, 2.1rem);
    line-height: 1.2;
  }

  main section h3 {
    font-size: 1.45rem;
    line-height: 1.3;
  }

  main section p,
  main section li,
  main section .text-sm {
    font-size: 1rem;
    line-height: 1.72;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-menu {
    width: min(100vw, 320px);
  }

  .btn-green,
  .btn-outline,
  .btn-orange {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    white-space: normal;
  }

  .form-input,
  select.form-input {
    font-size: 1rem;
    padding: 0.86rem 0.9rem;
  }
}

@media (max-width: 480px) {
  :root {
    --pm-body-size: clamp(0.98rem, 3.5vw, 1rem);
  }

  .max-w-7xl,
  .max-w-6xl {
    max-width: calc(100% - 1.25rem);
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .btn-green,
  .btn-outline,
  .btn-orange {
    width: 100%;
    justify-content: center;
  }

  .form-input {
    min-height: 48px;
  }

  iframe.w-full {
    min-height: 14rem;
  }
}
