/* Noteflat · propuesta 10 «Cálido»
   Crema, arcilla, durazno y marrón de madera. La partitura es un papel
   apoyado en la tapa del piano; las notas son manchas hechas a mano. */

:root {
  --crema: #f7eedf;
  --papel: #fffaf1;
  --arcilla: #b5502c;
  --arcilla-honda: #8f3c1f;
  --arcilla-texto: #9c4120;
  --durazno: #f8d3b6;
  --durazno-suave: #fbe6d3;
  --durazno-vivo: #e59a6c;
  --marron: #3a2317;
  --marron-suave: #6b5243;
  --madera: #7d4b31;
  --raya: #e6d2bb;

  --mano-derecha: #f2a03d;
  --mano-derecha-clara: #ffd39a;
  --mano-derecha-honda: #cf7d18;
  --mano-izquierda: #6d8bff;
  --mano-izquierda-clara: #b3c2ff;
  --mano-izquierda-honda: #4763e0;

  /* La tapa del piano: la madera sobre la que descansa la partitura */
  --tapa:
    linear-gradient(118deg, rgba(255, 232, 205, 0) 38%, rgba(255, 232, 205, 0.12) 47%, rgba(255, 232, 205, 0) 58%),
    repeating-linear-gradient(93deg, rgba(255, 225, 190, 0.05) 0 2px, rgba(0, 0, 0, 0) 2px 11px, rgba(40, 15, 5, 0.07) 11px 13px, rgba(0, 0, 0, 0) 13px 29px),
    radial-gradient(120% 80% at 24% 0%, #a06a48 0%, rgba(160, 106, 72, 0) 62%),
    linear-gradient(165deg, #82502f, #5c3421);
  --escenario: #170d08;
  --sobre-oscuro: #f3e3d0;

  --fuente: "Nunito", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --salida: cubic-bezier(0.23, 1, 0.32, 1);
  --ancho: 1160px;
  --sombra-suave: 0 1px 0 rgba(125, 75, 49, 0.06), 0 22px 44px -28px rgba(125, 75, 49, 0.42);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--crema);
  color: var(--marron);
  font: 500 1.125rem/1.6 var(--fuente);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--marron);
  outline-offset: 3px;
  border-radius: 10px;
}

.oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.salto {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 50;
  padding: 12px 20px;
  border-radius: 16px;
  background: var(--marron);
  color: var(--papel);
  font-weight: 800;
  text-decoration: none;
}

.salto:focus {
  top: 16px;
}

.ancho {
  width: min(var(--ancho), 100% - 48px);
  margin-inline: auto;
}

h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.titulo {
  font-size: clamp(1.875rem, 3.4vw, 2.625rem);
  line-height: 1.12;
}

.titulo--centro {
  text-align: center;
}

/* ───────── Botones: redondos y con canto, para que apetezca pulsarlos ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--arcilla);
  box-shadow: 0 4px 0 var(--arcilla-honda);
  color: #fff;
  font: 800 1.0625rem/1 var(--fuente);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 140ms var(--salida), box-shadow 140ms var(--salida), background-color 180ms ease;
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--arcilla-honda);
}

.btn--claro {
  background: var(--papel);
  box-shadow: 0 4px 0 var(--raya), inset 0 0 0 2px var(--raya);
  color: var(--marron);
}

.btn--claro:active {
  box-shadow: 0 1px 0 var(--raya), inset 0 0 0 2px var(--raya);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    background: #a94826;
    transform: translateY(-1px);
    box-shadow: 0 5px 0 var(--arcilla-honda);
  }

  .btn--claro:hover {
    background: #fff;
    box-shadow: 0 5px 0 var(--raya), inset 0 0 0 2px #d9bfa3;
  }

  .btn:active {
    transform: translateY(3px);
  }
}

/* ───────── Cabecera ───────── */

.cabecera {
  padding: 22px 0 0;
}

.cabecera__fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.marca svg {
  width: 28px;
  height: 28px;
}

.menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms ease;
}

.menu a[aria-current="page"] {
  background: var(--durazno);
}

.menu .menu__entrar {
  margin-left: 6px;
  background: var(--papel);
  box-shadow: inset 0 0 0 2px var(--raya);
}

@media (hover: hover) and (pointer: fine) {
  .menu a:hover {
    background: var(--durazno-suave);
  }

  .menu .menu__entrar:hover {
    background: #fff;
  }
}

/* ───────── Portada ───────── */

.portada {
  padding: 44px 0 96px;
}

.portada__rejilla {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: 64px;
  align-items: center;
}

