/* ==========================================================================
   Restaurantes Holbox — «Holbox tiene más de una forma de sorprenderte»
   Tres voces separadas, sin mezclar:
   · Portal (encabezado, costura «o» y pie): Cormorant Garamond, gris piedra.
   · MILPA: logotipo oficial dorado; Times/Helvetica y azul noche + oro,
     como en sus tarjetas.
   · CateringHolbox: Newsreader + Hanken Grotesk; espresso, marfil, ámbar,
     como en su sitio actual.
   Sin JavaScript: el revelado y la interacción son solo CSS.
   ========================================================================== */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader Variable';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/newsreader.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Hanken Grotesk Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/hanken-grotesk.woff2') format('woff2-variations');
}

:root {
  /* Portal (neutro) */
  --piedra: #0f0e0d;
  --hueso: #e8e4dc;
  --hueso-suave: #aaa59a;
  --portal-serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;

  /* MILPA */
  --milpa-noche: 23 26 55; /* #171a37 */
  --milpa-oro: #d8b975;
  --milpa-oro-claro: #f0dca5;
  --milpa-serif: 'Times New Roman', Times, serif;
  --milpa-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* CateringHolbox */
  --ch-espresso: 34 24 18; /* #221812 */
  --ch-marfil: #f5f1e9;
  --ch-arena: #d6c9b5;
  --ch-ambar: #d39a4a;
  --ch-serif: 'Newsreader Variable', 'Iowan Old Style', Georgia, serif;
  --ch-sans: 'Hanken Grotesk Variable', 'Helvetica Neue', Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-slow: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1.25rem, 0.6rem + 2.6vw, 3.25rem);
  --panel-h: clamp(26rem, 60svh, 40rem); /* móvil */
}

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

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

body {
  margin: 0;
  font-family: var(--portal-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; font-weight: inherit; }

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

/* ==========================================================================
   Encabezado del portal
   ========================================================================== */

.masthead {
  padding: clamp(1.4rem, 1rem + 2vw, 2.4rem) var(--gutter) clamp(1.2rem, 0.9rem + 1.4vw, 2rem);
  text-align: center;
  animation: rise 1s var(--ease-slow) both;
}

.masthead__title {
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.42em;
  margin-right: -0.42em; /* centra ópticamente el espaciado final */
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--hueso-suave);
}

