/* Nuview Construction — design layer
   Loaded from mu-plugins/nuview-design/. Safe to remove: the site falls back
   to the stock Elementor rendering. */

:root {
  --nuv-ink: #04121f;
  --nuv-navy: #0b2239;
  --nuv-navy-soft: #16324f;
  --nuv-blueprint: #0d3a63;
  --nuv-line: rgba(178, 214, 255, 0.55);
  --nuv-line-strong: rgba(214, 234, 255, 0.9);
  --nuv-amber: #f2a33c;
  --nuv-amber-hi: #ffb959;
  --nuv-paper: #f5f7fb;
  --nuv-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --nuv-header: 84px;
}

/* ------------------------------------------------------------------ *
 * 1. Hero — "Blueprint → Build"
 * ------------------------------------------------------------------ */

/* --bp is the scroll progress, 0 → 1. It defaults to 1 (the finished state)
   so the hero is always readable; the inline head script drops it to 0 only
   once we know scripting is alive, and nuview-design.js then drives it. */
.nuv-hero {
  --bp: 1;
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: 0 !important;
  background-attachment: scroll !important;
}

html.nuv-anim .nuv-hero {
  --bp: 0;
  min-height: calc(100svh + 560px);
}

/* The photo itself starts drained of colour and resolves as you scroll. */
.nuv-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #04121f 0%, #072441 45%, #04121f 100%);
  opacity: calc(0.92 - 0.78 * var(--bp));
  mix-blend-mode: multiply;
}

.nuv-hero > .elementor-background-overlay {
  opacity: calc(0.72 - 0.42 * var(--bp)) !important;
}

.nuv-hero > .elementor-container {
  z-index: 3;
  align-items: center;
  gap: 48px;
  padding: clamp(48px, 8vh, 110px) clamp(20px, 4vw, 72px);
}

/* Pin the content for the length of the story. */
html.nuv-anim .nuv-hero > .elementor-container {
  position: sticky;
  top: var(--nuv-header);
  min-height: calc(100svh - var(--nuv-header));
  padding-block: 0;
}

/* --- blueprint overlay ------------------------------------------------ */

.nuv-bp {
  position: sticky;
  top: 0;
  z-index: 1;
  display: block;
  height: 100svh;
  margin-bottom: -100svh;
  pointer-events: none;
}

