/**
 * Homepage-only hero layout (case-study style: centered stack, minimal header).
 * Scoped with .page-home on body.
 */

/* ——— Minimal header over hero ——— */
.page-home .header_top {
  display: none;
}

.page-home .header_section {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent !important;
  border: none;
  box-shadow: none;
}

.page-home .header_section .header_bottom {
  padding: 1.1rem 0;
  border: none;
}

.page-home .header_section .container-fluid {
  padding-left: clamp(1rem, 4vw, 2.5rem);
  padding-right: clamp(1rem, 4vw, 2.5rem);
}

/* Logo + wordmark over hero */
.page-home .km-hero-nav-brand {
  gap: 0.65rem;
  max-width: calc(100% - 11.5rem);
  min-width: 0;
}

.page-home .km-hero-nav-logo {
  height: clamp(36px, 7.5vw, 48px);
  width: auto;
  max-width: 52px;
  object-fit: contain;
  flex-shrink: 0;
  /* Monochrome white mark on dark hero (PNG with transparency works best) */
  filter: brightness(0) invert(1) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55));
}

/* Solid white wordmark (no gradient clip) */
.page-home .navbar-brand,
.page-home .navbar-brand:hover {
  color: #fff !important;
}

.page-home .navbar-brand span {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

.page-home .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.45);
  padding: 0.35rem 0.5rem;
}

/* MENU + icon in one row — override global .custom_nav-container .navbar-toggler span (block bars + pseudo-lines) */
.page-home .km-nav-menu-trigger.navbar-toggler {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.65rem;
  width: auto !important;
  height: auto !important;
  padding: 0.55rem 0.75rem !important;
}

.page-home .km-nav-menu-trigger .km-nav-menu-label,
.page-home .km-nav-menu-trigger .navbar-toggler-icon {
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  position: relative !important;
  background-color: transparent !important;
}

.page-home .km-nav-menu-trigger .km-nav-menu-label::before,
.page-home .km-nav-menu-trigger .km-nav-menu-label::after,
.page-home .km-nav-menu-trigger .navbar-toggler-icon::before,
.page-home .km-nav-menu-trigger .navbar-toggler-icon::after {
  content: none !important;
  display: none !important;
}

.page-home .km-nav-menu-trigger .km-nav-menu-label {
  font-family: var(--md-font-body), "Outfit", sans-serif;
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff !important;
  line-height: 1;
  text-shadow: 0 0 22px rgba(14, 29, 66, 0.5);
}

.page-home .km-nav-menu-trigger .navbar-toggler-icon {
  flex-shrink: 0;
  width: clamp(1.65rem, 4.5vw, 2.15rem) !important;
  height: clamp(1.35rem, 3.6vw, 1.75rem) !important;
  vertical-align: middle;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba%28255,255,255,0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.25' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}

.page-home .navbar-toggler:not(.km-nav-menu-trigger) span,
.page-home .navbar-toggler:not(.km-nav-menu-trigger) span::before,
.page-home .navbar-toggler:not(.km-nav-menu-trigger) span::after {
  background-color: #fff !important;
}

.page-home .header_section.md-header-scrolled {
  background: var(--km-ceo-bg-header) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(14, 29, 66, 0.35);
}

/* ——— Full-viewport hero ——— */
.page-home .hero_area {
  min-height: 100vh;
}

.page-home .wrapper {
  margin-top: 0;
}

.page-home #carousel {
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.page-home #carousel .carousel-inner {
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
}

.page-home #carousel .carousel-item {
  position: relative;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
}

/* Always cover the viewport — zoom stays “full bleed” with no gaps at edges */
.page-home #carousel .carousel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  transform-origin: center center;
  z-index: 0;
  transform: none;
  transition: none;
  animation: none;
}

/* Hero image with fixed 30% black overlay */
.page-home .carousel-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.6);
}

.page-home .carousel-item.active::before {
  animation: none;
}

