@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/eb-garamond.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/eb-garamond-italic.woff2") format("woff2");
}

:root {
  --navy: #233953;
  --navy-deep: #1b2d43;
  --gold: #b39050;
  --gold-soft: #cdb382;
  --paper: #fefefc;
  --page: #f4f0e9;
  --line: rgba(35, 57, 83, 0.14);
  --muted: #586678;
  --cream: #f4efe6;
  --bar-h: 64px;
  --gutter: 32px;
  --max: 1200px;
  /* Ancho y posición de la portada al cargar: la intro coloca el logo encima. */
  --cover-w: min(1200px, calc(100vw - 64px));
  --cover-top: calc(var(--bar-h) + 40px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }

/* ---------- Cambio de idioma ----------
   Las dos versiones son páginas distintas: el navegador funde una en otra
   (View Transitions entre documentos). La cabecera se queda quieta, la raya
   dorada del selector se desliza de ES a EN y la presentación se disuelve y
   reaparece. Sin soporte, el cambio es el normal. */
@view-transition { navigation: auto; }

.bar { view-transition-name: bar; }

/* La cabecera cambia de golpe (marca y posición son idénticas en los dos
   idiomas; fundirla dejaría «Contacto» y «Contact» superpuestos). */
::view-transition-group(bar) { animation: none; }
::view-transition-old(bar) { animation: none; opacity: 0; }
::view-transition-new(bar) { animation: none; }
::view-transition-group(langs-line) { animation-duration: 0.7s; animation-timing-function: var(--ease); }
::view-transition-old(root) { animation: lang-out 0.45s ease both; }
::view-transition-new(root) { animation: lang-in 1s var(--ease) 0.15s both; }

@keyframes lang-out { to { opacity: 0; filter: blur(6px); } }
@keyframes lang-in { from { opacity: 0; translate: 0 14px; filter: blur(4px); } }
.lenis.lenis-stopped { overflow: clip; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--paper);
  text-decoration: none;
}
.skip:focus { top: 12px; }

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

/* ---------- Barra superior ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--bar-h);
  background: rgba(254, 254, 252, 0.88);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: translate 0.6s var(--ease);
  animation: bar-in 1.1s var(--ease) backwards;
}
.bar.is-hidden { translate: 0 -100%; }
@keyframes bar-in { from { opacity: 0; translate: 0 -12px; } }

.bar__inner {
  height: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}
.brand img { width: 40px; height: auto; flex: none; }

.bar__nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.langs {
  display: flex;
  gap: 2px;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
}
.langs a {
  padding: 6px 7px;
  text-decoration: none;
  color: var(--muted);
}
.langs a:hover { color: var(--navy); }
.langs a { position: relative; }
.langs a[aria-current] { color: var(--navy); }
.langs__line {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  view-transition-name: langs-line;
}

.link {
  font-size: 0.98rem;
  text-decoration: none;
  background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 100% / 0 1px;
  transition: background-size 0.3s ease;
}
.link:hover { background-size: 100% 1px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px 8px;
  border: 1px solid var(--navy);
  color: var(--navy);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn svg { width: 15px; height: 15px; flex: none; margin-top: -2px; }
.btn:hover { background: var(--navy); color: var(--paper); }

.progress {
  position: fixed;
  z-index: 60;
  left: 0; right: 0; top: 0;
  height: 2px;
  pointer-events: none;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
@supports (animation-timeline: scroll()) {
  .progress {
    animation: progress linear both;
    animation-timeline: scroll(root block);
  }
}
@keyframes progress { to { transform: scaleX(1); } }

/* ---------- Diapositivas ---------- */

.deck {
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 40px var(--gutter) 72px;
  display: grid;
  gap: 32px;
}

.slide {
  margin: 0;
  position: relative;
  background: var(--paper);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(27, 45, 67, 0.06),
    0 24px 48px -28px rgba(27, 45, 67, 0.35);
}
.slide img { width: 100%; height: 100%; object-fit: cover; }

.slide img { transition: opacity 0.7s ease; }
.slide img.is-loading { opacity: 0; }

.slide.is-pending { opacity: 0; translate: 0 56px; }
.slide.is-pending img { scale: 1.07; }
.slide.is-shown {
  transition: opacity 1.3s var(--ease), translate 1.5s var(--ease);
}
.slide.is-shown img {
  transition: scale 2.4s var(--ease), opacity 0.7s ease;
}

