:root {
  /* === Brightness/Visibility Controls === */
  --ntrd-accent-boost: 1.18;
  --ntrd-accent-saturate: var(--ntrd-accent-boost);
  --ntrd-accent-opacity-max: 0.22;
  --ntrd-accent-contrast: 1.12;
  --ntrd-vignette-strength: 0.5;

  /* === Ambient background motion === */
  --ntrd-ambient-opacity-max: 0.14;
  --ntrd-ambient-drift-px: 28px;
  --ntrd-ambient-blur-px: 90px;
  --ntrd-ambient-duration: 55s;

  /* === Scroll reveal === */
  --ntrd-reveal-distance: 16px;
  --ntrd-reveal-duration: 620ms;
  --ntrd-reveal-stagger: 90ms;

  /* === Card interaction === */
  --ntrd-hover-lift: -4px;
  --ntrd-hover-scale: 1.01;
  --ntrd-hover-duration: 220ms;

  /* === Parallax depth === */
  --ntrd-parallax-max: 6px;

  /* === Navigation === */
  --ntrd-nav-height-default: 80px;
  --ntrd-nav-height-compact: 64px;
  --ntrd-nav-transition: 180ms;
}

/* Ambient computational drift (subtle, low amplitude). */
body {
  position: relative;
  isolation: isolate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  filter: blur(var(--ntrd-ambient-blur-px));
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
}

body::before {
  background:
    radial-gradient(60% 50% at 25% 20%, rgba(var(--ntrd-teal-rgb), calc(var(--ntrd-ambient-opacity-max) * 1.35)), transparent 60%),
    radial-gradient(55% 45% at 85% 80%, rgba(var(--ntrd-red-rgb), calc(var(--ntrd-ambient-opacity-max) * 1.05)), transparent 62%);
  animation: ntrd-ambient-drift-a var(--ntrd-ambient-duration) var(--ntrd-motion) infinite alternate;
  opacity: var(--ntrd-ambient-opacity-max);
}

body::after {
  background:
    radial-gradient(45% 40% at 70% 25%, rgba(var(--ntrd-teal-rgb), calc(var(--ntrd-ambient-opacity-max) * 0.9)), transparent 60%),
    radial-gradient(50% 45% at 20% 85%, rgba(var(--ntrd-red-rgb), calc(var(--ntrd-ambient-opacity-max) * 0.8)), transparent 62%);
  animation: ntrd-ambient-drift-b calc(var(--ntrd-ambient-duration) + 12s) var(--ntrd-motion) infinite alternate;
  opacity: calc(var(--ntrd-ambient-opacity-max) * 0.75);
}

@keyframes ntrd-ambient-drift-a {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(var(--ntrd-ambient-drift-px), var(--ntrd-ambient-drift-px), 0);
  }
}

@keyframes ntrd-ambient-drift-b {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(
      calc(var(--ntrd-ambient-drift-px) * 0.6),
      calc(var(--ntrd-ambient-drift-px) * 0.9),
      0
    );
  }
}

/* Scroll reveal: gated behind JS so non-JS users never get hidden content. */
body.ntrd-motion-enabled .ntrd-reveal {
  opacity: 0;
  transform: translate3d(0, var(--ntrd-reveal-distance), 0);
  transition:
    opacity var(--ntrd-reveal-duration) var(--ntrd-motion),
    transform var(--ntrd-reveal-duration) var(--ntrd-motion);
  transition-delay: var(--ntrd-reveal-delay, 0ms);
  will-change: opacity, transform;
}

body.ntrd-motion-enabled .ntrd-reveal.ntrd-reveal--left {
  transform: translate3d(calc(var(--ntrd-reveal-distance) * -1), 0, 0);
}

body.ntrd-motion-enabled .ntrd-reveal.ntrd-reveal--right {
  transform: translate3d(var(--ntrd-reveal-distance), 0, 0);
}

body.ntrd-motion-enabled .ntrd-reveal.ntrd-reveal--up {
  transform: translate3d(0, calc(var(--ntrd-reveal-distance) * -1), 0);
}

body.ntrd-motion-enabled .ntrd-reveal.ntrd-reveal--up-left {
  transform: translate3d(calc(var(--ntrd-reveal-distance) * -1), calc(var(--ntrd-reveal-distance) * -1), 0);
}

body.ntrd-motion-enabled .ntrd-reveal.ntrd-reveal--up-right {
  transform: translate3d(var(--ntrd-reveal-distance), calc(var(--ntrd-reveal-distance) * -1), 0);
}

/* Remove animated ambient background drift for performance. */
body::before,
body::after {
  display: none;
  animation: none;
  opacity: 0;
}

body.ntrd-motion-enabled .ntrd-reveal.is-visible,
body.ntrd-motion-enabled .ntrd-reveal.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.ntrd-parallax {
  --ntrd-parallax-y: 0px;
  --ntrd-parallax-x: 0px;
}

/* Parallax depth for hero cover images (scroll-linked via JS variable). */
.ntrd-hero.wp-block-cover .wp-block-cover__image-background {
  transform: translate3d(0, var(--ntrd-parallax-y, 0px), 0);
  will-change: transform;
}

/* Navigation compaction (scroll-linked via JS class). */
body.ntrd-nav--compact .ntrd-site-header {
  border-bottom-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(calc(var(--ntrd-overlay-blur) + 4px)) saturate(calc(var(--ntrd-overlay-saturate) + 0.05));
  -webkit-backdrop-filter: blur(calc(var(--ntrd-overlay-blur) + 4px)) saturate(calc(var(--ntrd-overlay-saturate) + 0.05));
}

.ntrd-site-header__inner {
  min-height: var(--ntrd-nav-height-default);
  transition:
    min-height var(--ntrd-nav-transition) var(--ntrd-motion),
    background var(--ntrd-nav-transition) var(--ntrd-motion);
}

body.ntrd-nav--compact .ntrd-site-header__inner {
  min-height: var(--ntrd-nav-height-compact);
}

/* Reduced motion: disable animation + keep everything static/visible. */
@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none !important;
    opacity: calc(var(--ntrd-ambient-opacity-max) * 0.45);
    transform: none !important;
  }

  body.ntrd-motion-enabled .ntrd-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .ntrd-card {
    transition: none !important;
    transform: none !important;
  }

  .ntrd-hero.wp-block-cover .wp-block-cover__image-background {
    transform: none !important;
  }

  .ntrd-parallax {
    --ntrd-parallax-x: 0px !important;
    --ntrd-parallax-y: 0px !important;
  }

  .ntrd-hero__spot {
    opacity: 0 !important;
    transition: none !important;
  }

  .ntrd-site-header__inner {
    transition: none !important;
  }
}
