@font-face { font-family: "Bricolage Grotesque"; src: url("../assets/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../assets/fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../assets/fonts/caveat.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Chango"; src: url("../assets/fonts/chango.woff2") format("woff2"); font-weight: 400; font-display: swap; }

/* Layout: un escaparate de noche fijo detrás (el frasco 3D) y una historia que sube por encima;
   en pantallas anchas el texto alterna de lado, en el celular se queda abajo y el frasco arriba. */
:root {
  --ink: #101216;
  --night: #20263a;
  --night-deep: #06080d;
  --paper: #fafaf7;
  --yellow: #ffd60a;
  --green: #1ed67a;
  --chile: #d9361c;
  --muted: rgba(250, 250, 247, 0.74);
  --bg: #06080d;
  --glow: rgba(255, 214, 10, 0.3);
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --sign: "Chango", "Bricolage Grotesque", "Arial Black", sans-serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --pad-x: clamp(16px, 4vw, 48px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--night-deep); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font: 400 1.0625rem/1.55 var(--text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* ---------- escenario fijo ---------- */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(38rem 30rem at var(--gx, 70%) 48%, var(--glow), transparent 70%);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.glow.is-on { opacity: 1; }
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s var(--ease-out);
}
#scene.is-ready { opacity: 1; }

/* ---------- barra ---------- */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--pad-x) 14px;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 10px;
  background: var(--paper);
  border-radius: 999px;
  text-decoration: none;
}
.wordmark {
  font: 800 1.25rem/1 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.wordmark i { font-style: normal; color: #087a42; }
.brand span {
  font: 700 0.72rem/1 var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  padding-left: 10px;
  border-left: 1px solid rgba(16, 18, 22, 0.2);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font: 800 0.98rem/1 var(--display);
  text-decoration: none;
  transition: transform 160ms ease-out;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .flavor:focus-visible, .brand:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.bar .btn { padding: 10px 16px; font-size: 0.9rem; }

/* ---------- historia ---------- */
main { position: relative; z-index: 1; }
.sec {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: start;
  padding-inline: var(--pad-x);
  padding-block: 96px 48px;
}
.sec.right { justify-items: end; }
.copy {
  display: grid;
  gap: 18px;
  max-width: 31rem;
  min-width: 0;
}
.chip {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 0.74rem/1 var(--text);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yellow);
}
.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
h1, h2 {
  margin: 0;
  font-family: var(--sign);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0.005em;
  text-wrap: balance;
}
h1 { font-size: clamp(3rem, 8.4vw, 6.6rem); }
h2 { font-size: clamp(2.3rem, 5.2vw, 4.3rem); }
h1 em, h2 em { font-style: normal; color: var(--yellow); }
.copy p { margin: 0; color: var(--muted); max-width: 30rem; text-wrap: pretty; }
.copy p strong { color: var(--paper); font-weight: 700; }
.hand {
  font: 600 1.7rem/1.1 var(--hand);
  color: var(--yellow);
  transform: rotate(-3deg);
  transform-origin: left center;
}
.hand-touch { display: none; }
@media (hover: none) {
  .hand-fine { display: none; }
  .hand-touch { display: block; }
}

.ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ingredients li {
  padding: 7px 12px;
  border: 1px solid rgba(250, 250, 247, 0.28);
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--paper);
}

.flavors { display: flex; flex-wrap: wrap; gap: 10px; }
.flavor {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 11px 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(250, 250, 247, 0.3);
  background: rgba(6, 8, 13, 0.5);
  color: var(--paper);
  font: 700 1rem/1 var(--display);
  cursor: pointer;
  transition: transform 160ms ease-out, border-color 200ms ease, background-color 200ms ease;
}
.flavor:active { transform: scale(0.97); }
.flavor i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}
.flavor[aria-pressed="true"] { border-color: var(--yellow); background: rgba(255, 214, 10, 0.14); }
@media (hover: hover) and (pointer: fine) {
  .flavor:hover { border-color: rgba(250, 250, 247, 0.7); }
}

#juega { touch-action: pan-y; cursor: grab; }
#juega.is-dragging { cursor: grabbing; }

/* ---------- final ---------- */
.final .copy { gap: 22px; }
.neon {
  justify-self: start;
  padding: 10px 18px 8px;
  border: 3px solid currentColor;
  border-radius: 14px;
  font: 400 clamp(1.6rem, 3.4vw, 2.4rem)/1 var(--sign);
  letter-spacing: 0.08em;
  color: rgba(30, 214, 122, 0.25);
  transition: color 200ms ease, text-shadow 200ms ease, box-shadow 200ms ease;
}
.neon.is-on {
  color: var(--green);
  text-shadow: 0 0 10px rgba(30, 214, 122, 0.8), 0 0 28px rgba(30, 214, 122, 0.5);
  box-shadow: 0 0 18px rgba(30, 214, 122, 0.45), inset 0 0 14px rgba(30, 214, 122, 0.3);
  animation: flicker 1.1s linear 1;
}
@keyframes flicker {
  0%, 12%, 20%, 34% { opacity: 1; }
  8%, 16%, 30% { opacity: 0.25; }
  100% { opacity: 1; }
}
.fine {
  font-size: 0.86rem !important;
  color: rgba(250, 250, 247, 0.55) !important;
}
.fine a { color: inherit; }

.no-3d-note { display: none; }
.no-3d .no-3d-note { display: block; }

/* ---------- celular: frasco arriba, texto abajo ---------- */
@media (max-width: 900px) {
  .sec, .sec.right {
    justify-items: stretch;
    align-content: end;
    padding-block: 52vh 28px;
    padding-block: 52svh 28px;
  }
  .copy {
    max-width: none;
    padding: 22px 18px 20px;
    margin-inline: -8px;
    border-radius: 22px;
    background: rgba(6, 8, 13, 0.72);
    border: 1px solid rgba(250, 250, 247, 0.08);
  }
  .hero .copy { background: transparent; border-color: transparent; padding-inline: 0; margin-inline: 0; }
  .glow { background: radial-gradient(28rem 24rem at 50% 30%, var(--glow), transparent 70%); }
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .neon.is-on { animation: none; }
  #scene, .glow { transition-duration: 0.3s; }
}

/* Color de cada sabor (sin estilos en línea: la política de seguridad del sitio los bloquea) */
.flavor[data-flavor="macha"] { --sw: #5a1407; }
.flavor[data-flavor="roja"] { --sw: #c21d10; }
.flavor[data-flavor="verde"] { --sw: #5f7f16; }
