/* ==================================================================
   Player Experience — kwizzbit/player-experience (whole-file segment)
   Faithful slice of /HTML/player-experience.html. Globals (reset/body/font-face/:root)
   dropped; tokens canonical (theme.json). Full-bleed via the .kwb-segment wrapper.
   ================================================================== */

.player-experience {
  background-color: var(--wp--preset--color--blood-orange);
  /* reduced TOP so it sits tighter under impact (same blood-orange block); bottom kept */
  padding-block: clamp(3.5rem, 6vw, 5.5rem) clamp(5.25rem, 9vw, 9rem);
  overflow-x: clip; /* iOS safe — no overflow-x:hidden on section */
}

/* Container */
.player-experience__inner {
  max-width: var(--wp--custom--layout--page-max);
  margin-inline: auto;
  padding-inline: var(--wp--custom--layout--gutter);
}

/* Cap the desktop 2×2 block so photos don't get oversized */
.player-experience__layout {
  max-width: 998px;
  margin-inline: auto;
}

/* ── Desktop grid: unified 2×2 — text top-left, photos fill the other 3 cells ── */
.player-experience__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: clamp(1.25rem, 2.5vw, 2.5rem);
  row-gap: 12px;
  align-items: stretch;
}

/* ── Top-left cell: copy ── */
.player-experience__copy {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  padding-top: 0;
  padding-right: clamp(0.5rem, 2vw, 2rem);
}

.player-experience__eyebrow {
  font-family: var(--wp--preset--font-family--pixel);
  font-size: var(--wp--preset--font-size--h-8-eyebrow);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--wp--preset--color--bright-yellow);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  /* WP: editable as Paragraph with Pixelar font applied */
}