/* Zoom in while veil darkens — same timing as veil */
.page-home .carousel-item.active .carousel-img {
  animation: kmHomeZoom 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes kmHomeZoom {
  0% {
    transform: scale(1.06) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1.18) translate3d(-0.75%, -0.35%, 0);
  }
}

/* Global hero gradient off — no extra overlay veil */
.page-home #carousel::after {
  content: none;
  display: none;
}

/* ——— Centered content stack ——— */
.page-home .carousel-caption.km-hero-stack {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: 50%;
  bottom: auto;
  transform: translateY(-42%);
  max-width: min(1180px, 96vw);
  margin-left: auto;
  margin-right: auto;
  padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1rem, 3vw, 2rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  container-type: inline-size;
  container-name: herohead;
}

/* Home hero: two-line brand lockup + generous gap before supporting copy */
.page-home .km-hero-home-headline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.35rem, 1.4vw, 0.75rem);
  margin: 0 0 clamp(2.5rem, 7vw, 4.75rem);
  padding: 0 clamp(0.5rem, 3vw, 1.25rem);
  max-width: min(40rem, 96vw);
  width: 100%;
  text-align: center;
  line-height: 1.08;
}

.page-home .km-hero-home-line1 {
  font-family: var(--md-font-body), "Outfit", sans-serif;
  font-weight: 600;
  font-size: clamp(0.82rem, 2.2vw + 0.45rem, 1.15rem);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.94);
  text-shadow:
    0 1px 2px rgba(14, 29, 66, 0.85),
    0 2px 22px rgba(0, 0, 0, 0.55);
}

.page-home .km-hero-home-line2 {
  font-family: var(--md-font-display), "Syne", sans-serif;
  font-weight: 800;
  font-size: clamp(1.45rem, 4.2vw + 0.85rem, 3.35rem);
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.06;
  color: var(--color-blue-800) !important;
  -webkit-text-fill-color: var(--color-blue-800);
  -webkit-text-stroke: 1px rgba(14, 29, 66, 0.35);
  paint-order: stroke fill;
  text-shadow:
    0 0 36px rgba(14, 29, 66, 0.45),
    0 4px 24px rgba(0, 0, 0, 0.65);
  text-wrap: balance;
  max-width: 22ch;
}

.page-home .km-hero-home-amp {
  color: #e8c45c;
  -webkit-text-fill-color: #e8c45c;
  font-weight: 800;
  margin: 0 0.08em;
}

/* As each slide’s veil deepens, main title transitions dark blue → white */
.page-home .carousel-item.active .km-hero-home-line2 {
  animation: kmHeroHeadlineTint 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes kmHeroHeadlineTint {
  0% {
    color: var(--color-blue-800);
    -webkit-text-fill-color: var(--color-blue-800);
  }
  72% {
    color: var(--color-blue-800);
    -webkit-text-fill-color: var(--color-blue-800);
  }
  72.1% {
    color: #fff;
    -webkit-text-fill-color: #fff;
  }
  100% {
    color: #fff;
    -webkit-text-fill-color: #fff;
  }
}

.page-home .carousel-item.active .km-hero-home-line2 .km-hero-home-amp {
  animation: kmHeroAmpStayGold 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes kmHeroAmpStayGold {
  0%,
  100% {
    color: #e8c45c;
    -webkit-text-fill-color: #e8c45c;
  }
}

@supports (font-size: 1cqi) {
  .page-home .km-hero-home-line1 {
    font-size: clamp(0.72rem, 1.35cqi + 0.42rem, 1.12rem);
  }

  .page-home .km-hero-home-line2 {
    font-size: clamp(1.1rem, 3.85cqi + 0.55rem, 3.2rem);
  }
}

/* Slow crossfade between slides — smooth “flow” */
.page-home #carousel.carousel-fade .carousel-item {
  transition: opacity 3.2s cubic-bezier(0.42, 0, 0.58, 1);
}

.page-home #carousel.carousel-fade .active.carousel-item-left,
.page-home #carousel.carousel-fade .active.carousel-item-right {
  transition: opacity 3.2s cubic-bezier(0.42, 0, 0.58, 1);
}

