:root {
  --bg: #05060A;
  --surface: #0F1117;
  --surface-2: #141823;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #F4F6FA;
  --text-muted: #9CA3AF;
  --cyan: #19D7FF;
  --blue: #1976D2;
  --grad: linear-gradient(135deg, #19D7FF 0%, #1976D2 100%);
  --grad-soft: linear-gradient(135deg, rgba(25, 215, 255, 0.18) 0%, rgba(25, 118, 210, 0.18) 100%);
  --radius: 14px;
  --radius-lg: 20px;
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  --max-w: 1180px;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0; }

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cyan);
  color: #000;
  padding: 10px 14px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}

.grad {
  background: var(--grad);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-shimmer 7s ease-in-out infinite alternate;
}
@keyframes grad-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(5, 6, 10, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nav.scrolled {
  background: rgba(5, 6, 10, 0.82);
  border-bottom-color: var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand img {
  height: 52px;
  width: auto;
  border-radius: 6px;
  transition: transform 0.3s var(--ease-out-soft), box-shadow 0.3s ease;
}
.nav-brand:hover img {
  transform: scale(1.05);
  box-shadow: 0 0 0 1px rgba(25, 215, 255, 0.4), 0 4px 20px rgba(25, 215, 255, 0.25);
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-menu a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-menu a:hover { color: var(--text); }
.nav-cta {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--grad);
  color: #001018 !important;
  font-weight: 600;
  transition: transform 0.3s var(--ease-out-soft), box-shadow 0.3s ease;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px -8px rgba(25, 215, 255, 0.55);
}
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(80px, 12vw, 160px) 0 clamp(80px, 10vw, 140px);
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  inset: -20% 0 auto 0;
  height: 600px;
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
  transform: translate3d(calc(var(--par-x, 0) * 18px), calc(var(--par-y, 0) * 12px + var(--scroll-drift, 0px)), 0);
  transition: transform 0.8s var(--ease-out-soft);
}
.hero-glow::before,
.hero-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  will-change: transform;
}
.hero-glow::before {
  background: radial-gradient(60% 70% at 30% 30%, rgba(25, 215, 255, 0.22) 0%, transparent 65%);
  animation: glow-drift-a 18s ease-in-out infinite alternate;
}
.hero-glow::after {
  background: radial-gradient(50% 60% at 75% 20%, rgba(25, 118, 210, 0.22) 0%, transparent 70%);
  animation: glow-drift-b 24s ease-in-out infinite alternate;
}
@keyframes glow-drift-a {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(4%, 6%, 0) scale(1.08); }
  100% { transform: translate3d(-5%, -3%, 0) scale(0.96); }
}
@keyframes glow-drift-b {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-6%, 4%, 0) scale(1.1); }
  100% { transform: translate3d(5%, -5%, 0) scale(0.95); }
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  transform: translate3d(calc(var(--par-x, 0) * -6px), calc(var(--par-y, 0) * -4px), 0);
  transition: transform 0.8s var(--ease-out-soft);
}
.hero h1 {
  margin-bottom: 22px;
}
.lede {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 36px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  transition: transform 0.3s var(--ease-out-soft), box-shadow 0.3s var(--ease-out-soft), background 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn::after {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: -45%;
  width: 32%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45) 50%, transparent);
  transform: skewX(-18deg);
  opacity: 0;
  pointer-events: none;
}
.btn-primary {
  background: var(--grad);
  color: #001018;
  box-shadow: 0 10px 30px -10px rgba(25, 215, 255, 0.45);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px -12px rgba(25, 215, 255, 0.65);
}
.btn-primary:hover::after {
  animation: btn-shine 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes btn-shine {
  0% { left: -45%; opacity: 0; }
  15% { opacity: 1; }
  100% { left: 135%; opacity: 0; }
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: rgba(25, 215, 255, 0.07);
  border-color: var(--cyan);
  transform: translateY(-1px);
}
.btn-lg {
  padding: 18px 32px;
  font-size: 1.05rem;
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(72px, 10vw, 128px) 0;
  position: relative;
}
.section-alt {
  background: linear-gradient(180deg, transparent, rgba(25, 118, 210, 0.04) 50%, transparent);
}
.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}
.section-head h2 { margin-bottom: 0; }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.service-card {
  --mx: 50%;
  --my: 0%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.35s var(--ease-out-soft), border-color 0.3s ease, background 0.3s ease, box-shadow 0.35s var(--ease-out-soft);
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(320px circle at var(--mx) var(--my), rgba(25, 215, 255, 0.12), transparent 65%),
    var(--grad-soft);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.55), 0 0 32px -8px rgba(25, 215, 255, 0.18);
}
.service-card:hover::before { opacity: 1; }
.service-card > * { position: relative; z-index: 1; }
.service-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(25, 215, 255, 0.08);
  border: 1px solid rgba(25, 215, 255, 0.22);
  color: var(--cyan);
  margin-bottom: 24px;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.35s var(--ease-out-soft);
}
.service-card:hover .service-icon {
  background: var(--grad);
  border-color: transparent;
  color: #04141b;
  transform: scale(1.06);
}
.service-icon svg { width: 32px; height: 32px; }
.service-card h3 { margin-bottom: 8px; }
.service-card p { color: var(--text-muted); font-size: 0.97rem; }