/* Entrada de la portada al cargar */
.deck .slide:first-child { animation: cover-in 1.6s var(--ease) 0.15s backwards; }
.deck .slide:first-child img { animation: settle 2.6s var(--ease) 0.15s backwards; }
@keyframes cover-in { from { opacity: 0; translate: 0 24px; } }
@keyframes settle { from { scale: 1.05; } }

/* ---------- Intro del logo (una vez por visita) ---------- */

.intro { display: none; }

html.has-intro .intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  background: var(--paper);
  animation: intro-out 1.1s var(--ease) 2.1s forwards;
}

/* Logo y nombre exactamente donde están en la portada (medido sobre la
   diapositiva): al fundirse la capa, la página se construye a su alrededor. */
.intro__mark {
  position: absolute;
  left: calc(50% - var(--cover-w) * 0.0018);
  top: calc(var(--cover-top) + var(--cover-w) * 0.2144);
  width: calc(var(--cover-w) * 0.1526);
  aspect-ratio: 2731 / 2381;
  translate: -50% -50%;
}
.intro__mark svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro__loop { animation: intro-loop 1.35s cubic-bezier(0.65, 0, 0.35, 1) 0.25s backwards; }
.intro__d { animation: intro-d 1.2s var(--ease) 0.6s backwards; }

.intro__name {
  position: absolute;
  left: calc(50% - var(--cover-w) * 0.0016);
  top: calc(var(--cover-top) + var(--cover-w) * 0.404);
  translate: -50% -50%;
  margin: 0;
  padding-left: 0.248em;
  font-size: calc(var(--cover-w) * 0.0188);
  line-height: 1;
  letter-spacing: 0.248em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--navy);
  animation: intro-name 1.6s var(--ease) 0.95s backwards;
}

/* La portada inglesa es otra exportación: el logo y el nombre caen un poco
   desplazados y algo más grandes (medido igual, sobre la diapositiva 1 en inglés). */
html[lang="en"] .intro__mark {
  left: calc(50% + var(--cover-w) * 0.001);
  top: calc(var(--cover-top) + var(--cover-w) * 0.2131);
  width: calc(var(--cover-w) * 0.1546);
}
html[lang="en"] .intro__name {
  left: calc(50% + var(--cover-w) * 0.0015);
  top: calc(var(--cover-top) + var(--cover-w) * 0.4056);
  font-size: calc(var(--cover-w) * 0.0191);
}

@keyframes intro-loop { from { clip-path: inset(0 50% 0 50%); } }
@keyframes intro-d { from { opacity: 0; translate: 0 10px; } }
@keyframes intro-name { from { opacity: 0; letter-spacing: 0.6em; } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }

/* Con intro, la portada queda quieta debajo y la barra llega al final. */
html.has-intro .bar { animation-delay: 2.4s; }
html.has-intro .deck .slide:first-child,
html.has-intro .deck .slide:first-child img { animation: none; }

/* ---------- Contador y WhatsApp ---------- */

.counter {
  position: fixed;
  z-index: 40;
  left: 32px;
  bottom: 30px;
  display: none;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  letter-spacing: 0.18em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--muted);
  opacity: 0;
  translate: 0 10px;
  pointer-events: none;
  transition: opacity 0.7s var(--ease), translate 0.7s var(--ease);
}
.counter.is-visible { opacity: 1; translate: 0 0; }
.counter__now { color: var(--navy); transition: opacity 0.16s ease, translate 0.16s ease; }
.counter__now.is-changing { opacity: 0; translate: 0 -4px; }
.counter__line { width: 32px; height: 1px; background: var(--gold); }

@media (min-width: 1380px) {
  .counter { display: flex; }
}

.wa {
  position: fixed;
  z-index: 45;
  right: 28px;
  bottom: 28px;
  display: none;
  align-items: center;
  height: 52px;
  padding: 0 15.5px;
  border-radius: 999px;
  background: rgba(254, 254, 252, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--navy);
  text-decoration: none;
  box-shadow:
    0 0 0 1px rgba(35, 57, 83, 0.12),
    0 18px 40px -20px rgba(27, 45, 67, 0.5);
  opacity: 0;
  translate: 0 18px;
  pointer-events: none;
  transition:
    opacity 0.7s var(--ease),
    translate 0.7s var(--ease),
    box-shadow 0.4s ease;
}
.wa.is-ready { display: flex; }
.wa.is-visible { opacity: 1; translate: 0 0; pointer-events: auto; }
.wa svg { width: 21px; height: 21px; flex: none; }
.wa__label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding-top: 2px;
  transition: max-width 0.6s var(--ease), opacity 0.4s ease, margin 0.6s var(--ease);
}
.wa:hover, .wa:focus-visible {
  box-shadow:
    0 0 0 1px var(--gold),
    0 22px 44px -20px rgba(27, 45, 67, 0.55);
}
.wa:hover .wa__label, .wa:focus-visible .wa__label {
  max-width: 130px;
  opacity: 1;
  margin: 0 4px 0 12px;
}

