/* =========================================================
   PP HOMEPAGE FILM v1.1.2 — IMMERSIVE VIEWING POLISH
   Ownership: film chapter, player, and explicitly gated Gateway rhythm only.
   PP Style Layers, Gateway HTML, Additional CSS, and Digital Atmosphere remain
   the owners of their existing surfaces.
========================================================= */

#pp-home-gateway .pphg-film {
  position: relative;
  z-index: 4;
  isolation: isolate;
  margin-top: clamp(34px, 5vw, 64px);
  padding: clamp(26px, 4vw, 44px) 0 clamp(22px, 3vw, 36px);
  border-top: 1px solid rgba(214, 167, 57, 0.18);
  border-bottom: 1px solid rgba(214, 167, 57, 0.14);
  background:
    radial-gradient(circle at 50% 18%, rgba(214, 167, 57, 0.075), transparent 42%),
    linear-gradient(180deg, rgba(7, 7, 5, 0.72), rgba(5, 5, 4, 0.34));
}

#pp-home-gateway .pphg-film__header {
  max-width: 920px;
  margin: 0 auto clamp(20px, 3vw, 30px);
  padding-inline: clamp(8px, 2vw, 18px);
  text-align: center;
}

#pp-home-gateway .pphg-film__header .pphg-section-title::after {
  margin-right: auto;
  margin-left: auto;
}

#pp-home-gateway .pphg-film__intro {
  margin-right: auto;
  margin-left: auto;
}

#pp-home-gateway .pphg-film__player {
  width: min(100%, 1220px);
  margin-inline: auto;
  color: var(--pphg-copy, #ddd4c2);
  font-family: var(--pphg-sans, "Open Sans", Arial, sans-serif);
}

#pp-home-gateway .pphf__immersive {
  position: relative;
  z-index: 2;
}

#pp-home-gateway .pphf__stage {
  position: relative;
  z-index: 2;
  isolation: isolate;
  contain: paint;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #030303;
  border: 1px solid var(--pphg-line, rgba(214, 167, 57, 0.28));
  border-radius: clamp(12px, 1.4vw, 18px);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.40);
}

#pp-home-gateway .pphf__stage::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(244, 216, 119, 0.08);
  border-radius: inherit;
}

#pp-home-gateway .pphf__video,
#pp-home-gateway .pphf__poster {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #030303;
}

#pp-home-gateway .pphf__status {
  position: absolute;
  z-index: 5;
  right: 12px;
  bottom: 10px;
  margin: 0;
  padding: 0.3rem 0.48rem;
  color: rgba(247, 239, 220, 0.82);
  background: rgba(3, 3, 3, 0.72);
  font-size: 0.7rem;
  line-height: 1.3;
}

#pp-home-gateway .pphf__status:empty {
  display: none;
}

#pp-home-gateway .pphf__controls {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.68rem;
  margin-top: 0.78rem;
}

#pp-home-gateway .pphf__button {
  appearance: none;
  cursor: pointer;
}

#pp-home-gateway .pphf__sound[aria-pressed="true"],
#pp-home-gateway .pphf__playback[aria-pressed="true"],
#pp-home-gateway .pphf__fullscreen[aria-pressed="true"] {
  border-color: var(--pphg-line-bright, rgba(244, 216, 119, 0.74));
  background: rgba(214, 167, 57, 0.12);
  color: var(--pphg-gold-bright, #f4d877);
}

#pp-home-gateway .pphf__fullscreen[hidden] {
  display: none !important;
}

#pp-home-gateway .pphf__support {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin-top: 0.42rem;
}

#pp-home-gateway .pphf__description,
#pp-home-gateway .pphf__credit {
  max-width: 760px;
  color: var(--pphg-muted, #b3a891);
  font-size: 0.78rem;
  line-height: 1.5;
}

#pp-home-gateway .pphf__description summary,
#pp-home-gateway .pphf__credit summary {
  cursor: pointer;
  color: rgba(221, 212, 194, 0.78);
  font-weight: 700;
}