.player-experience__headline {
  font-family: var(--wp--preset--font-family--display);
  font-size: clamp(2.75rem, 4.5vw, 4.0625rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.10769em;
  color: var(--wp--preset--color--white);
  margin-bottom: 0.5rem;
}

/* "love" accent word — bright yellow */
.player-experience__headline em {
  font-style: normal;
  color: var(--wp--preset--color--bright-yellow);
}

/* Headline period acts as a flashing cursor — matches site-wide pattern */
.player-experience__cursor {
  display: inline-block;
  animation: pe-cursor-blink 1s steps(1, end) infinite;
}
@keyframes pe-cursor-blink {
  0%, 50%      { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .player-experience__cursor { animation: none; opacity: 1; }
}

.player-experience__body {
  font-family: var(--wp--preset--font-family--body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.412;
  color: var(--wp--preset--color--white);
  max-width: 394px;
  opacity: 0.9;
}

/* ── Photos wrapper dissolves so children become items of the parent 2×2 grid ── */
.player-experience__photos {
  display: contents;
}

.player-experience__photo {
  overflow: hidden;
  /* WP note: border-radius 0 per site convention */
  border-radius: 0;
  position: relative;
}

/* Top-right photo */
.player-experience__photo--top {
  grid-column: 2;
  grid-row: 1;
  translate: -10px 0;
  animation: pe-float 5s ease-in-out infinite;
}

/* Bottom row */
.player-experience__photo--bottom-left {
  grid-column: 1;
  grid-row: 2;
  animation: pe-float 5s ease-in-out infinite;
  animation-delay: -2.5s;
}
.player-experience__photo--bottom-right {
  grid-column: 2;
  grid-row: 2;
  animation: pe-float 5s ease-in-out infinite;
  animation-delay: -2.5s;
}

.player-experience__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* WP: src attribute replaced with media library URL + srcset */
}

/* Aspect ratios — match Sketch composition */
.player-experience__photo--top       { aspect-ratio: 16 / 11; }
.player-experience__photo--bottom-left  { aspect-ratio: 4 / 3; }
.player-experience__photo--bottom-right { aspect-ratio: 4 / 3; }

/* Mobile-only strip — hidden by default */
.player-experience__photo--mobile-strip { display: none; }

/* Subtle floating loop — used on mobile, offset so the two images move opposite directions */
@keyframes pe-float {
  0%, 100% { transform: translate(-1px, -2px); }
  25%      { transform: translate(1px, -1px); }
  50%      { transform: translate(1px,  2px); }
  75%      { transform: translate(-1px, 1px); }
}

/* ── Scroll-reveal states ──
   Copy uses transform; photos use the `translate` property so the float
   `transform` animation can run independently. */
.player-experience__copy {
  opacity: 0;
  transform: translateY(var(--wp--custom--motion--scroll-reveal-distance));
  transition:
    opacity   var(--wp--custom--motion--scroll-reveal-duration) var(--wp--custom--motion--ease-out),
    transform var(--wp--custom--motion--scroll-reveal-duration) var(--wp--custom--motion--ease-out);
}
.player-experience__copy.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.player-experience__photo {
  opacity: 0;
  translate: 0 var(--wp--custom--motion--scroll-reveal-distance);
  transition:
    opacity   var(--wp--custom--motion--scroll-reveal-duration) var(--wp--custom--motion--ease-out),
    translate var(--wp--custom--motion--scroll-reveal-duration) var(--wp--custom--motion--ease-out);
}
.player-experience__photo.is-visible {
  opacity: 1;
  translate: 0 0;
}
/* Top-right photo keeps its -10px X offset through the reveal */
.player-experience__photo--top {
  translate: -10px var(--wp--custom--motion--scroll-reveal-distance);
}
.player-experience__photo--top.is-visible {
  translate: -10px 0;
}

/* Stagger the photos behind the copy */
.player-experience__photo--top          { transition-delay: 0.10s; }
.player-experience__photo--bottom-left  { transition-delay: 0.20s; }
.player-experience__photo--bottom-right { transition-delay: 0.20s; }
.player-experience__photo--mobile-strip { transition-delay: 0.20s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .player-experience__photo--top,
  .player-experience__photo--bottom-left,
  .player-experience__photo--bottom-right,
  .player-experience__photo--mobile-strip {
    animation: none !important;
  }
  .player-experience__copy,
  .player-experience__photo {
    opacity: 1;
    transform: none;
    translate: 0 0;
    transition: none;
  }
  .player-experience__photo--top {
    translate: -10px 0;
  }
}

/* ============================================================
   TABLET — ≤1023px
   Keep two-column layout but compress proportions
   ============================================================ */
@media (max-width: 1023px) {
  /* Keep the desktop 2×2 composition (text top-left, photos in the other 3 cells)
     and just compress proportions and typography for tablet */
  .player-experience__layout {
    column-gap: 1.25rem;
    row-gap: 10px;
  }

  .player-experience__headline {
    font-size: clamp(2rem, 4.5vw, 3rem);
  }

  .player-experience__eyebrow {
    font-size: 1.1875rem;
  }

  .player-experience__body {
    font-size: 15px;
    max-width: 300px;
  }
}

/* ============================================================
   MOBILE — ≤640px
   Single column: copy → exp1 (top) → exp2 (bottom-left + bottom-right)
   Per brief: stack 1 column, text then exp1 on top of exp2
   ============================================================ */
@media (max-width: 640px) {
  .player-experience {
    padding-block: 2rem 3rem;
  }

  .player-experience__layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .player-experience__copy {
    padding-top: 0;
    padding-right: 0;
    align-self: stretch;
    text-align: center;
  }

  .player-experience__eyebrow {
    font-size: 18px;
    margin-bottom: 0.25rem;
  }

  .player-experience__headline {
    font-size: clamp(1.875rem, 10.13vw, 2.375rem);
    line-height: 0.9;
    letter-spacing: -0.10763em;
    margin-bottom: 1rem;
  }

  .player-experience__body {
    font-size: 1rem;
    max-width: min(320px, 88vw);
    line-height: 1.5;
    margin-inline: auto;
  }

  /* Photos: full-width stack — exp1 on top, then exp2 as one combined strip below */
  .player-experience__photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    column-gap: 0;
    row-gap: 8px;
    width: 100%;
  }

  .player-experience__photo--top {
    grid-column: 1 / 3;
    grid-row: 1;
    aspect-ratio: 4 / 3;
    animation: pe-float 5s ease-in-out infinite;
    translate: -5px var(--wp--custom--motion--scroll-reveal-distance);
  }
  .player-experience__photo--top.is-visible {
    translate: -5px 0;
  }

  /* Hide the desktop crops; show the dedicated mobile strip instead */
  .player-experience__photo--bottom-left,
  .player-experience__photo--bottom-right {
    display: none;
  }
  .player-experience__photo--mobile-strip {
    display: block;
    grid-column: 1 / 3;
    grid-row: 2;
    animation: pe-float 5s ease-in-out infinite;
    animation-delay: -2.5s;
  }
}

/* ==================================================================
   SEAM GUARD — mobile & tablet only (desktop verified seam-free).
   Same class of bug as the mantra/use-cases seam fix (see button.css
   history + project memory): player-experience carries continuous
   animations (cursor blink, floating photos), which promotes it to
   its own GPU layer. The footer directly below is the same solid
   blood-orange. Two adjacent same-colour layers can round their
   shared edge independently on a high-DPR phone, exposing a 1-device-
   pixel seam even though layout math shows zero gap. Fix: pull the
   footer 1px up over player-experience's own padding so the rounding
   happens inside overlapping coral instead of at an exposed edge.
   ================================================================== */
@media (max-width: 1023px){
  .kwb-segment--player-experience{ margin-bottom: -1px; }
}
