/* BARFLOW · web de venta. La página es una noche de sábado en un bar: el plano del salón visto
   desde arriba, el ticket que sale de la impresora y la noche que avanza con el scroll. */
@font-face { font-family: 'Bricolage'; src: url('fonts/bricolage.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url('fonts/atkinson-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url('fonts/atkinson-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --noche: #081a19;
  --suelo: #0e2827;
  --mesa: #143736;
  --borde: #24504d;
  --espuma: #fff6e6;
  --tenue: #9fbab4;
  --ambar: #f2a93b;
  --ambar-deep: #b8650f;
  --menta: #6fd3a8;
  --coral: #ff6b5a;
  --papel: #fffaf0;
  --tinta: #1b1712;
  --tinta-2: #6b6256;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--noche);
  color: var(--espuma);
  font: 400 18px/1.6 'Atkinson', system-ui, sans-serif;
  overflow-x: hidden;
}
h1, h2 { font-family: 'Bricolage', system-ui, sans-serif; letter-spacing: -0.025em; line-height: 1.02; margin: 0; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ambar); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ambar); color: var(--tinta); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Navegación: mínima, sobre el salón ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(8, 26, 25, 0.95), rgba(8, 26, 25, 0));
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 20px 'Bricolage', sans-serif; letter-spacing: -0.02em; }
.brand b { color: var(--ambar); font-weight: 800; }
.reloj { font: 600 14px var(--mono); color: var(--tenue); margin-left: auto; letter-spacing: 0.04em; }
.nav-cta { text-decoration: none; font-weight: 700; padding: 9px 16px; border-radius: 999px; box-shadow: inset 0 0 0 2px var(--borde); white-space: nowrap; }
.nav-cta:hover { box-shadow: inset 0 0 0 2px var(--ambar); }

/* ---------- Plano del bar ---------- */
.suelo { fill: var(--suelo); stroke: var(--borde); stroke-width: 2; }
.barra { fill: #1d3f2c; stroke: #3c6b45; stroke-width: 2; }
.cocina { fill: #1a3746; stroke: #3d6a80; stroke-width: 2; stroke-dasharray: 8 6; }
.rotulo { fill: var(--tenue); font: 700 20px 'Atkinson', sans-serif; letter-spacing: 0.12em; text-anchor: middle; }

/* ---------- Portada ---------- */
.portada {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 90px;
  overflow: hidden;
}
.salon { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.9; }
.portada::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 65% at 50% 50%, rgba(8, 26, 25, 0.35), rgba(8, 26, 25, 0.9) 80%);
}
.mesa rect, .mesa circle { fill: var(--mesa); stroke: var(--borde); stroke-width: 2; }
.mesa text { fill: var(--tenue); font: 700 18px 'Atkinson', sans-serif; text-anchor: middle; }
.mesa:not(.libre) > :first-child { stroke: var(--ambar); }
/* La mesa ocupada se llena como un vaso (el nivel = tiempo que lleva abierta) */
.mesa .vaso { fill: rgba(242, 169, 59, 0.3); stroke: none; transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(var(--lleno)); }

