/* Mari · base compartida (diseño de Figma, 1440 px de ancho)
   Unidad: --u = 1 px de Figma, escalado al ancho de la ventana (tope 1.2 px). */

@font-face { font-family: "PT Serif"; src: url(../fonts/ptserif-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url(../fonts/ptserif-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url(../fonts/ptserif-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url(../fonts/ptserif-700-italic.woff2) format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(../fonts/archivo.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Red Hat Display"; src: url(../fonts/redhat.woff2) format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Red Hat Display"; src: url(../fonts/redhat-italic.woff2) format("woff2"); font-weight: 300 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Biro Script"; src: url(../fonts/biro-script.woff2) format("woff2"); font-display: swap; }

:root {
  --bordo: #6b1a2c;
  --bordo-fondo: #62101d;
  --tinta: #1e1517;
  --crema: #f3eee8;
  --rosa: #f1c2ca;
  --rosa-claro: #f1bec7;
  --f-titulo: "PT Serif", Georgia, serif;
  --f-etiqueta: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-texto: "Red Hat Display", "Helvetica Neue", Arial, sans-serif;
  --f-nota: "Biro Script", "Segoe Script", cursive;
  --tex-crema: url(../img/v2/objetos/textura-blanca.webp);
  --tex-rosa: url(../img/v2/objetos/textura-rosa.webp);
  --tex-bordo: url(../img/v2/objetos/textura-bordo.webp);
  --tex-tam: 1672px auto;
}
.pagina { container-type: inline-size; }
.pagina, .pagina * { --u: min(100cqw / 1440, 1.2px); --cab: calc(93 * var(--u)); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--crema); color: var(--tinta);
  font-family: var(--f-texto); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--bordo); outline-offset: 3px; border-radius: 4px; }
.saltar { position: fixed; left: 12px; top: -60px; z-index: 300; background: var(--bordo); color: var(--crema); padding: 10px 16px; border-radius: 99px; font-family: var(--f-etiqueta); font-weight: 700; text-decoration: none; }
.saltar:focus { top: 12px; }

/* ---------- lienzo: caja de 1440 px de Figma, centrada; todo se posiciona adentro ---------- */
.lienzo { position: relative; width: calc(1440 * var(--u)); height: calc(var(--h, 0) * var(--u)); margin-inline: auto; }
.lienzo [style*="--x:"], .lienzo [style*="--x: "] {
  position: absolute; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u));
}
.lienzo [style*="--w:"] { width: calc(var(--w) * var(--u)); }
.lienzo [style*="--w:"] > img:only-child { width: 100%; height: auto; }
/* botones centrados en un punto (--cx, --cy) o alineados a la derecha (--rx) */
.lienzo .boton[style*="--cx"] { position: absolute; left: calc(var(--cx) * var(--u)); top: calc(var(--cy) * var(--u)); translate: -50% -50%; }
.lienzo .boton[style*="--rx"] { position: absolute; right: calc((1440 - var(--rx)) * var(--u)); top: calc(var(--cy) * var(--u)); translate: 0 -50%; }

/* ---------- hojas de papel ---------- */
.hoja { position: relative; background: var(--crema) var(--tex-crema) 0 0 / var(--tex-tam); }
.hoja--rosa { background: #f3c9ce var(--tex-rosa) 0 0 / var(--tex-tam); }
.hoja--bordo { background: var(--bordo-fondo) var(--tex-bordo) 0 0 / var(--tex-tam); color: var(--crema); }

/* ---------- tipografía ---------- */
.titulo { font-family: var(--f-titulo); font-weight: 700; font-size: calc(64 * var(--u)); line-height: 1.02; letter-spacing: -.005em; color: var(--tinta); }
.titulo em { font-style: italic; color: var(--bordo); }
.titulo--der { text-align: right; }
.titulo--bordo { color: var(--bordo); }

/* ---------- botones (píldora de papel) ---------- */
.boton {
  display: inline-flex; align-items: center; gap: .45em; white-space: nowrap;
  height: calc(44 * var(--u)); padding: 0 calc(21 * var(--u)); border-radius: 999px;
  font-family: var(--f-etiqueta); font-weight: 700; font-size: calc(15 * var(--u)); letter-spacing: .04em; text-transform: uppercase;
  text-decoration: none; color: var(--bordo);
  background: rgba(107, 26, 44, .3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(60, 10, 20, .12), 0 2px 5px rgba(60, 10, 20, .18);
  transition: background-color .25s, color .25s, translate .25s cubic-bezier(.3, .7, .3, 1), box-shadow .25s;
}
.boton .flecha { display: inline-block; width: 1.15em; height: .7em; transition: translate .25s cubic-bezier(.3, .7, .3, 1); }
.boton .flecha svg { width: 100%; height: 100%; overflow: visible; }
.boton:hover { background: var(--bordo); color: var(--crema); }
.boton:hover .flecha { translate: 4px 0; }
.boton--lleno { background: var(--bordo); color: var(--crema); }
.boton--lleno:hover { background: #4f1120; }
.boton--rosa { background: rgba(107, 26, 44, .32); }
.boton--oscuro { background: rgba(243, 238, 232, .2); color: var(--crema); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 2px 6px rgba(20, 0, 6, .3); }
.boton--oscuro:hover { background: var(--crema); color: var(--bordo); }
.boton--mail { text-transform: none; font-size: calc(21 * var(--u)); letter-spacing: .02em; height: calc(46 * var(--u)); padding: 0 calc(21 * var(--u)); }

/* ---------- cabecera ---------- */
.cab { position: relative; z-index: 8; background: var(--crema); color: var(--bordo); height: var(--cab); }
.cab__lienzo { position: relative; width: calc(1440 * var(--u)); height: 100%; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; padding: 0 calc(95 * var(--u)); }
.cab__logo { display: block; width: calc(113 * var(--u)); color: var(--bordo); }
.cab__logo .logo-svg { width: 100%; height: auto; }
.cab__nav { display: flex; align-items: center; }
.cab__nav > a:not(.boton):not(.cab__ig) {
  font-family: var(--f-etiqueta); font-weight: 600; font-size: calc(15 * var(--u)); letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; margin-right: calc(36 * var(--u)); position: relative;
}
.cab__nav > a:not(.boton):not(.cab__ig) { transition: opacity .2s; }
.cab__nav > a:not(.boton):not(.cab__ig):hover { opacity: .7; }
.cab__nav .boton { height: calc(44 * var(--u)); padding: 0 calc(21 * var(--u)); letter-spacing: .06em; }
.cab__ig { margin-left: calc(36 * var(--u)); width: calc(27 * var(--u)); color: var(--bordo); transition: opacity .2s; }
.cab__ig:hover { opacity: .7; }
.cab__ig svg { width: 100%; height: auto; }
.cab--oscura { background: #6b1a2c var(--tex-bordo) 0 0 / var(--tex-tam); color: var(--crema); }
.cab--oscura .cab__logo, .cab--oscura .cab__ig { color: var(--crema); }
.cab--oscura .boton--lleno { background: var(--crema); color: var(--bordo); }

/* capas: la cinta larga (z 1) pasa por el fondo, debajo de todo lo que hay en cada hoja */
.lienzo > * { z-index: 2; }

/* ---------- cursor: un moñito ---------- */
html { cursor: url(../img/v2/cursor-mono.png) 18 18, auto; cursor: -webkit-image-set(url(../img/v2/cursor-mono.png) 1x, url(../img/v2/cursor-mono@2x.png) 2x) 18 18, auto; }
a, button, [data-brisa], .llavero { cursor: url(../img/v2/cursor-mono.png) 18 18, pointer; cursor: -webkit-image-set(url(../img/v2/cursor-mono.png) 1x, url(../img/v2/cursor-mono@2x.png) 2x) 18 18, pointer; }

/* ---------- escritura a mano: la lapicera escribe de izquierda a derecha ---------- */
@property --escrito { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
html.js .escritura {
  --escrito: 0%;
  -webkit-mask-image: linear-gradient(100deg, #000 calc(var(--escrito) - 3%), transparent var(--escrito));
  mask-image: linear-gradient(100deg, #000 calc(var(--escrito) - 3%), transparent var(--escrito));
}
html.js .escritura.escrita { animation: escribir var(--dur-escritura, 2.2s) linear forwards; }
@keyframes escribir {
  0% { --escrito: 0%; } 14% { --escrito: 15%; } 20% { --escrito: 18%; } 24% { --escrito: 19%; }
  40% { --escrito: 41%; } 46% { --escrito: 45%; } 50% { --escrito: 46%; }
  72% { --escrito: 72%; } 78% { --escrito: 77%; } 82% { --escrito: 78%; } 100% { --escrito: 104%; }
}
@media (prefers-reduced-motion: reduce) { html.js .escritura { -webkit-mask-image: none; mask-image: none; } }

/* ---------- pestañas del fichero (decorativas) ---------- */
.pestana {
  position: absolute; z-index: 5; width: calc(250 * var(--u)); aspect-ratio: 417 / 85;
  top: auto !important; bottom: calc(100% - 1px);
  display: grid; place-items: center; padding-top: calc(5 * var(--u));
  background: url(../img/v2/objetos/tab-blanco.webp) center bottom / 100% 100% no-repeat;
  font-family: var(--f-etiqueta); font-weight: 600; font-size: calc(15 * var(--u)); letter-spacing: .1em; text-transform: uppercase;
  color: var(--bordo); pointer-events: none; user-select: none;
}
.pestana--rosa { background-image: url(../img/v2/objetos/tab-rosa.webp); }
.pestana--bordo { background-image: url(../img/v2/objetos/tab-bordo.webp); color: var(--crema); }
html.editando .pestana { pointer-events: auto; }

/* ---------- volver arriba ---------- */
.subir {
  position: fixed; right: calc(28 * var(--u)); bottom: calc(28 * var(--u)); z-index: 80;
  display: grid; place-items: center; width: calc(52 * var(--u)); height: calc(52 * var(--u)); border-radius: 50%;
  background: var(--bordo); color: var(--crema); box-shadow: 0 4px 12px rgba(40, 5, 12, .3);
  opacity: 0; translate: 0 12px; pointer-events: none; transition: opacity .3s, translate .3s, background-color .2s;
}
.subir svg { width: 44%; height: 44%; }
.subir.ver { opacity: 1; translate: 0 0; pointer-events: auto; }
.subir:hover { background: #4f1120; }
.subir:hover svg { translate: 0 -2px; transition: translate .2s; }

/* ---------- pie ---------- */
.pie { position: relative; background: #efc1c7 var(--tex-rosa) 0 0 / var(--tex-tam); color: var(--bordo); }
.pie--bordo { background: var(--bordo-fondo) var(--tex-bordo) 0 0 / var(--tex-tam); color: var(--crema); }
.pie__lienzo { height: auto; padding: calc(116 * var(--u)) calc(95 * var(--u)) calc(66 * var(--u)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; row-gap: calc(46 * var(--u)); }
.pie__nav, .pie__redes { display: flex; flex-direction: column; gap: calc(14.5 * var(--u)); }
.pie__redes { align-items: flex-end; gap: calc(11.5 * var(--u)); }
.pie__nav a, .pie__redes a, .pie__legal {
  font-family: var(--f-etiqueta); font-weight: 700; font-size: calc(16.5 * var(--u)); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; line-height: 1.3;
}
.pie__nav a, .pie__redes a { width: fit-content; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .3s; }
.pie__nav a:hover, .pie__redes a:hover { background-size: 100% 1.5px; }
.pie__logo { width: calc(235 * var(--u)); margin-top: calc(4 * var(--u)); color: inherit; }
.pie__logo .logo-svg { width: 100%; height: auto; }
.pie__legal { grid-column: 1 / -1; text-align: center; border-top: 1px solid color-mix(in srgb, currentColor 35%, transparent); padding-top: calc(46 * var(--u)); }

/* ---------- intro: el logo se escribe sobre el papel bordó (una vez por visita) ---------- */
.intro-logo { display: none; }
html.con-intro .intro-logo {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 200;
  background: var(--bordo-fondo) var(--tex-bordo) 0 0 / var(--tex-tam); color: var(--crema);
  box-shadow: 0 24px 50px rgba(20, 6, 10, .35);
  animation: intro-sale .7s cubic-bezier(.7, 0, .2, 1) 1.1s both; cursor: pointer;
}
html.con-intro .intro-logo.fuera { animation: intro-sale .4s cubic-bezier(.6, 0, .3, 1) both; }
.intro-logo__marca { width: min(230px, 46vw); height: auto; }
html.con-intro .intro-logo__marca { animation: intro-logo .9s cubic-bezier(.3, 0, .15, 1) .1s both; }
@keyframes intro-logo { from { clip-path: inset(-10% 100% -10% 0); opacity: .3; translate: 0 6px; } to { clip-path: inset(-10% 0 -10% 0); opacity: 1; translate: 0 0; } }
@keyframes intro-sale { to { translate: 0 -104%; } }
