/* Hoja de ejercicios de Dani López — estilos compartidos (portada, zona, privacidad, panel) */

@font-face {
  font-family: "Atkinson Next";
  src: url("/fuentes/atkinson-next.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Boli";
  src: url("/fuentes/patrick-hand.woff2") format("woff2");
  font-display: swap;
}

:root {
  --camilla: #1f4553;        /* skai de la camilla, debajo de la hoja */
  --camilla-oscura: #163541;
  --papel: #eff1ed;          /* fotocopia, fría */
  --papel-hundido: #e2e5df;
  --linea: #c3c8c1;
  --toner: #191b1d;
  --toner-suave: #474c50;
  --bic: #1c3cb8;            /* boli azul: la mano de Dani y la acción */
  --bic-oscuro: #132a86;
  --fluor: #f2ec3a;          /* subrayador */
  --rojo: #c4241b;           /* corrector / sello */
  --boli: "Boli", "Comic Sans MS", cursive;
  --texto: "Atkinson Next", system-ui, sans-serif;
  --radio: 3px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--camilla);
  background-image: radial-gradient(var(--camilla-oscura) 1px, transparent 1.4px);
  background-size: 6px 6px;
  color: var(--toner);
  font: 400 1.1875rem/1.55 var(--texto);
  padding: 14px 10px 40px;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--fluor); color: var(--toner); }
:focus-visible { outline: 3px solid var(--bic); outline-offset: 3px; border-radius: 2px; }
a { color: var(--bic); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--bic-oscuro); text-decoration-thickness: 2.5px; }
img, video, svg { display: block; max-width: 100%; }

/* ---------- la hoja ---------- */
.hoja {
  position: relative;
  max-width: 46rem;
  margin: 0 auto;
  background-color: var(--papel);
  /* grano de tóner de fotocopia */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  padding: 26px 20px 30px 38px;
  box-shadow: 0 1px 1px rgba(0,0,0,.18), 0 14px 30px -10px rgba(0,0,0,.55);
  border-radius: 1px;
}
/* taladros de archivador */
.hoja::before, .hoja::after {
  content: "";
  position: absolute;
  left: 11px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--camilla);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,.55);
}
.hoja::before { top: 22%; }
.hoja::after { top: 62%; }
/* grapa */
.grapa {
  position: absolute; top: 12px; left: 22px;
  width: 38px; height: 5px;
  transform: rotate(-38deg);
  border: 2px solid #8b9196; border-bottom-color: #b9bec2;
  border-radius: 1px;
  box-shadow: 0 1px 1px rgba(0,0,0,.25);
}

