/* Brindis
   Papel sobre negro. Michelangelus para la voz de la marca e Instrument Sans
   para lo práctico (botones, enlaces, formularios, avisos). Sin color de acento:
   el elemento claro protagonista son las postales. */

/* ---------- Tokens ---------- */

:root {
  color-scheme: dark;

  --ink: #0c0c0c; /* negro, sin tono marrón */
  --paper: #ece8e1;
  --paper-dim: #9e9b95;
  --quiet: #5c5a56; /* texto que casi se funde con el fondo (la cita latina) */
  --paper-shade: #d9d5cc; /* sombras y sellos sobre el papel de las postales */
  --line: rgb(236 232 225 / 0.2);
  --hair: rgb(12 12 12 / 0.34); /* trazo fino de tinta sobre el papel */

  --serif: "Brindis Serif", "Brindis Garamond", "Brindis Times", Garamond, "EB Garamond",
    "Times New Roman", serif;
  --sans: "Brindis Sans", "Brindis Arial", Arial, Helvetica, sans-serif;

  --gutter: clamp(1.25rem, 4.5vw, 3.5rem);
  --pad-top: max(var(--gutter), env(safe-area-inset-top, 0px));
  --pad-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  --pad-bottom: max(var(--gutter), env(safe-area-inset-bottom, 0px));
  --pad-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  --section-space: clamp(5rem, 4rem + 8vw, 11rem);
  --measure: 34rem;

  --step--1: 0.9375rem;
  --step-0: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);
  --step-1: clamp(1.3rem, 1.18rem + 0.6vw, 1.7rem);
  --step-2: clamp(1.75rem, 1.4rem + 1.75vw, 2.75rem);
  --step-3: clamp(2rem, 1.45rem + 2.75vw, 3.6rem);
  /* El nombre: llena la columna en móvil; desde tableta, 25 vw. */
  --wordmark: min(calc((100vw - 2 * var(--gutter)) / 3.05), max(24vw, 8rem), 29rem);

  --ease: cubic-bezier(0.5, 0, 0.2, 1);
}

/* ---------- Base ---------- */

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

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* El fondo negro lo pinta html: así el vídeo de fondo puede ir detrás del contenido. */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-kerning: normal;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Grano de papel: ruido fractal en SVG, fijo sobre todo. Muy bajo (3 %)
   para que el fondo siga leyéndose negro y no gris. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 400;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}

[tabindex="-1"]:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--paper);
  color: var(--ink);
}

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

/* ---------- Piezas comunes ---------- */

.wordmark {
  font-size: var(--wordmark);
  line-height: 0.8;
  letter-spacing: -0.025em;
  /* La B tiene aproche; se compensa para que el fuste caiga en el margen. */
  margin-left: -0.045em;
  white-space: nowrap;
}

.latin {
  font-family: var(--sans);
  font-size: var(--step--1);
  letter-spacing: 0.01em;
  color: var(--quiet);
}

.legal {
  font-family: var(--sans);
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--paper-dim);
  max-width: 52ch; /* unos 65 caracteres: nunca más de 70 por línea */
}

.btn {
  display: inline-block;
  appearance: none;
  min-height: 2.75rem;
  border: 1px solid var(--paper);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  padding: 0.85rem 1.5rem;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: transparent;
  color: var(--paper);
}

.btn[aria-disabled="true"] {
  cursor: progress;
  opacity: 0.6;
}

/* Enlace subrayado en sans: la segunda opción, la que no se impone. */
.link-it {
  appearance: none;
  border: 0;
  background: none;
  color: var(--paper);
  font: inherit;
  font-family: var(--sans);
  font-size: var(--step--1);
  padding: 0.5rem 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
}

.link-it:hover {
  text-decoration-thickness: 2px;
}

.section {
  margin-inline: var(--pad-left) var(--pad-right);
  padding-block: var(--section-space);
}

.ruled {
  border-top: 1px solid var(--line);
}

/* Dos pistas en escritorio: a la izquierda el título, a la derecha el contenido. */
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem 4rem;
}

