/* ==========================================================================
   Hero — Phase 0 static initial frame
   Desktop coordinates are measured from 01-approved-art-direction.png and
   expressed in reference pixels at 1440px (multiplied by --u).
   ========================================================================== */

.hero {
  position: relative;
  overflow-x: clip;
}

.hero__grid {
  position: relative;
}

/* ---- Copy ---- */
.hero__copy {
  position: relative;
  z-index: 5;
}

.hero__title {
  color: var(--ink);
  font-weight: 900;
  font-stretch: var(--stretch-display);
  letter-spacing: -0.055em;
  line-height: 0.82;
  text-transform: uppercase;
}

/* Each line clips its word: prepared for the Phase 1 mask-cut / slide. */
.hero__line {
  display: block;
  overflow: hidden;
  /* room for the period + descender-free caps without clipping */
  padding-block: 0.02em;
  margin-block: -0.02em;
}
.hero__word { display: inline-block; }
.hero__word--signal { color: var(--mas-red); }

.hero__lede {
  color: var(--body);
  font-size: 15px;
  line-height: 1.45;
}

/* ---- Scroll cue ---- */
.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  text-decoration: none;
}
.scroll-cue__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--mas-red);
  border-radius: 50%;
  color: var(--mas-red);
}
.scroll-cue__icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.scroll-cue__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  font-stretch: var(--stretch-ui);
  letter-spacing: 0.34em;
  text-transform: uppercase;
}
.scroll-cue:hover .scroll-cue__label { color: var(--ink); }

/* ---- Aside: AI VIDEO × DIGITAL MARKETING ---- */
.hero__aside { font-size: 11px; }
.hero__aside::after {
  content: "";
  display: block;
  width: 14px;
  height: 2px;
  margin-top: 12px;
  background: var(--mas-red);
}

/* ==========================================================================
   Media composition
   ========================================================================== */
.hero__media {
  position: absolute;
  pointer-events: none;
}

.hm,
.signal {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
}