.masthead__concept {
  margin-top: 0.55rem;
  font-weight: 500;
  font-size: clamp(1.55rem, 1.1rem + 2.2vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.masthead__intro {
  margin-top: 0.8rem;
  font-style: italic;
  font-size: clamp(0.98rem, 0.9rem + 0.35vw, 1.2rem);
  line-height: 1.4;
  color: var(--hueso-suave);
  text-wrap: balance;
}

.masthead__coda {
  margin-top: 0.35rem;
  color: var(--hueso);
}

.br-wide { display: none; }

/* ==========================================================================
   Las dos propuestas
   ========================================================================== */

.choices {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  background: var(--piedra);
}

.choice {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  height: var(--panel-h);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* Revelado inicial: cada propuesta emerge de la penumbra (no retrasa el LCP:
   la foto ya está pintada debajo, solo se retira una capa). */
.choice::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--piedra);
  pointer-events: none;
  animation: unveil 1.5s var(--ease) 0.15s both;
}
.choice--catering::after { animation-delay: 0.3s; }

.choice__photo,
.choice__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.choice__photo img {
  object-fit: cover;
  transform: scale(1);
  animation: settle 2.6s var(--ease-slow) 0.15s backwards;
  transition: transform 1.8s var(--ease-slow), filter 0.9s var(--ease);
}
.choice--catering .choice__photo img { animation-delay: 0.3s; }

/* ==========================================================================
   Cámara ambiental en loop — «una cámara que respira»
   Capas (de fuera hacia dentro), cada una con un solo trabajo:
     .choice__cam   → zoom lento (scale) + paneo horizontal (translate X)
     .choice__photo → deriva vertical (translate Y)
     img            → acercamiento interactivo del hover (transform) y
                      entrada inicial; nunca compite con el loop
     .choice__light → luz que respira (opacity) y se desplaza en sentido
                      contrario a la cámara (paralaje = profundidad)
   Cada eje oscila con `alternate` y curva senoidal: no hay reinicio, por
   tanto no hay saltos. Los periodos son distintos entre ejes y entre marcas
   (incommensurables), así el movimiento nunca se detiene ni se repite de
   forma mecánica. Solo se animan scale, translate y opacity (GPU, sin CLS).
   ========================================================================== */

.choice__cam {
  position: absolute;
  inset: 0;
  scale: var(--z-min);
  will-change: scale, translate;
  animation:
    cam-zoom var(--t-zoom) var(--sine) var(--d-zoom) infinite alternate,
    cam-pan-x var(--t-x) var(--sine) var(--d-x) infinite alternate;
}

.choice__cam .choice__photo {
  will-change: translate;
  animation: cam-pan-y var(--t-y) var(--sine) var(--d-y) infinite alternate;
}

.choice__light {
  position: absolute;
  inset: -12%;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: var(--l-min);
  will-change: opacity, translate;
  animation:
    light-breathe var(--t-light) var(--sine) var(--d-light) infinite alternate,
    light-drift var(--t-x) var(--sine) var(--d-x) infinite alternate;
}

.choice--milpa {
  --sine: cubic-bezier(0.37, 0, 0.63, 1);
  /* Ciclo principal 22 s (11 s ida + 11 s vuelta) */
  --z-min: 1.06; --z-max: 1.12; --t-zoom: 11s;   --d-zoom: -3s;
  --px: 1.8%;                    --t-x: 14.5s;   --d-x: -9s;
  --py: 1.4%;                    --t-y: 9s;      --d-y: -2s;
  --l-min: 0.22; --l-max: 0.8;   --t-light: 12.5s; --d-light: -6s;
  --lx: 2.5%; --ly: -1.5%;
}
.choice--milpa .choice__light {
  /* Luz de oro claro de MILPA, como un foco cálido sobre la hierbabuena */
  background: radial-gradient(48% 40% at 34% 30%, rgb(240 220 165 / 0.75), rgb(240 220 165 / 0) 72%);
}

.choice--catering {
  --sine: cubic-bezier(0.37, 0, 0.63, 1);
  /* Ciclo principal 24 s; ritmos distintos de MILPA en todos los ejes */
  --z-min: 1.07; --z-max: 1.14; --t-zoom: 12s;   --d-zoom: -8s;
  --px: 2.2%;                    --t-x: 17s;     --d-x: -4s;
  --py: 1.2%;                    --t-y: 10.5s;   --d-y: -7s;
  --l-min: 0.25; --l-max: 0.85;  --t-light: 9.5s; --d-light: -1s;
  --lx: -2.5%; --ly: 1.5%;
}
.choice--catering .choice__light {
  /* Resplandor ámbar del atardecer, del lado del sol */
  background: radial-gradient(52% 48% at 76% 30%, rgb(211 154 74 / 0.8), rgb(211 154 74 / 0) 72%);
}

/* Móvil y tableta vertical: menos amplitud, sin recortes indeseados */
@media (max-width: 899px) {
  .choice--milpa    { --z-min: 1.04; --z-max: 1.08; --px: 1%;   --py: 0.8%; --lx: 1.5%;  --ly: -1%; }
  .choice--catering { --z-min: 1.05; --z-max: 1.09; --px: 1.2%; --py: 0.7%; --lx: -1.5%; --ly: 1%; }
}

/* Velos simétricos: mismas paradas en ambas, cada una en su color */
.choice__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgb(var(--tono) / 0.6) 0%, rgb(var(--tono) / 0) 30%),
    linear-gradient(to top,
      rgb(var(--tono) / 0.96) 0%,
      rgb(var(--tono) / 0.86) 20%,
      rgb(var(--tono) / 0.4) 40%,
      rgb(var(--tono) / 0) 62%);
  transition: opacity 0.9s var(--ease);
}