.nuv-bp__grid {
  position: absolute;
  inset: 0;
  opacity: calc(0.85 - 0.85 * var(--bp));
  background-image:
    linear-gradient(to right, var(--nuv-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--nuv-line) 1px, transparent 1px),
    linear-gradient(to right, rgba(178, 214, 255, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(178, 214, 255, 0.18) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  background-position: center;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 45%, #000 35%, transparent 78%);
          mask-image: radial-gradient(120% 90% at 50% 45%, #000 35%, transparent 78%);
}

.nuv-bp__art {
  position: absolute;
  left: 50%;
  bottom: -4%;
  translate: -50% 0;
  width: min(78vw, 1000px);
  height: auto;
  overflow: visible;
  opacity: calc(0.9 - 0.75 * max(0, (var(--bp) - 0.5)) / 0.5);
}

.nuv-bp__art [data-draw] {
  fill: none;
  stroke: var(--nuv-line-strong);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: calc(var(--len, 1200) * (1 - min(1, var(--bp) / 0.62)));
}

.nuv-bp__art [data-draw="dim"] {
  stroke: rgba(242, 163, 60, 0.85);
  stroke-width: 1;
  stroke-dasharray: 6 5;
  stroke-dashoffset: 0;
  opacity: calc(min(1, max(0, (var(--bp) - 0.3) / 0.25)));
}

/* --- hero copy -------------------------------------------------------- */

.nuv-hero .nuv-hero-copy,
.nuv-hero .nuv-hero-side {
  margin: 0 !important;
  padding: 0 !important;
}

@media (min-width: 1025px) {
  .nuv-hero .nuv-hero-copy {
    max-width: 640px;
  }
  /* Elementor writes text-align onto each widget wrapper, so the override has
     to reach the wrappers themselves, not just their contents. */
  .nuv-hero .nuv-hero-copy,
  .nuv-hero .nuv-hero-copy > *,
  .nuv-hero .nuv-hero-copy > * > *,
  .nuv-hero .nuv-hero-copy .elementor-heading-title,
  .nuv-hero .nuv-hero-copy p {
    text-align: left !important;
  }
  .nuv-hero .nuv-hero-body {
    max-width: 540px;
  }
}

.nuv-hero .nuv-hero-title .elementor-heading-title {
  --fill: min(1, var(--bp) / 0.72);
  font-size: clamp(2.4rem, 5.4vw, 4.6rem) !important;
  line-height: 1.04 !important;
  letter-spacing: -0.015em;
  text-shadow: none !important;
  color: transparent !important;
  -webkit-text-stroke: 1px rgba(226, 240, 255, 0.85);
  background-image: linear-gradient(
    100deg,
    #ffffff 0 calc(var(--fill) * 118% - 8%),
    rgba(255, 255, 255, 0) calc(var(--fill) * 118%)
  ) !important;
  -webkit-background-clip: text;
          background-clip: text;
}

/* Browsers without text-stroke get plain white type rather than nothing. */
@supports not (-webkit-text-stroke: 1px #fff) {
  .nuv-hero .nuv-hero-title .elementor-heading-title {
    color: #fff !important;
    background-image: none !important;
  }
}

.nuv-hero .nuv-hero-lead,
.nuv-hero .nuv-hero-body,
.nuv-hero .nuv-hero-cta,
.nuv-hero .nuv-hero-card {
  opacity: var(--in, 0);
  transform: translate3d(0, calc((1 - var(--in, 0)) * 26px), 0);
  will-change: opacity, transform;
}

.nuv-hero .nuv-hero-lead  { --in: clamp(0, (var(--bp) - 0.04) / 0.16, 1); }
.nuv-hero .nuv-hero-body  { --in: clamp(0, (var(--bp) - 0.10) / 0.16, 1); }
.nuv-hero .nuv-hero-cta   { --in: clamp(0, (var(--bp) - 0.16) / 0.16, 1); }
.nuv-hero .nuv-hero-card  { --in: clamp(0, (var(--bp) - 0.01) / 0.14, 1); }

.nuv-hero .nuv-hero-lead p {
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.55;
  color: #e7f0fa;
  text-shadow: 0 1px 12px rgba(4, 18, 31, 0.75);
}

.nuv-hero .nuv-hero-body p {
  font-size: clamp(0.95rem, 1.1vw, 1.03rem);
  line-height: 1.7;
  color: rgba(226, 238, 250, 0.86);
  text-shadow: 0 1px 10px rgba(4, 18, 31, 0.7);
}

.nuv-hero .nuv-hero-cta .elementor-button {
  padding: 18px 40px;
  white-space: nowrap;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  background: var(--nuv-amber);
  color: var(--nuv-navy);
  box-shadow: 0 14px 34px rgba(242, 163, 60, 0.32);
  transition: transform 0.35s var(--nuv-ease), box-shadow 0.35s var(--nuv-ease),
    background-color 0.35s var(--nuv-ease);
}

.nuv-hero .nuv-hero-cta .elementor-button:hover {
  background: var(--nuv-amber-hi);
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(242, 163, 60, 0.42);
}

/* --- quote card ------------------------------------------------------- */

.nuv-hero .nuv-hero-card {
  margin: 0 !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(165deg, rgba(11, 34, 57, 0.94), rgba(8, 24, 41, 0.97)) !important;
  box-shadow: 0 30px 70px rgba(2, 10, 20, 0.55) !important;
  backdrop-filter: blur(6px);
  max-width: 460px;
  margin-inline-start: auto !important;
}

.nuv-hero .nuv-hero-card .elementor-heading-title {
  text-shadow: none !important;
}

.nuv-quote-form .elementor-field-group {
  margin-bottom: 0;
}

.nuv-quote-form .elementor-field {
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.nuv-quote-form .elementor-field:focus {
  outline: 2px solid var(--nuv-amber);
  outline-offset: 1px;
}

.nuv-quote-form .elementor-button {
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 0.3s var(--nuv-ease), box-shadow 0.3s var(--nuv-ease);
}

.nuv-quote-form .elementor-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(242, 163, 60, 0.4);
}

/* --- scroll hint ------------------------------------------------------ */

.nuv-scrollhint {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 24px;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  font: 600 11px/1 system-ui, sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(226, 240, 255, 0.75);
  opacity: calc(1 - min(1, var(--bp) / 0.2));
  pointer-events: none;
}

.nuv-scrollhint i {
  display: block;
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, rgba(226, 240, 255, 0.9), transparent);
  animation: nuv-hint 1.9s var(--nuv-ease) infinite;
  transform-origin: top;
}

@keyframes nuv-hint {
  0%   { transform: scaleY(0.2); opacity: 0.2; }
  45%  { transform: scaleY(1);   opacity: 0.9; }
  100% { transform: scaleY(1);   opacity: 0;   }
}

/* --- hero responsive -------------------------------------------------- */

@media (max-width: 1024px) {
  html.nuv-anim .nuv-hero {
    min-height: auto;
  }
  .nuv-hero > .elementor-container,
  html.nuv-anim .nuv-hero > .elementor-container {
    position: static;
    min-height: auto;
    flex-direction: column;
    padding: calc(var(--nuv-header) + 48px) 20px 64px;
    gap: 36px;
  }
  .nuv-bp {
    position: absolute;
    inset: 0;
    height: 100%;
    margin-bottom: 0;
  }
  .nuv-bp__art {
    width: 78vw;
    right: -6vw;
    opacity: calc(0.5 - 0.4 * var(--bp));
  }
  .nuv-hero .nuv-hero-card {
    margin-inline: auto !important;
    max-width: 520px;
    width: 100%;
  }
  .nuv-scrollhint { display: none; }
}

/* ------------------------------------------------------------------ *
 * 2. Page-wide motion
 * ------------------------------------------------------------------ */

.nuv-reveal {
  opacity: 0;
  transform: translate3d(0, 34px, 0);
  transition: opacity 0.75s var(--nuv-ease), transform 0.75s var(--nuv-ease);
  transition-delay: var(--nuv-delay, 0ms);
}

.nuv-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Headings get a drawn rule underneath as they arrive. */
.nuv-underline {
  position: relative;
}

.nuv-underline::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  translate: -50% 0;
  width: 96px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--nuv-amber), rgba(242, 163, 60, 0));
  transform-origin: left center;
  scale: 0 1;
  transition: scale 0.8s var(--nuv-ease) 0.15s;
}