.portada h1 {
  font-size: clamp(2.375rem, 4.7vw, 3.875rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

/* Subrayado a mano bajo la palabra clave. */
.subrayado {
  position: relative;
  display: inline-block;
  z-index: 0;
}

.subrayado svg {
  position: absolute;
  left: -2%;
  bottom: -0.1em;
  z-index: -1;
  width: 104%;
  height: 0.3em;
  overflow: visible;
}

.subrayado path {
  fill: none;
  stroke: var(--durazno-vivo);
  stroke-width: 6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.entradilla {
  max-width: 31rem;
  margin-top: 22px;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.5;
  color: var(--marron-suave);
  text-wrap: pretty;
}

.soltar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 24px;
  margin-top: 34px;
  padding: 26px 28px;
  border: 2.5px dashed #e0b08c;
  border-radius: 30px;
  background: var(--papel);
  box-shadow: var(--sombra-suave);
  transition: transform 220ms var(--salida), background-color 200ms ease, border-color 200ms ease;
}

.soltar__texto {
  font-size: 1.3125rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.soltar__formatos {
  font-size: 1rem;
  color: var(--marron-suave);
}

.soltar .btn {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.soltar .btn:focus-within {
  outline: 3px solid var(--marron);
  outline-offset: 4px;
}

.soltar.es-destino {
  transform: scale(1.015);
  border-color: var(--arcilla);
  background: var(--durazno-suave);
}

.datos {
  display: grid;
  gap: 10px;
  margin-top: 30px;
  font-weight: 700;
  line-height: 1.4;
}

.datos li {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Cabezas de nota como viñetas. */
.datos li::before {
  content: "";
  flex: none;
  width: 17px;
  height: 13px;
  border-radius: 58% 42% 56% 44% / 52% 50% 50% 48%;
  background: var(--nota, var(--arcilla));
  transform: rotate(-20deg);
}

.datos li:nth-child(2) {
  --nota: var(--durazno-vivo);
}

.datos li:nth-child(3) {
  --nota: var(--madera);
}

/* La tapa del piano: un campo de madera con la hoja encima. */
.atril {
  position: relative;
  padding: 50px 0 54px;
}

.atril::before {
  content: "";
  position: absolute;
  inset: 0 0 0 7%;
  border-radius: 44px;
  background:
    linear-gradient(118deg, rgba(255, 232, 205, 0) 38%, rgba(255, 232, 205, 0.16) 47%, rgba(255, 232, 205, 0) 58%),
    repeating-linear-gradient(93deg, rgba(255, 225, 190, 0.05) 0 2px, rgba(0, 0, 0, 0) 2px 11px, rgba(40, 15, 5, 0.07) 11px 13px, rgba(0, 0, 0, 0) 13px 29px),
    radial-gradient(120% 80% at 24% 0%, #a06a48 0%, rgba(160, 106, 72, 0) 62%),
    linear-gradient(165deg, #82502f, #5c3421);
}

.atril__hoja,
.atril__debajo {
  position: relative;
  width: 76%;
  aspect-ratio: 1400 / 1770;
  overflow: hidden;
  border-radius: 6px;
  background: #fffdf8;
}

.atril__debajo {
  position: absolute;
  top: 66px;
  left: 16%;
  transform: rotate(5deg);
  background: #f6efe2 url("/web/material/partitura-fur-elise.png") 0 0 / 100% auto no-repeat;
  background-blend-mode: multiply;
  box-shadow: 0 16px 30px -18px rgba(30, 12, 4, 0.7);
}

.atril__hoja {
  margin-left: 2%;
  transform: rotate(-3.5deg);
  box-shadow:
    0 2px 3px rgba(30, 12, 4, 0.22),
    0 34px 50px -22px rgba(30, 12, 4, 0.75);
}

.atril__hoja img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.atril figcaption {
  position: relative;
  max-width: 26rem;
  margin: 26px 0 0 14%;
  padding-right: 20px;
  font-size: 1rem;
  line-height: 1.45;
  color: #fbe6d3;
}

/* ───────── Cómo funciona ───────── */

.borde-ondulado {
  width: 100%;
  height: 34px;
  fill: var(--papel);
}

/* ───────── Muestra: una partitura grande que suena ───────── */

.muestra {
  padding: 56px 0 26px;
  background: var(--papel);
  scroll-margin-top: 10px;
}

.muestra__cabeza {
  max-width: 44rem;
  margin-bottom: 34px;
}

.muestra__cabeza p {
  max-width: 38rem;
  margin-top: 14px;
  color: var(--marron-suave);
}

/* La hoja descansa sobre la misma madera que en la portada. --aumento amplía
   la partitura en pantallas estrechas; muestra.js la desliza para seguirla. */
.lector {
  --aumento: 1;
  padding: clamp(16px, 3vw, 38px);
  border-radius: 44px;
  background:
    linear-gradient(118deg, rgba(255, 232, 205, 0) 38%, rgba(255, 232, 205, 0.12) 47%, rgba(255, 232, 205, 0) 58%),
    repeating-linear-gradient(93deg, rgba(255, 225, 190, 0.05) 0 2px, rgba(0, 0, 0, 0) 2px 11px, rgba(40, 15, 5, 0.07) 11px 13px, rgba(0, 0, 0, 0) 13px 29px),
    radial-gradient(120% 80% at 24% 0%, #a06a48 0%, rgba(160, 106, 72, 0) 62%),
    linear-gradient(165deg, #82502f, #5c3421);
}

.lector__marco {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow:
    0 2px 3px rgba(30, 12, 4, 0.22),
    0 34px 50px -22px rgba(30, 12, 4, 0.75);
  cursor: pointer;
}

.lector__hoja {
  position: relative;
  width: calc(100% * var(--aumento));
  transition: transform 700ms var(--salida);
}

.lector__hoja img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

/* El compás que suena, teñido, y la línea que lo recorre */
.lector__compas,
.lector__cursor {
  position: absolute;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.lector__compas {
  border-radius: 8px;
  background: var(--durazno);
  mix-blend-mode: multiply;
  opacity: 0.75;
}

.lector__cursor {
  width: 3px;
  margin-left: -1.5px;
  border-radius: 3px;
  background: var(--arcilla);
}

.lector.es-inicio .lector__compas,
.lector.es-inicio .lector__cursor {
  opacity: 0;
}

.lector__mandos {
  display: grid;
  grid-template-columns: auto auto minmax(140px, 1fr) auto;
  align-items: center;
  gap: 14px 24px;
  margin-top: 26px;
  color: #fbe6d3;
}

.lector__tocar {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 50%;
  background: var(--papel);
  box-shadow: 0 4px 0 rgba(30, 12, 4, 0.5);
  color: var(--arcilla);
  cursor: pointer;
  transition: transform 140ms var(--salida), box-shadow 140ms var(--salida);
}

.lector__tocar:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(30, 12, 4, 0.5);
}

.lector__tocar:focus-visible,
.lector__avance:focus-visible {
  outline: 3px solid var(--durazno);
  outline-offset: 4px;
}

.lector__icono {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.lector__icono--tocar {
  margin-left: 3px;
}

.lector__icono--pausa,
.lector.esta-sonando .lector__icono--tocar {
  display: none;
}

.lector.esta-sonando .lector__icono--pausa {
  display: block;
}

.lector__pieza {
  display: grid;
  font-size: 1rem;
  line-height: 1.35;
}

.lector__pieza strong {
  color: #fff7ec;
  font-size: 1.1875rem;
  font-weight: 800;
}

.lector__avance {
  width: 100%;
  min-height: 44px;
  margin: 0;
  border-radius: 999px;
  accent-color: var(--durazno-vivo);
  cursor: pointer;
}

.lector__tiempo {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Qué suena: la grabación o las notas que escribió el motor */
.lector__fuente {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 247, 236, 0.2);
  color: #fbe6d3;
}

.lector__rotulo {
  font-size: 1rem;
  font-weight: 700;
}

.lector__opciones {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  border-radius: 22px;
  background: rgba(30, 12, 4, 0.34);
}

.lector__opcion {
  position: relative;
  cursor: pointer;
}

.lector__opcion span {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 17px;
  font-size: 1rem;
  font-weight: 800;
  transition: background-color 180ms ease, color 180ms ease;
}

.lector__opcion input:checked + span {
  background: var(--papel);
  color: var(--marron);
}

.lector__opcion input:focus-visible + span {
  outline: 3px solid var(--durazno);
  outline-offset: 3px;
}

.lector__explica {
  flex: 1 1 16rem;
  font-size: 1rem;
  line-height: 1.4;
}

/* Solo ocupa sitio cuando hay un aviso que dar */
.lector__explica:empty {
  display: none;
}

.lector__aviso {
  margin-top: 14px;
  color: #fff7ec;
  font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
  .lector__tocar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(30, 12, 4, 0.5);
  }
}

@media (max-width: 900px) {
  .lector {
    --aumento: 1.5;
    border-radius: 34px;
  }

  .lector__marco {
    aspect-ratio: 4 / 3;
  }

  .lector__mandos {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .lector__avance {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 620px) {
  .muestra {
    padding: 40px 0 10px;
  }

  .lector {
    --aumento: 2.1;
    border-radius: 26px;
  }

  .lector__tocar {
    width: 60px;
    height: 60px;
  }

  .lector__pieza span {
    font-size: 0.9375rem;
  }
}

.como {
  padding: 70px 0 110px;
  background: var(--papel);
  scroll-margin-top: 10px;
}

.como .titulo {
  max-width: 20ch;
}

.pasos-zona {
  position: relative;
  margin-top: 30px;
}

.pentagrama {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 150px;
  overflow: visible;
}

.pentagrama path {
  fill: none;
  stroke: #e3c9ad;
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.pasos {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  counter-reset: paso;
}

.paso {
  counter-increment: paso;
}

.paso__nota {
  position: relative;
  height: 176px;
}

/* La plica baja desde la nota hasta el texto del paso. */
.paso__nota::before {
  content: "";
  position: absolute;
  left: 4px;
  top: calc(var(--y) + 26px);
  bottom: 14px;
  width: 4px;
  border-radius: 4px;
  background: var(--color);
}

.paso__nota::after {
  content: counter(paso);
  position: absolute;
  left: 0;
  top: var(--y);
  display: grid;
  place-items: center;
  width: 64px;
  height: 50px;
  border-radius: 58% 42% 56% 44% / 52% 50% 50% 48%;
  background: var(--color);
  color: var(--numero, #fff);
  font-size: 1.5rem;
  font-weight: 900;
  transform: rotate(-12deg);
}

.paso:nth-child(1) .paso__nota {
  --y: 58px;
  --color: var(--arcilla);
}

.paso:nth-child(2) .paso__nota {
  --y: 22px;
  --color: var(--durazno-vivo);
  --numero: var(--marron);
}

.paso:nth-child(3) .paso__nota {
  --y: 76px;
  --color: var(--marron);
  --numero: var(--papel);
}

.paso h3 {
  font-size: 1.5rem;
  line-height: 1.2;
}

.paso p {
  max-width: 21rem;
  margin-top: 10px;
  color: var(--marron-suave);
  text-wrap: pretty;
}

/* ───────── Llamada a los planes ───────── */

.invitacion {
  padding: 0 0 100px;
  background: var(--papel);
}

.invitacion__caja {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  overflow: hidden;
  padding: 54px 60px;
  border-radius: 44px;
  background: var(--durazno);
}

.invitacion__caja > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.invitacion__caja > svg path {
  fill: none;
  stroke: #efbd98;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.invitacion h2 {
  position: relative;
  font-size: clamp(1.875rem, 3.8vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.invitacion .btn {
  position: relative;
}

/* ───────── Pie ───────── */

.pie {
  background: var(--papel);
}

.pie__fondo {
  padding: 46px 0 52px;
  border-radius: 44px 44px 0 0;
  background: var(--marron);
  color: #f3e3d0;
}

.pie--crema {
  background: var(--crema);
}

.pie__fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 40px;
}

.pie .marca {
  color: var(--papel);
}

.pie__lema {
  font-size: 1rem;
  color: #e7d2bb;
}

.pie__enlaces {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-inline: -16px;
}

.pie__enlaces a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 180ms ease;
}

.pie :focus-visible {
  outline-color: var(--durazno);
}

@media (hover: hover) and (pointer: fine) {
  .pie__enlaces a:hover {
    background: rgba(255, 240, 220, 0.14);
  }
}

/* ───────── Planes ───────── */

.planes-cabeza {
  padding: 56px 0 0;
  text-align: center;
}

.planes-cabeza h1 {
  max-width: 17ch;
  margin-inline: auto;
  font-size: clamp(2.25rem, 4.6vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.planes-cabeza .entradilla {
  max-width: 38rem;
  margin-inline: auto;
}

/* Medidor: ¿cuántos minutos transcribes al mes? */
.medida {
  max-width: 780px;
  margin: 44px auto 0;
  padding: 34px 40px 30px;
  border-radius: 36px;
  background: var(--papel);
  box-shadow: var(--sombra-suave);
  text-align: left;
}

.medida__pregunta {
  display: block;
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.medida__respuesta {
  display: block;
  min-height: 3.1em;
  margin-top: 8px;
  color: var(--marron-suave);
}

.medida__respuesta strong {
  font-weight: 800;
  color: var(--arcilla-texto);
}

.medida input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 48px;
  margin: 6px 0 0;
  background: transparent;
  cursor: pointer;
}

.medida input[type="range"]::-webkit-slider-runnable-track {
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--arcilla) var(--p, 55%), #f1d9c2 var(--p, 55%));
}

.medida input[type="range"]::-moz-range-track {
  height: 16px;
  border-radius: 999px;
  background: #f1d9c2;
}

.medida input[type="range"]::-moz-range-progress {
  height: 16px;
  border-radius: 999px;
  background: var(--arcilla);
}

/* El pulgar es una cabeza de nota. */
.medida input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 42px;
  height: 34px;
  margin-top: -9px;
  border: 4px solid var(--papel);
  border-radius: 58% 42% 56% 44% / 52% 50% 50% 48%;
  background: var(--marron);
  box-shadow: 0 5px 12px rgba(58, 35, 23, 0.4);
  transform: rotate(-16deg);
  transition: transform 160ms var(--salida);
}

.medida input[type="range"]::-moz-range-thumb {
  width: 34px;
  height: 26px;
  border: 4px solid var(--papel);
  border-radius: 58% 42% 56% 44% / 52% 50% 50% 48%;
  background: var(--marron);
  box-shadow: 0 5px 12px rgba(58, 35, 23, 0.4);
  transform: rotate(-16deg);
}

.medida input[type="range"]:active::-webkit-slider-thumb {
  transform: rotate(-16deg) scale(1.12);
}

.medida input[type="range"]:focus-visible {
  outline: 3px solid var(--marron);
  outline-offset: 2px;
  border-radius: 999px;
}

.medida__marcas {
  position: relative;
  height: 3.3em;
  margin: 2px 21px 0;
  font-size: 0.9375rem;
  line-height: 1.25;
  color: var(--marron-suave);
}

.medida__marcas span {
  position: absolute;
  top: 0;
  left: var(--x);
  padding-top: 12px;
  text-align: center;
  transform: translateX(-50%);
  transition: color 200ms ease;
}

.medida__marcas span::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 8px;
  margin-left: -1px;
  border-radius: 2px;
  background: #d9bfa3;
}

.medida__marcas b {
  display: block;
  font-weight: 800;
  color: var(--marron);
}

.medida__marcas span:last-child {
  text-align: right;
  transform: translateX(calc(-100% + 21px));
}

.medida__marcas span:last-child::before {
  left: auto;
  right: 20px;
}

.medida__marcas .es-encaje {
  color: var(--arcilla-texto);
}

.medida__marcas .es-encaje b {
  color: var(--arcilla-texto);
}

/* Selector mensual / anual: interruptor redondeado de dos opciones. */
.cambio {
  position: relative;
  display: inline-flex;
  margin-top: 40px;
  padding: 6px;
  border-radius: 22px;
  background: #f0dcc6;
}

.cambio__pulgar {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 0;
  border-radius: 16px;
  background: var(--arcilla);
  box-shadow: 0 3px 0 var(--arcilla-honda);
  transition: transform 280ms var(--salida), width 280ms var(--salida);
}

.cambio__opcion {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: color 200ms ease;
}

.cambio__opcion input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cambio__opcion:has(input:checked) {
  color: #fff;
}

.cambio__opcion:has(input:focus-visible) {
  outline: 3px solid var(--marron);
  outline-offset: 3px;
}

.cambio__regalo {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--papel);
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 800;
  color: var(--arcilla-texto);
}

.tarjetas {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 54px;
  padding-bottom: 100px;
  text-align: left;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 26px 28px;
  border-radius: 32px;
  background: var(--papel);
  box-shadow: var(--sombra-suave), inset 0 0 0 0 var(--arcilla);
  transition: box-shadow 260ms var(--salida), transform 260ms var(--salida), background-color 260ms ease;
}

.plan.es-encaje {
  background: #fff;
  box-shadow: 0 30px 50px -28px rgba(125, 75, 49, 0.6), inset 0 0 0 3px var(--arcilla);
  transform: translateY(-10px);
}

.plan__encaja {
  position: absolute;
  top: -17px;
  left: 26px;
  padding: 6px 15px;
  border-radius: 999px;
  background: var(--arcilla);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(6px) scale(0.94);
  transition: opacity 200ms ease, transform 260ms var(--salida);
}

.plan.es-encaje .plan__encaja {
  opacity: 1;
  transform: none;
}

.plan__titulo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.plan h2 {
  font-size: 1.625rem;
  line-height: 1.15;
}

.plan__recomendado {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--durazno);
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.35;
}

.plan__para {
  min-height: 3em;
  margin-top: 6px;
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--marron-suave);
}

.plan__minutos {
  margin-top: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.plan__minutos strong {
  display: block;
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--arcilla-texto);
}

.plan__equivale {
  margin-top: 4px;
  font-size: 1.0625rem;
  color: var(--marron-suave);
}

.plan__precio {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 2px dashed var(--raya);
}

.precio__antes {
  min-height: 1.5em;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--marron-suave);
}

.precio {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 8px;
  font-weight: 700;
}

.precio__cifra {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.precio__cifra.cambia {
  animation: cifra 240ms var(--salida);
}

@keyframes cifra {
  from { opacity: 0; transform: translateY(6px); }
}

.precio__detalle {
  min-height: 1.5em;
  font-size: 1.0625rem;
  color: var(--marron-suave);
}

.precio__ahorro {
  display: inline-block;
  min-height: 30px;
  margin-top: 8px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--durazno-suave);
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--arcilla-texto);
}

.precio__ahorro:empty {
  visibility: hidden;
}

[data-vista="mensual"] .precio__antes s {
  visibility: hidden;
}

[data-vista="mensual"] .precio__ahorro {
  padding-inline: 0;
  background: none;
  font-weight: 600;
  color: var(--marron-suave);
}

.plan .btn {
  margin-top: 24px;
  padding-inline: 12px;
}

.plan__final {
  margin-top: auto;
  display: grid;
}

/* Todos los planes incluyen */

.bloque {
  padding: 0 0 96px;
}

.incluye {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 34px;
  border-radius: 36px;
  background: var(--papel);
  box-shadow: var(--sombra-suave);
}

.incluye li {
  padding: 32px 26px 34px;
  font-weight: 700;
  line-height: 1.35;
}

.incluye li + li {
  border-left: 2px dashed var(--raya);
}

.incluye svg {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
}

/* Cómo se cuentan los minutos */

.cuenta {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 30px 64px;
  align-items: start;
}

.cuenta .titulo {
  max-width: 11ch;
}

.cuenta__lista {
  display: grid;
  gap: 18px;
}

.cuenta__lista li {
  display: flex;
  gap: 16px;
  text-wrap: pretty;
}

.cuenta__lista li::before {
  content: "";
  flex: none;
  width: 17px;
  height: 13px;
  margin-top: 0.48em;
  border-radius: 58% 42% 56% 44% / 52% 50% 50% 48%;
  background: var(--durazno-vivo);
  transform: rotate(-20deg);
}

/* Preguntas: una conversación. */

.charla {
  max-width: 720px;
  margin-inline: auto;
}

.charla .titulo {
  text-align: center;
}

.charla__hilo {
  display: grid;
  gap: 14px;
  margin-top: 36px;
}

.charla h3 {
  justify-self: end;
  max-width: 82%;
  padding: 14px 22px;
  border-radius: 26px 26px 8px 26px;
  background: var(--arcilla);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-wrap: pretty;
}

.charla h3:not(:first-child) {
  margin-top: 18px;
}

.charla__respuesta {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 88%;
}

.charla__respuesta svg {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 6px;
  border-radius: 50%;
  background: var(--durazno);
}

.charla__respuesta p {
  padding: 14px 22px;
  border-radius: 26px 26px 26px 8px;
  background: var(--papel);
  box-shadow: var(--sombra-suave);
  text-wrap: pretty;
}

/* ───────── Adaptación ───────── */

@media (max-width: 1080px) {
  .tarjetas {
    grid-template-columns: repeat(2, 1fr);
    gap: 34px 20px;
  }

  .plan__para {
    min-height: 0;
  }

  .incluye {
    grid-template-columns: repeat(2, 1fr);
  }

  .incluye li:nth-child(3) {
    border-left: 0;
  }

  .incluye li:nth-child(n + 3) {
    border-top: 2px dashed var(--raya);
  }
}

@media (max-width: 900px) {
  .portada__rejilla {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .portada {
    padding: 28px 0 72px;
  }

  .atril {
    max-width: 560px;
  }

  .pentagrama {
    display: none;
  }

  .pasos {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .pasos-zona {
    margin-top: 40px;
  }

  .paso {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 4px 18px;
  }

  .paso__nota {
    grid-row: 1 / span 2;
    height: 100%;
    min-height: 60px;
    --y: 0px !important;
  }

  .paso__nota::before {
    display: none;
  }

  .paso p {
    grid-column: 2;
    max-width: 30rem;
    margin-top: 0;
  }

  .cuenta {
    grid-template-columns: 1fr;
  }

  .cuenta .titulo {
    max-width: none;
  }

  .como {
    padding: 48px 0 80px;
  }

  .invitacion__caja {
    padding: 40px 34px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 1.0625rem;
  }

  .ancho {
    width: min(var(--ancho), 100% - 32px);
  }

  .cabecera {
    padding-top: 12px;
  }

  .cabecera__fila {
    gap: 4px;
  }

  .marca {
    gap: 4px;
    font-size: 1.0625rem;
  }

  .marca svg {
    width: 20px;
    height: 20px;
  }

  .menu {
    gap: 0;
  }

  .menu a {
    padding: 0 6px;
    font-size: 0.8125rem;
  }

  .menu .menu__entrar {
    margin-left: 2px;
    padding: 0 11px;
  }

  /* Sin sesión el menú tiene cuatro enlaces y no caben: se quedan los de
     entrar. «Cómo funciona» y «Planes» siguen en la portada y en el pie. */
  @media (max-width: 460px) {
    .menu li:first-child:nth-last-child(4) {
      display: none;
    }
  }

  @media (max-width: 350px) {
    .menu li:nth-child(2):nth-last-child(3) {
      display: none;
    }
  }

  .soltar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 24px 22px;
    text-align: center;
  }

  .soltar .btn {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
  }

  .atril {
    padding: 34px 0 36px;
  }

  .atril::before {
    border-radius: 30px;
  }

  .atril__debajo {
    top: 46px;
  }

  .atril figcaption {
    margin-left: 13%;
    font-size: 0.9375rem;
  }

  .planes-cabeza {
    padding-top: 36px;
  }

  .medida {
    padding: 26px 20px 22px;
    border-radius: 28px;
  }

  .medida__marcas {
    font-size: 0.8125rem;
  }

  .cambio__opcion {
    padding: 0 14px;
    gap: 8px;
  }

  .cambio__regalo {
    padding: 4px 9px;
    font-size: 0.8125rem;
  }

  .tarjetas {
    grid-template-columns: 1fr;
    padding-bottom: 72px;
  }

  .incluye {
    grid-template-columns: 1fr;
  }

  .incluye li {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 22px;
  }

  .incluye li + li {
    border-left: 0;
    border-top: 2px dashed var(--raya);
  }

  .incluye svg {
    flex: none;
    width: 48px;
    height: 48px;
    margin: 0;
  }

  .bloque {
    padding-bottom: 72px;
  }

  .charla h3,
  .charla__respuesta {
    max-width: 94%;
  }

  .invitacion {
    padding-bottom: 72px;
  }

  .invitacion__caja {
    border-radius: 32px;
    padding: 34px 26px;
  }

  .pie__fondo {
    border-radius: 32px 32px 0 0;
  }

  .pie__fila {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ───────── Cuentas: formularios, diálogo de subida y página de la cuenta ───────── */

.titulo + .acceso__sub,
.dialogo__sub {
  margin-top: 10px;
  color: var(--marron-suave);
}

.btn--ancho {
  display: flex;
  width: 100%;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* Un botón con aspecto de enlace, para acciones menores */
.enlace {
  padding: 0;
  border: 0;
  background: none;
  color: var(--arcilla-texto);
  font: 800 1rem/1.4 var(--fuente);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.campo {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  font-weight: 700;
}

.campo input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 2px solid var(--raya);
  border-radius: 16px;
  background: #fff;
  color: var(--marron);
  font: 500 1.0625rem/1.2 var(--fuente);
}

.campo input:focus-visible {
  outline: 3px solid var(--marron);
  outline-offset: 2px;
  border-color: var(--marron);
}

.campo small,
.dialogo__nota {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--marron-suave);
}

.dialogo__nota {
  margin-top: 14px;
}

.dialogo__nota a {
  color: var(--arcilla-texto);
  font-weight: 800;
}

.dialogo__error {
  margin-top: 14px;
  color: #a3261a;
  font-weight: 700;
}

.dialogo__error:empty {
  display: none;
}

.dialogo__aviso,
.tarjeta-aviso {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--durazno-suave);
}

.dialogo__botones {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
}

.dialogo__cambio {
  margin-top: 20px;
  text-align: center;
  color: var(--marron-suave);
}

.separador {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  color: var(--marron-suave);
  font-size: 0.9375rem;
}

.separador::before,
.separador::after {
  content: "";
  flex: 1;
  border-top: 2px solid var(--raya);
}

/* El diálogo que se abre al elegir una grabación */
.dialogo {
  width: min(540px, 100% - 32px);
  max-height: calc(100dvh - 32px);
  padding: 34px 32px 30px;
  border: 0;
  border-radius: 32px;
  background: var(--papel);
  color: var(--marron);
  box-shadow: 0 40px 80px -30px rgba(30, 12, 4, 0.7);
  overflow-y: auto;
}

.dialogo::backdrop {
  background: rgba(58, 35, 23, 0.55);
}

.dialogo__cerrar {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--marron);
  cursor: pointer;
}

.dialogo__cerrar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
}

.dialogo__titulo {
  padding-right: 44px;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  line-height: 1.15;
}

.dialogo__archivo {
  margin-top: 6px;
  color: var(--marron-suave);
  overflow-wrap: anywhere;
}

.opciones {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.opciones legend {
  padding: 0;
  margin-bottom: 10px;
  font-weight: 800;
}

.opcion {
  cursor: pointer;
}

/* Cada opción es una tarjeta; la elegida lleva el aro de arcilla */
.opcion__caja {
  display: grid;
  gap: 2px;
  padding: 14px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--raya);
  transition: box-shadow 160ms ease, background-color 160ms ease;
}

.opcion__caja small {
  font-size: 0.9375rem;
  color: var(--marron-suave);
}

.opcion input:checked + .opcion__caja {
  background: var(--durazno-suave);
  box-shadow: inset 0 0 0 3px var(--arcilla);
}

.opcion input:focus-visible + .opcion__caja {
  outline: 3px solid var(--marron);
  outline-offset: 3px;
}

.etiqueta {
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--durazno);
  font-size: 0.8125rem;
  font-style: normal;
  font-weight: 800;
}

/* Páginas de entrar y de confirmar el correo */
.acceso {
  display: grid;
  place-items: start center;
  padding: 56px 16px 110px;
}

.acceso__caja {
  width: min(480px, 100%);
  padding: 38px 34px 34px;
  border-radius: 32px;
  background: var(--papel);
  box-shadow: var(--sombra-suave);
}

.acceso__caja .btn--ancho {
  margin-top: 26px;
}

/* Mi cuenta */
.cuenta-pagina {
  padding: 48px 0 110px;
}

.cuenta-pagina__correo {
  margin-top: 6px;
  color: var(--marron-suave);
  overflow-wrap: anywhere;
}

.cuenta-pagina__subtitulo {
  margin-top: 56px;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
}

.tarjeta-aviso .btn {
  margin-top: 14px;
}

.saldo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-top: 28px;
  padding: 30px 32px;
  border-radius: 32px;
  background: var(--papel);
  box-shadow: var(--sombra-suave);
}

.saldo__cifra {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  font-weight: 700;
}

.saldo__cifra strong {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--arcilla-texto);
  font-variant-numeric: tabular-nums;
}

.saldo__acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* El plan contratado y su fecha, bajo el saldo y a todo el ancho */
.saldo__plan {
  flex: 1 1 100%;
  padding-top: 18px;
  border-top: 2px solid var(--raya);
  color: var(--marron-suave);
}

.saldo__plan strong {
  color: var(--marron);
}

.saldo__plan .enlace {
  display: block;
  margin-top: 10px;
}

.saldo__error {
  flex: 1 1 100%;
  margin-top: 0;
}

.partituras {
  display: grid;
  gap: 10px;
  margin: 22px 0 40px;
}

.partituras a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 16px;
  align-items: center;
  padding: 18px 22px;
  border-radius: 22px;
  background: var(--papel);
  box-shadow: var(--sombra-suave);
  color: inherit;
  text-decoration: none;
}

.partituras strong {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.partituras a span {
  grid-column: 1;
  font-size: 0.9375rem;
  color: var(--marron-suave);
}

.partituras__estado {
  grid-column: 2;
  grid-row: 1 / span 2;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--durazno-suave);
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 800;
}

.partituras__estado--lista {
  background: #dcefd9;
  color: #24562a;
}

.partituras__estado--error {
  background: #f6d7d2;
  color: #8a2015;
}

.partituras__vacio {
  padding: 22px;
  border-radius: 22px;
  background: var(--papel);
  color: var(--marron-suave);
}

@media (max-width: 620px) {
  .dialogo {
    padding: 28px 22px 24px;
    border-radius: 26px;
  }

  .dialogo__botones .btn {
    flex: 1 1 auto;
  }

  .acceso__caja {
    padding: 30px 22px 26px;
    border-radius: 26px;
  }

  .saldo {
    padding: 24px 22px;
    border-radius: 26px;
  }
}

/* ───────── Textos legales: una hoja de papel con texto largo ───────── */

.legal {
  padding: 48px 16px 110px;
}

.legal__hoja {
  width: min(760px, 100%);
  margin-inline: auto;
  padding: 46px 48px 44px;
  border-radius: 32px;
  background: var(--papel);
  box-shadow: var(--sombra-suave);
}

.legal__fecha {
  margin-top: 10px;
  font-size: 0.9375rem;
  color: var(--marron-suave);
}

.legal__hoja h2 {
  margin-top: 40px;
  font-size: 1.375rem;
  line-height: 1.25;
}

.legal__hoja p,
.legal__hoja ul {
  margin-top: 14px;
  max-width: 66ch;
}

.legal__hoja ul {
  display: grid;
  gap: 8px;
  padding-left: 22px;
  list-style: disc;
}

.legal__hoja li::marker {
  color: var(--durazno-vivo);
}

.legal__hoja a {
  color: var(--arcilla-texto);
  font-weight: 700;
  text-underline-offset: 3px;
}

.legal__otros {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 2px solid var(--raya);
}

/* Fila de enlaces legales, al final del pie */
.pie__legal {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(243, 227, 208, 0.22);
}

.pie__legal ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 26px;
}

.pie__legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  color: #e7d2bb;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .pie__legal a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

@media (max-width: 620px) {
  .legal {
    padding-top: 28px;
  }

  .legal__hoja {
    padding: 30px 22px 28px;
    border-radius: 26px;
  }
}

/* ───────── Página de una partitura: progreso, hoja sobre la tapa, teclado y reproductor ───────── */

.pieza {
  min-height: 66vh;
  padding: 30px 0 90px;
}

.pieza__vista {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.pieza__vista > .tarjeta-aviso {
  margin-top: 0;
}

.pieza__volver {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--arcilla-texto);
  font-weight: 800;
  text-decoration: none;
}

.pieza__cabeza {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 28px;
}

.pieza__cabeza > div:first-child {
  min-width: 0;
}

.pieza__vista .titulo {
  overflow-wrap: anywhere;
}

.pieza__datos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pieza__datos li {
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--papel);
  box-shadow: inset 0 0 0 2px var(--raya);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--marron-suave);
}

