/* Kroc Empanadas — landing */

@font-face {
  font-family: "Bebas Neue";
  src: url("../assets/fonts/bebas-neue-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Anton";
  src: url("../assets/fonts/anton-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Paleta de marca */
  --amarillo: #FCC915;
  --granate: #650D0F;
  --crema: #F5EEE7;
  --naranja: #F5A403;
  --amarillo-claro: #FFEC9C;

  /* Tipografías */
  --font-display: "Bebas Neue", "Anton", "Avenir Next Condensed", "Roboto Condensed", sans-serif-condensed, "Arial Narrow", Impact, sans-serif;
  --font-label: "Anton", "Bebas Neue", "Avenir Next Condensed", "Roboto Condensed", sans-serif-condensed, "Arial Narrow", Impact, sans-serif;
  --font-text: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Ritmo */
  --gutter: clamp(1.5rem, 6vw, 3rem);
  --measure: 45rem;
  --section-space: clamp(4.5rem, 16vw, 8.5rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-arrive: cubic-bezier(.16, 1, .3, 1);
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--amarillo);
  color: var(--granate);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

/* Si las tipografías de marca aún no han cargado, la de respaldo es más ancha:
   mejor partir una palabra que provocar scroll horizontal. */
.hero__title,
.display,
.menu__heading,
.menu__list li {
  overflow-wrap: anywhere;
}

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

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

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--granate);
  outline-offset: 4px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.section {
  padding: var(--section-space) var(--gutter);
  text-align: center;
}

.section > * {
  max-width: var(--measure);
  margin-inline: auto;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 18vw, 9rem);
  line-height: .9;
  letter-spacing: .005em;
  text-transform: uppercase;
}

.display > span {
  display: block;
}

.lead {
  max-width: 26rem;
  margin-top: 1.5rem;
  font-size: clamp(1.125rem, 4.6vw, 1.375rem);
  line-height: 1.45;
  text-wrap: balance;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  max-width: 100%;
  min-height: 3.5rem;
  padding: 0 1.75rem;
  border-radius: 999px;
  background: var(--granate);
  color: var(--crema);
  font-family: var(--font-label);
  font-size: 1.125rem;
  letter-spacing: .05em;
  text-decoration: none;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--ease), background-color .2s var(--ease),
    color .2s var(--ease), box-shadow .2s var(--ease);
}

.btn svg {
  flex: none;
  width: 1.4em;
  height: 1.4em;
  fill: currentColor;
}

@media (hover: hover) {
  .btn:hover {
    box-shadow: 0 10px 24px rgb(101 13 15 / .28);
  }
}

.btn:active {
  background: var(--naranja);
  color: var(--granate);
  transform: scale(.97);
}

/* 1. Portada ---------------------------------------------------------------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(.75rem, 2.8vh, 1.75rem);
  gap: clamp(.75rem, 2.8svh, 1.75rem);
  min-height: 100vh;
  min-height: 100svh;
  padding-block: clamp(1rem, 4vh, 4rem);
  padding-block: clamp(1rem, 4svh, 4rem);
}

/* Entrada de la portada: el logo cae, el titular sube línea a línea y, al final,
   un destello cruza el logo como el brillo de una empanada recién hecha.
   Solo CSS y con relleno "backwards": al terminar no queda ningún estilo pegado. */
.hero__logo {
  position: relative;
}

.hero__logo img {
  width: min(58vw, 280px, 30vh);
  width: min(58vw, 280px, 30svh);
  height: auto;
  filter: drop-shadow(0 16px 26px rgb(101 13 15 / .22));
  animation: logo-in .7s var(--ease-arrive) backwards;
}

/* El destello se recorta con la silueta del propio logo (misma imagen que carga el móvil) */
.hero__logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 42%, rgb(255 249 225 / .7) 50%, transparent 58%) 0 0 / 300% 100% no-repeat;
  -webkit-mask: url("../assets/img/logo-kroc-640.webp") center / contain no-repeat;
  mask: url("../assets/img/logo-kroc-640.webp") center / contain no-repeat;
  pointer-events: none;
  animation: logo-sheen 1s cubic-bezier(.45, 0, .25, 1) .75s backwards;
}

.hero__title span {
  animation: line-rise .75s var(--ease-arrive) backwards;
}

.hero__title span:nth-child(1) {
  animation-delay: .12s;
}

