/*
 * Version 4 — homepage (ND Security–inspired: hero band, regions, health-check strip).
 * Requires: html[data-wd-build="v4"], body.idx.idx-home.wd-surface-v4.
 */

/* Shell video hidden sitewide in v4-sitewide.css; hero uses .idx-v4-hero__video below. */

html[data-wd-build="v4"] body.wd-surface-v4.idx.idx-home {
  --wd-v4-nav-h: calc(env(safe-area-inset-top, 0px) + clamp(58px, 8vh, 72px));
}

/* ─── Hero: full-bleed banner video + gradient scrim + stacked headline ─ */
html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero {
  /* Hero lives inside <main> but uses a dark video stage — undo sitewide paper ink tokens. */
  --idx-ink: #fafafa;
  --idx-muted: rgb(255 255 255 / 0.78);
  --idx-line: rgb(255 255 255 / 0.16);
  --idx-line-strong: rgb(var(--idx-accent-rgb) / 0.45);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(92vh, 52rem);
  /* Break out of #main-content horizontal padding (not 50vw — wrong when main is centred). */
  margin-left: calc(-1 * var(--idx-gutter));
  margin-right: calc(-1 * var(--idx-gutter));
  width: calc(100% + 2 * var(--idx-gutter));
  max-width: none;
  box-sizing: border-box;
  padding: calc(var(--wd-v4-nav-h) + clamp(1.25rem, 4vw, 2.5rem)) var(--idx-gutter) clamp(2rem, 5vh, 3rem);
  display: flex;
  align-items: flex-end;
  background: #121214;
  border-bottom: 6px solid var(--idx-accent);
}

/* Scrim above video (section background paints behind children, so use a layer). */
html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    rgb(0 0 0 / 0.88) 0%,
    rgb(0 0 0 / 0.55) 42%,
    rgb(0 0 0 / 0.35) 100%
  );
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  pointer-events: none;
}

/* prefers-reduced-motion: keep the hero *video* (banner.mp4); only calm CSS motion.
 * Hiding the video + swapping a JPEG looked like a “broken” banner to most users and
 * matched the old poster frame 1:1. */
