/* ==========================================================================
   /3-tap and /es/prueba-3-toques only. Loaded after styles.css and mockup.css
   (the form reuses the mockup form styles) and reads their tokens; nothing
   here changes another page.
   ========================================================================== */

/* ---------- Hero ---------- */
.tap-hero .page-hero__title { max-width: 15ch; margin-top: var(--s-5); }
.tap-hero__lede { color: color-mix(in srgb, var(--paper) 86%, transparent); max-width: 46ch; }
.tap-hero__note { font-size: var(--t-small); color: var(--muted-ink); }
.btn:hover .arrow--down { transform: translateY(3px); }

/* ---------- The test: steps left, the real phone screen right (desktop) ---------- */
.tap-grid { display: grid; gap: var(--s-7); }
.tap-steps { counter-reset: none; }
.tap-step { display: grid; gap: var(--s-5); padding-block: var(--s-7); border-top: 1px solid var(--text); }
.tap-step:first-child { padding-top: var(--s-6); }
.tap-step__head { display: flex; align-items: flex-end; gap: var(--s-5); }
.tap-step__n { font-family: var(--f-display); font-size: clamp(4.5rem, 3.5rem + 4vw, 7rem); line-height: 0.78; color: var(--brick); font-variant-numeric: tabular-nums; }
.tap-step__title { font-family: var(--f-display); font-weight: 400; font-size: var(--t-title); line-height: var(--lh-title); letter-spacing: var(--track-display); }
.tap-step__label { display: block; margin-bottom: var(--s-2); font-family: var(--f-body); font-size: var(--t-small); font-weight: 600; letter-spacing: 0; color: var(--muted); }
.tap-step__q { font-family: var(--f-serif); font-style: italic; font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.875rem); line-height: 1.25; max-width: 30ch; }
.tap-checks { display: grid; gap: var(--s-6); }
@media (min-width: 40rem) { .tap-checks { grid-template-columns: 1fr 1fr; gap: var(--s-6) var(--s-7); } }
.tap-eg { display: grid; gap: var(--s-2); padding-left: var(--s-4); border-left: 2px solid var(--brick); max-width: var(--measure); font-size: var(--t-small); line-height: 1.5; }
.tap-eg__label { font-size: var(--t-caption); font-weight: 700; color: var(--brick); }
.tap-sms { margin-top: var(--s-2); }
.tap-sms span { display: inline-block; max-width: 30ch; padding: var(--s-3) var(--s-4); border-radius: 18px 18px 18px 4px; background: var(--ink); color: var(--paper); font-size: var(--t-small); line-height: 1.4; }
.tap-rule { margin-top: var(--s-2); padding-top: var(--s-6); border-top: 1px solid var(--text); font-family: var(--f-display); font-size: var(--t-title); line-height: var(--lh-title); text-wrap: balance; }

/* Real screen, cropped to the part each tap is about (phones and tablets) */
.tap-crops { display: grid; gap: var(--s-2); width: 100%; max-width: 24rem; }
.tap-crop { position: relative; overflow: hidden; border-radius: var(--radius-card); background: #000; box-shadow: 0 0 0 1px var(--rule); }
.tap-crop::before { content: ""; display: block; padding-top: calc(204.36% * (var(--b) - var(--a))); } /* 797 / 390 of the width, times the slice */
.tap-crop .tap-screen { position: absolute; inset: 0 0 auto 0; transform: translateY(calc(var(--a) * -100%)); }

/* The screen and its tap targets (shared by the crops and the desktop phone) */
.tap-screen { position: relative; }
.tap-screen img { width: 100%; height: auto; display: block; }
.tap-hit { position: absolute; border: 2px solid var(--brick-ink); box-shadow: 0 0 0 3px rgba(18, 18, 18, 0.45); pointer-events: none; }
.tap-hit--round { border-radius: 50%; }
.tap-hit--pill { border-radius: 999px; }
.tap-hit--box { border-radius: var(--radius-card); }
/* The touch dot, like a screen recording that shows taps */
.tap-hit i { position: absolute; left: 50%; top: 50%; width: 2.25rem; height: 2.25rem; margin: -1.125rem 0 0 -1.125rem; border-radius: 50%; background: rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); opacity: 0; }
.tap-hit--box i { display: none; }
@keyframes tap-press {
  0% { opacity: 0; transform: scale(1.5); }
  30% { opacity: 1; transform: scale(1); }
  65% { opacity: 1; transform: scale(0.88); }
  100% { opacity: 0; transform: scale(1.35); }
}
.tap-crop.is-on .tap-hit i { animation: tap-press 1.2s var(--ease-out) 0.2s both; }

