/* Tercero B. Marca del tablero: papel, tinta, rojo solo sobre papel.
   El amarillo es solo para encima de foto: aquí, las notas del bloque de las noches. */

@font-face {
  font-family: "Inter";
  src: url("assets/fuentes/inter-latin.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  /* Sustituta de Casuwalt hasta tener su archivo: cambiar solo este bloque. */
  font-family: "Mano";
  src: url("assets/fuentes/gochi-hand-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --papel: #F6F5F1;
  --tinta: #0D0D0D;
  --tinta-suave: #4B4B48;
  --rojo: #E8341F;
  --amarillo: #FFC629;

  --grande: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mano: "Mano", "Comic Sans MS", cursive;

  --margen: clamp(18px, 4.4vw, 56px);
  --hueco: clamp(72px, 13vw, 168px);
  --cab: 60px;

  /* capas: 40 cabecera, 50 grano, 60 salto */
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--cab) + 12px);
}

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--grande);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* grano de papel, fijo y sin interacción */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, p, ol, figure, blockquote { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; }

h1, h2 {
  font-weight: 800;
  letter-spacing: -.058em;
  line-height: .92;
  text-wrap: balance;
}
h2 { font-size: clamp(2.6rem, 8.2vw, 6.2rem); }

.texto {
  max-width: 34ch;
  color: var(--tinta-suave);
  font-size: clamp(1.0625rem, 1.5vw, 1.3rem);
}

.apoyo {
  max-width: 15em;
  line-height: 1.5;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.mano {
  font-family: var(--mano);
  font-weight: 400;
  color: var(--rojo);
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  line-height: 1.05;
  letter-spacing: 0;
}
/* letra torcida: mano.js parte cada nota en palabras y letras y les da giro, altura y tamaño */
.mano__palabra, .mano__letra { display: inline-block; }
.mano__palabra { white-space: nowrap; transform: translateY(var(--alto)) rotate(var(--giro)); }
.mano__letra { transform: translateY(var(--alto)) rotate(var(--giro)) scale(var(--escala)); }

.oculto {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.salto {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 60;
  padding: 12px 16px;
  background: var(--tinta);
  color: var(--papel);
  font-weight: 700;
  transform: translateY(-200%);
}
.salto:focus { transform: none; }

:focus-visible {
  outline: 3px solid var(--rojo);
  outline-offset: 3px;
}

/* ---------- botones: bloque de tinta con sombra dura roja ---------- */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 26px;
  border: 0;
  background: var(--tinta);
  color: var(--papel);
  font: inherit;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--rojo);
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), box-shadow .18s cubic-bezier(.16, 1, .3, 1);
}
.boton:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--rojo); }
.boton:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--rojo); }
.boton[disabled] { opacity: .6; cursor: progress; }

.boton--mini {
  min-height: 40px;
  padding: 0 16px;
  font-size: .9375rem;
  box-shadow: 3px 3px 0 var(--rojo);
}
.boton--mini:hover { box-shadow: 5px 5px 0 var(--rojo); }

.boton--linea {
  background: transparent;
  color: var(--tinta);
  box-shadow: inset 0 0 0 3px var(--tinta);
}
.boton--linea:hover { transform: translate(-2px, -2px); box-shadow: inset 0 0 0 3px var(--tinta), 5px 5px 0 var(--rojo); }
.boton--linea:active { transform: translate(2px, 2px); box-shadow: inset 0 0 0 3px var(--tinta); }

/* ---------- cabecera ---------- */
.cab {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--cab);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--margen);
  background: var(--papel);
}
.cab__marca {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -.06em;
  text-decoration: none;
}
/* el botón de la cabecera solo aparece cuando el del cartel ya no se ve */
.js .cab__llave {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .25s, transform .25s cubic-bezier(.16, 1, .3, 1), visibility 0s .25s;
}
.js .cab--pasada .cab__llave {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .25s, transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .18s;
}

