/* Presentación Bloqueo Fútbol. Monocromo: el naranja queda para los resaltados. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #fafafa;
  --fg: #111;
  --muted: #5c5c5c;
  --line: #e0e0e0;
  --accent: #ff5a1f;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --fade: 300ms;
  --zoom: 700ms;
  --draw: 500ms;
  --swap: 450ms;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;

  /* 40 px a 1920×1080, como pide el guion */
  --text: clamp(18px, min(2.08vw, 3.7vh), 40px);
  --title: clamp(24px, min(3vw, 5.4vh), 58px);
  --gutter: clamp(16px, 3vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--text)/1.3 var(--font);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* Enlace para salir de la guía y volver a la web */

.top { padding: 8px var(--gutter) 0; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  font: 500 14px/1 var(--font);
  color: var(--muted);
  text-decoration: none;
}

.back svg { width: 14px; height: 14px; }

.back:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 6px; }

@media (hover: hover) {
  .back:hover { color: var(--fg); }
}

/* Diapositivas */

.deck { position: relative; min-height: 0; }

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 34fr) minmax(0, 66fr);
  gap: var(--gutter);
  padding: var(--gutter);
  padding-bottom: calc(var(--gutter) / 2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--fade) ease, visibility 0s linear var(--fade);
}

.slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--fade) ease;
}

.copy {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.head {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.step {
  font: 500 var(--text)/1 var(--mono);
  color: var(--muted);
}

h2 {
  font-size: var(--title);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.path { color: var(--muted); text-wrap: balance; }

.lead { text-wrap: pretty; }
.lead b { font-weight: 700; }

.slide-wide { grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); }

/* Los fragmentos comparten celda para que el texto no mueva nada al cambiar */
.frags {
  display: grid;
  margin-top: auto;
  padding-top: 0.6em;
  list-style: none;
}

.frags li {
  grid-area: 1 / 1;
  align-self: end;
  font-weight: 500;
  text-wrap: balance;
  opacity: 0;
  transition: opacity var(--fade) ease;
}

.frags li.is-current { opacity: 1; }
.frags b { font-weight: 700; }

/* Los valores que en móvil no se pueden leer en la captura */
.phone-only { display: none; }

@media (max-width: 900px) {
  .phone-only {
    display: block;
    margin-top: 0.3em;
    font-size: 0.85em;
  }
}

.frags code {
  font: 500 0.82em/1.3 var(--mono);
  overflow-wrap: anywhere;
}

.frags a {
  color: var(--fg);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
}

[data-at] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--fade) ease, transform var(--fade) var(--ease);
}

[data-at].is-in {
  opacity: 1;
  transform: none;
}

