/* =====================================================================
   Mat Off Mute — Animated Fox additions
   Append to assets/css/main.css (or @import as a separate file).
   ===================================================================== */

/* ---- Core video frame: background blend + watermark crop ---- */

/*
 * ARCHITECTURE NOTE — why two separate elements:
 *
 * We need two things simultaneously:
 *   1. mix-blend-mode: screen  — makes the video's black background
 *      transparent against the site's dark background on all browsers
 *      (applied to the div, not the video, because iOS Safari ignores
 *      mix-blend-mode on <video> elements).
 *   2. overflow: hidden        — crops the scaled-up video so the
 *      Veo watermark at the bottom edge is never visible.
 *
 * The problem: when mix-blend-mode is non-normal, the browser promotes
 * the element to its own GPU compositing layer and performs clipping in
 * a separate pass. overflow:hidden on the SAME element as mix-blend-mode
 * is bypassed during this compositing step on both Chrome and WebKit.
 *
 * Solution: split the two concerns onto two nested elements.
 *   .mom-fox-live        → mix-blend-mode: screen  (no clipping here)
 *   .mom-fox-live__wrap  → overflow: hidden        (no blend mode here)
 *
 * Each element does exactly one thing; neither interferes with the other.
 */

.mom-fox-live {
  position: relative;
  display: block;
  background: transparent;
  /* Screen blend: black video background → page background colour.
     Works because screen(0, bg) = bg exactly, making black invisible. */
  mix-blend-mode: screen;
  /* No overflow / clip-path on this element — see note above. */
  width: 100%;
  aspect-ratio: 16 / 9;
}

/* Inner wrapper: sole job is to clip the oversized video. No blend mode. */
.mom-fox-live__wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* Force a GPU compositing layer so overflow:hidden clips correctly on
     iOS Safari (without this, WebKit skips the clip on mobile). */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.mom-fox-live__wrap > video {
  position: absolute;
  /* Scale up + offset to push the Veo watermark (bottom-right ~15% of
     the original frame) well outside the visible area.
       height 128% + top -8%   → 20% cropped from the bottom
       width  120% + left -10% → 10% cropped from each side            */
  width: 120%;
  height: 128%;
  left: -10%;
  top: -8%;
  object-fit: cover;
  object-position: center 40%;
  pointer-events: none;
  user-select: none;
}

.mom-fox-live::after {
  /* Subtle edge vignette over the clipped video. Since it's on the outer
     container it composites before the screen blend — its black edges
     become transparent against the page background automatically. */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.45) 100%);
}

/* ---- Monitor chrome: corner brackets, scan lines, optional labels ---- */
.mom-fox-live--monitor {
  /* Monitor variant is a deliberate opaque cinematic panel.
     Restore a solid dark background and cancel the screen blend. Since
     mix-blend-mode is back to normal, there's no compositing conflict and
     the standard overflow:hidden approach works fine here. */
  background: #0c0c0a;
  mix-blend-mode: normal;
  border: 1px solid var(--rule-2);
}
/* Give the monitor's inner wrap the same dark background so there are
   no transparent gaps at the edges when the video is scaled. */
.mom-fox-live--monitor .mom-fox-live__wrap {
  background: #0c0c0a;
}
.mom-fox-live--monitor::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  /* Scan lines */
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,0.18) 2px 3px);
  mix-blend-mode: multiply;
  opacity: 0.6;
}
/* Corner brackets via SVG mask in pseudo-element */
.mom-fox-live--monitor .mom-fox-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

/* Optional label overlays — hidden by default, opt-in with classes */
.mom-fox-live__label,
.mom-fox-live__stamp,
.mom-fox-live__rec,
.mom-fox-live__reticule {
  position: absolute;
  z-index: 4;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--bone-mute);
}
.mom-fox-live__label    { top: 14px; right: 22px; color: var(--gold); }
.mom-fox-live__rec      { top: 14px; left: 22px; display: flex; align-items: center; gap: 8px; }
.mom-fox-live__rec::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 6px;
  background: #b14d3a;
  box-shadow: 0 0 6px #b14d3a;
  animation: mom-fox-rec-blink 1.6s steps(2,end) infinite;
}
.mom-fox-live__stamp    { bottom: 12px; left: 22px; color: var(--bone-dim); letter-spacing: 0.22em; }
.mom-fox-live__reticule { bottom: 12px; right: 22px; color: var(--bone-dim); letter-spacing: 0.2em; }

@keyframes mom-fox-rec-blink { 50% { opacity: 0.25; } }

/* ---- Masthead live monitors (replace the static fox PNGs) ---- */
.masthead__fox-live {
  position: relative;
  width: 120px;
  height: 68px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg);
  /* No chrome labels in the masthead — clean, just the video. */
}
.masthead__fox-live .mom-fox-live { width: 100%; height: 100%; aspect-ratio: auto; }

.masthead__fox-live .mom-fox-live {
  background: transparent;
}
.masthead__fox-live .mom-fox-live__wrap {
  background: var(--bg);
}

.masthead__fox-live .mom-fox-live::after {
  display: none;
}

/* Mirror the right-hand masthead fox.
   IMPORTANT: the transform must live on .mom-fox-live itself, NOT on the
   .masthead__fox-live--mirror wrapper. Any transform on a parent element
   creates a new stacking context, which isolates mix-blend-mode: screen
   inside it — the fox then blends against a transparent backdrop instead
   of the page background, making the black video background reappear.
   Putting the transform on the same element as mix-blend-mode avoids this:
   there is still only one stacking context and it blends outward correctly. */

/* ---- Watch panel: cinematic broadcast above the featured story ---- */
.watch-panel {
  border-bottom: 1px solid var(--rule);
  padding: 32px var(--page-pad) 48px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201,168,106,0.06), transparent 70%),
    var(--bg);
  animation: mom-fox-fade-up 0.7s ease-out both;
}
.watch-panel__inner {
  max-width: 1320px;
  margin-inline: auto;
}
.watch-panel__stripe {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}
.watch-panel__stripe-label { color: var(--gold); }
.watch-panel__stripe-meta  { color: var(--bone-dim); }
.watch-panel__stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: start;
}
.watch-panel__screen { position: relative; width: 100%; }
.watch-panel__screen .mom-fox-live { aspect-ratio: 11 / 5.2; }

.watch-panel__side {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--bone-mute);
  border-left: 1px solid var(--rule);
  padding-left: 22px;
  line-height: 1.7;
}
.watch-panel__row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--rule);
}
.watch-panel__row .k { color: var(--bone-dim); }
.watch-panel__row .v { color: var(--bone); }
.watch-panel__row .v.gold { color: var(--gold); }
.watch-panel__foot {
  font-family: "Source Serif 4", serif;
  font-size: 13px;
  color: var(--bone-mute);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.55;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  margin-top: 18px;
  font-style: italic;
}

@keyframes mom-fox-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .watch-panel__stage { grid-template-columns: 1fr; }
  .watch-panel__side {
    border-left: none;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 18px;
  }
}

@media (max-width: 900px) {
  .masthead__fox-live { width: 96px; height: 54px; }
}

@media (max-width: 700px) {
  .masthead__fox-live { width: 76px; height: 44px; }
}

@media (max-width: 480px) {
  .masthead__fox-live { width: 60px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .watch-panel { animation: none; }
  .mom-fox-live__rec::before { animation: none; }
}
