/* Estilo común: paleta de María & Domi. Fondo claro, texto oliva oscuro y serif editorial */
:root {
  /* paleta */
  --olive-dark: #1F2315;
  --paper: #F8F7F2;
  --cream: #F1ECDD;
  --olive: #72774E;
  --lime: #D6E536;
  --blue: #2456F5;
  --salmon: #F05D43;

  --bg: var(--paper);
  --ink: var(--olive-dark);
  --dim: rgba(31, 35, 21, .7);
  --line: rgba(31, 35, 21, .2);
  --soft: rgba(31, 35, 21, .05);
  --accent: var(--olive);

  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --display: "Gilda Display", Didot, "Bodoni 72", Georgia, serif;
  --hand: "Caveat", "Segoe Print", cursive;
  color-scheme: light;
}
/* zonas oscuras: portada y cabeceras con foto. El lima solo va aquí, sobre blanco no se lee */
.dark {
  --bg: var(--olive-dark);
  --ink: var(--cream);
  --dim: rgba(241, 236, 221, .78);
  --line: rgba(241, 236, 221, .32);
  --soft: rgba(241, 236, 221, .08);
  --accent: var(--lime);
  color: var(--ink);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

/* textura de papel: grano fino y manchas suaves por encima de todo, sin bloquear clics */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .14 0 0 0 0 .08 0 0 0 .55 -.18'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .25 0 0 0 .4 -.18'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E");
  background-size: auto, 100% 100%; background-repeat: repeat, no-repeat;
  opacity: .5;
}
a { color: inherit; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: clamp(20px, 4.5vw, 58px); }
.wrap.narrow { max-width: 860px; }

/* cabecera */
.bar {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-top: clamp(22px, 5svh, 56px);
  font-size: clamp(.95rem, 2vw, 1.15rem); line-height: 1.1; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap;
}
.bar a { text-decoration: none; }
.menu {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 22px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase;
}
.menu nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.menu a { text-decoration: none; padding-block: 4px; border-bottom: 1px solid transparent; }
.menu a:hover, .menu a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.langs { display: flex; gap: 2px; }
.langs button {
  padding: 4px 7px; border: 0; border-radius: 4px; background: none; color: var(--dim);
  font: inherit; letter-spacing: inherit; cursor: pointer;
}
.langs button:hover { color: var(--ink); }
.langs button[aria-pressed="true"] { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* botones: de contorno fino, en mayúsculas espaciadas y con flecha; el principal va relleno */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px 30px; border: 1px solid var(--ink); border-radius: 0;
  background: var(--ink); color: var(--bg);
  font: inherit; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; text-align: center; cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn::after { content: "→"; letter-spacing: 0; transition: translate .2s ease; }
.btn:hover { background: transparent; color: var(--ink); }
.btn:hover::after { translate: 4px 0; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }
.dark .btn { background: transparent; color: var(--ink); }
.dark .btn:hover { border-color: var(--lime); color: var(--lime); }

.label { display: block; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }

/* logo original, coloreado con el color del texto (lima en las zonas oscuras) */
.mark { display: block; aspect-ratio: 478 / 101; background: var(--accent); -webkit-mask: url("/img/logo.svg") center / contain no-repeat; mask: url("/img/logo.svg") center / contain no-repeat; }

/* páginas interiores */
.page { position: relative; z-index: 2; flex: 1; padding-block: clamp(34px, 7svh, 76px) clamp(44px, 8svh, 90px); }
.page h1 { margin: 10px 0 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.45rem, 4vw, 2.3rem); line-height: 1.2; text-wrap: balance; }
.page .text { margin: 18px 0 0; max-width: 62ch; font-size: clamp(1rem, 2vw, 1.1rem); }
.facts { margin: clamp(22px, 4svh, 34px) 0 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 8em 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.facts dt { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.facts dd { margin: 0; font-size: clamp(.98rem, 2.4vw, 1.1rem); line-height: 1.35; }
.map { display: block; width: 100%; aspect-ratio: 16 / 10; min-height: 300px; margin-top: clamp(22px, 4svh, 34px); border: 1px solid var(--line); border-radius: 2px; background: var(--soft); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(20px, 3.5svh, 30px); }

.foot { position: relative; z-index: 2; border-top: 1px solid var(--line); }
.foot .wrap { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding-block: 16px 20px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }

@media (max-width: 520px) {
  .facts div { grid-template-columns: 6.2em 1fr; }
  .actions .btn { width: 100%; }
}

/* cabecera con foto de las páginas interiores */
.cover { position: relative; display: flex; flex-direction: column; min-height: min(58svh, 560px); overflow: hidden; background: var(--bg); }
.cover-bg { position: absolute; inset: -6% 0; background: center / cover no-repeat; animation: drift 26s ease-in-out infinite alternate; }
.cover-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(31, 35, 21, .66), rgba(31, 35, 21, .4) 45%, var(--bg)); }
@keyframes drift { from { transform: scale(1) translateY(-1.5%); } to { transform: scale(1.07) translateY(1.5%); } }
.cover .bar, .cover .menu { text-shadow: 0 1px 10px rgba(0, 0, 0, .55); }
.cover .title { position: relative; z-index: 2; margin-top: auto; padding-block: clamp(40px, 9svh, 90px) clamp(18px, 3svh, 30px); }
.cover h1 { margin: 10px 0 0; max-width: 22ch; font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 5vw, 3.2rem); line-height: 1.1; text-wrap: balance; }
.page.tight { padding-top: clamp(14px, 3svh, 30px); }

/* aparición al hacer scroll */
.js [data-rise] { opacity: 0; translate: 0 20px; transition: opacity .8s ease, translate .9s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.js [data-rise].in { opacity: 1; translate: none; }

.block { margin-top: clamp(34px, 6svh, 60px); }
.block > h2 { margin: 8px 0 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 3.6vw, 2.1rem); line-height: 1.15; }

