/* ¡Felices fiestas! · Grupo Radio Centro */

:root {
  --crema: #F4EDE1;
  --papel: #FFFDF8;
  --tinta: #17171C;
  --gris: #6B655B;
  --linea: #DDD3C1;
  --pino: #0C4B33;
  --rojo: #FF0138;
  --amarillo: #FFC93C;
  --menta: #9BE0BA;
  --estacion: #17171C;
  --estacion-texto: #F4EDE1;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--crema);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
p, h1, h2 { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.saltar {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--amarillo); color: var(--tinta); padding: 10px 14px;
  font-weight: 600; text-decoration: none; border-radius: 8px;
}
.saltar:focus { top: 16px; }
:focus-visible { outline: 3px solid var(--tinta); outline-offset: 3px; }

/* ============ Layout ============ */
@media (min-width: 1000px) {
  .layout { display: grid; grid-template-columns: minmax(420px, 42%) 1fr; }
  .hero { position: sticky; top: 0; height: 100svh; align-self: start; }
  .layout .hero .arbol {
    position: absolute; right: 0; bottom: 0;
    width: 56%; height: 54%; margin: 0;
  }
  .hero-pie { max-width: min(58%, 460px); z-index: 2; }
  .hero .cta { white-space: nowrap; }
  .hero .mensaje { max-width: none; font-size: clamp(17px, 1.15vw, 22px); }
}

@media (min-width: 1000px) and (max-height: 840px) {
  .layout .hero .arbol { width: 50%; height: 52%; }
}
@media (min-width: 1000px) {
  @container (max-width: 520px) {
    .layout .hero .arbol { width: 46%; height: 52%; }
  }
}

/* ============ Hero ============ */
.hero {
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  background: var(--pino);
  color: var(--crema);
  display: flex;
  flex-direction: column;
  padding: 24px 24px 0;
  min-height: 88svh;
}
.hero :focus-visible { outline-color: var(--amarillo); }
.nieve { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero > *:not(.nieve) { position: relative; }

.logo { width: 128px; height: auto; }

.hero-texto { margin-top: clamp(28px, 7svh, 72px); z-index: 2; will-change: transform; }
.titulo { line-height: .82; font-weight: normal; }
.titulo-1 {
  display: block;
  font-family: var(--sans);
  font-weight: 850;
  font-stretch: 74%;
  font-size: min(31cqw, 20svh, 240px);
  letter-spacing: -.035em;
  margin-left: -.04em;
}
.titulo-2 {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: min(34cqw, 23svh, 280px);
  letter-spacing: -.02em;
  color: var(--amarillo);
  margin: -.12em 0 0 .42em;
}
.hero-pie { position: relative; }
.mensaje span { display: block; text-wrap: balance; }
.mensaje {
  margin-top: 20px;
  max-width: 32ch;
  font-size: 18px;
  line-height: 1.35;
  color: #E7DFD1;
}

.cta {
  margin-top: 22px;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px 14px 16px;
  border: 0; border-radius: 999px;
  background: var(--amarillo); color: var(--tinta);
  font-weight: 700; font-size: 16px; cursor: pointer;
  transition: transform .2s ease;
}
.cta:hover { transform: translateY(-2px); }
.cta-ico {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--rojo); position: relative; flex: none;
}
.cta-ico::after {
  content: ""; position: absolute; left: 8px; top: 6px;
  border-left: 8px solid var(--crema); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
[aria-pressed="true"] .cta-ico::after {
  left: 7px; top: 7px; width: 8px; height: 8px; border: 0; background: var(--crema);
}

.arbol {
  flex: 1;
  min-height: 250px;
  position: relative;
  margin-top: 18px;
  touch-action: pan-y;
}
.arbol-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

@media (max-width: 999px) {
  .arbol { flex: none; height: 42svh; }
  .fig-1 { right: -16%; top: 3%; }
  .fig-2 { top: auto; bottom: 30%; right: 6%; }
  .fig-3 { left: auto; right: 30%; top: 4%; }
  .fig-4 { right: -4%; bottom: 10%; }
  .cierre { padding-top: 120px; }
}
@media (max-width: 560px) {
  .hero { min-height: 0; padding: 20px 20px 0; }
  .arbol { height: 36svh; }
  .mensaje { font-size: 17px; }
}

/* Árbol: armado y movimiento */
.arbol-svg .pieza, .arbol-svg .mece, .arbol-svg .esfera, .arbol-svg .gira, .arbol-svg .balance {
  transform-box: fill-box;
}
.arbol-svg .balance { transform-origin: 50% 100%; }
.arbol-svg .pieza { transform-origin: 50% 100%; animation: cae .9s cubic-bezier(.3, 1.45, .55, 1) both; }
.arbol-svg .p-maceta { animation-delay: .05s; }
.arbol-svg .p-1 { animation-delay: .25s; }
.arbol-svg .p-2 { animation-delay: .5s; }
.arbol-svg .p-3 { animation-delay: .75s; }
.arbol-svg .p-estrella { animation-name: estrella; animation-delay: 1.05s; transform-origin: 50% 50%; }
.arbol-svg .p-estrella .balance { transform-origin: 50% 50%; }
@keyframes cae { from { transform: translateY(-120%) rotate(-8deg); opacity: 0; } 40% { opacity: 1; } to { transform: none; } }
@keyframes estrella { from { transform: scale(0) rotate(-180deg); opacity: 0; } to { transform: none; opacity: 1; } }

.mece { transform-origin: 50% 100%; animation: mece 5s ease-in-out infinite; }
.p-1 .mece { animation-duration: 6.5s; }
.p-2 .mece { animation-duration: 5.2s; animation-delay: -1s; }
.p-3 .mece { animation-duration: 4.4s; animation-delay: -2s; }
@keyframes mece { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }

.gira { transform-origin: 50% 50%; animation: gira 14s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

.esfera {
  transform-origin: 50% 50%;
  transform: scale(calc(1 + var(--pulso, 0) * .45));
  animation: aparece-esfera .5s cubic-bezier(.3, 1.6, .5, 1) both;
  animation-delay: calc(1.25s + var(--d) * .08s);
}
@keyframes aparece-esfera { from { transform: scale(0); } to { transform: scale(1); } }
.esfera.lista { animation: none; transition: transform .08s linear; }

/* ============ Radio ============ */
.radio-zona {
  padding: 34px 16px 40px;
  display: flex; justify-content: center;
  outline: none;
}
@media (min-width: 1000px) {
  .radio-zona { min-height: 100svh; align-items: center; padding: 36px 40px; }
}
.radio-col { width: 100%; max-width: 760px; }
@media (min-width: 1000px) {
  .radio-col { max-width: clamp(470px, calc((100svh - 395px) * 1.45), 860px); }
  .controles { display: grid; grid-template-columns: 1.08fr 1fr; gap: 14px; margin-top: 14px; align-items: stretch; }
  .controles .panel, .controles .presets { margin-top: 0; }
  .controles .presets { grid-template-columns: repeat(2, 1fr); }
}

.radio-encabezado {
  border-top: 1.5px solid var(--tinta); padding-top: 12px; margin-bottom: 14px;
}
.radio-encabezado h2 {
  font-family: var(--serif); font-weight: normal;
  font-size: clamp(30px, 4.2vw, 42px); line-height: 1.02; letter-spacing: -.01em;
  text-wrap: balance;
}

.radio { position: relative; }
#radio-svg { width: 100%; height: auto; overflow: visible; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
#cuadrante, .perilla { cursor: grab; }
#boton-rojo { cursor: pointer; }
#cuadrante { touch-action: none; }
.arrastrando #cuadrante, .arrastrando .perilla { cursor: grabbing; }
.perilla { outline: none; }
.perilla .foco { stroke: transparent; stroke-width: 3; }
.perilla:focus-visible .foco { stroke: var(--tinta); }
#boton-rojo-disco, #boton-rojo-ico { transition: transform .12s ease; }
#boton-rojo:active #boton-rojo-disco, #boton-rojo:active #boton-rojo-ico,
#boton-rojo[aria-checked="true"] #boton-rojo-disco, #boton-rojo[aria-checked="true"] #boton-rojo-ico { transform: translateY(3px); }
#boton-rojo:hover #boton-rojo-disco { fill: #FF1F50; }
#piloto { transition: fill .25s; }
.svg-lectura { font-family: var(--sans); font-weight: 500; font-size: 13px; fill-opacity: .7; letter-spacing: .02em; fill: var(--tinta); }
.escala-num { font-family: var(--sans); font-weight: 700; letter-spacing: -.01em; fill: #2B2925; font-variant-numeric: tabular-nums; transition: fill .25s; }

/* Panel al aire */
.panel {
  margin-top: 16px;
  border-radius: 20px;
  padding: 18px 20px 20px;
  background: var(--tinta);
  color: var(--crema);
  transition: background .35s ease, color .35s ease;
  display: flex; flex-direction: column;
}
.panel[data-estado="al-aire"], .panel[data-estado="completo"], .panel[data-estado="sintonizando"] {
  background: var(--estacion); color: var(--estacion-texto);
}
.panel-fila { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; opacity: .9; }
.panel-tiempo { font-variant-numeric: tabular-nums; font-weight: 500; }
.panel-nombre {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(34px, 5.4vw, 44px); line-height: .98; letter-spacing: -.01em;
}
.panel-sub { margin-top: 6px; font-size: 15px; opacity: .85; }
.panel-barra { position: relative; height: 4px; margin-top: auto; padding-top: 18px; box-sizing: content-box; }
.panel-barra span, .panel-barra::after { position: absolute; left: 0; bottom: 0; height: 4px; border-radius: 4px; }
.panel-barra::after { content: ""; right: 0; background: currentColor; opacity: .22; }
.panel-barra span { width: 0; background: currentColor; z-index: 1; }
.panel-botones { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.boton {
  display: inline-flex; align-items: center; gap: 10px;
  border: 0; border-radius: 999px; padding: 11px 18px 11px 14px;
  font-weight: 700; font-size: 15px; cursor: pointer;
  background: var(--crema); color: var(--tinta);
}
#boton-repetir { padding-left: 18px; }
.boton[hidden] { display: none; }
.panel :focus-visible { outline-color: currentColor; }
.aviso {
  margin-top: 8px; display: flex; align-items: flex-start; gap: 8px;
  font-size: 15px; line-height: 1.35; color: var(--gris);
}
.aviso svg { flex: none; margin-top: 1px; color: var(--rojo); }

/* Estaciones */
.presets {
  margin-top: 14px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
@media (max-width: 620px) { .presets { grid-template-columns: repeat(2, 1fr); } }
.preset {
  --c: var(--tinta);
  position: relative; overflow: hidden; text-align: left; cursor: pointer;
  border: 1.5px solid var(--linea); border-radius: 18px;
  background: var(--papel); color: var(--tinta);
  padding: 14px 14px 13px;
  display: flex; flex-direction: column; gap: 3px;
  transition: border-color .25s, box-shadow .25s, transform .15s;
}
.preset:hover { transform: translateY(-2px); border-color: var(--c); }
.preset-logo { height: 40px; display: flex; align-items: center; margin-bottom: 10px; }
.preset-logo img { max-height: 40px; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.preset-loc { font-family: var(--serif); font-size: clamp(18px, 1.5vw, 22px); line-height: 1.05; }
.preset::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 0;
  background: var(--c); transition: height .25s ease;
}
.preset[aria-pressed="true"] { border-color: var(--c); box-shadow: inset 0 0 0 1.5px var(--c); }
.preset[aria-pressed="true"]::before { height: 6px; }

/* ============ Cierre ============ */
.cierre {
  position: relative; overflow: hidden;
  background: var(--pino); color: var(--crema);
  padding: clamp(64px, 12vw, 150px) clamp(20px, 6vw, 88px) 28px;
}
.cierre-figuras { position: absolute; inset: 0; pointer-events: none; }
.fig { position: absolute; border-radius: 50%; will-change: transform; }
.fig-1 { width: clamp(120px, 22vw, 320px); aspect-ratio: 1; background: var(--rojo); right: 6%; top: 12%; }
.fig-2 { width: clamp(44px, 7vw, 110px); aspect-ratio: 1; background: var(--amarillo); right: 33%; top: 6%; }
.fig-3 { width: clamp(36px, 5vw, 70px); aspect-ratio: 1; background: #3F5FE0; left: 58%; top: 8%; }
.fig-4 {
  width: 0; height: 0; border-radius: 0; right: 12%; bottom: 14%;
  border-left: clamp(50px, 8vw, 110px) solid transparent; border-right: clamp(50px, 8vw, 110px) solid transparent;
  border-bottom: clamp(86px, 14vw, 190px) solid #22A35E;
}
.cierre-texto { position: relative; z-index: 1; }
.cierre-gracias {
  font-family: var(--serif);
  font-size: clamp(34px, 5.6vw, 76px); line-height: 1.02; letter-spacing: -.01em;
}
.cierre-gracias span { display: block; }
.cierre-gracias span:first-child { font-style: italic; color: var(--menta); }
.cierre-feliz { margin-top: clamp(18px, 3vw, 36px); line-height: .8; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .14em; }
.cierre-feliz-1 {
  font-family: var(--sans); font-weight: 850; font-stretch: 74%;
  font-size: clamp(84px, 19vw, 260px); letter-spacing: -.04em;
}
.cierre-feliz-2 {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(96px, 22vw, 300px); letter-spacing: -.03em; color: var(--amarillo);
}
.cierre-firma {
  position: relative; z-index: 1;
  margin-top: clamp(48px, 8vw, 110px); padding-top: 16px;
  border-top: 1px solid rgba(244, 237, 225, .3);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: #C9C1B2;
}
.cierre-firma img { width: 120px; height: auto; }

/* Cargador: solo se ve si la página tarda más de ~0.4 s en estar lista */
.cargador {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--pino); color: var(--crema);
  opacity: 0; animation: cargador-entra .3s ease .4s forwards;
  transition: opacity .45s ease, visibility .45s;
}
.cargador.listo { opacity: 0 !important; visibility: hidden; animation: none; }
.cargador-puntos { display: flex; gap: 10px; }
.cargador-puntos span { width: 16px; height: 16px; border-radius: 50%; background: var(--amarillo); animation: cargador-brinca 1s ease-in-out infinite; }
.cargador-puntos span:nth-child(2) { background: var(--rojo); animation-delay: .15s; }
.cargador-puntos span:nth-child(3) { background: var(--menta); animation-delay: .3s; }
.cargador-txt { font-family: var(--serif); font-style: italic; font-size: 22px; }
@keyframes cargador-entra { to { opacity: 1; } }
@keyframes cargador-brinca { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* Apariciones al hacer scroll */
.js .aparece { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.js .aparece.visible { opacity: 1; transform: none; }
.js .presets.aparece { transition-delay: .08s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .aparece { opacity: 1; transform: none; }
  .cargador { opacity: 1; }
  .cargador.listo { display: none; }
}
