/* Encabezado: vidrio fijo arriba, menú en cápsula con sección activa, barra de avance */
.mast {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(8 15 29 / .55);
  border-bottom: 1px solid rgb(255 255 255 / .06);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  transition: background .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.mast.is-scrolled {
  background: rgb(6 12 24 / .82);
  border-bottom-color: rgb(198 244 50 / .14);
  box-shadow: 0 12px 40px -18px rgb(0 0 0 / .8);
}
.mast-inner { transition: height .35s ease; }
.mast.is-scrolled .mast-inner { height: 64px; }

/* Logo con brillo suave al pasar el mouse */
.wordmark img { transition: transform .4s cubic-bezier(.2,.8,.2,1), filter .4s ease; filter: drop-shadow(0 0 0 rgb(198 244 50 / 0)); }
.wordmark:hover img { transform: rotate(-6deg) scale(1.06); filter: drop-shadow(0 0 14px rgb(198 244 50 / .45)); }

/* Menú en cápsula */
.mast nav {
  gap: 4px;
  padding: 5px;
  border: 1px solid rgb(255 255 255 / .09);
  border-radius: 999px;
  background: rgb(255 255 255 / .035);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .05);
}
.mast nav a {
  position: relative;
  padding: 8px 16px;
  border-radius: 999px;
  color: #c9d6e6;
  transition: color .25s ease, background .25s ease;
}
.mast nav a:hover { color: #fff; background: rgb(255 255 255 / .07); }
.mast nav a[aria-current="location"] { color: #0a1a33; background: #c6f432; box-shadow: 0 6px 18px -6px rgb(198 244 50 / .6); }

/* Controles agrupados */
.mast-actions #movimiento,
.mast-actions #sonidos {
  border: 1px solid rgb(255 255 255 / .1);
  border-radius: 999px;
  background: rgb(255 255 255 / .04);
  transition: background .25s ease, border-color .25s ease;
}
.mast-actions #movimiento:hover,
.mast-actions #sonidos:hover { background: rgb(255 255 255 / .1); border-color: rgb(198 244 50 / .4); }

/* Botón principal relleno */
.mast .nav-talk {
  gap: 10px;
  border: 0;
  background: linear-gradient(135deg, #d6ff4a, #b4e61f);
  color: #0a1a33;
  box-shadow: 0 8px 24px -8px rgb(198 244 50 / .7), inset 0 1px 0 rgb(255 255 255 / .5);
  transition: transform .2s ease, box-shadow .2s ease;
}
.mast .nav-talk:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -8px rgb(198 244 50 / .85), inset 0 1px 0 rgb(255 255 255 / .5); }

/* Barra de avance de lectura */
.mast-avance {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, #3fd0ff, #c6f432);
  transform: scaleX(var(--avance, 0));
  transform-origin: left;
  pointer-events: none;
}

:focus-visible { scroll-margin-top: 90px; }
section[id] { scroll-margin-top: 80px; }

@media (max-width: 640px) {
  .mast nav { width: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 0; padding: 3px; }
  .mast nav a { padding: 6px 9px; font-size: .8rem; white-space: nowrap; }
  .mast-inner { padding-bottom: 6px; }
  .mast.is-scrolled .mast-inner { height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .mast, .mast-inner, .mast nav a, .wordmark img, .mast .nav-talk { transition: none; }
}
@media (max-width: 360px) {
  .mast nav a { padding: 6px 6px; font-size: .74rem; }
}
/* Pausa de animaciones: además del color, un aro visible cuando está activa */
#movimiento[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: 2px; }