.pieza__descargas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.pieza__descargas .enlace {
  margin-left: 6px;
}

.pieza__antetitulo {
  margin-bottom: 6px;
  color: var(--arcilla-texto);
  font-weight: 800;
}

.pieza__archivo,
.pieza__espera {
  color: var(--marron-suave);
}

.pieza__archivo {
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.pieza__fallo {
  padding: 28px 30px;
  border-radius: 32px;
  background: var(--papel);
  box-shadow: var(--sombra-suave);
}

.pieza__fallo-titulo {
  color: #a3261a;
  font-weight: 800;
}

.pieza__fallo p + p {
  margin-top: 8px;
  color: var(--marron-suave);
}

.pieza__fallo .btn {
  margin-top: 22px;
}

/* Las etapas de la transcripción mientras se espera */
.progreso {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 32px;
  background: var(--papel);
  box-shadow: var(--sombra-suave);
}

.progreso__paso {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 8px 16px;
  border-radius: 20px;
}

.progreso__paso strong,
.progreso__paso small {
  display: block;
}

.progreso__paso strong {
  font-weight: 700;
}

.progreso__paso small {
  font-size: 0.9375rem;
  color: var(--marron-suave);
}

.progreso__punto {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--raya);
}

.progreso__paso--hecho .progreso__punto {
  background: var(--arcilla);
  box-shadow: none;
}