/* membrete */
.membrete {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px;
  align-items: baseline;
  border-bottom: 2px solid var(--toner);
  padding: 0 0 8px 34px;
  font-size: .875rem; letter-spacing: .02em;
  color: var(--toner-suave);
}
.membrete b { color: var(--toner); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- tipografía ---------- */
h1, h2, h3 { font-family: var(--texto); line-height: 1.05; margin: 0; text-wrap: balance; letter-spacing: -0.02em; }
h1 { font-weight: 800; font-size: clamp(2.6rem, 11vw, 5.4rem); margin: 22px 0 18px; }
h2 { font-weight: 800; font-size: clamp(1.9rem, 7vw, 2.7rem); margin: 48px 0 14px; }
h3, .extra h2 { font-weight: 800; font-size: clamp(1.45rem, 5.4vw, 1.9rem); line-height: 1.12; margin: 0; }
p { margin: 0 0 14px; max-width: 34em; }

.fluor {
  background: linear-gradient(100deg, transparent 0 1%, var(--fluor) 2% 97%, transparent 99%) 0 72% / 100% 46% no-repeat;
  padding: 0 .08em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.boli { font-family: var(--boli); color: var(--bic); font-weight: 400; letter-spacing: 0; }
.nota {
  font-family: var(--boli); color: var(--bic);
  font-size: 1.6rem; line-height: 1.15;
  transform: rotate(-2deg);
  margin: 6px 0 18px;
}
.pequena { font-size: .95rem; color: var(--toner-suave); }

/* ---------- ficha (formulario) ---------- */
.ficha {
  position: relative;
  border: 2px solid var(--toner);
  padding: 18px 16px 20px;
  margin: 8px 0 10px;
  background: var(--papel);
}
.ficha-titulo {
  position: absolute; top: -0.85em; left: 12px;
  background: var(--papel); padding: 0 8px;
  font-weight: 800; font-size: .95rem; letter-spacing: .06em; text-transform: uppercase;
}
.campo { display: block; margin: 6px 0 16px; }
.campo span { display: block; font-weight: 700; font-size: 1rem; }
.campo input {
  width: 100%;
  font: 400 1.75rem/1.2 var(--boli);
  color: var(--bic);
  background: transparent;
  border: 0;
  border-bottom: 2px dotted var(--toner-suave);
  border-radius: 0;
  padding: 6px 2px 4px;
  min-height: 52px;
  caret-color: var(--bic);
}
.campo input::placeholder { color: #7d8489; opacity: 1; }
.campo input:focus { outline: none; border-bottom: 2px solid var(--bic); background: rgba(28,60,184,.05); }
.campo input[aria-invalid="true"] { border-bottom-color: var(--rojo); }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.casilla { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 18px; cursor: pointer; font-size: 1rem; line-height: 1.4; }
.casilla input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.caja {
  flex: none; position: relative;
  width: 30px; height: 30px; margin-top: 1px;
  border: 2px solid var(--toner);
  background: var(--papel);
}
.caja svg { position: absolute; inset: -9px -6px -2px -2px; width: calc(100% + 8px); height: calc(100% + 11px); overflow: visible; }
.caja path { fill: none; stroke: var(--bic); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; transition: stroke-dashoffset .28s cubic-bezier(.2,.8,.2,1); }
.casilla input:checked + .caja path { stroke-dashoffset: 0; }
.casilla input:focus-visible + .caja { outline: 3px solid var(--bic); outline-offset: 3px; }
.casilla input[aria-invalid="true"] + .caja { border-color: var(--rojo); }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; width: 100%;
  padding: 12px 22px;
  font: 800 1.25rem/1.1 var(--texto);
  color: #fff; background: var(--bic);
  border: 0; border-radius: var(--radio);
  box-shadow: 0 2px 0 var(--bic-oscuro), 0 6px 14px -6px rgba(0,0,0,.4);
  text-decoration: none; cursor: pointer;
  transition: transform .12s ease-out, background-color .15s, box-shadow .12s;
  touch-action: manipulation;
  user-select: none;
}
.boton:hover { background: var(--bic-oscuro); color: #fff; }
.boton:active { transform: translateY(2px); box-shadow: 0 0 0 var(--bic-oscuro), 0 2px 6px -3px rgba(0,0,0,.4); }
.boton[disabled] { opacity: .7; cursor: progress; }
.boton svg { width: 24px; height: 24px; flex: none; }
.boton-sec {
  background: transparent; color: var(--bic);
  border: 2px solid var(--bic); box-shadow: none;
}
.boton-sec:hover { background: rgba(28,60,184,.08); color: var(--bic-oscuro); }

.error {
  font-family: var(--boli); color: var(--rojo); font-size: 1.3rem; line-height: 1.2;
  margin: -6px 0 12px; min-height: 0;
}
.error:empty { display: none; }

/* sello ENTREGADO */
.sello {
  position: absolute; right: 8px; top: 34%;
  pointer-events: none;
  border: 4px solid var(--rojo); color: var(--rojo);
  padding: 6px 14px;
  font: 800 2rem/1 var(--texto); letter-spacing: .12em;
  transform: rotate(-11deg) scale(1.6);
  opacity: 0;
  mix-blend-mode: multiply;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.55' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.55' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.sello.puesto { animation: sellar .42s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes sellar {
  0% { opacity: 0; transform: rotate(-4deg) scale(1.7); }
  60% { opacity: 1; }
  100% { opacity: .92; transform: rotate(-11deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .sello.puesto { animation: none; opacity: .92; transform: rotate(-11deg); } }

/* ---------- portada (squeeze) ---------- */
.visual-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hoja-squeeze { max-width: 30rem; padding: 14px 16px 22px; }
.hoja-squeeze::before, .hoja-squeeze::after { display: none; }
.firma { font-size: .9rem; font-weight: 700; letter-spacing: .03em; color: var(--toner-suave); margin: 0 0 18px; }

.teaser {
  position: relative; display: block; width: 100%;
  padding: 0; border: 6px solid #fff; background: var(--toner);
  aspect-ratio: 4 / 3; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.25), 0 10px 22px -12px rgba(0,0,0,.6);
  transform: rotate(-.8deg);
}
.teaser img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9) contrast(1.03); }
.teaser::before, .teaser::after { /* celo */
  content: ""; position: absolute; width: 78px; height: 24px; z-index: 1;
  background: rgba(240, 236, 200, .6);
}
.teaser::before { top: -14px; left: -20px; transform: rotate(-32deg); }
.teaser::after { top: -12px; right: -22px; transform: rotate(30deg); }
.play {
  position: absolute; left: 50%; top: 72%; translate: -50% -50%;
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--bic); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.55);
  transition: scale .15s ease-out;
}
.play svg { width: 36px; height: 36px; fill: currentColor; margin-left: 4px; }
.teaser:hover .play { scale: 1.06; }
.solo {
  position: absolute; left: 10px; top: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--fluor); color: var(--toner);
  font-weight: 800; font-size: .95rem; padding: 6px 10px 6px 8px;
  transform: rotate(-1.5deg);
}
.solo svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; }

