/*
 * Lightflow v0.4.1 — directed hero refinement.
 * v0.4 remains the immutable rollback baseline; this layer only adjusts the
 * approved hero system and defines one reusable visual template for services.
 */

.hero-template {
  --hero-curve-bottom: -156px;
  --hero-photo-scale: 1.15;
  --hero-photo-scale-x: 1.05;
  --home-frame-expand-bottom: 78px;
  --home-curve-source-height: 310px;
  --home-curve-crop-height: 211px;
  --hero-triangle-scale: 1.35;
  --hero-triangle-opacity: .13;
}

/* Home: keep the compact layout while locking frame geometry separately from photo transforms. */
.hero-template-home {
  --hero-curve-bottom: -138px;
  --home-shard-bottom: 37px;
  min-height: 860px;
  padding-top: 38px;
}

.hero-template-home .hero-shell {
  min-height: 640px;
  grid-template-columns: minmax(0, .92fr) minmax(540px, 1.08fr);
}

.hero-template-home .hero-copy {
  padding-bottom: 104px;
}

.hero-template-home h1 .hero-headline-line {
  display: block;
  width: max-content;
  max-width: 100%;
}

.hero-template-home h1 .hero-headline-primary,
.hero-template-home h1 .hero-headline-underlined {
  color: var(--navy);
}

.hero-template-home h1 .hero-headline-accent {
  color: var(--blue);
}

.hero-template-home h1 .hero-headline-underlined {
  position: relative;
}

.hero-template-home h1 .hero-headline-underlined::after {
  position: absolute;
  right: 0;
  bottom: -.07em;
  left: 0;
  height: .12em;
  content: "";
  background: var(--yellow);
  border-radius: 99px 12px 99px 12px;
  transform: rotate(-1deg) scaleX(.96);
  transform-origin: left;
  opacity: .92;
}

.hero-template-home .hero-actions {
  margin-bottom: 0;
}

.hero-template-home .hero-visual {
  z-index: 2;
  min-height: 620px;
  isolation: isolate;
  transform: translateY(-22px);
}

.hero-template-home .hero-visual-backdrop {
  z-index: 0;
  inset: 34px -150px calc(22px - var(--home-frame-expand-bottom)) 5px;
  border-radius: 0;
  clip-path: ellipse(72% 64% at 66% 48%);
  transform: none;
}

.hero-template-home .hero-photo-frame-trio {
  z-index: 2;
  inset: -12px -150px calc(-12px - var(--home-frame-expand-bottom)) 0;
  overflow: hidden;
}

.hero-template-home .hero-photo-frame-trio img,
.hero-template-home .hero-photo-frame-trio:hover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - var(--home-frame-expand-bottom));
  object-fit: contain;
  object-position: center top;
  transform: translate(4%, 20px) scale(var(--hero-photo-scale)) scaleX(var(--hero-photo-scale-x));
  transform-origin: center top;
}

.hero-template-home .hero-photo-frame-trio:hover img {
  transform: translate(4%, 20px) scale(var(--hero-photo-scale)) scaleX(var(--hero-photo-scale-x));
}

.hero-template-home .hero-blue-sweep {
  z-index: 4;
  right: -178px;
  bottom: var(--hero-curve-bottom);
  width: 830px;
  height: var(--home-curve-crop-height);
  overflow: hidden;
  background: none;
  border-radius: 0;
  clip-path: none;
}

.hero-template-home .hero-blue-sweep::before,
.hero-template-service .inalite-blue-curve::before {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  content: "";
  background:
    url("assets/signature/triangles.svg") 90% 35% / 430px auto no-repeat,
    url("assets/signature/wave.svg") 54% 52% / 590px auto no-repeat;
  opacity: .14;
  pointer-events: none;
}

.hero-template-home .hero-blue-sweep::before,
.hero-template-home .hero-blue-sweep::after {
  height: var(--home-curve-source-height);
  border-radius: 75% 0 0 0 / 100% 0 0 0;
  clip-path: none;
}

.hero-template-home .hero-blue-sweep::after,
.hero-template-service .inalite-blue-curve::after {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  content: "";
  pointer-events: none;
}