.choice__kicker {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  padding: clamp(1.4rem, 1rem + 1.6vw, 2.4rem) var(--gutter) 0;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.45), 0 0 18px rgb(0 0 0 / 0.55);
  text-transform: uppercase;
  animation: rise 1.1s var(--ease-slow) 0.7s backwards;
}

.choice__body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 var(--gutter) clamp(2rem, 1.4rem + 2.6vw, 4rem);
  animation: rise 1.2s var(--ease-slow) 0.55s backwards;
  transition: opacity 0.9s var(--ease);
}
.choice--catering .choice__body,
.choice--catering .choice__kicker { animation-delay: 0.7s; }
.choice--catering .choice__kicker { animation-delay: 0.85s; }

/* Invitación: visible en táctil; en escritorio aparece al explorar */
.choice__invite {
  margin-top: 1.1rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease-slow);
}
.arrow {
  display: inline-block;
  margin-left: 0.25em;
  transition: transform 0.6s var(--ease);
}

.choice:focus-visible {
  outline: 2px solid var(--hueso);
  outline-offset: -6px;
}

/* ---------- MILPA ---------- */

.choice--milpa { --tono: var(--milpa-noche); background: rgb(var(--milpa-noche)); }
.choice--milpa .choice__photo img { object-position: 50% 24%; }

.milpa__kicker { font-family: var(--milpa-sans); color: var(--milpa-oro); }

.milpa__mark img {
  width: clamp(9.5rem, 7rem + 6.5vw, 14rem);
  height: auto;
  filter: drop-shadow(0 2px 14px rgb(0 0 0 / 0.35));
}

.milpa__line {
  margin-top: clamp(0.9rem, 0.6rem + 0.8vw, 1.3rem);
  font-family: var(--milpa-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.65rem);
  color: var(--milpa-oro-claro);
  line-height: 1.2;
}

.milpa__invite { font-family: var(--milpa-sans); color: var(--milpa-oro); }

/* ---------- CateringHolbox ---------- */

.choice--catering { --tono: var(--ch-espresso); background: rgb(var(--ch-espresso)); }
.choice--catering .choice__photo img { object-position: 64% 55%; }

.catering__kicker { font-family: var(--ch-sans); font-weight: 500; color: var(--ch-ambar); }

.catering__mark {
  font-family: var(--ch-serif);
  font-optical-sizing: auto;
  font-weight: 400;
  /* Escala óptica equivalente al logotipo de MILPA */
  font-size: clamp(2.2rem, 1.6rem + 2vw, 3.3rem);
  letter-spacing: -0.018em;
  line-height: 1;
  color: var(--ch-marfil);
  white-space: nowrap;
}

.catering__line {
  margin-top: clamp(0.9rem, 0.6rem + 0.8vw, 1.3rem);
  font-family: var(--ch-serif);
  font-weight: 340;
  font-size: clamp(1.2rem, 1.02rem + 0.6vw, 1.55rem);
  color: var(--ch-arena);
  line-height: 1.25;
}

.catering__invite { font-family: var(--ch-sans); font-weight: 500; color: var(--ch-ambar); }

/* ==========================================================================
   Costura «o»: la elección. En móvil, además, invita a seguir bajando.
   ========================================================================== */

.seam {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: var(--panel-h);
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  background: var(--piedra);
  box-shadow: 0 0 0 1px rgb(232 228 220 / 0.22);
  pointer-events: none; /* toda la superficie sigue siendo clicable */
  animation: fade 1s var(--ease) 1.1s both;
}

.seam__o {
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1;
  margin-top: -0.18rem;
  color: var(--hueso);
}

/* Señal de scroll (móvil): un trazo que desciende bajo la «o» */
.seam__cue {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  width: 1px;
  height: 1.5rem;
  translate: -50% 0;
  background: linear-gradient(to bottom, rgb(232 228 220 / 0.9), rgb(232 228 220 / 0));
  transform-origin: top;
  animation: cue 2.4s var(--ease) 1.6s infinite both;
}