.hero__title span:nth-child(2) {
  animation-delay: .2s;
}

.hero__title span:nth-child(3) {
  animation-delay: .28s;
}

.hero__lead,
.hero .btn {
  animation: hero-settle .6s var(--ease-arrive) .45s backwards;
}

.hero .btn {
  animation-delay: .55s;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: min(15vw, 8.5vh, 5.75rem);
  font-size: min(15vw, 8.5svh, 5.75rem);
  line-height: .9;
  text-transform: uppercase;
}

.hero__title span {
  display: block;
}

.hero__lead {
  max-width: 20rem;
  font-size: 1.125rem;
  line-height: 1.4;
  text-wrap: balance;
}

@media (min-width: 900px), (orientation: landscape) {
  .hero__title {
    max-width: none;
    font-size: min(7vw, 11vh, 7rem);
    font-size: min(7vw, 11svh, 7rem);
  }

  /* inline-block y no inline: un elemento en línea no admite transform y no podría subir */
  .hero__title span:nth-child(-n + 2) {
    display: inline-block;
  }

  .hero__lead {
    max-width: 30rem;
  }
}

@keyframes logo-in {
  from {
    opacity: 0;
    transform: scale(.9) rotate(-5deg);
  }
}

@keyframes logo-sheen {
  from {
    background-position: 100% 0;
  }
}

/* La línea sube desde detrás de su propia base: el recorte se mueve con el texto
   en sentido contrario, así la ventana visible queda quieta. El margen de .3em
   deja sitio a las tildes, que con line-height .9 sobresalen de la caja. */
@keyframes line-rise {
  from {
    transform: translateY(calc(100% + .6em));
    clip-path: inset(calc(-100% - .9em) -.3em calc(100% + .3em) -.3em);
  }

  to {
    clip-path: inset(-.3em);
  }
}

@keyframes hero-settle {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* 2. Franja de envíos -------------------------------------------------------- */

.shipping {
  padding: 1.25rem var(--gutter);
  background: var(--granate);
  color: var(--amarillo);
  font-family: var(--font-label);
  font-size: .875rem;
  letter-spacing: .06em;
  line-height: 1.6;
  text-align: center;
  text-transform: uppercase;
}

.shipping__terms span {
  display: inline-block;
  white-space: nowrap;
}

.shipping__terms span:not(:last-child)::after {
  content: "·";
  margin-inline: .55em;
}

/* 3 y 4. 100% maíz y carta ----------------------------------------------------- */

.statement,
.menu {
  background: var(--crema);
}

.statement {
  padding-bottom: calc(var(--section-space) * .6);
}

.tricolor {
  width: min(62vw, 240px);
  height: auto;
  margin-top: 1.25rem;
}

.menu {
  padding-top: calc(var(--section-space) * .4);
  /* Con la tipografía de respaldo (más ancha) y 320px, la etiqueta "Dulce" puede asomar
     unos píxeles: se recorta en vez de provocar scroll horizontal. */
  overflow-x: clip;
}

.menu__group + .menu__group {
  margin-top: 3.5rem;
}

.menu__heading {
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 13vw, 4.5rem);
  line-height: .9;
  text-transform: uppercase;
}

.menu__list li {
  font-family: var(--font-label);
  font-size: clamp(1.375rem, 6.2vw, 2.125rem);
  line-height: 1.2;
  text-transform: uppercase;
}

.menu__list li + li {
  margin-top: .35rem;
}

.menu__list small {
  display: block;
  margin-bottom: .5rem;
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.4;
  text-transform: none;
}

/* La etiqueta cuelga arriba a la derecha del nombre, como un superíndice:
   fuera del flujo, para que el sabor quede centrado igual que los demás. */
.menu__list li {
  position: relative;
  width: fit-content;
  margin-inline: auto;
}

.tag {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: .2em;
  padding: .3em .6em .25em;
  border-radius: 999px;
  background: var(--naranja);
  color: var(--granate);
  font-family: var(--font-text);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(-30%);
}

.menu__note {
  margin-top: 3rem;
}

/* 5. Ocasiones --------------------------------------------------------------- */

.occasions {
  background: var(--granate);
  color: var(--crema);
}

.occasions .display {
  color: var(--amarillo);
  font-size: clamp(2.75rem, 13vw, 6.5rem);
}

.occasions__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
  margin-top: 2.25rem;
}

