/* =========================================================
   ATLAS SONORO · PÁGINA DE INSTRUMENTOS
   Solo estilos propios de instrumentos.html; todo lo demás viene de styles.css (temas, cristal, botones, nav…).
   ========================================================= */

.inst-top { padding-top: clamp(6rem, 10vw, 8rem); }
.inst-title { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: .01em; margin: 0 0 .4em; }


/* Filtros por familia */
.inst-top .sec-head, .inst-fam .sec-head { justify-content: center; text-align: center; }
.inst-top .sec-head > *, .inst-fam .sec-head > * { text-align: center; }          /* (los párrafos van justificados en toda la web: aquí, centrados) */
.inst-top .sec-head > .lead, .inst-fam .sec-head > .lead { flex: 0 0 100%; max-width: 46rem; margin-inline: auto; }
.inst-top .sec-head > .inst-title + .lead { margin-top: .4rem; }
/* Menú de familias: ocho botones iguales en una rejilla simétrica (4 × 2; 2 × 4 en el móvil) */
.inst-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin: 0 0 1.4rem; }
.inst-filters .chip { --c: var(--c2); justify-content: center; text-align: center; min-height: 3.2rem; padding: .7rem 1rem; border-radius: 16px; line-height: 1.2; }
@media (max-width: 720px) { .inst-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; } .inst-filters .chip { font-size: .8rem; padding: .65rem .7rem; } }
.inst-only { margin: 0 auto .5rem; width: fit-content; padding: .5rem 1rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* Familias */
.inst-fam { padding-top: clamp(2.4rem, 5vw, 3.6rem); padding-bottom: clamp(1.4rem, 3vw, 2.4rem); }
.inst-fam .sec-head { margin-bottom: 1.6rem; }
.inst-fam .sec-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
.inst-fam .sec-head .lead { font-size: 1.05rem; margin-bottom: 0; }
.inst-fam .sec-head .kicker { color: color-mix(in srgb, var(--fc) 55%, var(--text)); }
.inst-fam .sec-head .kicker::after { content: ""; display: block; width: 2.8rem; height: 3px; border-radius: 3px; margin: .75rem auto .35rem; background: var(--fc); box-shadow: 0 0 12px color-mix(in srgb, var(--fc) 70%, transparent); }
/* Rejilla: las tarjetas de cada familia llenan la fila a partes iguales (5 columnas en las de 5 y 10, 3 en la de 6, 4 en el resto) y la última fila queda centrada */
.inst-grid { --gap: 1.1rem; --cols: var(--cd, 4); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }
.inst-grid > .inst { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; }
@media (max-width: 1000px) { .inst-grid { --cols: 3; } }
@media (max-width: 700px) { .inst-grid { --cols: 2; --gap: .8rem; } }
@media (max-width: 520px) { .inst-grid { --cols: 1; } }

/* Tarjeta: una ventana vertical con la misma estructura en todas (imagen cuadrada, nombre y origen a dos líneas, texto, botón abajo) */
.inst { display: flex; flex-direction: column; text-align: center; padding: 0; overflow: hidden; border-radius: 22px; transition: transform .35s var(--ease), border-color .3s; }
.inst:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--fc) 60%, transparent); }
.inst[hidden] { display: none; }
.inst__img { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; background: radial-gradient(68% 68% at 50% 46%, color-mix(in srgb, var(--fc) 28%, transparent), transparent 76%); border-bottom: 1px solid var(--line); }
.inst__img img { position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(0,0,0,.28)); transition: transform .25s ease; }
.inst__img[role="button"] { cursor: pointer; }
.inst__img[role="button"]:focus-visible { outline: 2px solid var(--fc); outline-offset: -4px; }
.inst__img.is-suena img { transform: scale(1.06); }
.inst__tag { position: absolute; top: .65rem; left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none; font-size: .58rem; padding: .4em .75em; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.inst__ph { display: grid; place-items: center; width: 46%; aspect-ratio: 1; border-radius: 50%; color: color-mix(in srgb, var(--fc) 70%, var(--text)); border: 1px solid color-mix(in srgb, var(--fc) 50%, transparent); background: color-mix(in srgb, var(--fc) 14%, transparent); }
.inst__ph svg { width: 56%; height: 56%; }
.inst__body { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 1.1rem 1.15rem .5rem; }
.inst__body h3 { margin: 0; font-size: clamp(1.05rem, 1.5vw, 1.22rem); line-height: 1.22; min-height: 2.44em; display: flex; align-items: center; justify-content: center; }
.inst__orig { margin: .15rem 0 0; min-height: 2.8em; display: flex; align-items: center; justify-content: center; font: 700 .66rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.inst__desc { margin: .75rem 0 0; padding-top: .85rem; border-top: 1px solid var(--line); width: 100%; font-size: .9rem; line-height: 1.55; color: var(--text-2); text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.inst__foot { display: grid; padding: .8rem 1.15rem 1.15rem; }
.inst__foot .btn { width: 100%; justify-content: center; text-align: center; }
.inst--on .inst__img { background: radial-gradient(68% 68% at 50% 46%, color-mix(in srgb, var(--fc) 42%, transparent), transparent 76%); }
@media (max-width: 520px) { .inst__img { aspect-ratio: 4 / 3; } .inst__img img { inset: 6%; width: 88%; height: 88%; } }

.inst-note { margin: 2rem auto 0; max-width: 46rem; }

/* Ficha */
.idlg { width: min(46rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 0; border: 1px solid var(--glass-edge); border-radius: 26px; color: var(--text); background: var(--glass-2); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); overflow: auto; overscroll-behavior: contain; }
.idlg::backdrop { background: rgba(8,10,32,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.idlg__x { position: absolute; top: .8rem; right: .8rem; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1rem; cursor: pointer; z-index: 2; }
.idlg__x:hover { background: var(--surface-2); }
.idlg__head { display: grid; grid-template-columns: 11rem 1fr; gap: 1.4rem; padding: 1.6rem 1.8rem 1rem; align-items: center; }
.idlg__head h2 { margin: 0 0 .2rem; font-size: clamp(1.5rem, 3.4vw, 2rem); padding-right: 2.4rem; }
.idlg__head p { margin: 0 0 .6rem; }
.idlg__head .kicker { margin-bottom: .5rem; color: color-mix(in srgb, var(--fc) 55%, var(--text)); }
.idlg__img { aspect-ratio: 1; display: grid; place-items: center; border-radius: 20px; background: radial-gradient(70% 70% at 50% 40%, color-mix(in srgb, var(--fc) 30%, transparent), transparent 75%); }
.idlg__img img { width: 92%; height: 92%; object-fit: contain; transition: transform .25s ease; }
.idlg__img[role="button"] { cursor: pointer; }
.idlg__img[role="button"]:focus-visible { outline: 2px solid var(--fc); outline-offset: -4px; }
.idlg__img.is-suena img { transform: scale(1.05); }
.idlg__img .inst__ph { width: 5.4rem; }
.idlg__body { padding: .4rem 1.8rem 1rem; display: grid; gap: 1.1rem; }
.idlg__ctrl { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; }
.idlg__acc { display: flex; flex-wrap: wrap; gap: .7rem; }
.idlg__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem 1.4rem; padding: 1rem 1.8rem 1.4rem; border-top: 1px solid var(--line); margin-top: .4rem; }

/* Notas (láminas, discos, tubos): una fila, o dos si hay muchas */
.notas { display: grid; grid-template-columns: repeat(var(--cols, 8), minmax(0, 1fr)); gap: .45rem; }
.nota { appearance: none; cursor: pointer; padding: 1.1rem .2rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 700 .8rem var(--sans); letter-spacing: .02em; transition: background .12s, border-color .12s, transform .12s, box-shadow .2s; touch-action: manipulation; }
.nota:hover { border-color: color-mix(in srgb, var(--fc) 70%, transparent); }
.nota:active, .nota.is-on { background: color-mix(in srgb, var(--fc) 38%, transparent); border-color: var(--fc); transform: translateY(1px) scale(.98); box-shadow: 0 0 22px -4px var(--fc); }
.btn.is-on { filter: brightness(1.12); }

@media (max-width: 640px) {
  .idlg__head { grid-template-columns: 1fr; text-align: left; }
  .idlg__img { width: 7.5rem; }
  .idlg__body, .idlg__head, .idlg__foot { padding-left: 1.2rem; padding-right: 1.2rem; }
  .notas { gap: .3rem; }
  .nota { padding: .95rem 0; font-size: .7rem; border-radius: 10px; }
}

/* Panel táctil del theremín: x = altura, y = volumen */
.pad { position: relative; height: clamp(11rem, 34vw, 15rem); border-radius: 20px; cursor: crosshair; touch-action: none; user-select: none; overflow: hidden;
  border: 1px solid var(--line); background:
    linear-gradient(to right, transparent calc(100% - 1px), var(--line) 0) 0 0 / 8.333% 100%,
    linear-gradient(to top, color-mix(in srgb, var(--fc) 24%, transparent), transparent 85%), var(--surface); }
.pad:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.pad__hint { position: absolute; inset: .8rem 1rem auto; font-size: .85rem; color: var(--muted); pointer-events: none; }
.pad__dot { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, var(--fc), transparent 70%); box-shadow: 0 0 28px 6px color-mix(in srgb, var(--fc) 60%, transparent); transition: opacity .2s; }
.pad.is-on .pad__dot { opacity: 1; }
.pad__out { position: absolute; inset: auto 1rem .7rem auto; font: 700 .85rem var(--sans); letter-spacing: .04em; color: var(--strong); pointer-events: none; }

/* Laboratorio sonoro (laboratorio.html): los bloques van directamente sobre el paisaje, así que llevan cristal como el resto de paneles */
.page-lab .lab { background-color: var(--panel); -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); border-radius: 26px; }
.page-lab .section + .section { padding-top: 0; }

/* Pruebas de escucha (laboratorio) */
.prueba-aviso { max-width: 52rem; }
.prueba-aviso__lista { margin: .6rem 0 1rem; padding-left: 1.2rem; }
.prueba-aviso__lista li { margin-bottom: .4rem; }
.pruebas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 25rem), 1fr)); gap: 1.1rem; }
.prueba { display: flex; flex-direction: column; gap: .6rem; padding: 1.4rem 1.5rem 1.2rem; }
.prueba h3 { margin: 0; font-size: 1.25rem; display: flex; gap: .6rem; align-items: baseline; }
.prueba__n { flex: none; display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; font: 700 .8rem var(--sans); background: color-mix(in srgb, var(--c5) 30%, transparent); border: 1px solid var(--c5); }
.prueba__desc { margin: 0; font-size: .93rem; line-height: 1.55; color: var(--text-2); flex: 1; }
.prueba .row { margin-top: .4rem; }
.prueba__t { font: 700 .85rem var(--sans); letter-spacing: .04em; color: var(--muted); }
.prueba__bar { height: 4px; border-radius: 4px; background: var(--track); overflow: hidden; }
.prueba__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c5), var(--c7)); transition: width .3s linear; }
.prueba__est { min-height: 1.5em; margin: 0; font-size: .85rem; color: var(--strong); }
.cuaderno { max-width: 52rem; }
.cuaderno__val { gap: .5rem; }
.cuaderno__val .btn:disabled { opacity: .45; cursor: not-allowed; }
.cuaderno__lista { list-style: none; margin: 1rem 0; padding: 0; font-size: .9rem; display: grid; gap: .35rem; }
.cuaderno__lista li { padding: .4rem .7rem; border-radius: 10px; background: var(--inset); }
