/* Background-video layout — loaded AFTER the theme, only on sites with a video.
   The clip fills the whole viewport and the name + link boxes sit centered on top
   of it. The theme still supplies all colors, fonts and button styles; this file
   only handles the video layer, the legibility scrim and the centering. */

/* ---- The clip: full-bleed, behind everything, above the theme background ---- */
.videowrap {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* The poster is set inline here purely so the blurred fill below can inherit
     it; it is never tiled, and the clip covers it as soon as it decodes. */
  background-size: cover;
  background-position: center;
}
.hero {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;   /* favor the face over the bottom of the frame */
  display: block;
}

/* Legibility scrim. Without it the blackletter name and the social buttons wash
   out whenever a bright frame comes up. Darkest at the top and bottom, lighter
   through the middle so she stays visible behind the links. */
.videowrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(5, 5, 8, 0.62) 0%,
      rgba(5, 5, 8, 0.34) 22%,
      rgba(5, 5, 8, 0.42) 56%,
      rgba(5, 5, 8, 0.84) 100%),
    radial-gradient(125% 85% at 50% 46%, transparent 24%, rgba(0, 0, 0, 0.48) 100%);
}

/* On anything wider than a portrait phone (landscape, tablet, desktop) covering
   the viewport with a 9:16 clip zooms it into an unusable close-up. Instead the
   clip is shown whole in a phone-shaped column and the gap either side is filled
   with a heavily blurred copy of the poster frame. */
@media (min-aspect-ratio: 2/3) {
  .hero {
    width: auto;
    height: 100%;
    aspect-ratio: 9 / 16;
    margin: 0 auto;
  }
  .videowrap::before {
    content: "";
    position: absolute;
    inset: -8%;
    z-index: -1;                 /* behind the clip, inside the video layer */
    background-image: inherit;   /* the poster, set inline on .videowrap */
    background-size: cover;
    background-position: center;
    filter: blur(46px) brightness(0.62) saturate(0.9);
  }
}

/* ---- The card: centered, frameless. No glass panel — a backdrop blur here
   would smear the video exactly where the subject is. ---- */
.card--video {
  width: min(440px, 100%);
  padding: clamp(24px, 7vw, 40px) clamp(18px, 5vw, 28px) clamp(58px, 12vw, 74px);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.card--video::before { display: none; }

/* Text sits directly on video, so it needs its own shadow to stay readable. */
.card--video .name    { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85), 0 0 14px var(--blood-glow, rgba(0,0,0,0.6)); }
.card--video .tagline,
.card--video .seo     { color: rgba(255, 255, 255, 0.82); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); }

/* The buttons are the one thing that must never be hard to read: darken the
   glass ones a little and give every box a lift off the moving background. */
.card--video .link          { box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9); }
.card--video .link--social  { background: rgba(10, 9, 14, 0.62); }
.card--video .link--social:hover { background: rgba(18, 15, 22, 0.74); }

/* ---- Footer + sound toggle, pinned clear of the notch / home indicator ---- */
.card--video .foot {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  opacity: 0.95;
}

/* The clip must start muted for mobile autoplay to be allowed, so this is how
   anyone turns audio on. Revealed by client.js (stays hidden without JS). */
.sound {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.sound:hover  { background: rgba(0, 0, 0, 0.62); border-color: rgba(255, 255, 255, 0.55); }
.sound:active { transform: scale(.95); }
.sound__icon  { font-size: 13px; line-height: 1; }
/* A short nudge so the toggle gets noticed, then it settles down. */
.sound[aria-pressed="false"] { animation: soundnudge 2.4s ease-in-out 3; }
@keyframes soundnudge {
  0%, 70%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  85%           { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.14); }
}

@media (prefers-reduced-motion: reduce) {
  .sound { animation: none; }
}