.nuv-underline.is-in::after {
  scale: 1 1;
}

/* Cards lift, images breathe. */
.nuv-card {
  transition: transform 0.45s var(--nuv-ease), box-shadow 0.45s var(--nuv-ease);
  will-change: transform;
}

.nuv-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 26px 54px rgba(4, 18, 31, 0.22);
}

.nuv-card .elementor-widget-image img,
.nuv-zoom img {
  transition: transform 0.7s var(--nuv-ease), filter 0.7s var(--nuv-ease);
}

.nuv-card:hover .elementor-widget-image img,
.nuv-zoom:hover img {
  transform: scale(1.055);
}

/* Gentle parallax on alternating feature rows. */
.nuv-parallax {
  transform: translate3d(0, var(--nuv-shift, 0px), 0);
  will-change: transform;
}

/* ------------------------------------------------------------------ *
 * 3. Visual refresh — type, rhythm, cards
 * ------------------------------------------------------------------ */

body.home .elementor-widget-heading .elementor-heading-title {
  letter-spacing: -0.01em;
}

body.home h2.elementor-heading-title {
  line-height: 1.15;
}

/* Service / feature cards inherit a consistent surface. */
body.home .nuv-card {
  border-radius: 18px;
  overflow: hidden;
}

/* Focus visibility for keyboard users, which the theme drops. */
body.home a:focus-visible,
body.home button:focus-visible,
body.home .elementor-button:focus-visible,
body.home input:focus-visible,
body.home select:focus-visible,
body.home textarea:focus-visible {
  outline: 3px solid var(--nuv-amber);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ------------------------------------------------------------------ *
 * 4. Reduced motion — everything resolves to its finished state
 * ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .nuv-hero,
  html.nuv-anim .nuv-hero {
    --bp: 1;
    min-height: auto;
  }
  .nuv-hero > .elementor-container,
  html.nuv-anim .nuv-hero > .elementor-container {
    position: static;
    min-height: auto;
    padding-block: calc(var(--nuv-header) + 56px) 72px;
  }
  .nuv-bp,
  .nuv-scrollhint {
    display: none;
  }
  .nuv-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .nuv-underline::after {
    scale: 1 1;
    transition: none;
  }
  .nuv-parallax {
    transform: none;
  }
  .nuv-card,
  .nuv-card .elementor-widget-image img,
  .nuv-zoom img {
    transition: none;
  }
}
