/* Libro digital de letras (/libro-letras/) */
@font-face {
  font-family: "Fikra Naskh";
  src: url("/libro-letras/fonts/noto-naskh-arabic-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
.ll { --naskh: "Fikra Naskh", "Amiri", serif; --c: var(--sea); padding-bottom: 3rem; }
.ll [lang="ar"], .ll .ll-big { font-family: var(--naskh); font-weight: 700; }
.ll h1, .ll h2 { font-family: var(--display); }
.ll-kicker { margin: 0 0 .6rem; font-weight: 600; color: var(--sea-deep); font-size: .95rem; }
.ll-sub, .ll-note { color: var(--muted); margin: .2rem 0 1rem; font-size: .95rem; }
.ll-top { padding-top: 1.2rem; }
.ll-backlink { font-weight: 600; text-decoration: none; }
.ll-backlink:hover { text-decoration: underline; }
.ll-btn {
  display: inline-flex; align-items: center; gap: .55rem; border: 0; cursor: pointer;
  border-radius: 999px; padding: .7rem 1.3rem; font-weight: 700; font-size: 1.05rem;
  background: var(--white); color: var(--ink); box-shadow: 0 0 0 2px var(--line) inset;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ll-btn:hover { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--c) inset; }
.ll-btn:disabled,
.ll-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
  pointer-events: none;
  transform: none;
  box-shadow: 0 0 0 2px var(--line) inset;
}
.ll-btn:disabled:hover,
.ll-btn[aria-disabled="true"]:hover,
.ll-listen:disabled:hover,
.ll-listen[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: 0 0 0 2px var(--line) inset;
}
.ll-btn:focus-visible, .ll-word:focus-visible, .ll-tile:focus-visible, .ll-navbtn:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }

/* ---------- índice ---------- */
.ll-ihero { padding: 2.2rem 0 1rem; max-width: 52rem; }
.ll-ihero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .6rem; }
.ll-lead { font-size: 1.15rem; margin: 0 0 .6rem; }
.ll-tip { color: var(--muted); margin: 0; }
.ll-grid { display: flex; flex-wrap: wrap; gap: 1rem; padding-top: 1.2rem; }
.ll-fam {
  display: flex; gap: .6rem; padding: .6rem; border-radius: 1.4rem;
  background: color-mix(in srgb, var(--c) 16%, white); border: 2px solid color-mix(in srgb, var(--c) 45%, white);
}
.ll-tile {
  position: relative; display: grid; justify-items: center; align-content: start; gap: .1rem;
  width: 8.2rem; padding: .5rem .4rem .6rem; border-radius: 1.1rem; background: var(--white);
  text-decoration: none; color: var(--ink); box-shadow: 0 6px 16px rgba(23, 32, 51, .08);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ll-tile:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 12px 24px rgba(23, 32, 51, .14); }
.ll-tile-l { font-size: 4.2rem; line-height: 1.25; color: var(--c); filter: brightness(.78) saturate(1.2); }
.ll-tile-img { width: 3.6rem; height: 3.6rem; object-fit: contain; }
.ll-tile-n { font-size: .85rem; font-weight: 600; direction: ltr; }
.ll-tile-n [lang="ar"] { font-size: 1rem; }