/* ---------- Desktop: sticky phone that follows the step you're reading ---------- */
.tap-stage-col { display: none; }
@media (min-width: 60rem) {
  .tap-grid { grid-template-columns: minmax(0, 1fr) 21rem; gap: var(--s-9); }
  .tap-crops { display: none; }
  .tap-stage-col { display: block; }
  .tap-stage { position: sticky; top: calc(var(--header-h) + var(--s-5)); display: grid; justify-items: center; gap: var(--s-4); padding-top: var(--s-6); }
  .tap-steps.is-live .tap-step { opacity: 0.4; transition: opacity var(--d-slow) var(--ease-out); }
  .tap-steps.is-live .tap-step.is-active { opacity: 1; }
}
.tap-phone { width: min(18.5rem, calc((100svh - var(--header-h) - 11rem) * 0.47)); }
.tap-phone .phone__view { position: relative; }
.tap-zoom { height: 100%; transition: transform 900ms var(--ease-out); }
.tap-stage .tap-screen, .tap-stage .tap-screen img { height: 100%; }
/* Taps 2 and 3: zoom 8% toward the tap, keeping that point still: translate = (centre - point) x (scale - 1) */
.tap-stage[data-active="1"] .tap-zoom { transform: none; } /* tap 1 has a target at the top and the bottom: show the whole screen */
.tap-stage[data-active="2"] .tap-zoom { transform: translate(calc((50% - var(--fx2)) * 0.08), calc((50% - var(--fy2)) * 0.08)) scale(1.08); }
.tap-stage[data-active="3"] .tap-zoom { transform: translate(calc((50% - var(--fx3)) * 0.08), calc((50% - var(--fy3)) * 0.08)) scale(1.08); }
.tap-stage .tap-hit { opacity: 0; transform: scale(1.15); transition: opacity var(--d-base) var(--ease-out), transform var(--d-slow) var(--ease-out); }
.tap-stage[data-active="1"] .tap-hit[data-for="1"],
.tap-stage[data-active="2"] .tap-hit[data-for="2"],
.tap-stage[data-active="3"] .tap-hit[data-for="3"] { opacity: 1; transform: none; transition-delay: 0.25s; }
.tap-stage[data-active="1"] .tap-hit[data-for="1"] i,
.tap-stage[data-active="3"] .tap-hit[data-for="3"] i { animation: tap-press 1.2s var(--ease-out) 0.6s both; }
.tap-stage[data-active="1"] .tap-hit[data-for="1"] + .tap-hit[data-for="1"] i { animation-delay: 1.4s; }

/* The text it opens (tap 3) */
.tap-msg { position: absolute; left: -2.5rem; bottom: 34%; z-index: 3; width: 14rem; padding: var(--s-3) var(--s-4); border-radius: 18px 18px 18px 4px; background: var(--paper); color: var(--text); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--rule); opacity: 0; transform: translateY(12px); transition: opacity var(--d-base) var(--ease-out), transform var(--d-slow) var(--ease-out); pointer-events: none; }
.tap-stage[data-active="3"] .tap-msg { opacity: 1; transform: none; transition-delay: 1.2s; }
.tap-msg__label { font-size: var(--t-caption); color: var(--muted); margin-bottom: var(--s-1); }
.tap-msg__text { font-size: var(--t-small); line-height: 1.4; }

.tap-stage__cap { display: grid; gap: var(--s-2); width: 100%; max-width: 19rem; text-align: center; }
.tap-caps { display: grid; }
.tap-cap { grid-area: 1 / 1; font-size: var(--t-small); font-weight: 600; line-height: 1.4; opacity: 0; transition: opacity var(--d-base) var(--ease-out); }
.tap-stage[data-active="1"] .tap-cap[data-for="1"],
.tap-stage[data-active="2"] .tap-cap[data-for="2"],
.tap-stage[data-active="3"] .tap-cap[data-for="3"] { opacity: 1; }
.tap-stage__src { font-size: var(--t-caption); color: var(--muted); }
.tap-stage__src a { color: var(--text); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 0.35em; border-bottom: 1px solid currentColor; padding-block: var(--s-1) 0; }
.tap-stage__src a:hover { color: var(--brick); }

/* Without JS the phone shows every target at once and no step captions */
.tap-stage:not(.is-live) .tap-hit { opacity: 1; transform: none; }
.tap-stage:not(.is-live) .tap-zoom { transform: none; }
.tap-stage:not(.is-live) .tap-caps, .tap-stage:not(.is-live) .tap-msg { display: none; }
/* Opens from a slit once motion is on; tap.js runs the reveal. */
html.motion:not(.motion-ready) .tap-phone { clip-path: inset(46% 0 46% 0 round 24px); }

/* ---------- Score ---------- */
.tap-scores { display: grid; }
.tap-score { display: grid; gap: var(--s-2); padding-block: var(--s-5); border-top: var(--hair-ink); }
.tap-score dt { font-family: var(--f-display); font-size: var(--t-title); line-height: var(--lh-title); color: var(--brick-ink); }
.tap-score dd { color: color-mix(in srgb, var(--paper) 86%, transparent); max-width: 40ch; }
@media (min-width: 48rem) { .tap-scores { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s-6); } }
.tap-next { display: grid; gap: var(--s-4); justify-items: start; margin-top: var(--s-7); }
.tap-next__small { font-size: var(--t-small); color: var(--muted-ink); max-width: 52ch; }

/* ---------- Final call to action: a longer sentence than other pages ---------- */
.tap-cta__title { font-size: clamp(2.75rem, 1.6rem + 5.4vw, 6.75rem); max-width: 18ch; }
/* Spanish capitals carry accents (Á, Ñ) that touch the line above at the site's tight leading */
html[lang="es"] .tap-test .h-section, html[lang="es"] .tap-cta__title { line-height: 1.12; }

@media (prefers-reduced-motion: reduce) {
  .tap-zoom, .tap-stage .tap-hit, .tap-msg, .tap-cap, .tap-steps.is-live .tap-step { transition: none !important; }
  .tap-stage[data-active] .tap-zoom { transform: none; }
  .tap-hit i { animation: none !important; opacity: 0 !important; }
}