@media (min-width: 56rem) {
  .cols {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  }
}

.section-title {
  font-size: var(--step-2);
  line-height: 1.12;
  max-width: 14em;
  text-wrap: balance;
}

/* ---------- Vídeo de fondo ---------- */

/* El chorro de vino, en blanco y negro, casi transparente y en bucle. */
.fondo {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.5s ease;
}

.fondo.is-on {
  opacity: 0.18;
}

@media (prefers-reduced-motion: reduce) {
  .fondo {
    display: none;
  }
}

/* ---------- Vídeo de entrada ---------- */

/* Antes que todo, incluso que la puerta de edad. Solo con JavaScript:
   sin él nunca bloquea la entrada. */
.intro {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
}

.intro-on .intro {
  display: block;
}

.intro-on body {
  overflow: hidden;
}

/* El vídeo siempre entero (sus rótulos llegan a los bordes); el hueco que
   sobra lo rellena el propio vídeo muy desenfocado (lo pinta el script en un
   lienzo diminuto), para que no se vea un rectángulo sobre negro. */
.intro-video {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.intro-ambiente {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  filter: blur(48px) brightness(0.9) saturate(0.8);
}

.intro-entrar {
  position: absolute;
  left: 50%;
  bottom: max(2.5rem, calc(env(safe-area-inset-bottom, 0px) + 1.5rem));
  min-width: 9rem;
  background: rgb(0 0 0 / 0.35);
  border-color: rgb(236 232 225 / 0.7);
  color: var(--paper);
  opacity: 0;
  transform: translate(-50%, 0.5rem);
  transition: opacity 0.9s ease, transform 0.9s ease, background-color 0.6s ease, color 0.6s ease;
  pointer-events: none;
}

.intro.is-listo .intro-entrar {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* Al acabar el vídeo, el botón se rellena: ahora toca entrar. */
.intro.is-fin .intro-entrar,
.intro-entrar:hover {
  background: var(--paper);
  color: var(--ink);
}

.intro.is-saliendo {
  opacity: 0;
  transition: opacity 0.7s ease;
}

/* ---------- Puerta de edad ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.gate-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4rem;
  padding: var(--pad-top) var(--pad-right) var(--pad-bottom) var(--pad-left);
}

.gate-title {
  font-size: var(--step-2);
  line-height: 1.12;
  max-width: 15em;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  margin-top: 2rem;
}

.gate-denied {
  display: none;
}

/* Las reglas con :has van aparte: si un navegador no lo entiende,
   descarta solo esa regla y no la que usa JavaScript. */
.gate.is-denied .gate-ask {
  display: none;
}

.gate:has(#todavia-no:target) .gate-ask {
  display: none;
}

.gate.is-denied .gate-denied {
  display: block;
}

.gate:has(#todavia-no:target) .gate-denied {
  display: block;
}

.gate-foot .legal {
  margin-top: 1.75rem;
}

/* Con la respuesta guardada (o tras «Sí» sin JavaScript) la puerta no existe. */
.edad-ok .gate {
  display: none;
}

:root:has(#portada:target) .gate {
  display: none;
}

/* Con JavaScript: el sitio queda debajo, inerte, y el fondo no se desplaza. */
.js:not(.edad-ok) body {
  overflow: hidden;
}

/* Sin JavaScript: la puerta ocupa la pantalla en el flujo normal y el sitio
   solo aparece tras pulsar «Sí» (enlace a #portada). No recuerda la respuesta. */
:root:not(.js) .gate {
  position: static;
}

:root:not(.js) .gate-inner {
  min-height: 100vh;
  min-height: 100svh;
}

:root:not(.js) .site {
  display: none;
}

:root:not(.js):has(#portada:target) .site {
  display: block;
}

:root:not(.js) .needs-js {
  display: none;
}

/* ---------- Portada ---------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  padding: var(--pad-top) var(--pad-right) clamp(3rem, 2rem + 4vw, 6rem) var(--pad-left);
}

.lema {
  font-size: var(--step-2);
  line-height: 1.12;
  max-width: 15em;
  text-wrap: balance;
}

.hero-link {
  margin-top: 1rem;
  display: inline-block;
}

.hero-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "nombre" "lineas";
}

.hero .wordmark {
  grid-area: nombre;
}

.hero .wordmark span {
  display: inline-block;
}

.hero-lines {
  grid-area: lineas;
  margin-top: clamp(1.75rem, 1rem + 3vw, 3.5rem);
}

.reflexion {
  font-style: italic;
  font-size: var(--step-1);
  line-height: 1.35;
  max-width: 19em;
  text-wrap: balance;
}

/* La explicación, en sans, debajo de la frase. */
.hero-text {
  margin-top: 0.9rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--paper-dim);
  max-width: 30rem;
}

.hero-text strong {
  font-weight: 600;
  color: var(--paper);
}

/* El nombre entra letra a letra al llegar a la portada. */
@media (prefers-reduced-motion: no-preference) {
  .js.edad-ok:not(.intro-on) .hero .wordmark span {
    animation: letra 0.7s var(--ease) both;
  }
  .js.edad-ok:not(.intro-on) .hero .wordmark span:nth-child(2) { animation-delay: 0.05s; }
  .js.edad-ok:not(.intro-on) .hero .wordmark span:nth-child(3) { animation-delay: 0.1s; }
  .js.edad-ok:not(.intro-on) .hero .wordmark span:nth-child(4) { animation-delay: 0.15s; }
  .js.edad-ok:not(.intro-on) .hero .wordmark span:nth-child(5) { animation-delay: 0.2s; }
  .js.edad-ok:not(.intro-on) .hero .wordmark span:nth-child(6) { animation-delay: 0.25s; }
  .js.edad-ok:not(.intro-on) .hero .wordmark span:nth-child(7) { animation-delay: 0.3s; }
}

@keyframes letra {
  from {
    opacity: 0;
    transform: translateY(0.3em);
  }
}

/* ---------- Manifiesto ---------- */

.manifiesto-text {
  font-size: var(--step-3);
  line-height: 1.2;
  max-width: 19em;
  text-wrap: pretty;
}

@media (min-width: 56rem) {
  .manifiesto .cols > :first-child {
    grid-column: 2;
  }
}

/* Se ilumina palabra a palabra al bajar. */
.manifiesto-on .manifiesto-text .w {
  opacity: 0.18;
  transition: opacity 0.4s ease;
}

.manifiesto-on .manifiesto-text .w.is-lit {
  opacity: 1;
}

/* ---------- Postales ---------- */

@media (min-width: 56rem) {
  .artes-cabecera {
    position: sticky;
    top: var(--pad-top);
    align-self: start;
  }
}

.artes-pista {
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--paper-dim);
}