/* Media element (img/video) dropped into any slot fills it predictably. */
.hm__media,
.hm > img,
.hm > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder (explicit — never mistaken for production media) */
.hm__ph {
  position: absolute;
  inset: 0;
}
.hm__label {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-size: 8.5px;
  font-weight: 600;
  font-stretch: var(--stretch-ui);
  letter-spacing: 0.22em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* Layer 0 — structural planes (thin, translucent, architectural) */
.hm--plane {
  z-index: 0;
  background: linear-gradient(120deg, rgb(206 211 216 / 0.42), rgb(236 238 240 / 0.12) 70%, rgb(255 255 255 / 0));
  border-top: 1px solid rgb(255 255 255 / 0.9);
  border-left: 1px solid rgb(8 8 8 / 0.06);
}

/* Layer 1 — subject / main brand film: dissolves into the white page on the
   left, top and bottom; its right side runs underneath the fragment cluster. */
.hm--subject { z-index: 1; }
.hm--subject .hm__media {
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 8%, #000 78%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 7%, #000 84%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 8%, #000 78%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 7%, #000 84%, transparent 100%);
  mask-composite: intersect;
}
.hm--subject .hm__ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 46% at 46% 40%, #d9dadc 0%, #e8e9ea 45%, rgb(246 246 246 / 0) 100%),
    linear-gradient(180deg, #eeeeef 0%, #f6f6f6 100%);
  -webkit-mask-image: radial-gradient(50% 50% at 50% 48%, #000 40%, transparent 100%);
  mask-image: radial-gradient(50% 50% at 50% 48%, #000 40%, transparent 100%);
}
.hm--subject .hm__label {
  left: 12%;
  bottom: 10%;
  color: var(--muted);
}

/* Layers 2/3 — fragments: film stills in thin light frames */
.hm--frag {
  overflow: hidden;
  background: #1a1b1d;
  transform: perspective(1000px) rotateY(-10deg);
  transform-origin: left center;
  outline: 2px solid rgb(236 238 240 / 0.95);
  box-shadow: 0 16px 28px -16px rgb(8 8 8 / 0.5);
}
.hm--frag[data-layer="2"] { z-index: 2; }
.hm--frag[data-layer="3"] { z-index: 4; }

/* Placeholder tones (used only when a slot has no media yet) */
.hm--frag .hm__ph {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.14) 0%, rgb(255 255 255 / 0) 45%),
    linear-gradient(165deg, #4a4f56 0%, #1d1f22 100%);
}
.hm--frag .hm__label { color: rgb(255 255 255 / 0.7); }

/* Red signal — primary bar sits between mid and foreground fragments; secondary lines in front */
.signal {
  z-index: 3;
  height: max(3px, calc(var(--h) * var(--k, 1) * var(--u)));
  transform: rotate(var(--r));
  transform-origin: left center;
  background: linear-gradient(90deg, rgb(192 0 8 / 0) 0%, rgb(192 0 8 / 0.75) 30%, var(--mas-red) 55%, var(--mas-red) 100%);
}
.signal--thin {
  z-index: 5;
  height: max(1px, calc(var(--h) * var(--u)));
}
.signal--cut {
  z-index: 5;
  background: var(--mas-red);
}

/* ==========================================================================
   Desktop (≥1024px): measured composition
   ========================================================================== */
@media (min-width: 1024px) {
  .hero__grid { height: calc(640 * var(--u)); }

  .hero__copy {
    width: calc(493 * var(--u));   /* 5 of 12 columns */
    padding-top: calc(72 * var(--u));
  }

  /* Thin red structural rule on the 80px safety line */
  .hero__copy::before {
    content: "";
    position: absolute;
    left: calc((var(--safety) - var(--gutter)));
    top: calc(72 * var(--u));
    width: 1px;
    height: calc(343 * var(--u));
    background: var(--mas-red);
  }

  .hero__title {
    margin-top: calc(16 * var(--u));
    font-size: calc(96 * var(--u));
  }

  .hero__lede {
    max-width: calc(360 * var(--u));
    min-width: 300px;
    margin-top: calc(26 * var(--u));
  }

  .scroll-cue { margin-top: calc(36 * var(--u)); }

  /* --k scales the measured media composition from its top-left anchor so
     the cluster fills the taller static hero without re-measuring. */
  .hero__media {
    --k: 1.1;
    left: calc(525 * var(--u));
    top: 0;
    width: calc(915 * var(--u));
    height: 100%;
  }
  .hm,
  .signal {
    left: calc(var(--x) * var(--k) * var(--u));
    top: calc(var(--y) * var(--k) * var(--u));
    width: calc(var(--w) * var(--k) * var(--u));
    height: calc(var(--h) * var(--k) * var(--u));
  }

  .hero__aside {
    position: absolute;
    z-index: 6;
    left: calc(1198 * var(--u));
    top: calc(330 * var(--u));
  }
  .hero__aside > span { display: block; }

  /* Slot geometry — x / y / w / h in 1440 reference px, relative to
     .hero__media, measured from 01-approved-art-direction.png */
  [data-slot="plane-a"]      { --x: 440; --y: 18;  --w: 250; --h: 200; }
  [data-slot="plane-b"]      { --x: 560; --y: 220; --w: 150; --h: 290; }
  [data-slot="plane-c"]      { --x: 300; --y: 370; --w: 150; --h: 170; }
  [data-slot="film"]         { --x: -2;  --y: -17; --w: 478; --h: 576; }

  [data-slot="frag-product"] { --x: 190; --y: 44;  --w: 228; --h: 138; }
  [data-slot="frag-social"]  { --x: 410; --y: 71;  --w: 96;  --h: 76;  }
  [data-slot="frag-street"]  { --x: 350; --y: 162; --w: 190; --h: 122; }
  [data-slot="frag-ai"]      { --x: 533; --y: 138; --w: 95;  --h: 90;  }
  [data-slot="frag-detail"]  { --x: 214; --y: 210; --w: 132; --h: 180; }
  [data-slot="frag-brand"]   { --x: 341; --y: 296; --w: 120; --h: 192; }
  [data-slot="frag-city"]    { --x: 472; --y: 255; --w: 126; --h: 157; }

  [data-slot="signal-main"]  { --x: 375; --y: 269; --w: 352; --h: 7;   --r: -12.5deg; }
  [data-slot="signal-top"]   { --x: 476; --y: 121; --w: 126; --h: 3;   --r: -10.4deg; }
  [data-slot="signal-low"]   { --x: 136; --y: 501; --w: 136; --h: 2;   --r: -10.5deg; }
  [data-slot="signal-cut"]   { --x: 452; --y: 386; --w: 5;   --h: 82;  --r: 0deg; }
}

/* ==========================================================================
   < 1024px: stacked editorial layout, reduced fragments
   ========================================================================== */
@media (max-width: 1023.98px) {
  .hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "eyebrow"
      "title"
      "media"
      "aside"
      "lede"
      "cue";
    padding-top: 28px;
    padding-bottom: 40px;
  }
  .hero__copy { display: contents; }

  .hero__eyebrow { grid-area: eyebrow; font-size: 11px; }

  .hero__title {
    grid-area: title;
    margin-top: 18px;
    font-size: clamp(44px, 15.2vw, 96px);
  }

  .hero__media {
    grid-area: media;
    position: relative;
    width: calc(100% + var(--gutter));
    aspect-ratio: 1 / 0.92;
    max-height: 560px;
    margin-top: 8px;
  }

  .hero__aside {
    grid-area: aside;
    font-size: 10.5px;
    letter-spacing: 0.28em;
  }
  .hero__aside::after { margin-top: 10px; }

  .hero__lede { grid-area: lede; margin-top: 20px; max-width: 34em; }
  .scroll-cue { grid-area: cue; margin-top: 28px; justify-self: start; }

  /* Only 2 fragments on small screens */
  .hm--frag:not([data-mobile]),
  [data-slot="plane-b"],
  [data-slot="plane-c"],
  .signal--thin,
  .signal--cut { display: none; }

  .hm,
  .signal {
    left: var(--mx);
    top: var(--my);
    width: var(--mw);
    height: var(--mh);
  }
  .signal { height: 5px; }

  .hm--frag { transform: perspective(700px) rotateY(-8deg); }
  .hm--subject .hm__label { left: 14%; bottom: 10%; max-width: 42%; }
  /* Mobile fragments don't sit over the subject's right side, so fade it
     out earlier (comp media has baked-in frames there). */
  .hm--subject .hm__media {
    -webkit-mask-image:
      linear-gradient(to right, transparent 0%, #000 6%, #000 18%, rgb(0 0 0 / 0.45) 29%, transparent 39%),
      linear-gradient(to bottom, transparent 0%, #000 7%, #000 84%, transparent 100%);
    mask-image:
      linear-gradient(to right, transparent 0%, #000 6%, #000 18%, rgb(0 0 0 / 0.45) 29%, transparent 39%),
      linear-gradient(to bottom, transparent 0%, #000 7%, #000 84%, transparent 100%);
  }

  [data-slot="plane-a"]      { --mx: 44%; --my: 6%;  --mw: 48%; --mh: 62%; }
  [data-slot="film"]         { --mx: -4%; --my: -2%; --mw: 80%; --mh: 104%; }
  [data-slot="frag-product"] { --mx: 34%; --my: 14%; --mw: 56%; --mh: 32%; }
  [data-slot="frag-brand"]   { --mx: 58%; --my: 50%; --mw: 30%; --mh: 40%; }
  [data-slot="signal-main"]  { --mx: 14%; --my: 66%; --mw: 82%; --r: -14deg; }
}

/* Reduced motion: Phase 0 has no hero motion, so nothing to disable here.
   Phase 1 must branch on prefers-reduced-motion to a true static fallback
   (headline + brand-film poster), not shorten animation durations. */
