/* ==========================================================================
   Volora · home.css
   Hero (libreta → Volora), clientes, bloque del programa, cinta y apagón.
   Por defecto todo se ve en su composición estática; con html.mov el JS
   parte de los estados iniciales que se marcan aquí.
   ========================================================================== */

/* ==========================================================================
   1 · HERO
   ========================================================================== */
.hero {
  position: relative;
  padding: clamp(28px, 5vw, 56px) 0 clamp(40px, 6vw, 72px);
  overflow: clip;
  background: var(--claro);
}
.hero__luz {
  /* Medidas fijas (no en % del alto del hero): al anclar la escena el hero crece y no debe moverse */
  position: absolute;
  top: calc(-1 * min(380px, 36vw));
  right: -22%;
  width: min(1100px, 120vw);
  aspect-ratio: 1;
  background:
    radial-gradient(closest-side, rgba(255, 107, 26, .16), rgba(255, 107, 26, .05) 55%, rgba(255, 107, 26, 0) 100%);
  pointer-events: none;
}
.mov .hero__luz { animation: luz-deriva 18s var(--suave) infinite alternate; }
@keyframes luz-deriva {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-6%, 5%, 0) scale(1.08); }
}
/* Una rejilla de puntos muy suave: precisión y calma */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(22, 22, 26, .09) 1px, transparent 1.2px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 0%, transparent 75%);
  pointer-events: none;
}

.hero__rejilla {
  position: relative;
  display: grid;
  gap: clamp(36px, 6vw, 56px);
}
@media (min-width: 900px) {
  .hero { padding: 0; }
  .hero__rejilla {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(32px, 4vw, 72px);
    min-height: calc(100svh - var(--fila));
    padding-block: 40px;
  }
}

.hero__eyebrow { margin-bottom: 20px; }
.hero__titular {
  font-family: var(--titulares);
  font-weight: var(--peso-titular, 800);
  font-size: clamp(2.55rem, 5.05vw, 4.75rem);
  line-height: .98;
  letter-spacing: -.038em;
  color: var(--tinta);
}
.hero__titular-2 { display: block; }
.hero__nivel {
  position: relative;
  font-style: normal;
  white-space: nowrap;
}
.hero__salto {
  position: absolute;
  left: 0;
  bottom: -.16em;
  width: 100%;
  height: .2em;
  overflow: visible;
}
.hero__salto path {
  fill: none;
  stroke: var(--mandarina);
  stroke-width: 7;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: miter;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.mov .hero__salto path { animation: dibuja 1.4s var(--salida) .5s both; }
@keyframes dibuja { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.hero__sub {
  margin-top: 26px;
  max-width: 32em;
  font-size: clamp(1.06rem, 1.35vw, 1.22rem);
  line-height: 1.5;
  color: var(--grafito);
}
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
/* ----- La escena ----- */
.escena { position: relative; }
.escena__marco {
  --marco-ratio: .64;
  position: relative;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  aspect-ratio: var(--marco-ratio);
}
@media (min-width: 600px) {
  .escena__marco { --marco-ratio: .8; }
}
@media (min-width: 900px) {
  .escena__marco {
    --marco-ratio: .88;
    max-width: 620px;
    width: min(100%, calc((100svh - var(--fila) - 110px) * var(--marco-ratio)));
  }
}
.escena__pie {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--grafito);
}

/* ----- La libreta ----- */
.libreta {
  position: absolute;
  left: 3%;
  top: 0;
  width: 64%;
  aspect-ratio: .66;
  z-index: 2;
  container-type: size;
  transform: rotate(-4deg);
  transform-origin: 50% 60%;
}
@media (min-width: 600px) {
  .libreta { left: 0; width: 58%; }
}
.libreta__respira { position: absolute; inset: 0; transform-origin: 50% 70%; }
/* La respiración mueve una capa con papel, texto y sombras: en su propia capa, sin repintarla en cada fotograma */
.mov .libreta__respira, .mov .hero__luz { will-change: transform; }

.libreta__hoja {
  position: absolute;
  inset: 0;
  border-radius: 2px 2px 5px 5px;
  box-shadow: var(--sombra-papel);
  overflow: hidden;
  background-color: var(--papel);
  background-image:
    /* margen rojo */
    linear-gradient(90deg, transparent calc(11% - 1px), var(--margen-rojo) calc(11% - 1px), var(--margen-rojo) calc(11% + 1px), transparent calc(11% + 1px)),
    /* pauta */
    repeating-linear-gradient(180deg, transparent 0, transparent calc(7.8cqh - 1.5px), var(--pauta) calc(7.8cqh - 1.5px), var(--pauta) 7.8cqh),
    /* luz del papel */
    linear-gradient(160deg, rgba(255, 255, 255, .7) 0%, rgba(255, 255, 255, 0) 40%, rgba(160, 130, 60, .06) 100%);
  background-size: 100% 100%, 100% calc(100% - 18.6cqh + 7.8cqh), 100% 100%;
  background-position: 0 0, 0 calc(18.6cqh - 7.8cqh + .75px), 0 0;
  background-repeat: no-repeat;
}
/* Fibra del papel (muy suave) */
.libreta__hoja::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23f)'/%3E%3C/svg%3E");
  opacity: .9;
  pointer-events: none;
}
/* Borde troquelado de arriba */
.libreta__hoja::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2.6cqh;
  background:
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, .14) 0 .45cqh, transparent .55cqh) 0 0 / 3cqh 100% repeat-x,
    linear-gradient(180deg, #E9DFC0, #F6EFD6);
  border-bottom: 1px dashed rgba(124, 138, 165, .45);
  z-index: 1;
}
.libreta__cabecera {
  position: absolute;
  left: 14%; right: 6%;
  top: 4.4cqh;
  display: flex;
  justify-content: space-between;
  font-family: var(--texto);
  font-size: 2.4cqh;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--impreso);
}
.libreta__cabecera span:last-child { color: #C0545A; letter-spacing: .06em; }
.libreta__impreso {
  position: absolute;
  left: 14%; right: 6%;
  top: 9.4cqh;
  display: flex;
  gap: 4%;
  font-size: 1.9cqh;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--impreso);
  opacity: .8;
}
.libreta__impreso span { flex: 1; border-bottom: 1px solid rgba(124, 138, 165, .5); padding-bottom: .3cqh; }
.libreta__impreso span:first-child { flex: 1.4; }