.progreso__paso--ahora {
  background: var(--durazno-suave);
}

.progreso__paso--ahora strong {
  font-weight: 800;
}

.progreso__paso--ahora .progreso__punto {
  border: 3px solid var(--arcilla);
  border-right-color: var(--durazno);
  box-shadow: none;
  animation: girar 0.9s linear infinite;
}

.progreso__paso--pendiente strong {
  color: var(--marron-suave);
}

@keyframes girar {
  to {
    transform: rotate(360deg);
  }
}

/* Partitura / Teclado: el mismo interruptor redondeado que mensual / anual */
.pestanas {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 6px;
  border-radius: 22px;
  background: #f0dcc6;
}

.pestanas__opcion {
  min-height: 46px;
  padding: 0 24px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--marron);
  font: 800 1.0625rem/1 var(--fuente);
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.pestanas__opcion[aria-selected="true"] {
  background: var(--arcilla);
  box-shadow: 0 3px 0 var(--arcilla-honda);
  color: #fff;
}

/* La hoja, apoyada en la tapa del piano */
.mesa {
  padding: clamp(12px, 2.4vw, 30px);
  border-radius: 40px;
  background: var(--tapa);
}

.mesa__papel {
  padding: 26px 18px;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow:
    0 2px 3px rgba(30, 12, 4, 0.22),
    0 34px 50px -22px rgba(30, 12, 4, 0.75);
}

