/* =========================================================================
   GIO WEB · ITERACIÓN 07 · Hero de la Iteración 05 («El mundo GIO»), como alternativa al hero de la Iteración 04
   Es el CSS del hero de la Iteración 05 (assets/css/gio.css, sección 1) con tres cambios:
   1. Todas sus clases llevan el prefijo «h2» (.h2, .h2__stage, .h2__pal…) para convivir con el hero de la
      Iteración 04 sin choques de nombres (ambos heroes se llaman .stage y .pal).
   2. Se eliminó su navegación propia: la placa cuadrada del logotipo (.brand), el rótulo superior
      «Paletas artesanales · Tegucigalpa, Honduras» (.hero__tag) y los enlaces superiores. La web usa una sola
      navegación, la de la Iteración 04 (ver hero.css y page.css).
   3. La rueda y la colina bajan un poco (lo calcula hero02.js) para dejar aire bajo esa navegación.
   Geometría, colores, fotografías y movimiento: los de la Iteración 05, sin tocar.
   ========================================================================= */

.h2 {
  /* Valores de partida (sin JS o antes del primer cálculo); hero02.js los ajusta a la ventana */
  --bg: var(--coco-suave);
  --hill: var(--coco);
  --R: 115vw;
  --rim: 66vh;
  --palH: 56vh;
  --theta: 15deg;
  --fruitW: 13vw;
  --ease: cubic-bezier(.2, .7, .2, 1);

  position: relative;
  height: 100vh; height: 100svh; height: 100dvh;   /* respaldo → svh → dvh: llena la pantalla visible */
  min-height: 500px;
  overflow: hidden;
  background: var(--bg);
  color: var(--negro);
  font: 400 17px/1.5 var(--f-text);
  -webkit-user-select: none; user-select: none;
}
.h2 img, .h2 svg { max-width: 100%; }
.h2 svg.h2__name { max-width: none; }
.h2 :focus-visible { outline: 2px solid var(--negro); outline-offset: 3px; }

.h2__stage { position: absolute; inset: 0; touch-action: pan-y; cursor: grab; }
.h2__stage.is-dragging { cursor: grabbing; }
.h2__stage:focus { outline: none; }

.h2__wheel { position: absolute; z-index: 0; left: 50%; top: calc(var(--rim) + var(--R)); width: 0; height: 0; isolation: isolate; }
.h2__hill { z-index: 1; }
.h2__wheel--front { z-index: 2; }
.h2__spoke { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }

.h2__pal {
  position: absolute; left: 0;
  bottom: calc(var(--R) - var(--palH) * .015);
  height: var(--palH);
  aspect-ratio: 858 / 1833;
  transform: translateX(-50%) translateY(var(--sink, 0px)) scale(var(--s, 1));
  transform-origin: 50% 100%;
}
.h2__pal img {
  width: 100%; height: 100%; max-width: none;
  -webkit-user-drag: none;
  transition: transform .4s var(--ease);
}

.h2__fruit {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  transform: rotate(calc(var(--theta) * var(--at)));
}
.h2__fruit img {
  position: absolute; left: 0; bottom: var(--R);
  width: calc(var(--fruitW) * var(--w)); height: auto; max-width: none;
  transform: translate(-50%, calc((var(--dip) + (1 - var(--fr, 0)) * 130) * 1%)) rotate(var(--rot));
  -webkit-user-drag: none; pointer-events: none;
}

/* La colina: el borde visible de la rueda, en el color pleno del sabor. */
.h2__hill {
  position: absolute; inset: 0;
  background: var(--hill);
  clip-path: circle(var(--R) at 50% calc(var(--rim) + var(--R)));
  pointer-events: none;
}

.h2__wheel--front { pointer-events: none; }
.h2__name { position: absolute; left: 0; top: 0; width: 1px; height: 1px; max-width: none; overflow: visible; opacity: 0; }
.h2__name text {
  fill: var(--blanco);
  font-family: var(--f-display);
  font-weight: 900;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
  letter-spacing: -.01em;
  font-size: 140px;
}

/* Antes de que hero02.js coloque la escena, las paletas esperan bajo el horizonte (evita un salto) */
.js .h2:not(.is-ready) .h2__pal { --sink: 3000px; }

@media (hover: hover) {
  .h2.is-ready .h2__spoke:not(.is-active) .h2__pal { cursor: pointer; }
  .h2.is-ready .h2__spoke:not(.is-active) .h2__pal:hover img { transform: translateY(-2.5%); }
}

/* Pestañas de sabor */
.h2__tabs {
  position: absolute; z-index: 5;
  left: 50%; bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px));
  transform: translateX(-50%);
  display: flex; padding: 5px;
  background: var(--blanco);
  border-radius: 999px;
}
.h2__tab {
  position: relative; z-index: 1;
  height: 40px; padding: 0 20px;
  border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 600 15px/1 var(--f-text);
  -webkit-tap-highlight-color: transparent;
}
.h2__ind {
  position: absolute; top: 5px; bottom: 5px; left: 0; width: 0;
  border-radius: 999px;
  background: var(--bg);
  transition: transform .5s var(--ease), width .5s var(--ease);
}

/* Sin JavaScript: escena estática de coco */
.no-js .h2__tabs { display: none; }
.no-js .h2__spoke[data-i="1"] { transform: rotate(15deg); }
.no-js .h2__spoke[data-i="2"] { transform: rotate(-15deg); }
.no-js .h2__spoke[data-i="1"] .h2__pal, .no-js .h2__spoke[data-i="2"] .h2__pal { --s: .86; }
.no-js .h2__spoke[data-i="0"] { --fr: 1; z-index: 2; }
.no-js .h2__wheel--front { display: none; }
.no-js .h2::after {                    /* el nombre curvo necesita JS; aquí va recto */
  content: "coco"; position: absolute; z-index: 3; left: 0; right: 0; bottom: 6vh;
  text-align: center; color: var(--blanco);
  font: 900 clamp(64px, 15vh, 150px)/1 var(--f-display);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0; letter-spacing: -.01em;
}
.no-js .h2__stage { cursor: default; }

@media (max-width: 559px) {
  .h2__tab { padding: 0 16px; }
}
/* Móvil: pestañas con 44 px de alto (la posición inferior es la original; el selector de heroes, temporal, la ajusta en page.css) */
@media (max-width: 700px), (min-width: 701px) and (max-aspect-ratio: 1/1) {
  .h2__tab { min-width: 44px; height: 44px; }
}
/* Hero 02 a pantalla completa real en móvil (ver hero01.css): el fondo llega al borde físico (lvh) y las pestañas suben la
   diferencia lvh − svh para no quedar bajo la barra de Safari. */
@media (max-width: 700px), (min-width: 701px) and (max-aspect-ratio: 1/1) {
  @supports (height: 100lvh) {
    .h2 { height: calc(max(100lvh, 500px) + var(--E, 0px)); }
    .h2__tabs { bottom: calc(max(22px, calc(env(safe-area-inset-bottom) + 12px)) + max(0px, 100lvh - 100svh) + var(--E, 0px)); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .h2 *, .h2 *::before, .h2 *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