.libreta__garabatos {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 2;
}
.libreta__garabatos path {
  fill: none;
  stroke: var(--boli);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.libreta__garabatos .tachon { stroke-width: 2.4; opacity: .85; }
.libreta__garabatos .subraya { stroke-width: 1.8; opacity: .8; }

.libreta__cafe {
  position: absolute;
  right: -12%;
  bottom: -9%;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.4cqh solid rgba(122, 78, 32, .10);
  box-shadow: inset 0 0 0 .4cqh rgba(122, 78, 32, .08), 0 0 0 .3cqh rgba(122, 78, 32, .05);
  transform: rotate(18deg) scaleY(.94);
}

.libreta__notas { position: absolute; inset: 0; z-index: 3; }
.nota {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-family: var(--mano);
  font-weight: 600;
  font-size: 6.4cqh;
  line-height: 1;
  color: var(--boli);
  white-space: nowrap;
  transform: rotate(var(--r, 0deg));
  transform-origin: 50% 50%;
}
.nota--grande { font-size: 8.2cqh; }
.nota--total { font-size: 7.4cqh; }
.nota--peque { font-size: 5.3cqh; }
.nota--clara { color: #3B56A8; }

/* ----- La interfaz de Volora ----- */
.app {
  position: absolute;
  right: 0;
  top: 22%;
  width: 94%;
  z-index: 3;
  container-type: inline-size;
  background: var(--claro);
  border-radius: var(--radio-pantalla);
  box-shadow: var(--sombra-flota), 0 0 0 1px rgba(22, 22, 26, .07);
  overflow: hidden;
  color: var(--tinta);
}
@media (min-width: 600px) {
  .app { top: 16%; width: 72%; }
}
.app__barra {
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  height: 10.5cqw;
  padding: 0 3.6cqw;
  background: var(--tinta);
  color: var(--luz);
  font-size: 3.2cqw;
}
.app__v { width: 4.4cqw; height: 4.4cqw; flex: none; }
.app__local { font-weight: 600; white-space: nowrap; }
.app__pestanas { display: flex; gap: 1cqw; margin-left: auto; }
.app__pestanas span { padding: .9cqw 2cqw; border-radius: 1.4cqw; color: var(--grafito-noche); }
.app__pestanas .activa { background: rgba(255, 255, 255, .1); color: var(--luz); }
.app__hora { color: var(--grafito-noche); }
@container (max-width: 340px) {
  .app__pestanas span:not(.activa) { display: none; }
}

.app__cuerpo { padding: 4cqw 4cqw 4.4cqw; font-size: 3.6cqw; }
.app__cab {
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  padding-bottom: 3cqw;
  border-bottom: 1px solid var(--linea);
}
.app__mesa { font-family: var(--titulares); font-weight: var(--peso-titular, 800); font-size: 6cqw; letter-spacing: -.02em; line-height: 1; }
.app__pax { color: var(--grafito); font-size: 3.2cqw; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 1.4cqw;
  margin-left: auto;
  padding: 1cqw 2.6cqw;
  border-radius: 999px;
  font-size: 3cqw;
  font-weight: 600;
  white-space: nowrap;
}
.chip i { width: 1.6cqw; height: 1.6cqw; border-radius: 50%; background: currentColor; }
.chip--verde { background: var(--verde-suave); color: var(--verde); }

.app__lineas li {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2cqw;
  min-height: 8.6cqw;
  border-bottom: 1px solid var(--claro-3);
}
.app__lineas b { font-weight: 700; color: var(--mandarina-texto); }
.app__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 10cqw;
  font-weight: 700;
  font-size: 4cqw;
}
.app__total .num { font-family: var(--titulares); font-weight: var(--peso-titular, 800); font-size: 5cqw; letter-spacing: -.02em; }
.app__avisos {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 2.4cqw;
  margin-top: 1.4cqw;
}
.aviso {
  display: flex;
  flex-direction: column;
  gap: .8cqw;
  padding: 2.6cqw 3cqw;
  border-radius: 2.4cqw;
  font-size: 3cqw;
  line-height: 1.32;
}
.aviso--clara { background: var(--mandarina-suave); color: #6B2A05; }
.aviso__quien { font-weight: 700; color: var(--mandarina-texto); }
.aviso--gestoria {
  flex-direction: row;
  align-items: center;
  gap: 2cqw;
  background: var(--verde-suave);
  color: var(--verde);
  font-weight: 600;
}
.aviso--gestoria svg { width: 5cqw; height: 5cqw; flex: none; }

/* ----- El cierre del día ----- */
.ganado {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 74%;
  z-index: 5;
  container-type: inline-size;
  padding: 3.2% 4% 3.4%; /* % del ancho de la escena (no puede usar cqw: es el propio contenedor) */
  border-radius: var(--radio-pantalla);
  background: var(--tinta);
  color: var(--luz);
  box-shadow: 0 30px 60px -24px rgba(14, 14, 17, .55), 0 0 0 1px rgba(255, 255, 255, .04) inset;
  overflow: hidden;
}
.ganado::before {
  content: "";
  position: absolute;
  right: -30%;
  top: -60%;
  width: 90%;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(255, 107, 26, .38), rgba(255, 107, 26, 0));
  pointer-events: none;
}
@media (min-width: 600px) {
  .ganado { width: 56%; }
}
.ganado__fila { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 3cqw; }
.ganado__titulo { font-size: 4.6cqw; color: var(--grafito-noche); }
.ganado .etiqueta-ejemplo { font-size: 3.6cqw; color: var(--mandarina); padding: .4cqw 2.4cqw; }
.ganado__frase { position: relative; margin-top: 4cqw; font-size: 6.4cqw; font-weight: 500; }
.ganado__cifra {
  position: relative;
  font-family: var(--titulares);
  font-weight: var(--peso-titular, 800);
  font-size: 21cqw;
  line-height: .95;
  letter-spacing: -.04em;
  color: var(--mandarina);
}

/* ----- Estados iniciales de la escena (solo con movimiento) ----- */
/* En móvil, con movimiento, la escena es más baja: al final la interfaz y el cierre llenan el hueco de la libreta */
@media (max-width: 599px) {
  .mov .escena__marco { --marco-ratio: .72; }
  .mov .app { top: 5%; }
  .mov .ganado { bottom: auto; top: 67%; }
}
/* Centrada en la escena (los mismos valores que calcula home.js, para que no salte al arrancar) */
.mov .libreta { z-index: 4; transform: translate(23.4%, calc(21.6% - 12px)) rotate(-2deg) scale(1.04); }
@media (min-width: 600px) {
  .mov .libreta { transform: translate(36.2%, calc(21.1% - 12px)) rotate(-2deg) scale(1.04); }
}
@media (min-width: 900px) {
  .mov .libreta { transform: translate(36.2%, calc(14.6% - 12px)) rotate(-2deg) scale(1.04); }
}
.mov .app { opacity: 0; }
.mov .app [data-destino] { opacity: 0; }
.mov .ganado { opacity: 0; }


/* Clara en el hero: la firma en el antetítulo y el huevo en el aviso */
.hero__clara { flex-wrap: wrap; gap: 8px 14px; }
.hero__clara .clara-firma__logo { height: 26px; }
.aviso__quien { display: inline-flex; align-items: center; gap: 1.2cqw; }
.aviso__quien .huevo { width: 3.8cqw; height: 3.8cqw; }
