/* ============================================================
   hero — brief/hero.md (desktop 3441:2051 · mobile 3441:1734)
   Mobile-first: base = <768 (anchor 375) · 768-1023 pseudo-tablet · 1024+ desktop (--vw-base 1440).
   Section-scoped only (GLOBAL-SCOPE LOCK). Tokens from css/tokens.css; .btn from components.css.
   ============================================================ */

/* ---------- Section (Pattern A + full-bleed band, D-HERO-2) ---------- */
.hero {
  /* Section-local spacing (brief §2) — mobile formulas */
  --hero-gap-sub: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 24px);
  --hero-gap-actions: clamp(20px, calc(24px + (var(--max-vw) - 375px) * 0.015), 32px);
  --hero-gap-btn: clamp(14px, calc(16px + (var(--max-vw) - 375px) * 0.015), 16px);
  --hero-gap-band: clamp(41px, calc(48px + (var(--max-vw) - 375px) * 0.015), 48px);

  display: flex;
  flex-direction: column;
  gap: var(--hero-gap-band);
  padding-block: var(--section-py);
  overflow-x: clip;
}

/* ---------- Intro: title + subtitle + CTAs ---------- */
.hero__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--hero-gap-actions);
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: var(--hero-gap-sub);
  width: 100%;
}

.hero__title {
  width: 100%;
  font-family: var(--font-display);
  font-weight: 600;
  /* D-HERO-6: FD-I guard — identical to --text-h1 at/above 375, proportional below it */
  font-size: clamp(55px, min(calc(64px + (var(--max-vw) - 375px) * 0.015), calc(64px * var(--max-vw) / 375px)), 104px);
  line-height: var(--lh-h1);
  letter-spacing: 0;
  text-align: left;
}

.hero__sub {
  width: 100%;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-body);
  line-height: var(--lh-body);
  text-align: left;
}

/* D-HERO-7: single spaces in the DOM (mobile copy); desktop double spaces added ≥1024 */
.hero__sep { margin-inline: 0; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hero-gap-btn);
}

/* ---------- Full-bleed band: collage + wordmark ---------- */
.hero__band {
  display: flex;
  flex-direction: column;
  margin-inline: calc(-1 * var(--gutter));
  container-type: inline-size;   /* cqw = band width (D-HERO-5.3) */
}

/* D-HERO-3: proportional canvas; photos positioned in % of the canvas */
.hero__collage {
  position: relative;
  width: 100%;
  aspect-ratio: 375 / 542;
  overflow: clip;
}

.hero__photo {
  position: absolute;
  display: block;
  max-width: none;
  object-fit: cover;
}

/* <picture> slot: its inner img must fill the slot (build-pitfalls §1) */
.hero__photo--5 img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* Mobile geometry (÷ 375 / ÷ 542) — photos 1 and 4 are desktop-only (D-HERO-4) */
.hero__photo--1,
.hero__photo--4 { display: none; }

.hero__photo--2 { left: -3.2%;    top: 17.446%; width: 29.867%; height: 20.664%; }
.hero__photo--3 { left: -3.2%;    top: 41.063%; width: 29.867%; height: 27.675%; }
.hero__photo--5 { left: 30.933%; top: 0;        width: 50.133%; height: 100%; }
.hero__photo--6 { left: 85.333%; top: 17.446%; width: 40%;      height: 36.9%; }

/* D-HERO-5: one line that always fills the band, overflow split evenly */
.hero__wordmark {
  display: flex;
  justify-content: center;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: calc(100cqw * 56 / 375);
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
}

/* ---------- Pseudo-tablet 768-1023 (no Figma layer — FD-BL) ----------
   intro: stack (measure-limited) · collage: desktop-compressed · wordmark: desktop-compressed */
@media (min-width: 768px) {
  .hero {
    --hero-gap-sub: clamp(24px, calc(24px + (var(--max-vw) - 768px) * 0.025), 24px);
    --hero-gap-actions: clamp(29.88px, calc(29.88px + (var(--max-vw) - 768px) * 0.025), 32px);
    --hero-gap-btn: clamp(16px, calc(16px + (var(--max-vw) - 768px) * 0.025), 16px);
    --hero-gap-band: clamp(48px, calc(48px + (var(--max-vw) - 768px) * 0.025), 48px);
  }

  .hero__title { font-size: var(--text-h1); }

  .hero__collage { aspect-ratio: 1440 / 724; }

  /* Desktop geometry (÷ 1440 / ÷ 724) */
  .hero__photo--1,
  .hero__photo--4 { display: block; }

  .hero__photo--1 { left: -6.296%;  top: 7.459%;  width: 21.944%; height: 65.608%; }
  .hero__photo--2 { left: 16.76%;   top: 13.061%; width: 15%;     height: 29.834%; }
  .hero__photo--3 { left: 16.76%;   top: 45.105%; width: 15%;     height: 39.779%; }
  .hero__photo--4 { left: 32.871%;  top: 23.302%; width: 21.944%; height: 43.646%; }
  .hero__photo--5 { left: 55.926%;  top: 0;       width: 30%;     height: 100%; }
  .hero__photo--6 { left: 87.037%;  top: 13.061%; width: 21.944%; height: 58.287%; }

  .hero__wordmark { line-height: 1.21; }
}

/* ---------- Desktop 1024+ (scaled from 1440, capped at 1920) ---------- */
@media (min-width: 1024px) {
  .hero {
    --hero-gap-sub: clamp(17px, calc(24px * (var(--max-vw) / var(--vw-base))), 32px);
    --hero-gap-actions: clamp(23px, calc(32px * (var(--max-vw) / var(--vw-base))), 43px);
    --hero-gap-btn: clamp(11px, calc(16px * (var(--max-vw) / var(--vw-base))), 21px);
    --hero-gap-band: clamp(34px, calc(48px * (var(--max-vw) / var(--vw-base))), 64px);
  }

  /* desktop copy has two spaces around each separator: +1 Inter space per side */
  .hero__sep { margin-inline: 0.28125em; }

  /* page token (216 @1440, 288 cap), guarded against a band narrower than the viewport */
  .hero__wordmark { font-size: min(var(--text-display), 15cqw); }
}