@media (prefers-reduced-motion: reduce) {
  html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__rotate-track {
    animation: none;
  }
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__inner {
  position: relative;
  z-index: 2;
  max-width: min(90rem, 100%);
  margin: 0 auto;
  width: 100%;
  /* Flex item default min-width:auto forbids shrinking below longest nowrap child → horizontal scroll. */
  min-width: 0;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__ticker {
  margin: 0 0 1rem;
  padding: 0.6rem clamp(1rem, 3vw, 1.4rem) 0.55rem;
  display: block;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  font-family: var(--v4-display);
  font-size: clamp(0.62rem, 0.5rem + 0.35vw, 0.76rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--idx-accent-ink);
  background: var(--idx-accent);
  border: 2px solid var(--idx-accent-ink);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__rotate {
  height: 1.55em;
  line-height: 1.55;
  overflow: hidden;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__rotate-track {
  display: block;
  animation: idx-v4-ticker 12s ease-in-out infinite;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__rotate-line {
  display: block;
  height: 1.55em;
  white-space: nowrap;
}

@keyframes idx-v4-ticker {
  0%,
  26% {
    transform: translateY(0);
  }
  33%,
  59% {
    transform: translateY(-1.55em);
  }
  66%,
  93% {
    transform: translateY(-3.1em);
  }
  100% {
    transform: translateY(0);
  }
}

/* Narrow viewports: nowrap + translateY assumes one short line per “slide”; long copy forces
 * overflow. Stack the three lines with wrapping and no rotation — compact type, not a tall poster. */
@media (max-width: 40rem) {
  html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__ticker {
    width: 100%;
    padding: 0.5rem clamp(0.65rem, 2.5vw, 1rem) 0.48rem;
    font-size: clamp(0.52rem, 0.42rem + 1.15vw, 0.66rem);
    letter-spacing: 0.055em;
  }

  html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__rotate {
    height: auto;
    line-height: 1.32;
    overflow: visible;
  }

  html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__rotate-track {
    display: flex;
    flex-direction: column;
    gap: 0.32em;
    animation: none;
  }

  html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__rotate-line {
    height: auto;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-h1 {
  margin: 0 0 1rem;
  max-width: 22ch;
  font-family: var(--v4-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw + 1rem, 4.25rem);
  line-height: 1.02;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--idx-ink);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-h1 em {
  font-style: normal;
  color: var(--idx-accent);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-sub {
  margin: 0 0 1.5rem;
  max-width: 40rem;
  font-family: var(--v4-font);
  font-size: clamp(1rem, 0.4vw + 0.95rem, 1.15rem);
  line-height: 1.55;
  color: rgb(255 255 255 / 0.88);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-sub strong {
  color: var(--idx-accent);
  font-weight: 700;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  font-family: var(--v4-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--idx-accent);
  transition: background 0.15s ease, color 0.15s ease;
  /* document.css main link accent — hero buttons are not in <main>; keep label legible on yellow. */
  color: var(--idx-accent-ink);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-btn--solid {
  background: var(--idx-accent);
  color: var(--idx-accent-ink);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-btn--solid:hover {
  background: #fff;
  border-color: #fff;
  color: var(--idx-accent-ink);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-btn--outline {
  background: transparent;
  color: #fff;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-btn--outline:hover {
  background: rgb(255 255 255 / 0.12);
  color: #fff;
}

/* Hero phone: readable chip on the image (nav phone pill stays black — different pattern). */
html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__tel {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin: 0;
  padding: 0.5rem clamp(0.85rem, 2.5vw, 1.15rem);
  max-width: 100%;
  box-sizing: border-box;
  font-family: var(--v4-display);
  font-size: clamp(1.1rem, 2vw + 0.8rem, 1.65rem);
  letter-spacing: 0.08em;
  color: var(--idx-accent);
  background: rgb(0 0 0 / 0.52);
  border: 1px solid rgb(255 255 255 / 0.14);
  border-left: 3px solid var(--idx-accent);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__tel a.idx-v4-hero__tel-link {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-hero__tel a.idx-v4-hero__tel-link:hover {
  color: var(--idx-accent);
  text-decoration: underline;
}

/* ─── Intro band (ND-style white block under hero) ─ */
html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-intro {
  margin-left: calc(-1 * var(--idx-gutter));
  margin-right: calc(-1 * var(--idx-gutter));
  width: calc(100% + 2 * var(--idx-gutter));
  max-width: none;
  box-sizing: border-box;
  padding: clamp(2.25rem, 5vw, 3.5rem) var(--idx-gutter);
  background: #fff;
  border-bottom: 1px solid #d8d8e0;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-intro__inner {
  max-width: min(90rem, 100%);
  margin: 0 auto;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-intro__h2 {
  margin: 0 0 1rem;
  font-family: var(--v4-display);
  font-size: clamp(1.35rem, 2vw + 0.75rem, 2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--v4-ink-dark);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-intro__lead {
  margin: 0;
  max-width: 52rem;
  font-size: clamp(1rem, 0.35vw + 0.95rem, 1.12rem);
  line-height: 1.65;
  color: var(--v4-muted-dark);
}

/* ─── Regional tiles (like ND district blocks) ─ */
html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-regions {
  margin-left: calc(-1 * var(--idx-gutter));
  margin-right: calc(-1 * var(--idx-gutter));
  width: calc(100% + 2 * var(--idx-gutter));
  max-width: none;
  box-sizing: border-box;
  padding: clamp(2rem, 4vw, 2.75rem) var(--idx-gutter);
  background: var(--v4-paper);
  border-bottom: 1px solid #d0d0d8;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-regions__grid {
  max-width: min(90rem, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-regions__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-region {
  display: block;
  padding: 1.35rem 1.25rem;
  text-decoration: none;
  background: #fff;
  border: 1px solid #c8c8d0;
  border-top: 4px solid var(--idx-accent);
  color: inherit;
  transition: box-shadow 0.15s ease;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-region:hover {
  box-shadow: 6px 6px 0 rgb(0 0 0 / 0.08);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-region h3 {
  margin: 0 0 0.35rem;
  font-family: var(--v4-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--v4-ink-dark);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-region p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--v4-muted-dark);
}

/* ─── Health-check strip ─ */
html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-check {
  margin-left: calc(-1 * var(--idx-gutter));
  margin-right: calc(-1 * var(--idx-gutter));
  width: calc(100% + 2 * var(--idx-gutter));
  max-width: none;
  box-sizing: border-box;
  padding: clamp(1.5rem, 3vw, 2rem) var(--idx-gutter);
  background: var(--idx-accent);
  border-bottom: 4px solid var(--idx-accent-ink);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-check__inner {
  max-width: min(90rem, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-check__copy {
  margin: 0;
  max-width: 40rem;
  font-family: var(--v4-display);
  font-size: clamp(1rem, 1.5vw + 0.65rem, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--idx-accent-ink);
  line-height: 1.35;
}

/* Inverted primary: strip is already brand yellow — match .cta-primary shape + shadow (white fill). */
html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-check__btn {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.35rem;
  font-family: var(--v4-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0;
  color: var(--idx-accent-ink);
  background: #fff;
  border: 2px solid var(--idx-accent-ink);
  box-shadow: 4px 4px 0 rgb(0 0 0 / 0.22);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-check__btn:hover {
  background: var(--idx-accent-ink);
  color: var(--idx-accent) !important;
  border-color: var(--idx-accent-ink);
  box-shadow: 3px 3px 0 rgb(0 0 0 / 0.18);
  transform: translate(1px, 1px);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-check__btn:focus-visible {
  background: var(--idx-accent-ink);
  color: var(--idx-accent) !important;
  border-color: var(--idx-accent-ink);
  box-shadow: 3px 3px 0 rgb(0 0 0 / 0.18);
  outline: 2px solid var(--idx-accent);
  outline-offset: 3px;
}

/* ─── Operations strip (replaces video stage): imagery + CEO CTA ─ */
html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops {
  position: relative;
  margin-left: calc(-1 * var(--idx-gutter));
  margin-right: calc(-1 * var(--idx-gutter));
  width: calc(100% + 2 * var(--idx-gutter));
  max-width: none;
  box-sizing: border-box;
  background: var(--v4-ink-dark);
  border-bottom: 6px solid var(--idx-accent);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__grid {
  display: grid;
  grid-template-columns: 1fr;
  min-height: clamp(14rem, 38vw, 22rem);
}

@media (min-width: 900px) {
  html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__grid {
    grid-template-columns: 1fr 1fr 1.1fr;
  }
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__shot {
  position: relative;
  margin: 0;
  min-height: 12rem;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__cycle {
  position: relative;
  width: 100%;
  min-height: 12rem;
  height: 100%;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__cycle-img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 12rem;
  object-fit: cover;
  opacity: 0;
  /* Matched to v4-ops-cycle.js FADE_MS — quick subtle hand-off */
  transition: opacity 0.42s cubic-bezier(0.33, 0, 0.2, 1);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__cycle-img {
    transition-duration: 0.12s !important;
  }
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__cycle-img--visible {
  opacity: 1;
  z-index: 1;
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__panel {
  padding: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgb(255 255 255 / 0.12);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__panel h2 {
  margin: 0 0 0.75rem;
  font-family: var(--v4-display);
  font-size: clamp(1rem, 0.8vw + 0.85rem, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--idx-accent);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__panel p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgb(255 255 255 / 0.82);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__panel a.idx-v4-ops__cta {
  align-self: flex-start;
  font-family: var(--v4-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--idx-accent-ink);
  background: var(--idx-accent);
  padding: 0.6rem 1.1rem;
  text-decoration: none;
  border: 2px solid var(--idx-accent);
}

html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops__panel a.idx-v4-ops__cta:hover {
  background: transparent;
  color: var(--idx-accent);
}

/* Hidden stage video for playback / session continuity (see script.js) */
html[data-wd-build="v4"] body.wd-surface-v4.idx .idx-v4-ops > video.idx-v2-stage-video {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

