/* ═══════════════════════════════════════════════════════════
   MASTERY IN THREE DIRECTIONS
   New section for the Production ("about") page.
   Sits after .about-process, before .stats-strip.

   Reuses design tokens from header.css (--gold, --font-head,
   --font-body, --ease, --t-base, --text-primary, --text-muted)
   and follows the same structural pattern as .about-process /
   .process-block, but is NOT a duplicate of it — the frame is
   an offset floating rectangle rather than an inset border, and
   the chapter numeral is much larger (per brief, ~180px).

   BEM naming: block = "mastery"
═══════════════════════════════════════════════════════════ */

.mastery {
  padding: 4rem 0 9rem;
  position: relative;
}

.mastery__header {
  max-width: 640px;
  margin: 0 auto 6rem;
  text-align: center;
}

.mastery__title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.15;
  margin-top: 1rem;
}

/* ── Chapter block ─────────────────────────────────────── */

.mastery__block {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}

.mastery__block + .mastery__block {
  margin-top: 11rem;
}

.mastery__block > * {
  min-width: 0;
}

/* Image left / text right (default) */
.mastery__block--img-left .mastery__media { order: 1; }
.mastery__block--img-left .mastery__content { order: 2; }

/* Text left / image right */
.mastery__block--img-right .mastery__media { order: 2; }
.mastery__block--img-right .mastery__content { order: 1; }

/* ── Media + floating gold frame (page signature) ─────────
   The frame sits BEHIND the photograph, offset — it must
   never touch the image itself.                            */

.mastery__media {
  position: relative;
}

.mastery__media::before {
  content: '';
  position: absolute;
  inset: 0;
  top: 38px;
  left: 38px;
  right: -38px;
  bottom: -38px;
  border: 1px solid rgba(201, 168, 76, 0.25);
  z-index: 0;
  transition: transform 0.9s var(--ease);
}

.mastery__block--img-right .mastery__media::before {
  left: -38px;
  right: 38px;
}

.mastery__media:hover::before {
  transform: translate(10px, -10px);
}

.mastery__frame {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.mastery__frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  transition: transform 0.9s var(--ease);
}

.mastery__media:hover .mastery__frame img {
  transform: scale(1.02);
}

/* ── Text content ──────────────────────────────────────── */

.mastery__content {
  position: relative;
}

.mastery__num {
  position: absolute;
  top: -4.5rem;
  left: -1rem;
  font-family: var(--font-head);
  font-size: clamp(7rem, 12vw, 11.25rem); /* ~180px on large screens */
  line-height: 1;
  color: rgba(201, 168, 76, 0.05);
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

.mastery__block--img-left .mastery__num { left: -1rem; }
.mastery__block--img-right .mastery__num { left: 0; }

.mastery__eyebrow,
.mastery__block-title,
.mastery__desc,
.mastery__link {
  position: relative;
  z-index: 1;
}

.mastery__block-title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.08;
  margin: 1rem 0 1.75rem;
}

.mastery__desc {
  color: var(--text-muted);
  font-family: var(--font-body);
  line-height: 2;
  max-width: 34rem;
}

/* ── Editorial CTA link ────────────────────────────────── */

.mastery__link {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2.5rem;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
}

.mastery__link-line {
  display: inline-block;
  width: 64px;
  height: 1px;
  background: var(--gold);
  position: relative;
  transition: width var(--t-base) var(--ease);
}

.mastery__link-line::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-top: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
  transform: rotate(45deg);
}

.mastery__link:hover .mastery__link-line {
  width: 88px;
}

/* ── Reveal-in animation (reuses site's IntersectionObserver
   pattern — .reveal-left / .reveal-right / .reveal-card
   already exist in header.css and are wired up by the
   existing reveal script; no new JS required) ───────────── */

.mastery__media.reveal-left,
.mastery__media.reveal-right {
  transition:
    opacity   0.9s var(--ease),
    transform 0.9s var(--ease);
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 1100px) {

  .mastery__block {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  .mastery__block--img-left .mastery__media,
  .mastery__block--img-left .mastery__content,
  .mastery__block--img-right .mastery__media,
  .mastery__block--img-right .mastery__content {
    order: unset;
  }

  .mastery__block + .mastery__block {
    margin-top: 7rem;
  }

  .mastery__num {
    top: -3rem;
  }
}

@media (max-width: 768px) {

  .mastery {
    padding: 2rem 0 6rem;
  }

  .mastery__header {
    margin-bottom: 4rem;
  }

  .mastery__media::before {
    top: 20px;
    left: 20px;
    right: -20px;
    bottom: -20px;
  }

  .mastery__block--img-right .mastery__media::before {
    left: -20px;
    right: 20px;
  }

  .mastery__num {
    font-size: 5.5rem;
    top: -2.25rem;
  }

  .mastery__block-title {
    font-size: 2.2rem;
  }
}