/* Donde se dibuja la partitura. Va sin relleno y su dibujo sin límite de
   ancho: el dibujo mide lo que mide este recuadro, y si se encogiera por
   otro lado la música dejaría de coincidir con el cursor que la sigue. */
.mesa__hoja {
  min-height: 240px;
  overflow-x: auto;
}

.mesa__hoja svg {
  max-width: none;
}

/* Mientras se ve el teclado la hoja se aparta sin ocultarla del todo: así
   conserva su ancho y no hay que volver a dibujarla al regresar. */
.mesa--aparte {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  padding-block: 0;
  overflow: hidden;
  visibility: hidden;
}

/* Teclado con notas que caen: el escenario oscuro, en madera quemada */
.teclado {
  overflow: hidden;
  border-radius: 32px;
  background: var(--escenario);
}

.teclado__barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 14px 18px;
  color: var(--sobre-oscuro);
}

.teclado__grupo,
.reproductor__sonido {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.teclado__nota {
  font-size: 0.9375rem;
}

.teclado__rollo {
  overflow-x: auto;
}

#roll {
  display: block;
  width: 100%;
  height: clamp(320px, 58vh, 560px);
}

.teclado :focus-visible,
.reproductor :focus-visible {
  outline-color: var(--papel);
}

/* Botón de elegir sobre fondo oscuro: el elegido se vuelve papel */
.ficha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 2px rgba(243, 227, 208, 0.5);
  color: #fff7ea;
  font: 700 0.9375rem/1 var(--fuente);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.ficha[aria-pressed="true"] {
  background: var(--papel);
  box-shadow: none;
  color: var(--marron);
}

