/* Loader de parrilla 3D y portada con historia por scroll. */

/* ---------- Loader ---------- */
.grill-loader { position: fixed; inset: 0; z-index: 100; display: block; background: var(--char, #0c0b09); transition: opacity .45s var(--ease-out, ease); }
.grill-loader.done { opacity: 0; pointer-events: none; }
.loader-stage { position: absolute; inset: 0; }
.loader-stage .steak-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.loader-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, #0c0b0966 0%, transparent 22%, transparent 55%, #0c0b09e6 100%); }
.loader-fallback { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .4s; }
.loader-fallback img { width: 120px; height: auto; opacity: .85; animation: loaderBreath 1.8s ease-in-out infinite alternate; }
.grill-loader.has-scene .loader-fallback { opacity: 0; transition-duration: .2s; }
.loader-hud { position: absolute; left: clamp(20px, 5vw, 72px); right: clamp(20px, 5vw, 72px); bottom: clamp(24px, 6vh, 64px); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px 24px; pointer-events: none; }
.loader-brand { grid-column: 1 / -1; margin: 0; font: 800 clamp(22px, 2.6vw, 34px)/1 'Barlow Condensed', sans-serif; letter-spacing: .01em; color: var(--paper); }
.loader-brand span { display: block; margin-top: 8px; font: 600 9px 'DM Sans', sans-serif; letter-spacing: .28em; color: var(--muted); }
.grill-loader .loader-label { margin: 0; font: 600 10px 'DM Sans', sans-serif; letter-spacing: .32em; color: var(--gold); }
.loader-meter { display: grid; justify-items: end; gap: 10px; min-width: min(46vw, 320px); }
.loader-count { font: 500 clamp(54px, 7vw, 96px)/.8 'Barlow Condensed', sans-serif; letter-spacing: -.03em; color: var(--paper); font-variant-numeric: tabular-nums; }
.loader-count b { font-weight: 600; }
.loader-bar { position: relative; display: block; width: 100%; height: 2px; background: #ffffff1f; overflow: hidden; }
.loader-bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--red), var(--ember)); box-shadow: 0 0 12px var(--ember); }
@keyframes loaderBreath { to { transform: scale(1.06); opacity: 1; } }
@media (max-width: 560px) {
  .loader-hud { grid-template-columns: 1fr; }
  .loader-meter { justify-items: start; min-width: 0; }
}