.impresora {
  position: relative;
  z-index: 3;
  width: min(520px, 94vw);
  height: 26px;
  margin-top: 92px;
  border-radius: 10px;
  background: linear-gradient(180deg, #2c3231, #151919);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.impresora span { position: absolute; left: 6%; right: 6%; bottom: 7px; height: 4px; border-radius: 2px; background: #050606; }
.ticket {
  position: relative;
  z-index: 2;
  width: min(440px, 86vw);
  margin-top: -14px;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.55));
}
.ticket-papel {
  background: var(--papel);
  color: var(--tinta);
  padding: 34px 30px 48px;
  /* Borde de abajo cortado en zigzag, como el papel de la impresora */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), 95% 100%, 90% calc(100% - 12px), 85% 100%, 80% calc(100% - 12px), 75% 100%, 70% calc(100% - 12px), 65% 100%, 60% calc(100% - 12px), 55% 100%, 50% calc(100% - 12px), 45% 100%, 40% calc(100% - 12px), 35% 100%, 30% calc(100% - 12px), 25% 100%, 20% calc(100% - 12px), 15% 100%, 10% calc(100% - 12px), 5% 100%, 0 calc(100% - 12px));
}
.t-cab, .t-lineas, .t-qr p, .t-pie, .r-cab, .recibo ul, .r-total, .r-nota { font-family: var(--mono); }
.t-cab { font-size: 13px; color: var(--tinta-2); text-align: center; line-height: 1.5; padding-bottom: 16px; border-bottom: 2px dashed #d9cfbd; }
.ticket h1 { font-size: clamp(46px, 9vw, 72px); font-weight: 800; margin: 22px 0 14px; letter-spacing: -0.035em; }
.t-sub { font-size: 17px; color: #3c352c; }
.t-lineas { list-style: none; padding: 16px 0 0; margin: 18px 0 0; border-top: 2px dashed #d9cfbd; font-size: 14px; }
.t-lineas li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.t-lineas .t-total { margin-top: 8px; padding-top: 8px; border-top: 1px solid #d9cfbd; font-weight: 700; font-size: 17px; }
.t-qr { display: flex; gap: 14px; align-items: center; margin-top: 18px; color: var(--tinta); }
.t-qr p { font-size: 12.5px; line-height: 1.45; }
.t-qr p span { color: var(--ambar-deep); font-weight: 700; }
.t-acciones { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.btn-tinta {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 12px;
  background: var(--tinta);
  color: var(--papel);
  font-weight: 700;
  text-decoration: none;
}
.btn-tinta:hover { background: #000; }
.enlace-tinta { text-align: center; color: var(--tinta-2); font-weight: 700; text-decoration: none; }
.enlace-tinta:hover { color: var(--tinta); }
.t-pie { text-align: center; font-size: 12px; color: var(--tinta-2); margin-top: 22px; }

/* El ticket sale de la impresora una sola vez al cargar (el único movimiento sin que el visitante haga nada) */
@media (prefers-reduced-motion: no-preference) {
  .ticket-papel { animation: imprime 1.6s 0.3s cubic-bezier(0.25, 0.9, 0.3, 1) both; }
  .mesa .vaso { animation: llena 2.4s var(--d, 0s) cubic-bezier(0.2, 0.9, 0.3, 1) both; }
}
@keyframes imprime { from { transform: translateY(-100%); } }
@keyframes llena { from { transform: scaleY(0); } }
.ticket { overflow: hidden; padding-bottom: 60px; margin-bottom: -60px; }

/* ---------- Una noche de sábado ---------- */
.noche { position: relative; height: 640vh; }
.escena {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 24px clamp(20px, 4vw, 56px);
  padding: 90px clamp(16px, 4vw, 48px) 32px;
  align-items: center;
  background-color: var(--noche);
  transition: background-color 0.6s ease;
}
.escena[data-paso='2'], .escena[data-paso='3'] { background-color: #170e0c; }
.escena-plano { position: relative; grid-row: 1 / 3; align-self: center; }
.escena-plano svg { width: 100%; height: auto; display: block; }
.nm { fill: var(--mesa); stroke: var(--borde); stroke-width: 2; transition: fill 0.5s ease, stroke 0.5s ease; }
/* 21:30: dos tercios llenos · 22:40 a 23:25: lleno · al cerrar, vacío */
.escena[data-paso='1'] .nm.o1, .escena[data-paso='1'] .nm.o2,
.escena[data-paso='2'] .nm, .escena[data-paso='3'] .nm, .escena[data-paso='4'] .nm { fill: rgba(242, 169, 59, 0.3); stroke: var(--ambar); }
.comandas path { fill: none; stroke: var(--ambar); stroke-width: 3; stroke-dasharray: 10 12; opacity: 0; transition: opacity 0.4s ease; }
.escena[data-paso='1'] .comandas path, .escena[data-paso='3'] .comandas path, .escena[data-paso='4'] .comandas path { opacity: 0.85; }
@media (prefers-reduced-motion: no-preference) {
  .comandas path { animation: fluye 1.2s linear infinite; }
}
@keyframes fluye { to { stroke-dashoffset: -44; } }

.estado-red { position: absolute; top: 3%; right: 3%; font: 700 15px var(--mono); }
.estado-red span { display: inline-block; padding: 6px 12px; border-radius: 999px; }
.red-on { background: rgba(111, 211, 168, 0.16); color: var(--menta); }
.red-off { display: none !important; background: rgba(255, 107, 90, 0.18); color: var(--coral); }
.escena[data-paso='2'] .red-on, .escena[data-paso='3'] .red-on { display: none; }
.escena[data-paso='2'] .red-off, .escena[data-paso='3'] .red-off { display: inline-block !important; }

.marcador { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; border-top: 1px solid var(--borde); padding-top: 18px; }
.m-num { display: block; font: 800 clamp(40px, 5vw, 64px) 'Bricolage', sans-serif; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
#m-guardadas { color: var(--ambar); }
#m-enviadas { color: var(--menta); }
.m-txt { color: var(--tenue); font-size: 15px; }

.relato { grid-column: 2; grid-row: 1; list-style: none; padding: 0; margin: 0; position: relative; min-height: 280px; align-self: end; }
.relato li { position: absolute; inset: auto 0 0 0; opacity: 0; transform: translateY(14px); transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1); pointer-events: none; }
.relato li.activo { opacity: 1; transform: none; pointer-events: auto; }
.hora { font: 700 18px var(--mono); color: var(--ambar); }
.relato h2 { font-size: clamp(44px, 6vw, 84px); font-weight: 800; margin: 6px 0 14px; }
.relato p { color: var(--tenue); font-size: 19px; max-width: 34ch; }
.relato li[data-paso='2'] .hora, .relato li[data-paso='3'] .hora { color: var(--coral); }

@media (max-width: 860px) {
  .escena { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; padding-top: 72px; gap: 14px; }
  .escena-plano { grid-row: 1; }
  .marcador { grid-column: 1; grid-row: 2; }
  .relato { grid-column: 1; grid-row: 3; align-self: start; min-height: 230px; }
  .relato li { inset: 0 0 auto 0; }
  .relato p { font-size: 17px; }
  .reloj { display: none; }
}

/* ---------- La caja ---------- */
.caja {
  max-width: 1180px;
  margin: 0 auto;
  padding: 140px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.monitor-pantalla {
  border: 16px solid #1b1f1f;
  border-radius: 22px;
  background: var(--suelo) url('media/hero-poster.jpg') center / cover;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  box-shadow: 0 50px 80px rgba(0, 0, 0, 0.45);
}
.monitor-pantalla video { display: block; width: 100%; height: 100%; object-fit: cover; }
.monitor-pie { width: 22%; height: 60px; margin: 0 auto; background: linear-gradient(180deg, #1b1f1f, #101313); clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }
.ficha h2 { font-size: clamp(34px, 4.4vw, 54px); font-weight: 780; margin-bottom: 24px; }
.ficha dl { margin: 0; }
.ficha dl div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--borde); }
.ficha dt { font: 700 14px var(--mono); color: var(--ambar); padding-top: 3px; letter-spacing: 0.04em; }
.ficha dd { margin: 0; color: var(--tenue); }
@media (max-width: 860px) {
  .caja { grid-template-columns: 1fr; padding: 90px 16px; }
  .ficha dl div { grid-template-columns: 96px 1fr; }
}

/* ---------- Precios: recibos ---------- */
.precios { max-width: 1060px; margin: 0 auto; padding: 60px 16px 140px; }
.precios h2 { font-size: clamp(40px, 6vw, 76px); font-weight: 800; }
.precios-sub { color: var(--tenue); margin-top: 12px; }
.recibos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 4vw, 48px); margin-top: 48px; align-items: start; }
.recibo {
  background: var(--papel);
  color: var(--tinta);
  padding: 30px 28px 40px;
  clip-path: polygon(0 10px, 5% 0, 10% 10px, 15% 0, 20% 10px, 25% 0, 30% 10px, 35% 0, 40% 10px, 45% 0, 50% 10px, 55% 0, 60% 10px, 65% 0, 70% 10px, 75% 0, 80% 10px, 85% 0, 90% 10px, 95% 0, 100% 10px, 100% calc(100% - 10px), 95% 100%, 90% calc(100% - 10px), 85% 100%, 80% calc(100% - 10px), 75% 100%, 70% calc(100% - 10px), 65% 100%, 60% calc(100% - 10px), 55% 100%, 50% calc(100% - 10px), 45% 100%, 40% calc(100% - 10px), 35% 100%, 30% calc(100% - 10px), 25% 100%, 20% calc(100% - 10px), 15% 100%, 10% calc(100% - 10px), 5% 100%, 0 calc(100% - 10px));
}
.recibo:nth-child(1) { transform: rotate(-1.2deg); }
.recibo:nth-child(2) { transform: rotate(1deg) translateY(28px); }
.r-cab { text-align: center; font-weight: 700; font-size: 16px; letter-spacing: 0.06em; padding-bottom: 14px; border-bottom: 2px dashed #d9cfbd; }
.r-cab span { font-weight: 400; color: var(--tinta-2); letter-spacing: 0; font-size: 13px; }
.recibo ul { list-style: none; padding: 14px 0; margin: 0; font-size: 14px; border-bottom: 2px dashed #d9cfbd; }
.recibo li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.recibo li span:last-child { color: var(--tinta-2); }
.r-total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 6px; font-weight: 700; }
.r-total span:last-child { font: 800 44px 'Bricolage', sans-serif; letter-spacing: -0.03em; }
/* Precio del equipo: se paga una vez, más pequeño que la cuota mensual */
.r-equipo { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 0; margin: 0; font-family: var(--mono); font-weight: 700; }
.r-equipo span:last-child { font: 800 26px 'Bricolage', sans-serif; letter-spacing: -0.02em; }
.r-equipo + .r-total { padding-top: 4px; }
.r-nota { font-size: 12.5px; color: var(--tinta-2); margin: 6px 0 22px; line-height: 1.5; }
.recibo .btn-tinta { width: 100%; }
@media (max-width: 760px) {
  .recibos { grid-template-columns: 1fr; }
  .recibo:nth-child(2) { transform: rotate(1deg); }
}

/* ---------- Dudas ---------- */
.dudas { max-width: 860px; margin: 0 auto; padding: 40px 16px 120px; }
.dudas h2 { font-size: clamp(32px, 4.5vw, 52px); font-weight: 780; margin-bottom: 26px; }
.dudas details { border-top: 1px solid var(--borde); padding: 20px 0; }
.dudas details:last-of-type { border-bottom: 1px solid var(--borde); }
.dudas summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; font: 700 21px 'Bricolage', sans-serif; }
.dudas summary::-webkit-details-marker { display: none; }
.dudas summary::after { content: '+'; color: var(--ambar); font-size: 26px; line-height: 1; transition: transform 0.2s ease; }
.dudas details[open] summary::after { transform: rotate(45deg); }
.dudas details p { color: var(--tenue); margin-top: 12px; max-width: 62ch; }

/* ---------- Contacto ---------- */
.contacto {
  padding: 140px 16px 160px;
  text-align: center;
  background: radial-gradient(ellipse 60% 70% at 50% 100%, rgba(242, 169, 59, 0.16), transparent 70%);
}
.contacto-hora { font: 700 16px var(--mono); color: var(--ambar); letter-spacing: 0.04em; }
.contacto h2 { font-size: clamp(44px, 8vw, 110px); font-weight: 800; max-width: 13ch; margin: 18px auto 34px; }
.contacto-acciones { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 22px; }
.btn-ambar { display: inline-flex; align-items: center; min-height: 58px; padding: 0 28px; border-radius: 14px; background: var(--ambar); color: var(--tinta); font-weight: 700; font-size: 19px; text-decoration: none; }
.btn-ambar:hover { background: #ffbb55; }
.enlace-claro { color: var(--tenue); font-weight: 700; }
.enlace-claro:hover { color: var(--espuma); }

.pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 26px clamp(16px, 4vw, 40px) 36px; border-top: 1px solid var(--borde); color: var(--tenue); font-size: 15px; }
.pie a { color: var(--tenue); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .relato li, .nm, .escena, .comandas path { transition: none !important; animation: none !important; }
}