/* ---------- dibujos ---------- */
.dib { display: block; }
.dib img { width: 100%; }

/* ---------- cartel ---------- */
.cartel {
  min-height: calc(100dvh - var(--cab));
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: clamp(10px, 1.6vw, 20px);
  padding: 6px var(--margen) clamp(22px, 3.4vw, 40px);
}
.cartel__arriba {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.cartel__dato {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cartel__titular {
  font-size: clamp(4.2rem, 20.5vw, 13.5rem);
  letter-spacing: -.068em;
  line-height: .86;
  max-width: 6.2em;
}
.cartel__dibujos {
  position: relative;
  min-height: 190px;
}
.cartel__dibujos .dib { position: absolute; }
.dib--casa { width: min(64%, 300px); left: 50%; bottom: 0; translate: -50% 0; }
.cartel__dibujos .dib--monigote-a { width: min(17%, 84px); left: 0; bottom: 3%; rotate: -6deg; }
.cartel__dibujos .dib--monigote-b { width: min(16%, 78px); right: 0; bottom: 0; rotate: 7deg; scale: -1 1; }
.dib--vaso { width: min(15%, 70px); left: 6%; top: 8%; rotate: -8deg; }
.dib--asterisco { width: min(15%, 72px); right: 8%; top: 4%; }

.cartel__abajo {
  display: grid;
  gap: 14px;
}
.cartel__cuando {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.cartel__fecha {
  font-weight: 800;
  font-size: clamp(3.4rem, 15.5vw, 9rem);
  letter-spacing: -.06em;
  line-height: .86;
  white-space: nowrap;
}
.cartel__nota { rotate: -4deg; white-space: nowrap; }
.cartel__ir {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
}
.cartel__sitio { font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; }

/* ---------- secciones ---------- */
.llave, .normas, .noches, .vecino, .donde {
  padding: var(--hueco) var(--margen);
  max-width: 1400px;
  margin: 0 auto;
}
.llave > *, .normas > *, .noches > *, .vecino > *, .donde > * { min-width: 0; }

/* llave */
.llave { display: grid; gap: 28px; }
.llave__dibujo { width: min(72%, 420px); rotate: -9deg; margin-left: -3%; }
.llave__texto { display: grid; gap: 18px; }
.llave__cerrada { rotate: -2deg; max-width: 14em; }

.llave__form { display: grid; gap: 22px; max-width: 460px; }
.llave__precio { font-weight: 800; font-size: 1.6rem; letter-spacing: -.04em; }
.campo { display: grid; gap: 8px; }
.campo label { font-weight: 700; font-size: .9375rem; }
.campo input[type="text"], .campo input[type="email"] {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  border: 3px solid var(--tinta);
  border-radius: 0;
  background: #FFFFFF;
  color: var(--tinta);
  font: inherit;
  font-size: 1.0625rem;
}
.campo__ayuda { font-size: .875rem; color: var(--tinta-suave); }
.campo__error { font-size: .875rem; font-weight: 700; color: #B3200F; }
.campo--mal input { border-color: #B3200F; }
.campo--casilla {
  grid-template-columns: 28px 1fr;
  align-items: start;
  column-gap: 12px;
}
.campo--casilla input {
  width: 26px; height: 26px;
  margin: 0;
  accent-color: var(--tinta);
}
.campo--casilla label { font-weight: 500; line-height: 1.35; }
.campo--casilla .campo__error { grid-column: 2; }
.llave__form .boton { justify-self: start; }
.llave__fallo { font-weight: 700; color: #B3200F; }

/* normas */
.normas { display: grid; gap: clamp(32px, 5vw, 64px); position: relative; }
.normas__cabeza { position: relative; max-width: 9.5em; font-size: clamp(2.6rem, 8.2vw, 6.2rem); }
.normas__cabeza h2 { font-size: 1em; }
.normas__asterisco { position: absolute; width: .62em; right: -.1em; top: -.46em; }
.normas__lista {
  counter-reset: norma;
  display: grid;
  gap: clamp(22px, 3vw, 38px) clamp(32px, 6vw, 96px);
}
.normas__lista li {
  counter-increment: norma;
  display: grid;
  grid-template-columns: 1.5em 1fr;
  align-items: baseline;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.12;
}
.normas__lista li::before {
  content: counter(norma);
  font-weight: 800;
  font-size: 1.5em;
  letter-spacing: -.06em;
  line-height: .9;
}
.normas__tachada { position: relative; align-items: center; }
.normas__tachada img { width: min(100%, 420px); height: 1.5em; }
.normas__dado { width: clamp(64px, 9vw, 116px); justify-self: end; rotate: 8deg; }

/* noches: la cámara de la casa y sus fotos, reveladas en blanco y negro y pegadas con
   cinta, cada una a su aire. Lo que va encima de la foto es amarillo; aquí no entra el rojo.
   Cada foto se coloca en tanto por ciento de la pared, así el collage escala entero. */
.noches { display: grid; gap: clamp(30px, 7vw, 48px); position: relative; }
.noches__texto { display: grid; gap: 18px; }
.noches__camara { position: absolute; top: calc(var(--hueco) - 6px); right: var(--margen); width: clamp(84px, 24vw, 112px); rotate: 9deg; }
.noches__pared { position: relative; aspect-ratio: 100 / 127; }
.foto {
  position: absolute;
  padding: clamp(5px, 1.5vw, 10px);
  background: #FFFFFF;
  box-shadow: 4px 5px 0 rgba(13, 13, 13, .14);
  transition: rotate .3s cubic-bezier(.16, 1, .3, 1), scale .3s cubic-bezier(.16, 1, .3, 1);
}
.foto img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.12); }
.foto::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: var(--cinta-x, 50%);
  top: 0;
  width: 36%;
  height: clamp(15px, 4.6vw, 26px);
  translate: -50% -58%;
  rotate: var(--cinta, -3deg);
  background: rgba(222, 216, 200, .88);
  clip-path: polygon(0 0, 3% 22%, 0 45%, 3% 70%, 0 100%, 100% 100%, 97% 76%, 100% 52%, 97% 28%, 100% 0);
}
.foto__nota {
  position: absolute;
  max-width: 82%;
  color: var(--amarillo);
  font-size: clamp(1.3rem, 5.6vw, 2rem);
  line-height: .95;
  /* un poco de sombra para que se lea también sobre lo claro de la foto */
  text-shadow: 0 0 .5em rgba(13, 13, 13, .6), 0 1px .12em rgba(13, 13, 13, .55);
}
.foto--1 { left: -2%; top: 0; width: 58%; rotate: -3.5deg; z-index: 2; --cinta: -5deg; --cinta-x: 44%; }
.foto--2 { left: 47%; top: 10%; width: 55%; rotate: 3.5deg; z-index: 1; --cinta: 4deg; --cinta-x: 58%; }
.foto--3 { left: 52%; top: 60%; width: 50%; rotate: -5deg; z-index: 4; --cinta: 7deg; }
.foto--4 { left: -2%; top: 53%; width: 64%; rotate: 2.5deg; z-index: 3; --cinta: -2deg; --cinta-x: 40%; }
/* la 3 se recorta por abajo y la 4 se tumba */
.foto--3 img { aspect-ratio: 1; object-position: 50% 100%; }
.foto--4 img { aspect-ratio: 5 / 4; object-position: 50% 68%; }
.foto--2 .foto__nota { left: 22%; top: 8%; rotate: -4deg; white-space: nowrap; }
.foto--4 .foto__nota { left: 30%; top: 9%; rotate: -4deg; white-space: nowrap; }

/* vecino */
.vecino { display: grid; gap: clamp(34px, 5vw, 72px); }
.vecino__texto { display: grid; gap: 18px; }
.papel {
  justify-self: start;
  width: min(100%, 440px);
  padding: 38px 30px 30px;
  rotate: 2.2deg;
  background-color: #FFFFFF;
  background-image:
    linear-gradient(rgba(13, 13, 13, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 13, 13, .09) 1px, transparent 1px);
  background-size: 22px 22px;
  box-shadow: 6px 7px 0 rgba(13, 13, 13, .12);
  display: grid;
  gap: 22px;
}
.papel__texto { color: var(--tinta); font-size: clamp(1.9rem, 4.2vw, 2.7rem); line-height: 1.08; }
.papel__firma { font-family: var(--mano); font-size: 1.5rem; text-align: right; color: var(--tinta-suave); }

/* dónde */
.donde { display: grid; gap: 36px; }
.donde__texto { display: grid; gap: 14px; justify-items: start; }
.donde__barrio { font-weight: 800; font-size: clamp(1.5rem, 3.2vw, 2.6rem); letter-spacing: -.045em; line-height: 1; }
.donde__garabato { width: min(62%, 320px); margin: 2px 0 8px; }
.donde .boton { margin-top: 10px; }
.donde__dibujos {
  display: flex;
  align-items: flex-end;
  gap: 4%;
  padding-top: 8px;
}
.donde__dibujos .dib { width: min(17%, 96px); }
.donde__dibujos .dib--monigote-a { rotate: -7deg; }
.donde__dibujos .dib--monigote-b { rotate: 4deg; scale: -1 1; translate: 0 -8px; }
.donde__dibujos .dib--monigote-c { rotate: 9deg; }
.donde__nota { rotate: -5deg; margin: 0 0 12% 2%; }

/* pie */
.pie {
  display: grid;
  gap: 18px;
  padding: 34px var(--margen) 40px;
  border-top: 3px solid var(--tinta);
  max-width: 1400px;
  margin: 0 auto;
}
.pie__marca { font-weight: 800; font-size: 2rem; letter-spacing: -.06em; line-height: 1; }
.pie__enlaces { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: .9375rem; font-weight: 600; }
.pie__enlaces a { padding: 8px 0; text-underline-offset: 4px; }
.pie__firma { grid-column: 1 / -1; font-size: .8125rem; color: var(--tinta-suave); }
.pie__firma a { text-underline-offset: 4px; }

/* ---------- páginas legales ---------- */
.legal { max-width: 720px; margin: 0 auto; padding: clamp(28px, 6vw, 72px) var(--margen) var(--hueco); display: grid; gap: 22px; }
.legal h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); }
.legal h2 { font-size: 1.5rem; letter-spacing: -.04em; line-height: 1.1; margin-top: 18px; }
.legal p, .legal li { color: var(--tinta-suave); max-width: 66ch; }
.legal ul { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; }
.legal .pendiente { background: #FFE9A8; color: var(--tinta); padding: 0 4px; font-weight: 700; }
.legal__volver { font-weight: 700; text-underline-offset: 4px; justify-self: start; }

/* ---------- escritorio ---------- */
@media (min-width: 900px) {
  :root { --cab: 68px; }

  .cartel {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto 1fr auto;
    column-gap: 24px;
  }
  .cartel__arriba { grid-column: 1 / -1; }
  .apoyo { max-width: none; }
  .cartel__dato { flex-direction: row; gap: 18px; }
  .cartel__titular { grid-column: 1 / span 7; grid-row: 2; align-self: start; font-size: clamp(6rem, 13.2vw, 13rem); }
  .cartel__dibujos { grid-column: 8 / -1; grid-row: 2; min-height: 0; }
  .dib--casa { width: min(78%, 430px); bottom: 4%; }
  .cartel__dibujos .dib--monigote-a { width: min(19%, 104px); left: -2%; bottom: 6%; }
  .cartel__dibujos .dib--monigote-b { width: min(18%, 98px); right: -1%; bottom: 4%; }
  .dib--vaso { width: min(16%, 86px); left: 4%; top: 6%; }
  .dib--asterisco { width: min(16%, 88px); right: 6%; top: 4%; }
  .cartel__abajo { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: end; }
  .cartel__fecha { font-size: clamp(5rem, 9.6vw, 9.4rem); }
  .cartel__ir { flex-direction: column; align-items: flex-end; gap: 16px; }
  .cartel__sitio { font-size: 1.0625rem; }

  .llave { grid-template-columns: 5fr 7fr; align-items: center; column-gap: 6%; }
  .llave__dibujo { grid-column: 1; grid-row: 1 / span 2; width: 100%; margin-left: -6%; }
  .llave__texto, .llave__caja { grid-column: 2; }

  .normas__lista { grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(3, auto); }
  .normas__dado { position: absolute; right: var(--margen); top: var(--hueco); }

  /* el texto se queda arriba a la izquierda, encima de la misma pared, y la cámara baja al hueco de la derecha */
  .noches__texto, .noches__pared { grid-area: 1 / 1; }
  .noches__texto { position: relative; z-index: 5; align-self: start; justify-self: start; width: 37%; }
  .noches__texto h2 { font-size: min(6.9vw, 6.2rem); }
  .noches__camara { top: auto; bottom: calc(var(--hueco) + 3vw); right: calc(var(--margen) + 1.5%); width: clamp(104px, 11vw, 158px); }
  .noches__pared { aspect-ratio: 100 / 61; }
  .foto { padding: clamp(8px, .8vw, 11px); }
  .foto::before { height: clamp(20px, 2vw, 28px); }
  .foto__nota { font-size: clamp(1.5rem, 2.3vw, 2.2rem); }
  .foto--1 { left: 41%; top: 0; width: 28%; }
  .foto--2 { left: 68%; top: 8%; width: 28%; }
  .foto--3 { left: 57%; top: 52%; width: 27%; }
  .foto--4 { left: 9%; top: 47%; width: 37%; }

  .vecino { grid-template-columns: 6fr 5fr; align-items: center; }
  .papel { justify-self: end; }

  .donde { grid-template-columns: 7fr 5fr; align-items: end; }
  .donde__dibujos { justify-content: flex-end; }

  .pie { grid-template-columns: 1fr auto; align-items: end; }
}

/* ---------- movimiento ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* los dibujos tiemblan como una animación a mano, a saltos y solo con transform */
  @keyframes temblor {
    0%   { transform: rotate(-.7deg) translate(0, 0); }
    50%  { transform: rotate(.8deg) translate(1px, -1px); }
    100% { transform: rotate(-.7deg) translate(0, 0); }
  }
  .dib img { animation: temblor .9s steps(1) infinite; }
  .dib--casa img, .normas__dado img { animation-delay: -.3s; }
  .dib--monigote-b img, .dib--asterisco img, .llave__dibujo img { animation-delay: -.55s; }
  .normas__tachada img, .donde__garabato img { animation: none; }

  .js .ver { opacity: 0; transform: translateY(22px); }
  .js .ver.visto {
    opacity: 1;
    transform: none;
    transition: opacity .6s cubic-bezier(.16, 1, .3, 1), transform .6s cubic-bezier(.16, 1, .3, 1);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  /* las fotos entran de una en una y, con ratón, la que se toca se endereza y pasa delante */
  .js .foto.ver.visto {
    transition: opacity .6s cubic-bezier(.16, 1, .3, 1), transform .6s cubic-bezier(.16, 1, .3, 1), rotate .3s cubic-bezier(.16, 1, .3, 1), scale .3s cubic-bezier(.16, 1, .3, 1);
    transition-delay: calc(var(--i, 0) * 70ms), calc(var(--i, 0) * 70ms), 0s, 0s;
  }
}
@media (hover: hover) {
  .foto:hover { rotate: 0deg; scale: 1.04; z-index: 6; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boton, .cab__llave { transition: none; }
}