/* ---------- About ---------- */
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
  align-items: start;
}
.about-inner .section-head { margin-bottom: 0; }
.about-copy p + p { margin-top: 18px; }
.about-copy p {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact-inner {
  max-width: 640px;
  margin: 0 auto;
}
.contact h2 { margin-bottom: 18px; }
.contact .lede { margin: 0 auto 32px; }

/* ---------- Footer ---------- */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.footer-brand:hover {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.footer-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .about-inner { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    position: absolute;
    top: calc(var(--nav-h) - 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 24px 20px;
    background: rgba(5, 6, 10, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s;
  }
  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-menu a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }
  .nav-menu a:last-child { border-bottom: none; }
  .nav-menu a:not(.nav-cta)::after { display: none; }
  .nav-cta {
    margin-top: 8px;
    padding: 12px 18px;
    text-align: center;
    border-radius: 12px;
  }
  .services-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* ---------- Nav underline (hover + active share one system) ---------- */
.nav-menu a[aria-current="page"] {
  color: var(--text);
}
.nav-menu a:not(.nav-cta) {
  position: relative;
}
.nav-menu a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease-out-soft);
}
.nav-menu a:not(.nav-cta):hover::after,
.nav-menu a[aria-current="page"]:not(.nav-cta)::after {
  transform: scaleX(1);
}

/* ---------- Page hero (compact, for non-home pages) ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 110px) 0 clamp(48px, 7vw, 80px);
  border-bottom: 1px solid var(--border);
}
.page-hero > .container {
  position: relative;
  z-index: 1;
}
.page-hero .hero-glow {
  height: 360px;
}
.page-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin-bottom: 18px;
}
.page-hero .lede { margin-bottom: 0; }

/* ---------- Section CTA (centered "Learn more" rows) ---------- */
.section-cta {
  text-align: center;
  margin-top: 48px;
}
.arrow-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.2s ease;
}
.arrow-link span {
  transition: transform 0.25s var(--ease-out-soft);
}
.arrow-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out-soft);
}
.arrow-link:hover {
  color: var(--text);
}
.arrow-link:hover span {
  transform: translateX(5px);
}
.arrow-link:hover::after {
  transform: scaleX(1);
}
.about-cta { margin-top: 28px; }

/* ---------- Homepage contact CTA row ---------- */
.contact-cta-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* ---------- Values grid (About page) ---------- */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 8px;
}

/* ---------- How we work (Services page) ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}
.step-card {
  --mx: 50%;
  --my: 0%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  transition: transform 0.35s var(--ease-out-soft), border-color 0.3s ease, background 0.3s ease, box-shadow 0.35s var(--ease-out-soft);
}
.step-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.55), 0 0 32px -8px rgba(25, 215, 255, 0.18);
}
.step-card::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 12px;
  letter-spacing: 0.06em;
}
.step-card h3 { margin-bottom: 8px; }
.step-card p { color: var(--text-muted); }

/* ---------- Contact page layout ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.contact-details dt {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
}
.contact-details dd {
  margin: 0 0 24px 0;
  color: var(--text);
  font-size: 1.02rem;
}
.contact-details dd a { color: var(--text); }
.contact-details dd a:hover { color: var(--cyan); }
.contact-pitch h2 { margin-bottom: 18px; }
.contact-pitch p { color: var(--text-muted); margin-bottom: 28px; }

/* ---------- Legal pages (Privacy / Terms) ---------- */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
}
.legal-content h2 {
  font-size: 1.35rem;
  margin-top: 40px;
  margin-bottom: 12px;
}
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content h3 {
  margin-top: 24px;
  margin-bottom: 8px;
}
.legal-content p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
}
.legal-content p + p { margin-top: 14px; }
.legal-content ul {
  color: var(--text-muted);
  padding-left: 22px;
  margin: 12px 0;
}
.legal-content li { margin-bottom: 6px; }
.legal-notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 36px;
}

