/*
 * Unified hero system for ntg.bg.
 *
 * The selectors deliberately cover the three existing runtime shapes:
 *   - .ntg-hero            shared inner-page component
 *   - #hero                database-managed homepage hero
 *   - .hero-bg             legacy legal/static page hero
 * Service detail pages keep their own semantic markup and receive the same
 * visual language through .service-hero-card below.
 */

:root {
  --ntg-hero-ink: #f8fbff;
  --ntg-hero-muted: rgba(226, 236, 248, 0.82);
  --ntg-hero-surface: #071426;
  --ntg-hero-surface-2: #0c2544;
  --ntg-hero-accent: #4f8cff;
  --ntg-hero-accent-2: #36c4d8;
  --ntg-hero-radius: 28px;
}

.ntg-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 260px;
  padding: clamp(2.75rem, 4vw, 3.75rem) 0;
  color: var(--ntg-hero-ink);
  background:
    radial-gradient(circle at 82% 18%, rgba(79, 140, 255, 0.28), transparent 31%),
    radial-gradient(circle at 64% 110%, rgba(54, 196, 216, 0.18), transparent 42%),
    linear-gradient(135deg, var(--ntg-hero-surface), var(--ntg-hero-surface-2));
}

.ntg-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, transparent, #000 48%, #000);
}

.ntg-hero::after {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: max(4vw, calc((100vw - 1320px) / 2));
  width: clamp(180px, 24vw, 360px);
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(167, 203, 255, 0.24);
  border-radius: 50%;
  box-shadow:
    0 0 0 36px rgba(79, 140, 255, 0.055),
    0 0 0 88px rgba(54, 196, 216, 0.035),
    inset 0 0 70px rgba(79, 140, 255, 0.14);
  transform: translateY(-50%);
}

.ntg-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.34fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.ntg-hero__copy {
  max-width: 850px;
}

.ntg-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: #a9ccff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ntg-hero__eyebrow::before {
  width: 30px;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ntg-hero-accent), var(--ntg-hero-accent-2));
}

.ntg-hero__title {
  max-width: 20ch;
  margin: 0;
  color: #fff;
  font-size: clamp(2.1rem, 3.6vw, 3.4rem);
  font-weight: 750;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.ntg-hero__description {
  max-width: 70ch;
  margin: 1.25rem 0 0;
  color: var(--ntg-hero-muted);
  font-size: clamp(1rem, 1.45vw, 1.2rem);
  line-height: 1.65;
  text-wrap: pretty;
}

.ntg-hero__visual {
  position: relative;
  min-height: 170px;
}

.ntg-hero__visual::before,
.ntg-hero__visual::after {
  position: absolute;
  content: "";
  border-radius: 999px;
}

.ntg-hero__visual::before {
  inset: 12% 8% 18% 16%;
  border: 1px solid rgba(170, 211, 255, 0.33);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14), 0 24px 70px rgba(0, 0, 0, 0.22);
  transform: rotate(-12deg);
}

.ntg-hero__visual::after {
  width: 68px;
  height: 68px;
  right: 14%;
  bottom: 5%;
  background: linear-gradient(145deg, var(--ntg-hero-accent), var(--ntg-hero-accent-2));
  box-shadow: 0 18px 42px rgba(54, 196, 216, 0.25);
}

/* Homepage: retain the existing LCP image and content, replace the dated
 * centred overlay treatment with a readable editorial composition. */
section#hero {
  position: relative;
  isolation: isolate;
  height: clamp(500px, 62vh, 640px) !important;
  min-height: 500px !important;
  background: var(--ntg-hero-surface);
}

section#hero > img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  filter: saturate(1.12) contrast(1.06);
  transform: scale(1.015);
}

section#hero > .position-absolute.top-0 {
  z-index: 1;
  opacity: 1 !important;
  background:
    linear-gradient(90deg, rgba(3, 13, 27, 0.97) 0%, rgba(3, 13, 27, 0.88) 35%, rgba(3, 13, 27, 0.34) 73%, rgba(3, 13, 27, 0.18) 100%),
    linear-gradient(0deg, rgba(3, 13, 27, 0.55), transparent 52%) !important;
}

section#hero > .position-absolute.translate-middle {
  z-index: 2;
  top: 50% !important;
  left: max(24px, calc((100% - 1320px) / 2 + 24px)) !important;
  width: min(760px, calc(100% - 48px));
  max-width: 760px !important;
  padding: 0 !important;
  text-align: left !important;
  transform: translateY(-50%) !important;
}

section#hero #hero-title {
  max-width: 16ch;
  margin-bottom: 1.15rem !important;
  color: #fff;
  font-size: clamp(2.5rem, 4vw, 3.75rem) !important;
  font-weight: 760 !important;
  line-height: 1.02 !important;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

section#hero #hero-desc {
  display: block !important;
  max-width: 62ch;
  margin-bottom: 1.6rem !important;
  color: rgba(235, 243, 252, 0.84) !important;
  font-size: clamp(1rem, 1.45vw, 1.2rem) !important;
  line-height: 1.6;
}

section#hero .d-flex {
  justify-content: flex-start !important;
}