/* ==========================================================================
   Exploración con cursor (escritorio)
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {
  .choice__invite { opacity: 0; transform: translateY(0.5rem); }

  .choice:hover .choice__photo img,
  .choice:focus-visible .choice__photo img { transform: scale(1.085); filter: brightness(1.06); }

  .choice:hover .choice__invite,
  .choice:focus-visible .choice__invite { opacity: 1; transform: none; }

  .choice:hover .arrow,
  .choice:focus-visible .arrow { transform: translate(3px, -3px); }

  /* La otra propuesta sigue presente, en penumbra, esperando su turno */
  .choices:hover .choice:not(:hover) .choice__photo img { filter: brightness(0.58) saturate(0.85); }
  .choices:hover .choice:not(:hover) .choice__body { opacity: 0.7; }
}

.choice:active .choice__photo img { filter: brightness(0.92); }

/* ==========================================================================
   Pie
   ========================================================================== */

.colophon {
  padding: clamp(2.2rem, 1.4rem + 2vw, 3rem) var(--gutter) calc(clamp(1.8rem, 1.2rem + 2vw, 2.8rem) + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.95rem;
  color: var(--hueso-suave);
  line-height: 1.6;
}
.colophon p:first-child {
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--hueso);
}
.colophon__place { margin-top: 0.3rem; }
.colophon__note { font-style: italic; margin-top: 0.3rem; }

/* ==========================================================================
   Animaciones
   ========================================================================== */

@keyframes unveil { from { opacity: 1; } to { opacity: 0; } }
@keyframes settle { from { transform: scale(1.06); } to { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(0.75rem); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cam-zoom { from { scale: var(--z-min); } to { scale: var(--z-max); } }
@keyframes cam-pan-x { from { translate: calc(var(--px) * -1) 0; } to { translate: var(--px) 0; } }
@keyframes cam-pan-y { from { translate: 0 calc(var(--py) * -1); } to { translate: 0 var(--py); } }
@keyframes light-breathe { from { opacity: var(--l-min); } to { opacity: var(--l-max); } }
@keyframes light-drift { from { translate: var(--lx) var(--ly); } to { translate: calc(var(--lx) * -1) calc(var(--ly) * -1); } }
@keyframes cue {
  0% { transform: scaleY(0); opacity: 1; }
  55% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .choice::after { display: none; }
  .choice:hover .choice__photo img,
  .choice:focus-visible .choice__photo img { transform: none; }
  .seam__cue { transform: none; }
  /* Versión estática: encuadre fijo (con margen) y luz en reposo */
  .choice__cam, .choice__cam .choice__photo, .choice__light { will-change: auto; translate: none; }
}

/* ==========================================================================
   Tableta vertical
   ========================================================================== */

/* Móvil y tableta vertical: el segundo bloque deja sitio a la «o» y su trazo */
@media (max-width: 899px) {
  .choice--catering .choice__kicker { padding-top: 4.9rem; }
}

@media (min-width: 600px) and (max-width: 899px) {
  :root { --panel-h: clamp(26rem, 46svh, 36rem); }
}

/* ==========================================================================
   Escritorio y tableta horizontal: lado a lado
   ========================================================================== */

@media (min-width: 900px) {
  body {
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr auto;
  }

  .masthead {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 2rem;
    text-align: left;
    padding-block: clamp(1.6rem, 1rem + 1.6vw, 2.6rem) clamp(1.3rem, 1rem + 1vw, 2rem);
  }
  .masthead__title { margin-right: 0; }
  .masthead__intro { margin-top: 0; text-align: right; }
  .br-wide { display: inline; }

  .choices {
    grid-template-columns: 1fr 1fr;
    min-height: max(34rem, calc(100svh - 10.5rem));
  }
  .choice { height: auto; min-height: 100%; }

  /* La «o» sobre la costura vertical, a media altura; sin señal de scroll */
  .seam { top: 50%; }
  .seam__cue { display: none; }
}