#pp-home-gateway .pphf__description p,
#pp-home-gateway .pphf__credit p {
  margin: 0.48rem 0 0;
  padding: 0.68rem 0.82rem;
  border-left: 2px solid var(--pphg-line, rgba(214, 167, 57, 0.28));
  background: rgba(9, 9, 7, 0.82);
}

#pp-home-gateway .pphf__description summary:focus-visible,
#pp-home-gateway .pphf__credit summary:focus-visible {
  outline: 2px solid var(--pphg-gold-bright, #f4d877);
  outline-offset: 3px;
}

#pp-home-gateway #pphg-paths-title {
  scroll-margin-top: 110px;
}

#pp-home-gateway .pphg-film__exit {
  display: flex;
  justify-content: center;
  margin-top: clamp(20px, 3vw, 30px);
}

.pphf-admin-warning {
  padding: 1rem;
  border: 1px solid #b98a24;
  background: #fff7df;
  color: #201a10;
}

body.pphf-hide-intent-nav #pp-home-gateway .pphg-intent-nav {
  display: none !important;
}

@media (min-width: 1041px) {
  body.pphf-compact-routes #pp-home-gateway .pphg-route-card--evidence {
    min-height: 495px;
  }
  body.pphf-compact-routes #pp-home-gateway .pphg-route-card--study,
  body.pphf-compact-routes #pp-home-gateway .pphg-route-card--discernment {
    min-height: 238px;
  }
  body.pphf-compact-routes #pp-home-gateway .pphg-route-card--games,
  body.pphf-compact-routes #pp-home-gateway .pphg-route-card--watch {
    min-height: 288px;
  }
}

body.pphf-soften-prophecy #pp-home-gateway .pphg-prophecy {
  border-color: rgba(214, 167, 57, 0.21);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.31);
}

body.pphf-soften-prophecy #pp-home-gateway .pphg-prophecy::after {
  opacity: 0.25;
}

/* Fullscreen shell keeps custom controls visible in browsers that support
   element fullscreen. iPhone falls back to native video fullscreen. */
#pp-home-gateway .pphf__immersive:fullscreen,
#pp-home-gateway .pphf__immersive:-webkit-full-screen {
  position: fixed;
  inset: 0;
  left: auto;
  display: flex;
  width: 100vw;
  height: 100vh;
  transform: none;
  max-width: none;
  flex-direction: column;
  justify-content: center;
  padding:
    max(10px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
  background: #000;
}

#pp-home-gateway .pphf__immersive:fullscreen .pphf__stage,
#pp-home-gateway .pphf__immersive:-webkit-full-screen .pphf__stage {
  width: 100%;
  min-height: 0;
  max-height: calc(100vh - 82px);
  flex: 1 1 auto;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#pp-home-gateway .pphf__immersive:fullscreen .pphf__stage::after,
#pp-home-gateway .pphf__immersive:-webkit-full-screen .pphf__stage::after {
  display: none;
}

#pp-home-gateway .pphf__immersive:fullscreen .pphf__controls,
#pp-home-gateway .pphf__immersive:-webkit-full-screen .pphf__controls {
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 0;
  padding: 10px 0 0;
  background: #000;
}

#pp-home-gateway .pphf__video::backdrop,
#pp-home-gateway .pphf__immersive::backdrop {
  background: #000;
}