section#hero .btn {
  min-height: 48px;
  padding: 0.7rem 1.15rem;
  border-radius: 12px;
}

section#hero ul.list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.35rem;
  margin-top: 1.25rem !important;
  color: rgba(226, 236, 248, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

section#hero ul.list-inline li {
  margin: 0 !important;
}

section#hero ul.list-inline strong {
  color: #fff;
}

/* Legal/static pages that still use the small .hero-bg hook. */
body .hero-bg {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(3rem, 6vw, 5rem) 0 !important;
  background:
    radial-gradient(circle at 82% 30%, rgba(79, 140, 255, 0.25), transparent 28%),
    linear-gradient(135deg, var(--ntg-hero-surface), var(--ntg-hero-surface-2)) !important;
}

body .hero-bg::after {
  position: absolute;
  z-index: -1;
  top: -90px;
  right: 7vw;
  width: 260px;
  height: 260px;
  content: "";
  border: 1px solid rgba(167, 203, 255, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(79, 140, 255, 0.045);
}

body .hero-bg .container {
  text-align: left !important;
}

body .hero-bg h1 {
  max-width: 22ch;
  margin-bottom: 0.85rem;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 750 !important;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

body .hero-bg .lead {
  margin: 0;
  color: var(--ntg-hero-muted);
  font-size: 1rem;
}

/* Bring the service-product hero into the same visual family without changing
 * calculator, pricing or add-to-cart behaviour. */
.ntg-service-page .service-hero-card {
  border-color: rgba(47, 91, 148, 0.15) !important;
  border-radius: var(--ntg-hero-radius) !important;
  background: linear-gradient(145deg, #fff 0%, #f8fbff 100%) !important;
  box-shadow: 0 22px 70px rgba(15, 42, 75, 0.11) !important;
}

.ntg-service-page .service-hero-media {
  border-radius: 20px !important;
  background: linear-gradient(145deg, #edf5ff, #e9f8fb) !important;
}

.ntg-service-page .service-title {
  max-width: 22ch;
  color: #10243e !important;
  font-weight: 750;
  line-height: 1.12 !important;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.ntg-service-page .service-kicker {
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: #eef5ff !important;
}

@media (max-width: 991.98px) {
  .ntg-hero {
    min-height: 0;
    padding: 2.75rem 0;
  }

  .ntg-hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 0.25fr);
    gap: 1.5rem;
  }

  .ntg-service-page .service-hero-card > .row > .col-lg-7 {
    order: -1;
  }
}

@media (max-width: 767.98px) {
  .ntg-hero {
    padding: 2.5rem 0 2.75rem;
  }

  .ntg-hero::after {
    top: auto;
    right: -70px;
    bottom: -105px;
    width: 220px;
    transform: none;
  }

  .ntg-hero__inner {
    display: block;
  }

  .ntg-hero__visual {
    display: none;
  }

  .ntg-hero__title {
    max-width: 18ch;
    font-size: clamp(2rem, 9vw, 2.55rem);
    line-height: 1.08;
  }

  .ntg-hero__description {
    margin-top: 1rem;
    font-size: 1rem;
    line-height: 1.55;
  }

  section#hero {
    height: 510px !important;
    min-height: 510px !important;
    overflow: hidden !important;
  }

  section#hero > img {
    height: 100% !important;
    object-position: 68% center !important;
  }

  section#hero > .position-absolute.top-0 {
    background:
      linear-gradient(90deg, rgba(3, 13, 27, 0.94), rgba(3, 13, 27, 0.62)),
      linear-gradient(0deg, rgba(3, 13, 27, 0.78), transparent 72%) !important;
  }

  section#hero > .position-absolute.translate-middle {
    top: 48% !important;
    left: 20px !important;
    width: calc(100% - 40px) !important;
    max-width: none !important;
    transform: translateY(-50%) !important;
  }

  section#hero #hero-title {
    max-width: 18ch;
    font-size: clamp(2rem, 9vw, 2.75rem) !important;
    line-height: 1.05 !important;
  }

  section#hero #hero-desc {
    max-width: 35ch;
    font-size: 1rem !important;
    line-height: 1.5;
  }

  section#hero .d-flex {
    align-items: stretch;
    gap: 0.65rem !important;
  }

  section#hero .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    padding: 0.72rem 0.75rem;
    font-size: clamp(0.92rem, 4.4vw, 1.05rem);
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  section#hero ul.list-inline {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem !important;
    margin-top: 1rem !important;
    font-size: 0.61rem;
    line-height: 1.35;
  }

  section#hero ul.list-inline li {
    display: block !important;
    margin: 0 !important;
  }

  section#hero ul.list-inline strong {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.78rem;
  }

  body .hero-bg {
    padding: 2.75rem 0 3rem !important;
  }

  body .hero-bg h1 {
    font-size: clamp(2rem, 9vw, 2.65rem);
  }

  .ntg-service-page .service-hero-card {
    border-radius: 20px !important;
  }

  .ntg-service-page .service-hero-card > .row > .col-lg-7 {
    order: -1;
  }

  .ntg-service-page .service-title {
    font-size: clamp(2rem, 8vw, 2.6rem) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  section#hero > img {
    transform: none;
  }
}