/* ---------- Responsive overrides for new layouts ---------- */
@media (max-width: 960px) {
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  .values-grid { grid-template-columns: 1fr; }
  .contact-cta-row { display: flex; }
  .contact-cta-row .btn { width: 100%; }
}

/* ---------- Refined Glow: cursor-reactive card border ---------- */
.service-card::after,
.step-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(280px circle at var(--mx) var(--my), rgba(25, 215, 255, 0.6), rgba(25, 118, 210, 0.25) 50%, transparent 80%);
  -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, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
@media (hover: hover) {
  .service-card:hover::after,
  .step-card:hover::after { opacity: 1; }
}

/* ---------- Refined Glow: scroll reveals ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease-out-soft), transform 0.65s var(--ease-out-soft);
  transition-delay: var(--reveal-delay, 0s);
}
html.js .reveal.is-revealed {
  opacity: 1;
  transform: none;
}

/* ---------- Living Depth: film grain ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='180'%20height='180'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.9'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------- Living Depth: hero load choreography ---------- */
@keyframes rise-in {
  0% {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}
.hero-copy > :nth-child(-n+4),
.page-hero > .container > :nth-child(-n+3) {
  animation: rise-in 0.7s var(--ease-out-soft) backwards;
}
.hero-copy > :nth-child(1),
.page-hero > .container > :nth-child(1) { animation-delay: 0.05s; }
.hero-copy > :nth-child(2),
.page-hero > .container > :nth-child(2) { animation-delay: 0.17s; }
.hero-copy > :nth-child(3),
.page-hero > .container > :nth-child(3) { animation-delay: 0.29s; }
.hero-copy > :nth-child(4) { animation-delay: 0.41s; }

/* ---------- Refined Glow + Living Depth: reduced-motion guards ---------- */
@media (prefers-reduced-motion: reduce) {
  .service-card::before,
  .service-card::after,
  .step-card::after,
  .btn::after { display: none; }
  html.js .reveal {
    opacity: 1;
    transform: none;
  }
  .hero-glow::before,
  .hero-glow::after,
  .grad,
  .hero-copy > :nth-child(-n+4),
  .page-hero > .container > :nth-child(-n+3) {
    animation: none;
  }
}

/* ====================================================================== */
/* Lively Motion Layer                                                    */
/* Word reveal, 3D tilt, magnetic CTAs, hero mesh, icon float, stats band */
/* All effects are progressive (html.js) and motion-safe (guards below).  */
/* ====================================================================== */

/* ---------- Word-by-word headline reveal ---------- */
html.js .rw {
  display: inline-block;
  transform: translateY(0.55em);
  opacity: 0;
  transition: transform 0.6s var(--ease-out-soft), opacity 0.6s var(--ease-out-soft);
  transition-delay: var(--wd, 0s);
  will-change: transform, opacity;
}
html.js .words-in .rw {
  transform: none;
  opacity: 1;
}
/* The hero heading hands its load reveal over to the word animation. */
html.js .hero-copy > h1.is-split,
html.js .page-hero > .container > h1.is-split {
  animation: none;
}

/* ---------- 3D card tilt (pointer devices only) ---------- */
/* Tilt is scoped to :hover so the scroll-reveal translate stays in control
   of the card transform until the pointer is actually over it. */
@media (hover: hover) and (pointer: fine) {
  html.js .service-card,
  html.js .step-card { transform-style: preserve-3d; }
  html.js .service-card:hover,
  html.js .step-card:hover {
    transform: perspective(900px) translateY(-6px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  }
}

/* ---------- Magnetic CTAs (pointer devices only) ---------- */
@media (hover: hover) and (pointer: fine) {
  html.js .btn-primary,
  html.js .btn-lg,
  html.js .arrow-link {
    transform: translate(var(--mag-x, 0px), var(--mag-y, 0px));
  }
  html.js .btn-primary:hover,
  html.js .btn-lg:hover {
    transform: translate(var(--mag-x, 0px), calc(var(--mag-y, 0px) - 2px));
  }
}

/* ---------- Hero ambient mesh ---------- */
.hero::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.6px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(62% 62% at 50% 28%, #000 0%, transparent 76%);
  mask-image: radial-gradient(62% 62% at 50% 28%, #000 0%, transparent 76%);
  animation: mesh-drift 34s linear infinite;
}
@keyframes mesh-drift {
  from { background-position: 0 0; }
  to { background-position: 34px 68px; }
}

/* ---------- Service icon float ---------- */
html.js .service-icon svg {
  animation: icon-float 6s ease-in-out infinite;
}
@keyframes icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.services-grid .service-card:nth-child(2) .service-icon svg,
.values-grid .service-card:nth-child(2) .service-icon svg { animation-delay: -1.2s; }
.services-grid .service-card:nth-child(3) .service-icon svg,
.values-grid .service-card:nth-child(3) .service-icon svg { animation-delay: -2.4s; }
.services-grid .service-card:nth-child(4) .service-icon svg { animation-delay: -3.6s; }
.services-grid .service-card:nth-child(5) .service-icon svg { animation-delay: -4.8s; }
.services-grid .service-card:nth-child(6) .service-icon svg { animation-delay: -0.6s; }

/* ---------- Stats band ---------- */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 40px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.stat { text-align: center; }
.stat-num {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 4.2vw, 3rem);
  line-height: 1;
  letter-spacing: -0.02em;
  background: var(--grad);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-shimmer 7s ease-in-out infinite alternate;
}
.stat-suffix { font-size: 0.72em; }
.stat-infinite { font-size: 1.05em; }
.stat-label {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

@media (max-width: 768px) {
  .stats-band { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
}

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(25, 215, 255, 0.55);
  z-index: 60;
  pointer-events: none;
}

/* ---------- Section heading draw-in underline ---------- */
html.js .section-head h2.is-split::after {
  content: "";
  display: block;
  height: 2px;
  width: 0;
  margin-top: 18px;
  border-radius: 2px;
  background: var(--grad);
  transition: width 0.7s var(--ease-out-soft) 0.25s;
}
html.js .section-head h2.is-split.words-in::after {
  width: 64px;
}

/* ---------- Lively Motion Layer: reduced-motion guards ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js .rw { transform: none; opacity: 1; transition: none; }
  .hero::before,
  .page-hero::before,
  html.js .service-icon svg,
  .stat-num { animation: none; }
  html.js .section-head h2.is-split::after { transition: none; width: 64px; }
}

/* ====================================================================== */
/* Photography Layer                                                      */
/* Full-bleed hero photo, brand-tinted media frames, and the Services/    */
/* About media bands. Reuses existing tokens + parallax vars; every       */
/* motion piece is guarded for prefers-reduced-motion below.              */
/* ====================================================================== */

/* ---------- Full-bleed hero (home) ---------- */
.hero--full {
  display: flex;
  align-items: center;
  min-height: clamp(540px, 82vh, 780px);
}
.hero-copy { min-width: 0; max-width: 620px; }
.hero-copy .lede { margin-bottom: 34px; }

/* Full-width background photo behind the hero copy. */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% center;
}
/* Brand-cool cast over the photo. */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--grad);
  opacity: 0.22;
  mix-blend-mode: overlay;
}
/* Legibility scrim: dark on the left for the copy, vignette into the page. */
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(5, 6, 10, 0.95) 0%, rgba(5, 6, 10, 0.82) 34%, rgba(5, 6, 10, 0.42) 64%, rgba(5, 6, 10, 0.62) 100%),
    linear-gradient(180deg, rgba(5, 6, 10, 0.5) 0%, transparent 24%, rgba(5, 6, 10, 0.88) 100%);
}

