/* Self-hosted decorative footage, with the existing image as fallback. */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
}
.hero-image.video-ready .hero-video {
  opacity: 1;
}
.hero-image.video-ready picture {
  visibility: hidden;
}
.hero-image:after {
  pointer-events: none;
}
.hero-video-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  gap: 8px;
}
.hero-video-controls button {
  border: 0;
  border-radius: 0;
  padding: 10px 14px;
  background: #24231fe8;
  color: #fff8eb;
  font: 13px/1.4 Arial, sans-serif;
  cursor: pointer;
  min-height: 40px;
}
.hero-video-controls button:hover {
  background: #63462d;
}
.hero-video-controls[hidden] {
  display: none;
}
[data-images="hide"] .hero-video,
[data-reading="on"] .hero-video-controls {
  display: none;
}

.film-open {
  margin-top: 20px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 14px/1.5 Arial, sans-serif;
  cursor: pointer;
}
.film-open:hover {
  color: var(--copper);
}
#academy-film {
  width: min(1100px, calc(100% - 24px));
  max-width: 1100px;
  max-height: 94dvh;
  padding: 20px;
}
.film-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
#academy-film h2 {
  margin: 0;
  flex: 1;
  font-size: clamp(18px, 2.5vw, 28px);
}
.film-close {
  flex: 0 0 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 28px;
  cursor: pointer;
}
.academy-film-player {
  display: block;
  width: 100%;
  max-height: 70dvh;
  aspect-ratio: 16 / 9;
  background: #000;
}
@media (max-width: 600px) {
  #academy-film { padding: 12px; }
  .film-heading { gap: 8px; }
}

/* The first screen fills the available viewport beneath the identity header. */
html:not([data-reading="on"]) .hero {
  display: block;
  min-height: calc(100svh - var(--hero-header-height, 76px) - var(--hero-menu-height, 80px));
  background: #252722;
}
html:not([data-reading="on"]) .hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: calc(100svh - var(--hero-header-height, 76px) - var(--hero-menu-height, 80px));
  padding: 80px 5% 70px;
}
html:not([data-reading="on"]) .hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
html:not([data-reading="on"]) .hero-image:after {
  inset: 0;
  background: linear-gradient(90deg, #111711dd 0%, #111711a6 35%, #11171128 80%),
    linear-gradient(0deg, #11171155, transparent 45%);
}
html:not([data-reading="on"]) .hero .hero-copy h1,
html:not([data-reading="on"]) .hero .hero-copy .hero-lead,
html:not([data-reading="on"]) .hero .film-open {
  color: #fff9ee;
}
html:not([data-reading="on"]) .hero .hero-copy .eyebrow {
  color: #efd3a5;
}
html:not([data-reading="on"]) .hero .text-link {
  color: #fff9ee;
  background: #1b211c66;
  border-color: #d8bf97;
}
.hero-copy button {
  pointer-events: auto;
}
html:not([data-reading="on"]) .hero .film-open {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  text-align: left;
}
@media (max-width: 700px) {
  html:not([data-reading="on"]) .hero-copy {
    padding: 76px 22px 70px;
  }
  html:not([data-reading="on"]) .hero-image:after {
    background: linear-gradient(90deg, #111711c9, #11171173),
      linear-gradient(0deg, #11171199, transparent 75%);
  }
  .hero-video-controls { top: 12px; right: 12px; }
  .hero .film-open { font-size: 13px; }
}

html[data-contrast="normal"]:not([data-reading="on"]) .hero .hero-copy .hero-lead {
  color: #fff9ee !important;
}

/* On phones, keep the complete film frame clear of the headline. */
@media (max-width: 700px) {
  html:not([data-reading="on"]) .hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--paper);
  }
  html:not([data-reading="on"]) .hero-image {
    position: relative;
    order: 0;
    inset: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0;
    background: #102330;
  }
  html:not([data-reading="on"]) .hero-image picture {
    position: absolute;
    inset: 0;
  }
  html:not([data-reading="on"]) .hero-image img,
  html:not([data-reading="on"]) .hero-video {
    object-fit: contain;
    object-position: center;
  }
  html:not([data-reading="on"]) .hero-image:after {
    display: none;
  }
  html:not([data-reading="on"]) .hero-copy {
    order: 1;
    min-height: 0;
    padding: 24px 22px;
    background: var(--paper);
  }
  html:not([data-reading="on"]) .hero .hero-copy h1 {
    font-size: clamp(30px, 7.8vw, 42px);
    line-height: 1.1;
    color: var(--ink);
    margin-bottom: 16px;
  }
  html[data-contrast="normal"]:not([data-reading="on"]) .hero .hero-copy .hero-lead {
    color: var(--ink) !important;
    font-size: 15px;
  }
  html:not([data-reading="on"]) .hero .hero-copy .eyebrow {
    color: var(--copper);
    font-size: 9px;
    margin-bottom: 16px;
  }
  html:not([data-reading="on"]) .hero .film-open,
  html:not([data-reading="on"]) .hero .text-link {
    color: var(--ink);
    background: transparent;
  }
  .hero .hero-actions { margin-top: 20px; gap: 12px; }
  .hero .hero-actions a { padding: 13px 14px; font-size: 12px; }
  .hero .film-open { margin-top: 10px; }
  .hero-video-controls { top: 8px; right: 8px; }
  .hero-video-controls button { padding: 6px 10px; min-height: 32px; font-size: 11px; }
  .hero-image figcaption { bottom: 6px; right: 6px; left: 6px; text-align: right; }
  .hero-image figcaption small { display: inline-block; max-width: 100%; font-size: 9px; padding: 4px 6px; }
}

/* Give the closing invitation the whole video frame. */
.hero-image.video-ready.video-ending figcaption { visibility: hidden; }
html:not([data-reading="on"]) .hero-image.video-ready.video-ending:after { background: transparent; }
@media (min-width: 701px) {
  .hero:has(.hero-image.video-ready.video-ending) .hero-copy { visibility: hidden; }
}
