/* Landing v4 · media and layout fixes from Joan's 20 nov review. Tokens from landing-v3.css. */

/* Width-matched fallback for the display face: if the preloaded Anton arrives after first paint, the swap keeps
   the hero line breaks. Average width Anton/Impact = 95.3 %; 96.5 % gave the lowest CLS across the 8 locales at
   390/1280 with fonts delayed 600 ms (max 0.017, against 0.18 with no fallback). */
@font-face { font-family: "NQ Anton Fallback"; src: local("Impact"); size-adjust: 96.5%; }
:root { --display: Anton, "NQ Anton Fallback", Impact, sans-serif; }
.landing-v3 #atletas { scroll-margin-top: 88px; }

/* Shared 9:16 frame for real footage and stills. Sizes are reserved by width/height + aspect-ratio. */
.ux4-film-frame, .ux4-shot {
  position: relative;
  margin: 0;
  border: 4px solid var(--dark);
  border-radius: 14px;
  background: var(--dark);
  overflow: hidden;
}
.ux4-film-frame video, .ux4-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--dark);
}
.ux4-film-live, .ux4-film-cue, .ux4-film-step { position: absolute; z-index: 2; pointer-events: none; }
.ux4-film-live {
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  background: #11120fe8;
  color: #b6edce;
  font: 800 11px/1.22 var(--body);
  letter-spacing: .04em;
}
.ux4-film-cue { right: 6%; bottom: 7%; left: 6%; margin: 0; text-align: center; }
.ux4-film-cue span {
  display: inline-block;
  padding: 5px 9px;
  background: #11120fe8;
  color: #fff9e8;
  font: 750 16px/1.25 var(--body);
}
.ux4-film-step {
  bottom: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  padding: 6px 9px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.05rem/1.1 var(--display);
}
.ux4-play {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 10px;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--paper);
  border-radius: 50%;
  background: #11120fd9;
  color: var(--paper);
  font-size: .8rem;
  cursor: pointer;
}
.ux4-coach-film .ux4-play { top: 10px; bottom: auto; }
.ux4-sound {
  position: absolute;
  z-index: 3;
  top: 42px;
  left: 10px;
  max-width: calc(100% - 20px);
  min-height: 35px;
  border: 1px solid #aedec0;
  border-radius: 5px;
  padding: 5px 9px;
  background: #bceccc;
  color: #11120f;
  font: 750 .82rem/1.2 var(--body);
  cursor: pointer;
}
.ux4-sound[aria-pressed="true"] { background: #11120f; color: #dcf9e5; }

/* Seal line under the hero CTA and the method quote. */
.ux4-seal { margin: 1rem 0 0; max-width: 46ch; font-size: .8rem; line-height: 1.4; color: var(--dim); }
.section-light .ux4-seal { color: var(--muted); }
#metodo .ux4-seal {
  margin: calc(.55rem - clamp(26px, 4.5vw, 52px)) 0 clamp(26px, 4.5vw, 52px);
  padding-inline-start: calc(clamp(16px, 3vw, 28px) + 3px);
}

/* Pain: four concrete faults, the alternatives and the test. */
.landing-v3 #por-que { scroll-margin-top: 88px; }
.ux4-pain-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(14px, 2vw, 22px) clamp(18px, 3vw, 40px);
  margin: clamp(18px, 3vw, 30px) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: ux4-pain;
}
.ux4-pain-grid li {
  position: relative;
  min-width: 0;
  padding: .1rem 0 0 3rem;
  counter-increment: ux4-pain;
}
.ux4-pain-grid li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 1.95rem;
  content: counter(ux4-pain);
  border: 1.5px solid var(--ink);
  border-radius: 52% 46% 49% 45%;
  font: 400 1.05rem/1 var(--display);
  transform: rotate(-6deg);
}
.ux4-pain-grid h3 { margin: 0 0 .35rem; font: 400 clamp(1.2rem, 1.9vw, 1.55rem)/1.12 var(--display); }
.ux4-pain-grid p { margin: 0; }
.ux4-pain-close {
  display: grid;
  gap: 1rem;
  align-items: center;
  margin-block-start: clamp(22px, 3.4vw, 40px);
  padding: clamp(14px, 2.4vw, 24px);
  border-inline-start: 3px solid var(--ink);
  background: #f8f6ef;
}
.ux4-pain-close p { margin: 0; max-width: 62ch; font-weight: 750; }
.ux4-pain-close .button { justify-self: start; background: var(--dark); color: var(--paper); border-color: var(--dark); }

