/* components/_curtain_hero.css */

/* Hard scope: nothing leaks outside this component */
[data-component="curtain-hero"] {
  position: relative;
  overflow: hidden;
}

/* If you want spacing controlled by the plugin, keep it class-based */
[data-component="curtain-hero"] .curtainhero__padding {
  padding-left: 1rem;
  padding-right: 1rem;
}

[data-component="curtain-hero"] .curtainhero__container {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

[data-component="curtain-hero"] .curtainhero__layout {
  display: grid;
  gap: 1.5rem;
  align-items: end;
  padding-top: 5rem;
  padding-bottom: 3rem;
}

@media (min-width: 992px) {
  [data-component="curtain-hero"] .curtainhero__layout {
    grid-template-columns: 1fr auto;
    padding-top: 7rem;
    padding-bottom: 4rem;
  }
}

[data-component="curtain-hero"] .curtainhero__textcol {
  display: grid;
  gap: 1rem;
}

[data-component="curtain-hero"] .curtainhero__mark img,
[data-component="curtain-hero"] .curtainhero__mark svg {
  display: block;
  max-width: 100%;
  height: auto;
}

[data-component="curtain-hero"] .curtainhero__title {
  margin: 0 0 0.75rem 0;
}

[data-component="curtain-hero"] .curtainhero__lead {
  margin: 0;
  opacity: 0.9;
  max-width: 52rem;
}

/* Scroll row */
[data-component="curtain-hero"] .curtainhero__scrolllink {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

[data-component="curtain-hero"] .curtainhero__scrollrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hero image */
[data-component="curtain-hero"] .curtainhero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Curtain overlay (scoped version of your .header-gradient rule) */
[data-component="curtain-hero"] .curtainhero__curtain {
  position: fixed;
  inset: 0;
  z-index: 98; /* ensure it's above everything */
  pointer-events: none;

  /* starts fully covering */
  transform: scaleY(1);
  transform-origin: top; /* top pinned, bottom moves up */
  will-change: transform;
}

/* Optional variants you had (scoped) */
[data-component="curtain-hero"][data-variant="detail"] .curtainhero__curtain {
  width: 80%;
  background-image: linear-gradient(to right, var(--grey800) 45%, #38313600);
}

.curtainhero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
.curtainhero__inner,
.curtainhero__container {
  min-height: 100vh;
}

/* THE CURTAIN */
.curtainhero__curtain {
  position: fixed;
  inset: 0;
  pointer-events: none;

  /* start fully covering */
  transform: scaleY(1);

  /* THIS is the trick:
       top edge stays pinned, bottom edge moves up */
  transform-origin: top;
  will-change: transform;
}

/* when opening: curtain height collapses upward (reveals from bottom up) */
.curtainhero__curtain.is-open {
  transform: scaleY(0);
  transition: transform 900ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .curtainhero__curtain.is-open {
    transition: none;
  }
}

/* Make the hero media fill the section */
.curtainhero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.curtainhero__hero {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Content stays above image */
.curtainhero__inner,
.curtainhero__gradient {
  position: relative;
}

/* Optional: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .curtainhero__curtain.is-open {
    transition: none;
  }
}

._2-col.is-head {
  place-items: end stretch;
}
@media screen and (min-width: 1920px) {
  ._2-col {
    grid-template-columns: 0.75fr 1fr;
  }
}
._2-col {
  grid-column-gap: 5rem;
  grid-row-gap: 5rem;
  grid-template-rows: auto;
  grid-template-columns: 1fr 1fr;
  grid-auto-columns: 1fr;
  display: grid;
}

.header-wrapper-new {
  flex-flow: column;
  justify-content: space-between;
  height: 95vh;
  padding-top: 20vh;
  padding-bottom: 1.5rem;
  display: flex;
  overflow: visible;
}
@media screen and (min-width: 1920px) {
  .header-wrapper-new {
    height: 90vh;
    padding-top: 15vh;
  }
}
.curtainhero_hero {
  background-image: none;
  background-size: auto;
  width: 100%;
  height: 100%;
  display: inline-block;
  position: absolute;
  inset: 0% 0% 0% auto;
}
.header-text.image-select {
  z-index: 99;
  object-fit: fill;
  object-position: 0% 50%;
  width: 25vw;
  display: block;
  position: relative;
}
.curtainhero__headline {
  letter-spacing: -2px;
  margin-top: 0;
  margin-bottom: 0;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  z-index: 1;
  position: relative;
}

.curtainhero__intro {
  font-size: 18px;
  z-index: 1;
  position: relative;
}

/* --- SVG reveal --- */
[data-component="curtain-hero"] .curtainhero__header-svg svg {
  display: block;
  max-width: 100%;
  height: auto;
}

[data-component="curtain-hero"] .curtainhero__header-svg [data-reveal-path] {
  transform: translateY(var(--jump-from, 18px));
  opacity: 0;
  will-change: transform, opacity;
}

[data-component="curtain-hero"] .curtainhero__header-svg.is-revealing [data-reveal-path] {
  opacity: 1;
  transform: translateY(0);
  transition: transform 520ms cubic-bezier(0.2, 1.2, 0.2, 1), opacity 280ms ease;
  transition-delay: var(--delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  [data-component="curtain-hero"] .curtainhero__curtain.is-open {
    transition: none;
  }
  [data-component="curtain-hero"] .curtainhero__header-svg [data-reveal-path] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

[data-component="curtain-hero"] [data-header-svg] {
  visibility: hidden; /* hidden but keeps layout */
}

/* When JS is ready, it will add this */
[data-component="curtain-hero"] [data-header-svg].is-ready {
  visibility: visible;
}

/* Your reveal animation (jump-up) */
[data-component="curtain-hero"] [data-header-svg] [data-reveal-path] {
  transform: translateY(var(--jump-from, 18px));
  opacity: 0;
  animation: curtainhero-path-pop 520ms ease forwards;
  animation-delay: var(--delay, 0ms);
  will-change: transform, opacity;
}

/* Animation runs only after .is-revealing is applied */
[data-component="curtain-hero"] [data-header-svg]:not(.is-revealing) [data-reveal-path] {
  animation: none;
}

@keyframes curtainhero-path-pop {
  0% {
    transform: translateY(var(--jump-from, 18px));
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
.curtainhero__scroll {
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
}

.lottie-flex {
  display: flex;
  gap: 20px;
  align-items: center;
}
.curtainhero__header-mark svg {
  width: 100% !important;
  height: auto !important;
}

@media screen and (max-width: 1200px) {
  [data-component="curtain-hero"] .curtainhero__container {
    max-width: calc(100% - 100px);
  }
  .header-text.image-select {
    width: 100% !important;
  }
}

@media screen and (max-width: 1000px) {
  .curtainhero,
  .header-wrapper-new,
  .curtainhero__inner,
  .curtainhero__container {
    min-height: unset !important;
    height: 100vh;
    max-height: 900px;
  }
}

@media screen and (max-width: 768px) {
  [data-component="curtain-hero"] .curtainhero__container {
    max-width: calc(100% - 40px);
  }
  .curtainhero__headline {
    letter-spacing: -1px;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.7rem;
    font-weight: 700;
  }
  .curtainhero__intro {
    font-size: 16px;
  }
}

@media screen and (max-width: 500px) {
  .curtainhero__cols {
    display: flex;
    flex-direction: column;
  }

  .curtainhero,
  .header-wrapper-new,
  .curtainhero__inner,
  .curtainhero__container {
    min-height: unset !important;
    height: fit-content !important;
    max-height: unset !important;
  }
  .curtainhero__scroll {
    margin-top: 60px;
  }
}