.hero-template-home .hero-blue-sweep::after {
  height: var(--home-curve-source-height);
  background: linear-gradient(125deg, var(--blue) 0%, #1263bb 58%, var(--navy-2) 100%);
}

.hero-template-home .shard-hero {
  z-index: 6;
  right: max(52px, calc(50% - 115px));
  bottom: var(--home-shard-bottom);
}

/* This field sits inside the visual stack: backdrop < triangle < photo < curve. */
.hero-template-home .hero-triangle-field-focus {
  z-index: 1;
  top: auto;
  right: -15px;
  bottom: 92px;
  left: auto;
  width: 620px;
  height: 430px;
  background: url("assets/signature/triangles.svg") center / 1180px auto no-repeat;
  opacity: var(--hero-triangle-opacity);
  transform: rotate(2deg) scale(var(--hero-triangle-scale));
  transform-origin: center;
}

.hero-template-home > .hero-triangle-field-left {
  z-index: 0;
  opacity: .11;
}

.hero-template-home > .signal-rail {
  z-index: 7;
  margin: -32px auto 0;
}

/* Shared service-hero stack derived from the approved home composition. */
.hero-template-service {
  --service-photo-scale: 1.3;
  --service-photo-scale-hover: 1.3;
  --service-photo-shift-x: 50px;
  --service-photo-shift-y: -40px;
  --service-frame-base-top: 4px;
  --service-frame-base-right: -58px;
  --service-frame-base-bottom: 42px;
  --service-frame-base-left: 2px;
  --service-frame-expand-top: 80px;
  --service-frame-expand-right: 110px;
  --service-frame-expand-bottom: 90px;
  --service-curve-source-height: 300px;
  --service-curve-crop-height: 220px;
  --service-curve-lift: 60px;
  --service-curve-thickness-add: 0px;
  --service-shard-lift: 30px;
  min-height: 810px;
  padding: 38px 0 0;
  background:
    radial-gradient(circle at 82% 22%, rgba(93, 216, 255, .34), transparent 28%),
    radial-gradient(circle at 8% 75%, rgba(255, 196, 0, .08), transparent 21%),
    linear-gradient(145deg, #fff 0%, #f6fbff 44%, #eaf6ff 100%);
}

.hero-template-service .inalite-hero-shell {
  min-height: 650px;
  grid-template-columns: minmax(0, .92fr) minmax(540px, 1.08fr);
  gap: 24px;
}

.hero-template-service .inalite-copy {
  position: relative;
  z-index: 5;
  padding-bottom: 42px;
}

.hero-template-service .inalite-visual {
  z-index: 2;
  min-height: 620px;
  isolation: isolate;
  transform: translateY(-14px);
}

.hero-template-service .inalite-visual-backdrop {
  z-index: 0;
  inset: 8px -145px 38px -4px;
  background:
    radial-gradient(circle at 45% 27%, rgba(255, 255, 255, .96), transparent 27%),
    linear-gradient(152deg, #eefaff 2%, #cdefff 50%, #8fd8f5 100%);
  clip-path: ellipse(72% 64% at 66% 48%);
}

.hero-template-service .inalite-triangles-right {
  z-index: 1;
  top: auto;
  right: -10px;
  bottom: 88px;
  left: auto;
  width: 610px;
  height: 420px;
  background: url("assets/signature/triangles.svg") center / 1180px auto no-repeat;
  opacity: var(--hero-triangle-opacity);
  transform: rotate(2deg) scale(var(--hero-triangle-scale));
  transform-origin: center;
}

.hero-template-service .inalite-photo {
  z-index: 2;
  inset:
    calc(var(--service-frame-base-top) - var(--service-frame-expand-top))
    calc(var(--service-frame-base-right) - var(--service-frame-expand-right))
    calc(var(--service-frame-base-bottom) - var(--service-frame-expand-bottom))
    var(--service-frame-base-left);
  border-radius: 46% 18% 46% 12% / 31% 22% 39% 18%;
  clip-path: polygon(7% 2%, 96% 0, 100% 83%, 88% 100%, 4% 96%, 0 17%);
}

.hero-template-service .inalite-photo img {
  position: absolute;
  top: var(--service-frame-expand-top);
  left: 0;
  width: calc(100% - var(--service-frame-expand-right));
  height: calc(100% - var(--service-frame-expand-top) - var(--service-frame-expand-bottom));
  object-position: var(--service-photo-x, 50%) var(--service-photo-y, 50%);
  transform: translate(var(--service-photo-shift-x), var(--service-photo-shift-y)) scale(var(--service-photo-scale));
  transform-origin: center;
  transition: transform .45s ease;
}

/* A quiet DNA trace sits over the photo, while curve and shard stay above it. */
.hero-template-service .inalite-photo::after {
  position: absolute;
  z-index: 3;
  top: calc(var(--service-frame-expand-top) + 22px);
  left: 18px;
  width: min(62%, 480px);
  height: 210px;
  content: "";
  background: url("assets/signature/wave.svg") left top / 520px auto no-repeat;
  opacity: .3;
  pointer-events: none;
}

.hero-template-service .inalite-photo:hover img {
  transform: translate(var(--service-photo-shift-x), var(--service-photo-shift-y)) scale(var(--service-photo-scale-hover));
}

.hero-template-service .inalite-blue-curve {
  z-index: 4;
  right: -155px;
  bottom: calc(var(--hero-curve-bottom) + var(--service-curve-lift));
  width: 790px;
  height: calc(var(--service-curve-crop-height) + var(--service-curve-thickness-add));
  overflow: hidden;
  background: none;
  clip-path: none;
}

.hero-template-service .inalite-blue-curve::before,
.hero-template-service .inalite-blue-curve::after {
  height: var(--service-curve-source-height);
  clip-path: ellipse(72% 70% at 72% 100%);
}

.hero-template-service .inalite-blue-curve::after {
  background: linear-gradient(128deg, #0877ca, #173b7a);
}

.hero-template-service .inalite-blue-curve strong,
.hero-template-service .inalite-blue-curve span {
  right: 176px;
}

.hero-template-service .inalite-blue-curve strong {
  bottom: 126px;
}

.hero-template-service .inalite-blue-curve span {
  bottom: 99px;
}

.hero-template-service .inalite-shard {
  z-index: 6;
  right: max(44px, calc(50% - 125px));
  bottom: calc(var(--service-curve-crop-height) + var(--service-curve-thickness-add) + var(--hero-curve-bottom) + var(--service-shard-lift) - 31px);
}

.hero-template-service > .inalite-triangles {
  top: -112px;
  left: -160px;
  width: 650px;
  height: 610px;
  background-size: 1280px auto;
  opacity: .11;
}

.hero-template-service > .inalite-wave {
  top: -118px;
  left: 25%;
  width: 880px;
  height: 460px;
  opacity: .42;
}

/* Per-asset focal controls: frame stays templated; content can be tuned safely. */
.detail-inalite {
  --service-photo-x: 54%;
  --service-photo-y: 9%;
}

.detail-inara {
  --service-photo-x: 58%;
  --service-photo-y: 50%;
}

.detail-inara .hero-template-service {
  --service-curve-thickness-add: 10px;
}

.detail-inalink {
  --service-photo-x: 58%;
  --service-photo-y: 50%;
}

.detail-managed {
  --service-photo-x: 54%;
  --service-photo-y: 0%;
}

.detail-managed .hero-template-service {
  --service-photo-shift-y: -5px;
}

.detail-managed .hero-template-service .inalite-photo {
  overflow: hidden;
  background: transparent;
  border-radius: 0;
  clip-path: none;
  box-shadow: none;
}

.detail-managed .hero-template-service .inalite-photo img {
  object-fit: contain;
}

.detail-iot {
  --service-photo-x: 78%;
  --service-photo-y: 50%;
}

.footer-bottom > span:empty {
  display: none;
}

@media (max-width: 1180px) {
  .hero-template-home .hero-shell,
  .hero-template-service .inalite-hero-shell {
    grid-template-columns: minmax(0, 1fr) minmax(480px, .98fr);
  }
}

@media (max-width: 900px) {
  .hero-template-home,
  .hero-template-service {
    min-height: auto;
  }

  .hero-template-service {
    --service-frame-base-top: 8px;
    --service-frame-base-right: 2%;
    --service-frame-base-bottom: 42px;
    --service-frame-base-left: 4%;
    --service-frame-expand-top: 72px;
    --service-frame-expand-right: 96px;
    --service-frame-expand-bottom: 82px;
    padding-bottom: 144px;
  }

  .hero-template-home .hero-shell,
  .hero-template-service .inalite-hero-shell {
    grid-template-columns: 1fr;
  }

  .hero-template-home .hero-copy {
    padding-bottom: 18px;
  }

  .hero-template-home .hero-visual,
  .hero-template-service .inalite-visual {
    width: min(690px, 100%);
    min-height: 630px;
    margin-inline: auto;
    transform: none;
  }

  .hero-template-home .hero-photo-frame-trio {
    inset: -8px -80px calc(-18px - var(--home-frame-expand-bottom)) 4%;
  }

  .hero-template-home .hero-photo-frame-trio img,
  .hero-template-home .hero-photo-frame-trio:hover img {
    transform: translate(2%, 20px) scale(var(--hero-photo-scale)) scaleX(var(--hero-photo-scale-x));
  }

  .hero-template-home .hero-triangle-field-focus,
  .hero-template-service .inalite-triangles-right {
    opacity: .11;
  }

  .hero-template-home > .signal-rail {
    margin-top: -28px;
  }

  .hero-template-service .inalite-copy {
    max-width: 720px;
    padding: 20px 0 10px;
  }

  .hero-template-service .inalite-blue-curve {
    right: -125px;
  }

  .hero-template-service .inalite-shard {
    right: max(44px, calc(50% - 96px));
  }
}

@media (max-width: 620px) {
  .hero-template-home {
    --home-frame-expand-bottom: 64px;
    --home-curve-source-height: 260px;
    --home-curve-crop-height: 175px;
    --hero-curve-bottom: -106px;
    --home-shard-bottom: 33px;
    padding-top: 26px;
  }

  .hero-template-home .hero-visual,
  .hero-template-service .inalite-visual {
    min-height: 520px;
  }

  .hero-template-home .hero-photo-frame-trio {
    inset: 0 -35px calc(-12px - var(--home-frame-expand-bottom)) 0;
  }

  .hero-template-home .hero-photo-frame-trio img,
  .hero-template-home .hero-photo-frame-trio:hover img {
    transform: translate(1%, 20px) scale(var(--hero-photo-scale)) scaleX(var(--hero-photo-scale-x));
  }

  .hero-template-home .hero-visual-backdrop {
    inset: 30px -100px calc(15px - var(--home-frame-expand-bottom)) -40px;
  }

  .hero-template-home .hero-blue-sweep {
    right: -210px;
    width: 720px;
  }

  .hero-template-home .hero-triangle-field-focus {
    right: -155px;
    bottom: 82px;
    width: 520px;
    height: 360px;
  }

  .hero-template-home > .signal-rail {
    margin-top: -18px;
  }

  .hero-template-service {
    --service-frame-base-top: 12px;
    --service-frame-base-right: -3%;
    --service-frame-base-bottom: 38px;
    --service-frame-base-left: 0px;
    --service-frame-expand-top: 52px;
    --service-frame-expand-right: 72px;
    --service-frame-expand-bottom: 70px;
    --service-curve-source-height: 250px;
    --service-curve-crop-height: 183px;
    --hero-curve-bottom: -142px;
    padding-top: 24px;
    padding-bottom: 150px;
  }

  .hero-template-service .inalite-copy {
    padding-inline: 2px;
  }

  .hero-template-service .inalite-blue-curve {
    right: -220px;
    width: 700px;
  }

  .hero-template-service .inalite-blue-curve strong,
  .hero-template-service .inalite-blue-curve span {
    right: 236px;
  }

  .hero-template-service .inalite-blue-curve strong {
    bottom: 102px;
    font-size: 18px;
  }

  .hero-template-service .inalite-blue-curve span {
    bottom: 78px;
  }

  .hero-template-service .inalite-shard {
    right: max(40px, calc(50% - 100px));
  }

  .hero-template-service .inalite-triangles-right {
    right: -165px;
    bottom: 75px;
    width: 520px;
    height: 350px;
    opacity: .1;
  }

  .hero-template-service > .inalite-triangles {
    left: -330px;
  }
}