/* Proof: real athletes and the range of the route, right after the pain. */
.ux4-proof .section-heading { margin-block-end: clamp(18px, 3vw, 34px); }
.ux4-proof .ux4-film-frame { border-color: var(--steel); }
.ux4-proof-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ux4-proof-tile figure { margin: 0; }
.ux4-proof-tile figcaption { display: grid; gap: .15rem; margin-top: .6rem; font-size: .9rem; line-height: 1.3; }
.ux4-proof-tile figcaption b { font: 400 1.15rem/1.15 var(--display); letter-spacing: .01em; }
.ux4-proof-tile[data-proof="sergi"] .ux4-film-frame { border-color: var(--sand); }
/* Three tiles (bar, rings, handstand) read as one row, also on a phone. */
.ux4-proof-grid[data-tiles="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 2vw, 24px); }
.ux4-proof-grid[data-tiles="3"] figcaption b { font-size: clamp(.92rem, 3.4vw, 1.15rem); }
.ux4-proof-grid[data-tiles="3"] .ux4-play { min-width: 32px; min-height: 32px; right: 6px; bottom: 6px; }

/* How it works. Phone: «antes» and «durante» as media + text rows, «después» full width.
   From 640 px the visuals share one aligned row (subgrid); the layer legend runs full width below. */
.ux4-how .ux4-moments {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(22px, 5vw, 32px) clamp(12px, 2.4vw, 28px);
  border-top: 1px solid var(--line);
  padding-top: clamp(20px, 3vw, 36px);
}
.ux4-how .ux4-moment {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "media title" "media notes";
  gap: .85rem clamp(12px, 3.5vw, 18px);
  align-items: start;
  min-width: 0;
  padding: 0;
  border: 0;
}
.ux4-how .ux4-moment[data-moment="after"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas: "title" "media";
}
.ux4-how .ux4-moment h3 { font-size: clamp(1.35rem, 2.3vw, 2.15rem); line-height: 1.08; }
.ux4-how .ux4-moment .ux2-result { font-weight: 450; }
.ux4-how .ux4-moment .ux2-result + .text-link { display: inline-block; margin-top: .6rem; }
.ux4-how .ux4-during .ux4-film-cue span { font-size: clamp(11px, 3.2vw, 16px); }
.ux4-how .ux4-moment > figure { width: 100%; max-width: 300px; margin: 0; }
.ux4-how .ux4-moment[data-moment="after"] > figure { justify-self: center; }
.ux4-how .phantom-stage { width: 100%; }
.ux4-how .ux4-layers { max-width: 62ch; margin-top: clamp(18px, 3vw, 30px); }
.ux4-how .ux4-layers > p:not(#metodo-readout) { margin: 0 0 .7rem; }

/* Live coach: the example session next to the voice console. */
.ux4-coach .section-heading { margin-block-end: clamp(18px, 3vw, 34px); }
.ux4-coach-grid { display: grid; gap: clamp(18px, 4vw, 52px); align-items: start; }
.ux4-coach-film { width: min(100%, 340px); margin: 0 auto; }
.ux4-coach-film figcaption { margin-top: .5rem; color: var(--dim); font-size: .85rem; }
.ux4-coach-console { min-width: 0; }
.ux4-coach .ux2-actions { margin-block-start: clamp(20px, 3vw, 36px); }

/* Method: the whole progression in one fast loop, no buttons. */
#metodo .ux4-progression figure { width: min(100%, 300px); max-width: 300px; justify-self: center; }
#metodo .ux4-progression video { aspect-ratio: 9 / 16; }
.ux4-steps {
  display: grid;
  margin: 1.1rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
  counter-reset: ux4-step;
}
/* A progress indicator that follows the film, not a set of buttons. */
.ux4-steps li {
  position: relative;
  padding: .5rem .5rem .5rem 3rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  counter-increment: ux4-step;
  font-weight: 750;
  transition: color .2s, box-shadow .2s;
}
.ux4-steps li::before {
  position: absolute;
  top: 50%;
  left: .9rem;
  content: counter(ux4-step, decimal-leading-zero);
  font: 400 1rem/1 var(--display);
  transform: translateY(-50%);
}
.ux4-steps li[aria-current="step"] { color: var(--ink); box-shadow: inset 4px 0 0 var(--ink); }

@media (min-width: 640px) {
  .ux4-how .ux4-moments { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 0; }
  .ux4-how .ux4-moment, .ux4-how .ux4-moment[data-moment="after"] {
    grid-row: span 2;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: subgrid;
    grid-template-areas: "title" "media";
    row-gap: .85rem;
  }
  .ux4-how .ux4-moment[data-moment="after"] { grid-column: 1 / -1; margin-top: clamp(26px, 5vw, 40px); }
  .ux4-pain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ux4-pain-close { grid-template-columns: minmax(0, 1fr) auto; }
  .ux4-pain-close .button { justify-self: end; }
}
@media (min-width: 900px) {
  .ux4-proof-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ux4-proof-grid[data-tiles="3"] { grid-template-columns: repeat(3, minmax(0, 300px)); }
  .ux4-proof-grid[data-tiles="3"] .ux4-play { min-width: 38px; min-height: 38px; right: 10px; bottom: 10px; }
  .ux4-how .ux4-moments { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ux4-how .ux4-moment[data-moment="after"] { grid-column: auto; margin-top: 0; }
  .ux4-how .ux4-moment[data-moment="after"] > figure { justify-self: start; }
  .ux4-how .ux4-layers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .2rem clamp(16px, 2.4vw, 28px);
    max-width: none;
    padding-top: clamp(16px, 2.4vw, 24px);
    border-top: 1px solid var(--line);
  }
  .ux4-how .ux4-layers > :is(.ux2-label, p:not(#metodo-readout), .metodo-legend) { grid-column: 1 / -1; }
  .ux4-how .ux4-layers .metodo-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem clamp(16px, 2.4vw, 28px); }
  .ux4-how .ux4-layers #metodo-readout { grid-column: 1; align-self: center; }
  .ux4-how .ux4-layers .ux2-priority { grid-column: 2 / -1; margin-block-start: .55rem; }
  .ux4-coach-grid { grid-template-columns: 340px minmax(0, 1fr); }
  .ux4-coach-film { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ux4-steps li { transition: none; }
}