/* ---------- Portada: base estática (sin JS, sin WebGL o movimiento reducido) ---------- */
.hero { display: block; max-width: none; margin: 0; padding: 0; position: relative; }
.hero-track { position: relative; }
.hero-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 24px 40px; max-width: 1440px; margin: 0 auto; padding: clamp(40px, 7vh, 80px) 6vw 40px; }
.hero-canvas { position: relative; grid-column: 2; grid-row: 1; aspect-ratio: 1; width: 100%; max-width: 620px; justify-self: center; }
.hero-still { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 40px 60px #000a); }
.steak-canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .7s var(--ease-out, ease); }
.steak-canvas.is-live { opacity: 1; }
.hero.is-scrolly .hero-still, .hero.is-still .hero-still { display: none; }
.hero-steps { grid-column: 1; grid-row: 1; display: grid; gap: 34px; }
.hero-step:not(.hero-step-intro) { border-top: 1px solid var(--line); padding-top: 22px; }
.hero h1 { font-size: clamp(56px, 7.2vw, 132px); line-height: .86; letter-spacing: -.025em; margin: 0 0 26px; text-wrap: balance; }
.step-index { margin: 0 0 12px; font: 600 11px 'DM Sans', sans-serif; letter-spacing: .24em; color: var(--ember); }
.step-index span { color: var(--muted); }
.step-title { margin: 0 0 14px; font-size: clamp(40px, 4.6vw, 72px); line-height: .88; }
.step-copy { margin: 0 0 18px; color: #cfc8b9; font-size: 15px; line-height: 1.65; max-width: 34ch; }
.hero-labels, .hero-rail, .hero-cue { display: none; }
.hero-step-intro .lead { max-width: 40ch; }

/* ---------- Portada con escena 3D fijada ---------- */
.hero.is-scrolly .hero-track { height: 460svh; }
.hero.is-scrolly .hero-stage { position: sticky; top: 0; display: block; height: 100svh; max-width: none; padding: 0; overflow: hidden; }
.hero.is-scrolly .hero-canvas, .hero.is-still .hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; aspect-ratio: auto; }
.hero.is-scrolly .hero-steps { position: absolute; inset: 0; display: block; pointer-events: none; }
.hero.is-scrolly .hero-step { position: absolute; left: clamp(24px, 6vw, 96px); bottom: clamp(48px, 12vh, 140px); width: min(780px, 50vw); padding: 0; border: 0; opacity: 0; visibility: hidden; transform: translate3d(0, 48px, 0); transition: opacity .55s var(--ease-out), transform .9s var(--ease-out), visibility 0s .9s; }
.hero.is-scrolly .hero-step.is-past { transform: translate3d(0, -48px, 0); }
.hero.is-scrolly .hero-step.is-active { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .7s var(--ease-out) .12s, transform 1s var(--ease-out) .12s, visibility 0s; }
.hero.is-scrolly .hero-step :is(h1, .step-title) { clip-path: inset(0 0 102% 0); transition: clip-path .9s var(--ease-out) .1s; }
.hero.is-scrolly .hero-step.is-active :is(h1, .step-title) { clip-path: inset(-6% -4% -12% -4%); }
.hero.is-scrolly h1, .hero.is-scrolly .step-title { font-size: clamp(64px, 7.4vw, 136px); line-height: .84; }
.hero.is-scrolly .step-copy, .hero.is-scrolly .hero-step-intro .lead { max-width: 36ch; }
.hero.is-scrolly .step-copy { font-size: 16px; }
.hero.is-scrolly .hero-step-intro .lead { margin-bottom: 26px; }