/* cifras */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 16px); margin-top: 18px; }
.stat { padding: clamp(14px, 2vw, 22px); border: 1px solid var(--line); border-radius: 2px; }
.stat b { display: block; margin-top: 8px; font-family: var(--display); font-weight: 400; font-size: clamp(1.4rem, 3.6vw, 2.1rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat small { display: block; margin-top: 6px; font-size: 14px; line-height: 1.35; color: var(--dim); }

/* selector de origen */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.chips button:hover { border-color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* trayecto animado */
.trip { margin-top: 18px; padding: clamp(16px, 2.4vw, 26px); border: 1px solid var(--line); border-radius: 2px; background: var(--cream); }
.trip .ends { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; }
.trip .ends span:last-child { text-align: right; }
.road { position: relative; height: 22px; margin: 10px 0 12px; }
.road::before { content: ""; position: absolute; inset: 10px 0 auto; border-top: 2px dashed var(--line); }
.road::after { content: ""; position: absolute; top: 5px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--salmon); box-shadow: 0 0 0 5px rgba(240, 93, 67, .18); animation: travel 4.5s cubic-bezier(.5, 0, .3, 1) infinite; }
.road i { position: absolute; top: 4px; width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 50%; background: var(--bg); }
.road i:last-child { right: 0; border-radius: 3px; background: var(--ink); }
@keyframes travel { 0% { left: 0; opacity: 0; } 12% { opacity: 1; } 82% { opacity: 1; } 100% { left: calc(100% - 12px); opacity: 0; } }
.trip .big { margin: 0; font-family: var(--display); font-size: clamp(1.5rem, 4.6vw, 2.4rem); line-height: 1.15; }
.trip .how { margin: 6px 0 0; font-size: 14px; color: var(--dim); }
.swap { animation: swap .5s ease both; }
@keyframes swap { from { opacity: 0; translate: 0 8px; } }

/* tarjetas enlazadas */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 16px); }
.tile { display: flex; flex-direction: column; gap: 10px; padding: clamp(18px, 2.4vw, 26px); border: 1px solid var(--line); border-radius: 2px; text-decoration: none; transition: background .25s ease, border-color .25s ease, translate .25s ease; }
.tile:hover { background: var(--soft); border-color: var(--ink); translate: 0 -3px; }
.tile strong { font-family: var(--display); font-weight: 400; font-size: clamp(1.15rem, 2.2vw, 1.4rem); line-height: 1.3; text-wrap: balance; }
.tile .label::after { content: " →"; }

/* cupón */
.deal { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(16px, 4vw, 44px); }
.deal .pct { font-family: var(--display); font-size: clamp(4.4rem, 17vw, 9rem); line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.deal p { margin: 0; font-size: clamp(1rem, 2.2vw, 1.2rem); line-height: 1.4; }
.coupon {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  margin-top: 20px; padding: 16px clamp(18px, 3vw, 28px); background: var(--olive-dark); color: var(--cream); border-radius: 4px;
  -webkit-mask: radial-gradient(circle 9px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 9px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
}
.coupon .label { color: inherit; opacity: .75; }
.coupon b { display: block; font-weight: 500; color: var(--lime); font-size: clamp(1.3rem, 4.4vw, 2rem); letter-spacing: .08em; line-height: 1.2; }
.coupon button { padding: 10px 18px; border: 1px solid var(--cream); border-radius: 0; background: none; color: var(--cream); font: inherit; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }

/* pasos */
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 16px); counter-reset: paso; }
.steps li { counter-increment: paso; padding: clamp(14px, 2vw, 22px); border-top: 1px solid var(--olive); font-size: 16px; line-height: 1.4; }
.steps li::before { content: "0" counter(paso); display: block; margin-bottom: 8px; font-family: var(--hand); font-size: 1.5rem; line-height: 1; color: var(--salmon); }
.steps a { text-underline-offset: 3px; }

@media (max-width: 640px) {
  .stats, .steps, .cards { grid-template-columns: 1fr; }
  .deal { grid-template-columns: 1fr; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .cover-bg, .road::after, .swap { animation: none; }
  .road::after { left: calc(50% - 6px); }
  .js [data-rise] { opacity: 1; translate: none; transition: none; }
}

/* botón para volver arriba: las copas brindando de los dibujos, con su flecha */
.to-top {
  position: fixed; z-index: 50; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 1px solid rgba(214, 229, 54, .5); border-radius: 50%;
  background: #1F2315; color: #D6E536; cursor: pointer; box-shadow: 0 10px 24px -10px rgba(31, 35, 21, .6);
  opacity: 0; visibility: hidden; translate: 0 12px; transition: opacity .3s ease, translate .3s ease, visibility .3s, border-color .2s ease;
}
.to-top.show { opacity: 1; visibility: visible; translate: none; }
.to-top:hover { border-color: #D6E536; }
.to-top:focus-visible { outline: 2px solid #F05D43; outline-offset: 3px; }
.to-top svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.to-top:hover svg path:first-child { animation: up .6s ease; }
@keyframes up { 50% { translate: 0 -5px; } }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } .to-top:hover svg path:first-child { animation: none; } }
@media print { .to-top { display: none !important; } }

/* notas a mano que se escriben solas: letra a letra, cada una aparece con un fundido suave y se solapa con la siguiente */
[data-written] .ww { white-space: nowrap; }
[data-written] .ch { opacity: 0; filter: blur(3px); }
.writing .ch { animation: ink .6s cubic-bezier(.3, .6, .4, 1) calc(var(--extra, 0s) + var(--i) * 32ms) forwards; }
@keyframes ink { to { opacity: 1; filter: blur(0); } }
