/* Video additions for the A.T.O.R. media showcase. Existing page structure remains intact. */
.hero-film,
.process-film__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-film {
  position: absolute;
  inset: 0;
  z-index: -2;
  object-position: 50% 52%;
  filter: brightness(1.18) saturate(1.03);
}

.hero::before {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(17, 20, 24, 0.8) 0%, rgba(17, 20, 24, 0.64) 43%, rgba(17, 20, 24, 0.18) 100%),
    repeating-linear-gradient(0deg, rgba(247, 248, 249, 0.055) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(247, 248, 249, 0.055) 0 1px, transparent 1px 64px);
}

.media-toggle {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 0;
  background: rgba(9, 30, 51, 0.76);
  color: #fff;
  font: 700 11px/1 var(--font-mono, monospace);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.media-toggle:hover,
.media-toggle:focus-visible {
  border-color: #fff;
  background: var(--brand, #1954b8);
  outline: 2px solid transparent;
}

.media-toggle--hero { right: max(22px, calc((100% - var(--container)) / 2)); bottom: 24px; }

.process-film {
  position: relative;
  min-height: clamp(300px, 41vw, 520px);
  overflow: hidden;
  background: #0c1c2a;
}

.process-film::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 21, 37, 0.34), rgba(7, 21, 37, 0.05) 58%, rgba(7, 21, 37, 0.25));
}

.process-film__media {
  position: absolute;
  inset: 0;
  object-position: 50% 50%;
  filter: brightness(1.14) saturate(1.03);
}

.capability-card.has-card-film .card-film {
  position: relative;
  height: 214px;
  overflow: hidden;
  border-top: 1px solid var(--rule-hair);
  background: #0b2132;
}

.capability-card.has-card-film .card-film__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  object-fit: cover;
}

.capability-card.has-card-film .card-film__video {
  opacity: 0.92;
  filter: brightness(1.12) saturate(1.03);
  transition: opacity 360ms ease, transform 520ms var(--ease-reveal, ease);
}

.capability-card.has-card-film .card-film__video.is-ready {
  opacity: 0.92;
}

.capability-card.has-card-film:hover .card-film__video {
  transform: scale(1.03);
}

.direction-row.has-direction-film {
  overflow: hidden;
  padding-right: min(38%, 340px);
}

.direction-row.has-direction-film > :not(.direction-film) {
  position: relative;
  z-index: 1;
}

.direction-film {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 auto;
  width: min(36%, 320px);
  overflow: hidden;
  background: #0b2132;
}

.direction-film::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg-surface) 0%, rgba(247, 249, 251, 0.08) 58%, rgba(10, 30, 48, 0.16) 100%);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.direction-row:hover .direction-film::after {
  background: linear-gradient(90deg, var(--brand) 0%, rgba(25, 84, 184, 0.36) 62%, rgba(6, 32, 74, 0.42) 100%);
}

.direction-film__video,
.quality-film__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(1.14) saturate(1.03);
  opacity: 0;
  transition: opacity 360ms ease;
}

.direction-film__video.is-ready,
.quality-film__video.is-ready {
  opacity: 0.9;
}

.engineering-film__feature {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  border: 0;
  background: #eef2f4;
  object-fit: contain;
}

.engineering-film__toggle {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 0;
  background: rgba(7, 25, 39, 0.82);
  color: #ffffff;
  font: 700 18px/1 var(--font-sans, sans-serif);
  cursor: pointer;
}

.engineering-film__toggle:hover,
.engineering-film__toggle:focus-visible {
  border-color: #ffffff;
  background: var(--brand, #1954b8);
  outline: 2px solid transparent;
}

.engineering-film.is-feature-open {
  z-index: 4;
  inset: 0;
  width: 100%;
  background: #eef2f4;
}

.engineering-film.is-feature-open::after { display: none; }
.engineering-film.is-feature-open .engineering-film__preview { opacity: 0; }
.engineering-film.is-feature-open .engineering-film__feature { display: block; }

.quality-callout.has-quality-film {
  position: relative;
  isolation: isolate;
  min-height: 300px;
  padding: clamp(32px, 5vw, 58px);
  overflow: hidden;
  border: 1px solid #153b60;
  background: #071927;
}

.quality-callout.has-quality-film::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 20, 34, 0.8) 0%, rgba(5, 20, 34, 0.55) 52%, rgba(5, 20, 34, 0.2) 100%);
}

.quality-callout.has-quality-film > :not(.quality-film) {
  position: relative;
  z-index: 1;
}

.quality-callout.has-quality-film h2,
.quality-callout.has-quality-film p:not(.section-kicker) {
  color: #ffffff;
}

.quality-callout.has-quality-film .section-kicker {
  color: #77c6f3;
}

.quality-callout.has-quality-film .pill {
  border-color: rgba(255, 255, 255, 0.82);
  color: #ffffff;
}

.quality-callout.has-quality-film .pill:hover,
.quality-callout.has-quality-film .pill:focus-visible {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--brand);
}

.quality-film {
  position: absolute;
  z-index: 0;
  inset: 0;
}

.media-toggle--process { right: max(22px, calc((100% - var(--container)) / 2)); bottom: 24px; }

@media (max-width: 767px) {
  .hero-film { object-position: 62% 50%; }
  .hero::before {
    background:
      linear-gradient(0deg, rgba(17, 20, 24, 0.84) 0%, rgba(17, 20, 24, 0.66) 58%, rgba(17, 20, 24, 0.2) 100%),
      repeating-linear-gradient(0deg, rgba(247, 248, 249, 0.04) 0 1px, transparent 1px 52px),
      repeating-linear-gradient(90deg, rgba(247, 248, 249, 0.04) 0 1px, transparent 1px 52px);
  }
  .media-toggle--hero,
  .media-toggle--process { right: 16px; bottom: 16px; }
  .process-film { min-height: 270px; }

  .direction-row.has-direction-film {
    padding-right: 32px;
  }

  .direction-film {
    position: relative;
    inset: auto;
    order: 4;
    width: calc(100% + 64px);
    height: 152px;
    margin: 8px -32px -28px;
  }

  .engineering-film { height: 216px; }

  .direction-film::after {
    background: linear-gradient(90deg, rgba(7, 28, 47, 0.35), rgba(7, 28, 47, 0.1));
  }

  .quality-callout.has-quality-film {
    min-height: 340px;
    padding: 28px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-film,
  .process-film__media,
  .direction-film,
  .quality-film { display: none; }

  .direction-row.has-direction-film {
    padding-right: 32px;
  }
}