.wait {
  height: 6px;
  max-width: 16em;
  margin-top: 0.3em;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.wait span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.slide.is-active .wait span { animation: wait 6s var(--ease) forwards; }

@keyframes wait { to { transform: scaleX(0.92); } }

.end-icon {
  width: clamp(56px, min(6vw, 11vh), 112px);
  height: auto;
}

/* Capturas */

.frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.shot {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  transition: transform var(--zoom) var(--ease);
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.is-resizing .shot { transition: none; }

.frame-phone .shot {
  border-radius: 4.5% / 2.6%;
  overflow: hidden;
}

.shot img, .shot svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.shot img + img {
  opacity: 0;
  transition: opacity var(--swap) ease;
}

.shot img.is-shown { opacity: 1; }

.shot-hint {
  font: 500 15px var(--mono);
  fill: #5c5c5c;
}

.mark {
  fill: none;
  stroke: var(--accent);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset var(--draw) var(--ease), opacity var(--fade) ease, y var(--zoom) var(--ease);
}

.mark.is-on, .slide.is-active .mark-all { stroke-dashoffset: 0; }
.mark.is-past { opacity: 0; }

/* Diapositivas solo de texto */

.slide-text { grid-template-columns: minmax(0, 1fr); }

.slide-text .copy { max-width: 62rem; width: 100%; }

.needs, .todo {
  display: grid;
  gap: 0.7em;
  margin-top: auto;
  list-style: none;
  font-size: var(--title);
  line-height: 1.15;
  font-weight: 500;
}

.needs { gap: 0.5em; }

.needs li {
  display: grid;
  grid-template-columns: 1.3em minmax(0, 1fr) 1em;
  align-items: center;
  gap: 0.6em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--line);
}

.need-icon, .tick { display: block; width: 100%; height: auto; }
.tick { color: var(--accent); }

.todo { counter-reset: todo; }

.todo li {
  display: grid;
  grid-template-columns: 1.4em minmax(0, 1fr);
  counter-increment: todo;
  font-size: calc(var(--title) * 0.74);
}

.todo li::before {
  content: counter(todo);
  font: 500 0.8em/1.45 var(--mono);
  color: var(--muted);
}

.todo b { font-weight: 700; }

.cta {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  margin-top: auto;
}

.install {
  display: inline-block;
  align-self: flex-start;
  padding: 0.7em 1.4em;
  border-radius: 999px;
  background: var(--fg);
  color: #fff;
  font-size: var(--title);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: transform 140ms var(--ease), background-color 140ms ease;
}

.install:active { transform: scale(0.98); }
.install:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

/* Portada */

.slide-cover {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  padding-left: clamp(16px, 9vw, 180px);
  padding-right: var(--gutter);
}

.cover-icon {
  width: clamp(72px, min(8vw, 14vh), 132px);
  height: auto;
  margin-bottom: 0.9em;
}

h1 {
  font-size: clamp(48px, min(9.5vw, 17vh), 176px);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.cover-sub {
  margin-top: 0.8em;
  max-width: 24em;
  font-size: clamp(21px, min(2.6vw, 4.6vh), 50px);
  line-height: 1.2;
  text-wrap: balance;
}

.cover-meta {
  margin-top: 1.2em;
  font: 500 var(--text)/1.3 var(--mono);
  color: var(--muted);
}

.nowrap { white-space: nowrap; }

/* Barra inferior */

.bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px var(--gutter);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.btn {
  justify-self: start;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--fg);
  font: 500 clamp(16px, 1.1vw, 20px)/1 var(--font);
  cursor: pointer;
  transition: transform 140ms var(--ease), background-color 140ms ease, opacity 140ms ease;
}

.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.btn:disabled { opacity: 0.35; cursor: default; }

.btn-next {
  justify-self: end;
  border-color: var(--fg);
  background: var(--fg);
  color: #fff;
}

@media (hover: hover) {
  .install:hover { background: #333; }
  .btn:not(:disabled):hover { background: #f0f0f0; }
  .btn-next:not(:disabled):hover { background: #333; }
}

.count {
  font: 500 clamp(14px, 1vw, 18px)/1 var(--mono);
  color: var(--muted);
}

.progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
}

.progress span {
  display: block;
  height: 100%;
  background: var(--fg);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform var(--fade) var(--ease);
}

/* Vertical: el texto arriba, la captura en medio y el rótulo debajo */

@media (max-aspect-ratio: 1/1) {
  .slide:has(.frame) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
  }

  .slide:has(.frame) .copy { display: contents; }
  .head { grid-row: 1; }
  .frame { grid-row: 2; }

  .slide:has(.frame) .frags {
    grid-row: 3;
    margin-top: 0;
    padding-top: 0;
    min-height: 2.6em;
  }

  .slide:has(.frame) .frags li { align-self: start; }
}

/* Móvil en horizontal: las listas pasan al lado del título */

@media (max-height: 480px) and (min-aspect-ratio: 1/1) {
  .phone-only { font-size: 0.78em; line-height: 1.2; }

  .slide-text .copy {
    display: grid;
    grid-template-columns: minmax(0, 34fr) minmax(0, 66fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: var(--gutter);
    max-width: none;
  }

  .slide-text .frags { grid-column: 1; grid-row: 2; align-self: end; }

  .slide-text .needs, .slide-text .todo, .slide-text .cta {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: start;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --fade: 0ms; --zoom: 0ms; --draw: 0ms; --swap: 0ms; }
}