/* En escritorio, tres arriba y dos abajo, centradas. Rectas: el movimiento
   lo da la interacción. Mismo formato que las reales (A5 vertical). */
.actos {
  --hueco: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3.5rem var(--hueco);
}

.acto {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
}

@media (min-width: 40rem) {
  .acto {
    flex-basis: calc((100% - var(--hueco)) / 2);
  }
}

@media (min-width: 75rem) {
  .acto {
    flex-basis: calc((100% - 2 * var(--hueco)) / 3);
  }
}

.postal {
  display: block;
  width: min(100%, 16.5rem);
  aspect-ratio: 148 / 210;
  container-type: inline-size;
  appearance: none;
  border: 0;
  border-radius: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  perspective: 1400px;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

/* Con ratón, la postal se inclina apenas siguiendo el cursor, como al
   sostenerla en la mano (el script fija --rx y --ry). */
.postal.is-tilting {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px);
  transition-duration: 0.25s;
}

/* Un reflejo de luz muy suave que sigue al cursor sobre el papel. */
.postal-cara::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgb(255 255 255 / 0.45), transparent 55%);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.postal.is-tilting .postal-cara::after {
  opacity: 0.35;
}

.postal:focus-visible {
  outline-offset: 8px;
}

.postal-giro {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.9s var(--ease);
}

