/* =======================================================
   Homepage intro video (hero-video) — added 2026-09-25
   Sits directly beneath the homepage photo hero.
   Loaded on index.html only. Pairs with js/hero-video.js.
   ======================================================= */

.hvid {
  position: relative;
  background: #0a1720;
  color: #fff;
  isolation: isolate;
}
.hvid__frame {
  position: relative;
  width: 100%;
  height: min(100vh, 56.25vw);   /* full 16:9 on typical desktops, never taller than the screen */
  min-height: 420px;
  overflow: hidden;
  background: #0a1720;
}
.hvid__poster,
.hvid__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.hvid__video { opacity: 0; transition: opacity .6s ease; }
.hvid.is-playing .hvid__video,
.hvid.has-played .hvid__video { opacity: 1; }

/* Legibility: shade under the transparent nav, and under captions/controls */
.hvid__shade {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(0deg, rgba(10,23,32,.55) 0, rgba(10,23,32,0) 180px);
}

/* ---------- Captions ---------- */
.hvid__captions {
  position: absolute;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%);
  z-index: 2;
  width: min(92%, 900px);
  text-align: center;
  pointer-events: none;
}
.hvid__captions span {
  display: inline;
  font-family: "Archivo", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(15px, 1.55vw, 24px);
  line-height: 1.55;
  color: #fff;
  background: rgba(10,15,12,.74);
  padding: .12em .5em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  white-space: pre-line;
  border-radius: 3px;
}
.hvid.cc-off .hvid__captions { display: none; }
/* Native captions are hidden by JS (track mode "hidden"); this is a fallback for browsers that ignore it */
.hvid__video::cue { background: rgba(10,15,12,.74); color: #fff; font-family: "Archivo", system-ui, sans-serif; }

/* ---------- Controls ---------- */
.hvid__controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100% - 48px, var(--container, 1240px));
  margin-inline: auto;
  padding: 0 0 32px;
}
.hvid__controls button {
  cursor: pointer;
  line-height: 1;
  border: 0;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.hvid__controls button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.hvid__controls svg { width: 22px; height: 22px; flex: none; }

.hvid__sound {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px 0 18px;
  border-radius: 999px;
  background: var(--accent, #B2854A);
  font-family: "Archivo", system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .01em;
  box-shadow: 0 10px 28px -10px rgba(0,0,0,.6);
  transition: background var(--t, .26s), transform var(--t, .26s);
}
.hvid__sound:hover { background: #9C7239; transform: translateY(-1px); }
/* Attention ring while muted */
.hvid.is-muted .hvid__sound::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: inherit;
  border: 2px solid rgba(255,255,255,.75);
  animation: hvidPulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes hvidPulse {
  0%   { opacity: .9; transform: scale(.96); }
  70%  { opacity: 0;  transform: scale(1.12); }
  100% { opacity: 0;  transform: scale(1.12); }
}
.hvid:not(.is-muted) .hvid__sound { background: rgba(10,15,12,.62); backdrop-filter: blur(6px); }
.hvid:not(.is-muted) .hvid__sound:hover { background: rgba(10,15,12,.8); }

.hvid__icon-on, .hvid__icon-play { display: none; }
.hvid:not(.is-muted) .hvid__icon-off { display: none; }
.hvid:not(.is-muted) .hvid__icon-on  { display: block; }

.hvid__right { display: flex; gap: 10px; }
.hvid__btn {
  display: inline-grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(10,15,12,.62);
  backdrop-filter: blur(6px);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .04em;
  transition: background var(--t, .26s);
}
.hvid__btn:hover { background: rgba(10,15,12,.85); }
.hvid__cc[aria-pressed="false"] { opacity: .6; text-decoration: line-through; }
.hvid__play .hvid__icon-play { display: none; }
.hvid.is-paused .hvid__play .hvid__icon-pause { display: none; }
.hvid.is-paused .hvid__play .hvid__icon-play  { display: block; }

/* Not autoplaying (reduced motion / data saver / autoplay blocked): make the start obvious */
.hvid.needs-tap .hvid__sound .hvid__icon-off { display: none; }
.hvid.needs-tap .hvid__sound .hvid__icon-play { display: block; }

/* ---------- Tablet / phone ---------- */
@media (max-width: 1024px) {
  .hvid__frame { height: auto; min-height: 0; aspect-ratio: 16 / 9; }
  .hvid__shade {
    background: linear-gradient(0deg, rgba(10,23,32,.45) 0, rgba(10,23,32,0) 90px);
  }
  .hvid__captions { bottom: 10px; width: 94%; }
  .hvid__captions span { font-size: clamp(13px, 3.6vw, 18px); line-height: 1.5; }
  /* Controls move to a strip under the frame so they never cover the picture or captions */
  .hvid__controls {
    position: static;
    width: auto;
    padding: 12px 16px 14px;
    background: #0a1720;
  }
  .hvid__sound { min-height: 48px; font-size: 15px; padding: 0 20px 0 16px; }
  .hvid__btn { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .hvid.is-muted .hvid__sound::after { animation: none; opacity: 0; }
  .hvid__video { transition: none; }
}