/* ---------- Contacto ---------- */

/* Zonas clicables sobre los correos y el teléfono de la última diapositiva. */
.spot {
  position: absolute;
  z-index: 1;
  border-radius: 2px;
}
.spot::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 14%;
  height: 1px;
  background: var(--gold);
  scale: 0 1;
  transition: scale 0.5s var(--ease);
}
.spot:hover::after, .spot:focus-visible::after { scale: 1 1; }
.spot:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
/* En pantallas táctiles el texto mide unos 18 px: se amplía la zona de pulsación. */
@media (pointer: coarse) {
  .spot::before { content: ""; position: absolute; inset: -12px -4px; }
}

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

.foot {
  background: var(--paper);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.foot__inner {
  max-width: calc(var(--max) + var(--gutter) * 2);
  min-height: 48px;
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}

.foot__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}
.foot__legal a { text-decoration: none; transition: color 0.3s ease; }
.foot__legal a:hover { color: var(--navy); }
.foot .credit { opacity: 0.7; }

/* ---------- Páginas legales ---------- */

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}
.doc h1 {
  margin: 0 0 8px;
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3rem);
  line-height: 1.1;
}
.doc .updated { margin: 0 0 40px; color: var(--muted); font-style: italic; }
.doc h2 {
  margin: 44px 0 10px;
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.25;
}
.doc p, .doc li { color: #2c3f57; }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 4px 0; }
.doc a { text-decoration-color: var(--gold); text-underline-offset: 3px; }
.doc dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0; }
.doc dt { color: var(--muted); }
.doc dd { margin: 0; }
.todo { background: #fff2c7; padding: 0 4px; }

.lost {
  min-height: calc(100vh - var(--bar-h));
  display: grid;
  place-content: center;
  text-align: center;
  padding: 48px 24px;
}
.lost h1 { font-weight: 400; font-size: clamp(2rem, 6vw, 3rem); margin: 0 0 24px; }
.lost .btn { justify-self: center; }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  :root { --bar-h: 56px; --gutter: 16px; --cover-w: 100vw; --cover-top: calc(var(--bar-h) + 16px); }
  .brand img { width: 34px; }
  .bar__nav { gap: 12px; }
  .bar__nav .link { display: none; }
  .btn { padding: 8px 12px 7px; }
  .deck { padding: 16px 0 48px; gap: 12px; }
  .slide { box-shadow: none; }
  .slide.is-pending { translate: 0 28px; }
  .foot { font-size: 0.6rem; letter-spacing: 0.16em; }
  .foot__inner { justify-content: center; text-align: center; gap: 6px 18px; padding: 14px var(--gutter) 18px; }
  .foot__legal { justify-content: center; gap: 6px 18px; }
  .wa { right: 16px; bottom: 16px; height: 48px; padding: 0 13.5px; }
  .doc dl { grid-template-columns: 1fr; gap: 0; }
  .doc dd { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
  .progress { display: none; }
  .bar, .deck .slide:first-child, .deck .slide:first-child img { animation: none; }
  .intro { display: none !important; }
}

@media print {
  .bar, .skip, .wa, .counter, .progress { display: none !important; }
  body { background: #fff; }
  .deck { padding: 0; gap: 0; }
  .slide { box-shadow: none; break-inside: avoid; }
}

/* Zonas de contacto (generado por build.mjs) */
.spot--es-1 { left: 20.5%; top: 83.2%; width: 15.9%; height: 8%; }
.spot--es-2 { left: 41.6%; top: 83.2%; width: 15.9%; height: 8%; }
.spot--es-3 { left: 62.7%; top: 83.2%; width: 17%; height: 8%; }
.spot--en-4 { left: 20.1%; top: 82.6%; width: 16.1%; height: 8%; }
.spot--en-5 { left: 41.4%; top: 82.6%; width: 16.2%; height: 8%; }
.spot--en-6 { left: 62.7%; top: 82.6%; width: 17.3%; height: 8%; }