/* ---------- página de letra ---------- */
.ll-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; padding: 1rem 0 1.5rem; }
.ll-stage {
  background: var(--white); border-radius: 1.6rem; padding: 1rem 1rem .8rem;
  box-shadow: var(--shadow); border: 3px solid color-mix(in srgb, var(--c) 40%, white);
}
.ll-trace { width: 100%; height: auto; display: block; max-height: 62vh; overflow: visible; }
.ll-trace text.ll-ghost, .ll-trace text.ll-ink { font-family: var(--naskh); font-weight: 700; font-size: 170px; text-anchor: middle; direction: rtl; }
.ll-ghost { fill: #e7ebf0; }
.ll-ink { fill: color-mix(in srgb, var(--c) 82%, black); }
.ll-mask-strokes path { fill: none; stroke: #fff; stroke-width: 30; stroke-linecap: round; stroke-linejoin: round; }
.ll-mask-dots circle { fill: #fff; }
.ll-lines line { stroke: #d9e1ea; stroke-width: .8; stroke-dasharray: 3 3; }
.ll-gline { fill: none; stroke: #172033; stroke-opacity: .55; stroke-width: 1.6; stroke-dasharray: 3.5 3; stroke-linecap: round; }
.ll-arrows polygon { fill: #172033; fill-opacity: .7; }
.ll-gdot { fill: none; stroke: #172033; stroke-opacity: .55; stroke-width: 1.4; stroke-dasharray: 2.2 1.8; }
.ll-start circle { fill: #1b8a3a; stroke: #fff; stroke-width: 1.5; }
.ll-start circle.in { fill: #fff; stroke: none; }
.ll-num circle { fill: #fff; stroke: #172033; stroke-width: 1.4; }
.ll-num text { font: 700 10px var(--font); fill: #172033; text-anchor: middle; dominant-baseline: central; }
.ll-num.is-on circle { fill: #fef305; }
.ll-pen { fill: #fef305; stroke: #172033; stroke-width: 1.6; opacity: 0; }
.ll-trace.is-playing .ll-pen { opacity: 1; }
.ll-stage-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .4rem; }
.ll-howto { margin: 0; font-weight: 600; color: var(--muted); }
.ll-info { display: grid; gap: .7rem; align-content: center; }
.ll-h1 { display: flex; align-items: center; gap: 1.2rem; margin: 0; overflow: visible; }
.ll-big {
  font-size: clamp(5rem, 12vw, 8rem); line-height: 1.55;
  padding-block: .12em .08em; overflow: visible;
  color: color-mix(in srgb, var(--c) 82%, black);
}
.ll-names { display: grid; font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.25; }
.ll-name-es { font-family: var(--display); color: var(--muted); }
.ll-listen { justify-self: start; font-size: 1.35rem; padding: 1rem 2rem; background: var(--c); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 40%, transparent); }
.ll-listen:hover { box-shadow: 0 10px 24px color-mix(in srgb, var(--c) 55%, transparent); }
.ll-listen.is-speaking .ll-spk { animation: ll-pulse .6s ease-in-out infinite alternate; }
.ll-spk { width: 1.4rem; height: 1.4rem; background: currentColor; -webkit-mask: var(--spk) center / contain no-repeat; mask: var(--spk) center / contain no-repeat;
  --spk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E"); }
.ll-noaudio { margin: 0; color: #9b4d1b; font-weight: 600; }
.ll-sound { margin: 0; font-size: 1.1rem; }
.ll-start-tip { margin: 0; display: flex; align-items: center; gap: .5rem; color: var(--muted); }
.ll-greendot { width: .9rem; height: .9rem; border-radius: 50%; background: #1b8a3a; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #1b8a3a; }

.ll-card { background: var(--white); border-radius: 1.4rem; padding: 1.3rem 1.4rem; box-shadow: var(--shadow); margin-top: 1.2rem; }
.ll-card h2 { font-size: 1.5rem; margin-bottom: .3rem; }
.ll-words { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ll-word {
  display: grid; justify-items: center; gap: .2rem; padding: 1rem .6rem 1.1rem; cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--c) 35%, white); border-radius: 1.3rem;
  background: color-mix(in srgb, var(--c) 9%, white); font: inherit; color: inherit;
}
.ll-word:hover .ll-pic { animation-duration: .9s; }
.ll-pic { display: block; width: min(13rem, 70%); }
.ll-pic img { width: 100%; height: auto; }
.ll-word-ar { font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1.5; color: var(--ink); }
.ll-hl { color: color-mix(in srgb, var(--c) 75%, black); text-decoration: underline 4px color-mix(in srgb, var(--c) 45%, white); text-underline-offset: 10px; }
.ll-word-es { color: var(--muted); font-weight: 600; }
.ll-word.is-hop .ll-pic { animation: ll-hop .6s ease; }

.ll-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; }
.ll-two .ll-card { margin-top: 1.2rem; }
.ll-forms { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; direction: rtl; }
.ll-forms li { display: grid; justify-items: center; gap: .2rem; padding: .6rem .3rem; border-radius: 1rem; border: 2px dashed color-mix(in srgb, var(--c) 45%, white); }
.ll-form { font-size: clamp(2.6rem, 6vw, 3.4rem); line-height: 1.7; color: color-mix(in srgb, var(--c) 80%, black); }
.ll-form-l {
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  direction: ltr; font-size: .8rem; color: var(--muted); font-weight: 600; text-align: center; line-height: 1.25;
}
.ll-form-dash { display: none; }
.ll-form-es { order: 1; }
.ll-form-ar { order: 2; font-family: var(--naskh); font-weight: 700; font-size: 1.05em; color: var(--ink); }
html[dir="rtl"] .ll-form-es { order: 2; }
html[dir="rtl"] .ll-form-ar { order: 1; }
.ll-mouth-svg { width: 100%; max-width: 22rem; display: block; margin: .4rem auto; }
.ll-mouth-svg .head { fill: #fde9d9; stroke: #c99a7c; stroke-width: 1.6; }
.ll-mouth-svg .nasal { fill: #e3eef8; stroke: #a9bfd3; stroke-width: 1; }
.ll-mouth-svg .cavity { fill: #f7d0c4; }
.ll-mouth-svg .tongue { fill: #ee8a93; stroke: #c45a66; stroke-width: 1.4; }
.ll-mouth-svg .palate { fill: none; stroke: #b5655e; stroke-width: 3; stroke-linecap: round; }
.ll-mouth-svg .teeth { fill: #fff; stroke: #9aa3ad; stroke-width: 1.2; }
.ll-mouth-svg .wall, .ll-mouth-svg .larynx { fill: none; stroke: #b5655e; stroke-width: 2.4; stroke-linecap: round; }
.ll-mk-pt .dot { fill: #1b8a3a; stroke: #fff; stroke-width: 1.4; }
.ll-mk-pt .ring { fill: rgba(27, 138, 58, .18); stroke: #1b8a3a; stroke-width: 1.6; transform-box: fill-box; transform-origin: center; animation: ll-ring 1.6s ease-out infinite; }
.ll-mk-area { fill: rgba(27, 138, 58, .16); stroke: #1b8a3a; stroke-width: 1.4; stroke-dasharray: 4 3; }
.ll-mk-up { fill: none; stroke: #1b8a3a; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ll-mk-text { font-weight: 600; margin: .4rem 0 0; }

.ll-nav { display: flex; justify-content: space-between; gap: .8rem; margin-top: 1.6rem; }
.ll-navbtn { display: inline-flex; align-items: center; gap: .6rem; padding: .7rem 1.2rem; border-radius: 999px; background: var(--white); box-shadow: var(--shadow); text-decoration: none; font-weight: 700; color: var(--ink); }
.ll-navl { font-size: 2rem; line-height: 1; color: color-mix(in srgb, var(--c) 80%, black); }
.ll-navidx { align-self: center; }

/* animaciones de los dibujos */
.ll-bounce { animation: ll-bounce 2.4s ease-in-out infinite; }
.ll-sway { animation: ll-sway 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes ll-bounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 45% { transform: translateY(-10px) scale(.99, 1.02); } 55% { transform: translateY(-10px); } 85% { transform: translateY(0) scale(1.03, .97); } }
@keyframes ll-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes ll-hop { 0% { transform: scale(1); } 40% { transform: scale(1.12) translateY(-8px); } 100% { transform: scale(1); } }
@keyframes ll-ring { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes ll-pulse { from { transform: scale(1); } to { transform: scale(1.2); } }

html[dir="rtl"] .ll-backlink, html[dir="rtl"] .ll-nav { direction: rtl; }
html[dir="rtl"] .ll-tile-n { direction: rtl; }

@media (max-width: 820px) {
  .ll-hero, .ll-two { grid-template-columns: 1fr; }
  .ll-hero { gap: 1rem; }
  .ll-info { order: -1; }
  .ll-tile { width: 6.4rem; }
  .ll-tile-l { font-size: 3.4rem; }
  .ll-tile-img { width: 2.8rem; height: 2.8rem; }
  .ll-forms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ll-navidx { display: none; }
}
@media (max-width: 480px) {
  .ll-grid { gap: .6rem; }
  .ll-fam { gap: .4rem; padding: .4rem; }
  .ll-tile { width: 5.4rem; }
  .ll-words { gap: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ll-bounce, .ll-sway, .ll-mk-pt .ring, .ll-word.is-hop .ll-pic, .ll-listen.is-speaking .ll-spk { animation: none; }
  .ll-tile, .ll-btn { transition: none; }
  .ll-tile:hover { transform: none; }
}
.ll-trace.is-done .ll-ink { mask: none; }