.occasions__list li {
  padding: .6rem 1.1rem .5rem;
  border: 1.5px solid rgb(245 238 231 / .5);
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: .9375rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* 6. Cierre ------------------------------------------------------------------ */

.closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.closing__alt,
.closing__social {
  font-size: 1rem;
}

.closing__alt + .closing__social {
  margin-top: -1rem;
}

.closing a:not(.btn),
.footer a {
  font-weight: 600;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .2em;
}

/* 7. Pie --------------------------------------------------------------------- */

.footer {
  padding: 2.5rem var(--gutter) calc(2.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid rgb(101 13 15 / .15);
  font-size: .875rem;
  line-height: 1.6;
  text-align: center;
}

/* Barra fija de WhatsApp ------------------------------------------------------- */

.stickybar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: .75rem var(--gutter) calc(.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid rgb(101 13 15 / .08);
  background: rgb(245 238 231 / .8);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform .45s var(--ease), visibility 0s linear .45s;
}

.stickybar.is-visible {
  transform: none;
  visibility: visible;
  transition: transform .45s var(--ease), visibility 0s;
}

.stickybar .btn {
  width: 100%;
  max-width: 26rem;
}

/* Animaciones de entrada (solo si main.js se ha ejecutado) --------------------- */

/* La transición va solo en el estado visible: ocultar es instantáneo, aparecer se anima. */
.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(16px);
}

.reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

.reveal-ready .tricolor.reveal {
  opacity: 1;
  transform: none;
}

.reveal-ready .tricolor path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.reveal-ready .tricolor.is-visible path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.1s var(--ease);
}

.reveal-ready .tricolor.is-visible path:nth-child(2) {
  transition-delay: .12s;
}

.reveal-ready .tricolor.is-visible path:nth-child(3) {
  transition-delay: .24s;
}

/* Los titulares grandes no se desvanecen: cada línea sube desde su base, como en la portada */
.reveal-ready .display.reveal {
  opacity: 1;
  transform: none;
}

.reveal-ready .display.reveal > span {
  transform: translateY(calc(100% + .6em));
  clip-path: inset(calc(-100% - .9em) -.3em calc(100% + .3em) -.3em);
}

.reveal-ready .display.reveal.is-visible > span {
  transform: none;
  clip-path: inset(-.3em);
  transition: transform .9s var(--ease-arrive), clip-path .9s var(--ease-arrive);
}

.reveal-ready .display.reveal.is-visible > span:nth-child(2) {
  transition-delay: .1s;
}

.reveal-ready .display.reveal.is-visible > span:nth-child(3) {
  transition-delay: .2s;
}

@media print {
  .reveal-ready .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal-ready .display.reveal > span {
    transform: none;
    clip-path: none;
  }

  .stickybar {
    display: none;
  }
}

/* Movimiento reducido: sin entradas, sin destello y sin desplazamientos.
   Lo que responde al usuario se mantiene, pero como cambio de color o fundido. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
  }

  .btn:active {
    transform: none;
  }

  .stickybar {
    opacity: 0;
    transform: none;
    transition: opacity .25s var(--ease), visibility 0s linear .25s;
  }

  .stickybar.is-visible {
    opacity: 1;
    transition: opacity .25s var(--ease), visibility 0s;
  }
}

/* Página no encontrada (404) -------------------------------------------------- */

.notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 100vh;
  min-height: 100svh;
}

.notfound .display {
  font-size: clamp(3rem, 14vw, 7rem);
}

.notfound .lead {
  margin-top: 0;
}

/* Aviso legal ---------------------------------------------------------------- */

.legal-page {
  background: var(--crema);
}

.legal {
  max-width: 40rem;
  margin-inline: auto;
  padding: clamp(2.5rem, 8vw, 4.5rem) var(--gutter) calc(3rem + env(safe-area-inset-bottom));
}

.legal h1 {
  margin: 1.5rem 0 2rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 12vw, 4.5rem);
  line-height: .95;
  text-transform: uppercase;
}

.legal h2 {
  margin: 2.5rem 0 .75rem;
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.legal dl {
  margin: 0;
}

.legal dt {
  margin-top: 1rem;
  font-weight: 700;
}

.legal dd {
  margin: .15rem 0 0;
}

.legal a {
  font-weight: 600;
  text-underline-offset: .2em;
}

.legal__back {
  font-size: .9375rem;
}