.hoja-squeeze h1 { font-size: clamp(2rem, 8.6vw, 2.75rem); line-height: 1.04; margin: 18px 0 8px; }
.sub { font-size: 1.1rem; line-height: 1.4; color: var(--toner-suave); margin: 0 0 16px; }

.captura { position: relative; }
.captura input[type="email"] {
  width: 100%; min-height: 58px;
  font: 400 1.3rem/1.2 var(--texto); color: var(--toner);
  background: #fff; border: 2px solid var(--toner); border-radius: var(--radio);
  padding: 12px 14px; margin: 0 0 10px;
}
.captura input[type="email"]::placeholder { color: #6d7479; opacity: 1; }
.captura input[type="email"]:focus { outline: 3px solid var(--bic); outline-offset: 2px; border-color: var(--bic); }
.captura input[aria-invalid="true"] { border-color: var(--rojo); }
.captura .boton { width: 100%; min-height: 62px; font-size: 1.3rem; }
.captura .error { margin: 10px 0 0; }
.captura .casilla { margin: 14px 0 8px; font-size: .95rem; align-items: center; }
.captura .caja { width: 26px; height: 26px; margin: 0; }
.calma { font-size: .95rem; color: var(--toner-suave); margin: 0; }
.captura .sello { top: -40px; right: 0; }

@media (min-width: 700px) {
  .hoja-squeeze { padding: 22px 30px 30px; }
}

.pie {
  margin-top: 40px; padding-top: 12px;
  border-top: 2px solid var(--toner);
  font-size: .95rem; color: var(--toner-suave);
  display: flex; flex-wrap: wrap; gap: 6px 20px;
}
.pie a { color: var(--toner); }

.contacto { display: grid; gap: 10px; margin: 6px 0 4px; }

/* ---------- zona ---------- */
.indice { list-style: none; padding: 0; margin: 4px 0 0; counter-reset: i; }
.indice li { padding: 6px 0; }
.indice a { font-weight: 700; font-size: 1.15rem; text-decoration: none; display: inline-flex; gap: 10px; align-items: baseline; }
.indice a::before { counter-increment: i; content: counter(i) "."; color: var(--toner-suave); font-weight: 400; min-width: 1.4em; }
.indice a span { text-decoration: underline; text-underline-offset: .18em; }

.extra {
  position: relative;
  padding: 30px 0 34px;
  border-top: 2px solid var(--toner);
  scroll-margin-top: 12px;
}
.extra:first-of-type { margin-top: 30px; }
.extra .del { font-size: 1rem; color: var(--toner-suave); margin: 8px 0 14px; }
.extra .del b { color: var(--toner); }
.extra .nota { margin: 4px 0 16px; }
.extra.llegada h2 { animation: subrayar 1.6s ease-out .3s both; }
@keyframes subrayar { from { background-size: 0% 46%; } to { background-size: 100% 46%; } }
.extra.llegada h2 {
  background: linear-gradient(100deg, transparent 0 1%, var(--fluor) 2% 97%, transparent 99%) 0 72% / 100% 46% no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.nuevo {
  position: absolute; top: 18px; right: -4px;
  font: 400 1.5rem/1 var(--boli); color: var(--rojo);
  padding: 8px 14px 10px;
  transform: rotate(6deg);
}
.nuevo svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.nuevo ellipse { fill: none; stroke: var(--rojo); stroke-width: 2.5; }
.extra .con-nuevo { padding-right: 96px; }

/* vídeo «pegado» en la hoja */
.marco {
  position: relative;
  background: var(--toner);
  aspect-ratio: 16 / 9;
  border: 6px solid #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25), 0 8px 18px -10px rgba(0,0,0,.6);
  transform: rotate(-.6deg);
  margin: 6px 0 16px;
}
.marco video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.marco::before, .marco::after { /* celo */
  content: ""; position: absolute; width: 74px; height: 24px;
  background: rgba(240, 236, 200, .55);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04);
  z-index: 1;
}
.marco::before { top: -14px; left: -18px; transform: rotate(-32deg); }
.marco::after { bottom: -12px; right: -16px; transform: rotate(-28deg); }
.marco.vacio {
  background: var(--papel-hundido);
  border: 2px dashed var(--toner-suave);
  box-shadow: none; transform: none;
  display: grid; place-items: center; text-align: center;
  padding: 16px;
}
.marco.vacio::before, .marco.vacio::after { display: none; }
.marco.vacio .boli { font-size: 1.45rem; line-height: 1.2; max-width: 18em; }
.marco.vacio svg { width: 60px; height: 78px; margin: 0 auto 6px; }

.semanas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 20px; max-width: 30rem; }
.semanas div { border: 2px solid var(--toner); padding: 6px 8px 8px; font-size: .9rem; font-weight: 700; min-height: 56px; }
.semanas div span { display: block; font: 400 1.4rem/1 var(--boli); color: var(--bic); }

.cargando { font-family: var(--boli); color: var(--bic); font-size: 1.5rem; padding: 30px 0; }

/* ---------- panel ---------- */
.panel .hoja { max-width: 70rem; }
.panel h1 { font-size: 2.2rem; }
.panel .boton { width: auto; }
.tabla { overflow-x: auto; margin-top: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--linea); white-space: nowrap; }
th { border-bottom: 2px solid var(--toner); }
td button { font: inherit; color: var(--rojo); background: none; border: 1px solid var(--rojo); border-radius: var(--radio); padding: 4px 10px; cursor: pointer; }

/* ---------- pantallas más grandes ---------- */
@media (min-width: 700px) {
  body { padding: 40px 24px 60px; }
  .hoja { padding: 36px 52px 40px 78px; }
  .hoja::before, .hoja::after { left: 24px; width: 18px; height: 18px; }
  .grapa { left: 40px; top: 18px; }
  .membrete { padding-left: 24px; }
  .boton { width: auto; min-width: 18rem; }
  .contacto { grid-template-columns: repeat(2, max-content); }
  .semanas { grid-template-columns: repeat(8, 1fr); max-width: none; }
}