.ficha:disabled {
  opacity: 0.7;
  cursor: progress;
}

.ficha__mano {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.ficha__mano--izquierda {
  background: var(--mano-izquierda);
}

.ficha__mano--derecha {
  background: var(--mano-derecha);
}

/* Reproductor, fijo en la parte baja */
.reproductor {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  padding: 14px 24px;
  border-radius: 28px 28px 0 0;
  background: var(--marron);
  color: var(--sobre-oscuro);
  box-shadow: 0 -18px 40px -24px rgba(30, 12, 4, 0.6);
}

.reproductor__tocar {
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--durazno-vivo);
  box-shadow: 0 3px 0 #a9623a;
  color: var(--marron);
  cursor: pointer;
  transition: transform 140ms var(--salida), box-shadow 140ms var(--salida);
}

.reproductor__tocar:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #a9623a;
}

.reproductor__tocar:disabled {
  opacity: 0.7;
  cursor: progress;
}

.reproductor__tiempo {
  min-width: 96px;
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.reproductor input[type="range"] {
  height: 28px;
  accent-color: var(--durazno-vivo);
}

.reproductor__avance {
  flex: 1 1 220px;
  max-width: 520px;
}

.reproductor__velocidad {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 700;
}

.reproductor__velocidad input {
  width: 130px;
}

.reproductor__velocidad .ficha {
  min-width: 74px;
  font-variant-numeric: tabular-nums;
}

/* El pie deja sitio para que el reproductor no tape sus enlaces */
body:has(.reproductor) .pie__fondo {
  padding-bottom: 140px;
}

@media (hover: hover) and (pointer: fine) {
  .pieza__volver:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .pestanas__opcion:not([aria-selected="true"]):hover {
    background: rgba(255, 250, 241, 0.7);
  }

  .ficha:not([aria-pressed="true"]):hover {
    background: rgba(243, 227, 208, 0.14);
  }
}

@media (max-width: 620px) {
  .pieza {
    padding-top: 18px;
  }

  .pieza__descargas {
    width: 100%;
  }

  .pieza__descargas .btn {
    flex: 1 1 auto;
    padding: 0 18px;
  }

  .mesa {
    padding: 10px;
    border-radius: 24px;
  }

  .mesa__papel {
    padding: 16px 8px;
  }

  .teclado {
    border-radius: 24px;
  }

  .progreso,
  .pieza__fallo {
    border-radius: 26px;
  }

  /* El reproductor pasa a dos filas: arriba tocar y avanzar; abajo velocidad y sonido */
  .reproductor {
    justify-content: space-between;
    gap: 8px 10px;
    padding: 10px 12px 12px;
    border-radius: 22px 22px 0 0;
  }

  .reproductor__tocar {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
  }

  .reproductor__tiempo {
    min-width: 0;
    font-size: 0.875rem;
  }

  .reproductor__avance {
    flex: 1 1 100px;
  }

  .reproductor__velocidad,
  .reproductor__sonido {
    flex: 1 1 100%;
  }

  .reproductor__velocidad input {
    flex: 1 1 auto;
    width: auto;
  }

  .reproductor__sonido .ficha {
    flex: 1 1 0;
    padding: 0 8px;
  }

  body:has(.reproductor) .pie__fondo {
    padding-bottom: 230px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