.postal[aria-pressed="true"] .postal-giro {
  transform: rotateY(180deg);
}

.postal-cara {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  background: var(--paper);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Como en la postal real: «B.» grande arriba y el título abajo. */
.anverso-b {
  position: absolute;
  left: 19.6%;
  top: 8%;
  font-size: 19cqw;
  line-height: 1;
}

.anverso-titulo {
  position: absolute;
  left: 19.6%;
  right: 10%;
  top: 70%;
  font-size: 6.4cqw;
  line-height: 1.25;
}

.anverso-titulo strong {
  font-weight: 700;
}

.postal-dorso {
  transform: rotateY(180deg);
}

.dorso-deco {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dorso-texto {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 33%;
  font-style: italic;
  font-size: 7cqw;
  line-height: 1.3;
  color: var(--ink);
}

.dorso-deco * {
  vector-effect: non-scaling-stroke;
}

.sello {
  fill: var(--paper-shade);
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.sello-marco,
.renglon {
  fill: none;
  stroke: var(--hair);
  stroke-width: 1;
}

.sello-num {
  fill: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  text-anchor: middle;
}

.matasellos {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0.45;
  stroke-width: 1;
}

.artes-nota {
  margin-top: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  font-size: var(--step-1);
}

@media (prefers-reduced-motion: reduce) {
  .postal,
  .postal-giro {
    transition: none;
  }
}

/* ---------- Aparición al bajar ---------- */

.reveal-on .reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal-on .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Las postales se revelan una tras otra: suben apenas y pasan de un leve
   desenfoque a nítidas. El retraso de cada una lo pone el script, según
   cuántas entran a la vez en pantalla. */
.reveal-on .acto {
  opacity: 0;
  transform: translateY(1.1rem);
  filter: blur(6px);
  transition:
    opacity 1.4s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 1.8s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.reveal-on .acto.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------- El kit ---------- */

/* Sin filete: el kit es la caja que contiene esas postales. */
.artes + .kit {
  padding-top: 0;
}

.kit-text {
  font-size: var(--step-1);
  line-height: 1.45;
  max-width: 24em;
}

/* ---------- Lista de espera ---------- */

.lista-intro {
  color: var(--paper-dim);
  max-width: 24rem;
  margin-top: 1.5rem;
}

.form {
  max-width: 32rem;
}

.field label {
  display: block;
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--paper-dim);
}

.field input {
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--paper-dim);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-family: var(--sans);
  font-size: var(--step-1);
  padding: 0.35rem 0 0.5rem;
  margin-bottom: 2px;
}

.field input::placeholder {
  color: var(--paper-dim);
  opacity: 0.6;
}

.field input:focus {
  outline: none;
  border-bottom-color: var(--paper);
  box-shadow: 0 1px 0 var(--paper);
}

/* Error sin color: la línea del campo se engrosa. */
.field input[aria-invalid="true"] {
  border-bottom: 3px solid var(--paper);
  margin-bottom: 0;
  box-shadow: none;
}

.msg {
  font-family: var(--sans);
  font-size: var(--step--1);
  min-height: 1.6em;
  margin-top: 0.4rem;
}

.msg:empty {
  min-height: 0;
}

.consent {
  margin-top: 1.75rem;
  max-width: 27rem;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  color: var(--paper-dim);
  font-family: var(--sans);
  font-size: var(--step--1);
  line-height: 1.5;
}

.consent a {
  color: var(--paper);
}

.consent input {
  flex: none;
  appearance: none;
  width: 1.3rem;
  height: 1.3rem;
  margin: 0.05rem 0 0;
  border: 1px solid var(--paper);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.consent input:checked {
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5l3.6 3.6 7.4-8.2' fill='none' stroke='%230c0c0c' stroke-width='1.6'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.consent input[aria-invalid="true"] {
  border-width: 3px;
}

.form .btn {
  margin-top: 2.25rem;
}

/* Trampa para robots: fuera de la vista y del orden de tabulación. */
.trampa {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sent {
  max-width: 32rem;
}

.sent h3 {
  font-size: var(--step-2);
  line-height: 1.12;
  margin-bottom: 0.75rem;
}

.sent p {
  color: var(--paper-dim);
}

.sent .latin {
  color: var(--quiet);
  margin-top: 1.5rem;
}

.sent .link-it {
  margin-top: 1.25rem;
}

.sent-email {
  color: var(--paper);
  overflow-wrap: anywhere;
}

/* Confirmación: llega una postal y se sella con «B.». */
.postal-ok {
  width: min(18rem, 80%);
  margin-bottom: 2rem;
  transform: rotate(-2deg);
}

.postal-ok svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.pok-papel {
  fill: var(--paper);
}

.pok-sello-borde {
  fill: var(--paper-shade);
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.pok-sello-fondo {
  fill: var(--ink);
}

.pok-b {
  fill: var(--paper);
  font-family: var(--serif);
  font-size: 34px;
  text-anchor: middle;
}

.pok-sello {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

@media (prefers-reduced-motion: no-preference) {
  .sent .postal-ok {
    animation: pok-llega 0.7s var(--ease) both;
  }

  .sent .pok-sello {
    animation: pok-sello 0.4s cubic-bezier(0.2, 1.3, 0.4, 1) 0.6s both;
  }

  .sent .pok-matasellos {
    animation: aparece 0.4s ease 0.9s both;
  }
}

@keyframes pok-llega {
  from {
    opacity: 0;
    transform: translateY(2rem) rotate(-8deg);
  }
}

@keyframes pok-sello {
  from {
    opacity: 0;
    transform: scale(1.6);
  }
}

/* ---------- Pie ---------- */

/* El único color de la web: un viñedo con un árbol solo en la loma, que
   sale del negro por arriba y se oscurece abajo para que se lea el texto. */
.pie {
  position: relative;
  isolation: isolate;
  min-height: clamp(36rem, 26rem + 28vw, 50rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5rem;
  padding: clamp(5rem, 4rem + 6vw, 9rem) var(--pad-right) var(--pad-bottom) var(--pad-left);
  background: var(--ink);
  overflow: hidden;
}

.pie-foto,
.pie-foto img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

.pie-foto img {
  object-fit: cover;
  object-position: 50% 55%;
}

.pie::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    var(--ink) 0%,
    rgb(12 12 12 / 0.8) 20%,
    rgb(12 12 12 / 0.3) 45%,
    rgb(12 12 12 / 0.08) 70%,
    rgb(12 12 12 / 0.4) 88%,
    rgb(12 12 12 / 0.65) 100%
  );
}

/* En móvil, los enlaces van sobre negro y el paisaje aparece debajo, con el
   árbol en un hueco libre y el texto final sobre la parte oscura. */
@media (max-width: 40rem) {
  .pie {
    gap: 0;
  }

  .pie-contenido {
    margin-bottom: 22rem;
  }

  .pie-foto {
    top: auto;
    height: 62%;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%);
    mask-image: linear-gradient(to bottom, transparent, #000 30%);
  }

  .pie::before {
    background: linear-gradient(
      180deg,
      var(--ink) 0%,
      var(--ink) 38%,
      rgb(12 12 12 / 0.45) 50%,
      rgb(12 12 12 / 0.1) 64%,
      rgb(12 12 12 / 0.6) 82%,
      rgb(12 12 12 / 0.85) 100%
    );
  }
}

.pie-contenido {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.75rem 3rem;
}

@media (min-width: 40rem) {
  .pie-contenido {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pie-marca {
    grid-column: 1 / -1;
  }
}

/* En pantallas anchas, todo a la izquierda: a la derecha queda el árbol. */
@media (min-width: 56rem) {
  .pie-contenido {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2.5fr);
  }

  .pie-marca {
    grid-column: auto;
  }
}

.pie-logo {
  font-size: var(--step-3);
}

.pie-texto {
  margin-top: 1rem;
  max-width: 22rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--paper-dim);
}

.pie-titulo {
  margin-bottom: 0.9rem;
  font-size: var(--step-1);
  line-height: 1.2;
}

.pie-col a {
  display: inline-block;
  padding-block: 0.3rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--paper-dim);
  text-decoration: none;
}

.pie-col a:hover,
.pie-col a[aria-current="page"] {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.pie-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem 2.5rem;
  font-family: var(--sans);
  font-size: var(--step--1);
}

.pie-base .legal {
  max-width: 44ch;
}

.pie-copy {
  color: var(--paper-dim);
}

/* ---------- Páginas de texto (legales, 404) ---------- */

.doc-head {
  padding: var(--pad-top) var(--pad-right) 0 var(--pad-left);
}

/* El logo: «B.» en Michelangelus redonda, como el favicon. */
.logo {
  display: inline-block;
  font-size: var(--step-3);
  line-height: 1;
  text-decoration: none;
}

.doc {
  margin-inline: var(--pad-left) var(--pad-right);
  padding-block: clamp(4rem, 3rem + 6vw, 8rem) var(--section-space);
}

.doc h1 {
  font-size: var(--step-3);
  line-height: 1.1;
  max-width: 14em;
  text-wrap: balance;
}

.doc-body {
  max-width: var(--measure);
  margin-top: clamp(3rem, 2rem + 3vw, 4.5rem);
}

.doc-body h2 {
  font-size: var(--step-1);
  line-height: 1.25;
  margin-top: 3rem;
  margin-bottom: 0.75rem;
}

.doc-body p + p,
.doc-body p + ul,
.doc-body ul + p {
  margin-top: 1rem;
}

.doc-body ul {
  padding-left: 1.25rem;
  list-style: "– ";
}

.doc-body li + li {
  margin-top: 0.4rem;
}

.doc-body .pendiente {
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: var(--step--1);
  margin-top: 1rem;
}

.doc-body th,
.doc-body td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}

.doc-body th {
  color: var(--paper-dim);
}

.doc-body .table-wrap {
  overflow-x: auto;
}

/* Logo «B.» boca abajo (girado 180º) en todas sus apariciones. */
.logo,
.anverso-b {
  display: inline-block;
  transform: rotate(180deg);
}

.pok-b {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transform: rotate(180deg);
}

/* ---------- Giro del nombre al bajar ----------
   «Brindis.» se recoge en «B.» y gira hasta quedar boca abajo, como el logo.
   Después, el logo se queda fijo en la esquina. Lo mueve main.js (initGiro). */
.hero .wordmark.is-girando span {
  animation: none;
}

.hero .wordmark.is-girando {
  will-change: transform;
}

.logo-fijo {
  position: fixed;
  top: var(--pad-top);
  left: var(--pad-left);
  z-index: 20;
  /* Sello: «B.» sobre un círculo tinta, como el favicon. Tapa lo que pasa por debajo. */
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  font-size: 1.45rem;
  line-height: 1;
  padding-bottom: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.logo-fijo.is-on {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Preguntas ---------- */

.kit-sub {
  margin-top: 1.25rem;
  max-width: 34rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--paper-dim);
}

.faq-list {
  max-width: 40rem;
}

.faq-item {
  border-top: 1px solid var(--line);
}

.faq-item:last-child {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.1rem;
  font-size: var(--step-1);
  line-height: 1.3;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--sans);
  color: var(--paper-dim);
  transition: transform 0.3s var(--ease);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item summary:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 4px;
}

.faq-item p {
  padding-bottom: 1.25rem;
  max-width: 34rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--paper-dim);
}

/* ---------- Lecturas (artículos) ---------- */

.doc-kicker {
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--paper-dim);
  margin-bottom: 1rem;
}

.doc-lead {
  margin-top: 1.5rem;
  max-width: 30em;
  font-style: italic;
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--paper-dim);
}

.articulo .doc-body p,
.articulo .doc-body li {
  font-size: var(--step-0);
  line-height: 1.6;
}

.doc-cta {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.doc-cta-t {
  font-size: var(--step-2);
  line-height: 1.15;
}

.doc-cta .btn {
  margin-top: 0.5rem;
}

.articulo .doc-body .doc-cta-t {
  font-size: var(--step-2);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}