@media (max-width: 760px) {
  #pp-home-gateway .pphg-film {
    margin-top: 22px;
    padding: 22px 0 24px;
  }

  #pp-home-gateway .pphg-film__header {
    max-width: 100%;
    margin-bottom: 14px;
    padding-inline: 8px;
    text-align: left;
  }

  #pp-home-gateway .pphg-film__title {
    max-width: 100%;
    font-size: clamp(1.55rem, 6.6vw, 1.9rem) !important;
    line-height: 1.08 !important;
  }

  #pp-home-gateway .pphg-film__intro {
    max-width: 34ch;
    margin-top: 0.64rem;
    margin-left: 0;
    font-size: 0.94rem;
    line-height: 1.56;
  }

  #pp-home-gateway .pphg-film__header .pphg-section-title::after {
    width: 66px;
    margin-top: 0.58rem;
    margin-left: 0;
  }

  /* The actual viewing surface and its controls become viewport-wide while
     copy, disclosures, and the next-step CTA remain aligned to page gutters. */
  #pp-home-gateway .pphf__immersive {
    left: 50%;
    width: 100vw;
    max-width: none;
    transform: translateX(-50%);
  }

  @supports (width: 100dvw) {
    #pp-home-gateway .pphf__immersive {
      width: 100dvw;
    }
  }

  #pp-home-gateway .pphf__stage {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  }

  #pp-home-gateway .pphf__stage::after {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  #pp-home-gateway .pphf__controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0;
    padding: 0.66rem 14px 0;
    background: linear-gradient(180deg, rgba(3, 3, 3, 0.98), rgba(5, 5, 4, 0.94));
  }

  #pp-home-gateway .pphf__button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding-inline: 0.45rem;
    font-size: 0.69rem;
    letter-spacing: 0.045em;
  }

  #pp-home-gateway .pphf__sound {
    grid-column: 1 / -1;
    font-size: 0.76rem;
  }

  #pp-home-gateway #pphg-paths-title {
    scroll-margin-top: 88px;
  }

  #pp-home-gateway .pphf__support {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.52rem;
    justify-content: stretch;
    margin-top: 0.72rem;
  }

  #pp-home-gateway .pphf__description,
  #pp-home-gateway .pphf__credit {
    max-width: none;
    border: 1px solid rgba(214, 167, 57, 0.16);
    background: rgba(7, 7, 5, 0.56);
  }

  #pp-home-gateway .pphf__description[open],
  #pp-home-gateway .pphf__credit[open] {
    grid-column: 1 / -1;
  }

  #pp-home-gateway .pphf__description summary,
  #pp-home-gateway .pphf__credit summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.58rem 0.68rem;
    font-size: 0.72rem;
    line-height: 1.3;
  }

  #pp-home-gateway .pphf__description p,
  #pp-home-gateway .pphf__credit p {
    margin: 0;
    border-top: 1px solid rgba(214, 167, 57, 0.14);
    border-left: 0;
  }

  #pp-home-gateway .pphg-film__exit {
    margin-top: 18px;
  }

  #pp-home-gateway .pphg-film__exit .pphg-button {
    width: 100%;
    min-height: 54px;
  }

  body.pphf-compact-routes #pp-home-gateway .pphg-route-card--evidence {
    min-height: 390px;
  }

  body.pphf-compact-routes #pp-home-gateway .pphg-route-card,
  body.pphf-compact-routes #pp-home-gateway .pphg-route-card--study,
  body.pphf-compact-routes #pp-home-gateway .pphg-route-card--discernment,
  body.pphf-compact-routes #pp-home-gateway .pphg-route-card--games,
  body.pphf-compact-routes #pp-home-gateway .pphg-route-card--watch {
    min-height: 330px;
  }
}

@media (max-width: 360px) {
  #pp-home-gateway .pphf__button {
    font-size: 0.64rem;
    letter-spacing: 0.025em;
  }
}

@media (hover: none), (pointer: coarse) {
  #pp-home-gateway .pphf__button:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #pp-home-gateway .pphf__button {
    transition: none !important;
  }
}

@media (prefers-contrast: more) {
  #pp-home-gateway .pphf__stage {
    border-color: var(--pphg-gold-bright, #ffe38a);
  }
}

@media (forced-colors: active) {
  #pp-home-gateway .pphf__stage,
  #pp-home-gateway .pphg-film,
  #pp-home-gateway .pphf__description,
  #pp-home-gateway .pphf__credit {
    border: 1px solid CanvasText;
    box-shadow: none;
  }
}

@media print {
  #pp-home-gateway .pphg-film {
    display: none !important;
  }
}