/* ---------- Reusable media frame + brand tint ---------- */
.media-frame {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Cool the photo toward the cyan/blue brand, then vignette into the dark bg. */
.photo-tint {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(135% 115% at 50% 6%, transparent 34%, rgba(5, 6, 10, 0.78) 100%);
}
.photo-tint::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad);
  opacity: 0.30;
  mix-blend-mode: overlay;
}
/* Gradient hairline border-glow (same mask trick as the service cards). */
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(25, 215, 255, 0.55), rgba(25, 118, 210, 0.18) 55%, transparent 85%);
  -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, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Slow Ken Burns drift on photos (pointer devices only) ---------- */
@media (hover: hover) and (pointer: fine) {
  html.js .media-frame img,
  html.js .hero-bg img {
    animation: ken-burns 24s ease-in-out infinite alternate;
  }
}
@keyframes ken-burns {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.09) translate3d(-1.5%, -1.2%, 0); }
}

/* ---------- Media band (Services / About): photo + copy, 2-up ---------- */
.media-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.media-band-copy { min-width: 0; }
.media-band-copy .section-head { margin-bottom: 22px; }
.media-band-copy .about-copy { margin-bottom: 0; }
.media-band-copy .arrow-link { margin-top: 24px; }

/* ---------- Responsive: collapse hero + bands ---------- */
@media (max-width: 900px) {
  .media-band { grid-template-columns: 1fr; gap: 36px; }
  /* Photo first on stacked layouts regardless of source order. */
  .media-band .media-frame { order: -1; }
}

/* ---------- Reduced-motion guards (photography) ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js .media-frame img,
  html.js .hero-bg img { animation: none; }
}