/* Etiquetas de especificación ancladas a la escena */
.hero.is-scrolly .hero-labels { display: block; position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.hero-label { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity .35s ease; will-change: transform; }
.hero-label.is-on { opacity: 1; }
.hero-label::before { content: ''; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 5px #ff6a2b2e, 0 0 18px #ff6a2bcc; }
.hero-label::after { content: ''; position: absolute; top: 0; left: 12px; width: 56px; height: 1px; background: linear-gradient(90deg, var(--ember), #ffffff80); transform-origin: left; transform: scaleX(0); transition: transform .5s var(--ease-out) .1s; }
.hero-label.is-on::after { transform: scaleX(1); }
.hero-label span { position: absolute; top: 0; left: 76px; transform: translate(-8px, -50%); white-space: nowrap; padding: 9px 14px 10px; border: 1px solid #ffffff24; border-radius: 2px; background: #0c0b0999; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font: 600 12px/1.2 'DM Sans', sans-serif; letter-spacing: .04em; color: var(--paper); opacity: 0; transition: opacity .4s ease .18s, transform .6s var(--ease-out) .18s; }
.hero-label.is-on span { opacity: 1; transform: translate(0, -50%); }
.hero-label small { display: block; margin-bottom: 3px; font-size: 9px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.hero-label.to-left::after { left: auto; right: 12px; transform-origin: right; background: linear-gradient(270deg, var(--ember), #ffffff80); }
.hero-label.to-left span { left: auto; right: 76px; transform: translate(8px, -50%); }
.hero-label.to-left.is-on span { transform: translate(0, -50%); }

/* Riel de progreso */
.hero.is-scrolly .hero-rail { display: flex; position: absolute; right: clamp(16px, 2.6vw, 40px); top: 50%; transform: translateY(-50%); gap: 14px; align-items: stretch; }
.hero-rail-track { position: relative; width: 1px; background: #ffffff26; }
.hero-rail-track i { position: absolute; inset: 0; background: var(--ember); transform-origin: top; transform: scaleY(0); box-shadow: 0 0 10px var(--ember); }
.hero-rail ol { display: grid; gap: 34px; margin: 0; padding: 0; list-style: none; font: 600 10px 'DM Sans', sans-serif; letter-spacing: .18em; color: #ffffff59; }
.hero-rail li { transition: color .3s; }
.hero[data-step="0"] .hero-rail li:nth-child(1), .hero[data-step="1"] .hero-rail li:nth-child(2), .hero[data-step="2"] .hero-rail li:nth-child(3), .hero[data-step="3"] .hero-rail li:nth-child(4) { color: var(--paper); }
.hero.is-scrolly .hero-cue { display: block; position: absolute; left: 50%; bottom: 22px; margin: 0; transform: translateX(-50%); font: 600 9px 'DM Sans', sans-serif; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); transition: opacity .4s; }
.hero-cue::after { content: ''; display: block; width: 1px; height: 34px; margin: 10px auto 0; background: linear-gradient(var(--ember), transparent); animation: cueDrip 1.8s var(--ease-out) infinite; transform-origin: top; }
.hero:not([data-step="0"]) .hero-cue { opacity: 0; }
@keyframes cueDrip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* Movimiento reducido: un cuadro fijo del bife feteado, sin fijar el scroll */
.hero.is-still .hero-canvas { position: sticky; top: calc(var(--header-space) + 20px); grid-column: 2; inset: auto; align-self: start; height: min(70vh, 620px); }
.hero-canvas { align-self: start; }

/* ---------- Cierre de la portada: la foto real y el video ---------- */
.hero-outro { overflow: hidden; overflow: clip; overflow-clip-margin: 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); align-items: center; gap: 40px 8vw; max-width: 1440px; margin: 0 auto; padding: clamp(60px, 10vh, 120px) 6vw clamp(70px, 11vh, 130px); }
.outro-title { margin: 0 0 22px; font: 800 clamp(54px, 6.4vw, 104px)/.86 'Barlow Condensed', sans-serif; letter-spacing: -.02em; }
.outro-text { max-width: 38ch; color: #cfc8b9; font-size: 16px; }
.hero-outro .hero-media { justify-self: end; max-width: 480px; }
.hero-outro .hero-facts { margin-top: 36px; }

/* ---------- Móvil ---------- */
@media (max-width: 899px) {
  .hero-stage { grid-template-columns: 1fr; padding: 32px 20px 24px; }
  .hero-canvas { grid-column: 1; grid-row: 2; max-width: 460px; }
  .hero-steps { grid-row: 1; }
  .hero.is-scrolly .hero-track { height: 430svh; }
  .hero.is-scrolly .hero-step { left: 20px; right: 20px; top: calc(var(--header-space, 92px) + 8px); bottom: auto; width: auto; }
  .hero.is-scrolly h1, .hero.is-scrolly .step-title { font-size: clamp(50px, 14.5vw, 92px); }
  .hero.is-scrolly .hero-step-intro .lead { font-size: 14px; margin-bottom: 18px; }
  .hero.is-scrolly .step-copy { font-size: 14px; }
  .hero.is-scrolly .hero-step .eyebrow { margin-bottom: 14px; }
  .hero-label::after { width: 26px; }
  .hero-label span { left: 44px; font-size: 11px; padding: 7px 10px 8px; }
  .hero-label.to-left span { right: 44px; }
  .hero.is-scrolly .hero-rail ol { display: none; }
  .hero.is-scrolly .hero-rail { right: 10px; height: 34vh; top: auto; bottom: 8vh; transform: none; }
  .hero.is-still .hero-canvas { position: relative; top: auto; grid-column: 1; height: 64vh; }
  .hero-outro { grid-template-columns: minmax(0, 1fr); padding: 64px 20px 72px; overflow-clip-margin: 0; }
  .hero-outro .hero-media { justify-self: center; width: 100%; }
}
@media (max-width: 899px) and (max-height: 700px) {
  .hero.is-scrolly .hero-step-intro .lead { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero.is-scrolly .hero-track { height: auto; }
  .loader-fallback img, .hero-cue::after { animation: none; }
}