.page-home .km-hero-sub {
  font-family: var(--md-font-body), "Outfit", sans-serif;
  font-size: clamp(0.95rem, 2.35vw, 1.28rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.72;
  max-width: min(40rem, 92vw);
  margin: 0 0 1.85rem;
  text-shadow:
    0 1px 2px rgba(14, 29, 66, 0.9),
    0 2px 20px rgba(0, 0, 0, 0.75);
}

.page-home .km-hero-sub__lead {
  display: block;
  font-family: var(--md-font-body), "Outfit", sans-serif;
  font-weight: 700;
  font-size: clamp(0.88rem, 2vw, 1.05rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  -webkit-text-fill-color: #fff;
  margin-bottom: clamp(0.65rem, 2vw, 1rem);
  padding-bottom: clamp(0.45rem, 1.5vw, 0.65rem);
  border-bottom: 2px solid rgba(232, 196, 92, 0.65);
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.95),
    0 0 14px rgba(255, 255, 255, 0.55);
}

/* Brand blue pill, white ring (case-study CTA) */
.page-home .km-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.85rem;
  font-family: var(--md-font-body), "Outfit", sans-serif;
  font-weight: 700;
  font-size: clamp(0.68rem, 1.65vw, 0.85rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff !important;
  background: var(--km-ceo-bg) !important;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(14, 29, 66, 0.5),
    0 0 32px rgba(14, 29, 66, 0.75),
    0 0 64px rgba(14, 29, 66, 0.35);
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s ease,
    background 0.25s ease;
}

.page-home .km-hero-cta:hover {
  color: #fff !important;
  text-decoration: none;
  background: var(--color-blue-800) !important;
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(14, 29, 66, 0.7),
    0 0 48px rgba(14, 29, 66, 0.95),
    0 0 96px rgba(14, 29, 66, 0.45);
}

/* Hide legacy hero classes inside KM stack on home */
.page-home .km-hero-stack .md-hero-kicker,
.page-home .km-hero-stack .md-hero-lede,
.page-home .km-hero-stack .outline-text,
.page-home .km-hero-stack .md-cta-pill {
  display: none !important;
}

/* Controls above veil + caption */
.page-home .carousel-indicators {
  bottom: 2.25rem;
  margin-bottom: 0;
  z-index: 4;
}

.page-home .carousel-control-prev,
.page-home .carousel-control-next {
  bottom: 2rem;
  opacity: 0.85;
  z-index: 4;
}

/* Marquee: aligned with hero surface blue */
.page-home .md-marquee {
  background: var(--km-ceo-bg);
  border-color: rgba(255, 255, 255, 0.12);
}

.page-home .md-marquee__track {
  color: #fff;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .page-home #carousel.carousel-fade .carousel-item,
  .page-home #carousel.carousel-fade .active.carousel-item-left,
  .page-home #carousel.carousel-fade .active.carousel-item-right {
    transition: opacity 0.4s ease;
  }

  .page-home .carousel-item.active .carousel-img {
    animation: none;
    transform: scale(1.08);
  }

  .page-home .carousel-item.active::before {
    animation: none;
    opacity: 0.72;
  }

  .page-home .carousel-item.active .km-hero-home-line2,
  .page-home .carousel-item.active .km-hero-home-line2 .km-hero-home-amp {
    animation: none;
    color: #fff;
    -webkit-text-fill-color: #fff;
  }

  .page-home .carousel-item.active .km-hero-home-line2 .km-hero-home-amp {
    color: #e8c45c;
    -webkit-text-fill-color: #e8c45c;
  }
}

@media (max-width: 576px) {
  .page-home .carousel-caption.km-hero-stack {
    transform: translateY(-38%);
    padding-top: 4.5rem;
  }

  .page-home .km-hero-home-line2 {
    -webkit-text-stroke: 1px rgba(14, 29, 66, 0.45);
  }

  .page-home .km-hero-home-headline {
    gap: 0.25rem;
    margin-bottom: clamp(2rem, 9vw, 3.25rem);
  }
}
