/* ==========================================================================
   NV Group — css/apps.css
   La página de las apps (/apps, apps.php), encima de css/landing.css: la
   barra, el pie y el vidrio son de ahí. Lo propio, como el App Store: los
   íconos, las estrellas y los aparatos, la órbita de la portada, las
   tarjetas de «Hoy» que se agrandan hasta ser la ficha de la app (la
   <dialog>, que arma js/apps.js) y la tabla de compatibilidad. Las clases
   empiezan con «ap-».
   ========================================================================== */

/* El lugar de la barra de desplazamiento queda reservado: al abrir la ficha
   la página no se corre de costado */
html { scrollbar-gutter: stable; }
html.ap-sin-scroll { overflow: hidden; }

/* --- Íconos, estrellas y aparatos ----------------------------------------
   Las estrellas son las de las tiendas: cinco grises y encima las llenas,
   cortadas en la nota; al aparecer se prenden de a una (en la ficha se
   llenan: más abajo, «La calificación»). */
.ap-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ap-icono { --t: 64px; position: relative; display: block; flex: none; width: var(--t); aspect-ratio: 1; overflow: hidden; border-radius: 22.5%; }
.ap-icono img { width: 100%; height: 100%; object-fit: cover; }
/* El filo claro de los íconos sobre lo oscuro, como en el App Store */
.ap-icono::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); pointer-events: none; }

.ap-estrellas { --e: 14px; display: inline-flex; align-items: center; gap: 1px; vertical-align: middle; }
.ap-estrellas i { position: relative; display: block; width: var(--e); height: var(--e); }
.ap-estrellas svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: rgba(255, 255, 255, 0.2); }
.ap-estrellas svg + svg { fill: #f5f5f7; clip-path: inset(0 calc(100% - var(--lleno, 100%)) 0 0); filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.35)); }
.ap-estrellas--grandes { --e: 22px; gap: 3px; }
.js [data-aparecer]:not(.lp-visible) .ap-estrellas svg + svg { opacity: 0; }
.js .lp-visible .ap-estrellas svg + svg { animation: ap-estrella 0.7s var(--resorte) both; animation-delay: calc(var(--k, 0) * 90ms + 0.3s); }
@keyframes ap-estrella {
  0%   { opacity: 0; transform: scale(0.2) rotate(-50deg); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

/* Los aparatos: en fila, solo el dibujo; con nombre, cada uno en su cajita */
.ap-aparatos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ap-aparato { display: flex; align-items: center; color: var(--texto-2); }
.ap-aparato__dibujo { width: 18px; height: 18px; flex: none; }
.ap-aparatos--grandes { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.ap-aparatos--grandes .ap-aparato { display: grid; justify-items: start; align-content: start; gap: 2px; padding: 18px 18px 16px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.ap-aparatos--grandes .ap-aparato__dibujo { width: 34px; height: 34px; margin-bottom: 12px; color: var(--texto); }
.ap-aparato b { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; color: var(--texto); }
.ap-aparato small { font-size: 13px; line-height: 1.35; color: var(--texto-3); }
.js .lp-visible .ap-aparato,
.ap-hoja .ap-aparato { animation: ap-aparece 0.6s var(--resorte) both; animation-delay: calc(var(--k, 0) * 70ms + 0.35s); }
@keyframes ap-aparece { from { opacity: 0; transform: translateY(10px) scale(0.9); } }

/* --- Portada: el título y la órbita --------------------------------------- */
.ap-portada { position: relative; padding: clamp(128px, 17vh, 176px) 0 clamp(24px, 4vw, 56px); overflow: hidden; text-align: center; isolation: isolate; }
.ap-portada__texto { display: grid; justify-items: center; }
.ap-portada__titulo { margin-top: 14px; font-size: clamp(48px, 7.6vw, 112px); font-weight: 600; line-height: 0.98; letter-spacing: -0.055em; }
.ap-portada__titulo span { display: block; }
/* La segunda línea, en aluminio, como la de la portada */
.ap-portada__titulo span:last-child {
  background: linear-gradient(180deg, #eef0f2 0%, #a3a9b1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ap-portada__bajada { max-width: 40em; margin-top: 26px; font-size: clamp(19px, 1.7vw, 22px); line-height: 1.45; letter-spacing: -0.02em; color: var(--texto-2); }

/* La órbita: un óvalo visto de costado. Cada pieza va a --x, --y (de -1 a 1)
   del centro; --s y --o la achican y la apagan cuando pasa por atrás.
   Las medidas salen del ancho de la órbita (cqw) */
.ap-orbita {
  --alto: 0.44;
  --rx: 44cqw;
  --ry: calc(40cqw * var(--alto));
  position: relative;
  width: min(1080px, 100% - 32px);
  aspect-ratio: 1 / var(--alto);
  margin: clamp(24px, 4vw, 52px) auto 0;
  container-type: inline-size;
}
/* La luz azul de atrás de las apps */
.ap-orbita::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 58%;
  aspect-ratio: 2.2;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(0, 113, 227, 0.42), rgba(0, 113, 227, 0));
  animation: ap-respira 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ap-respira { 50% { opacity: 0.65; transform: translate(-50%, -50%) scale(1.08); } }
.ap-orbita__anillos { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ap-orbita__anillo { fill: none; stroke: rgba(255, 255, 255, 0.15); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ap-orbita__anillo--dentro { stroke: rgba(255, 255, 255, 0.09); stroke-dasharray: 3 9; animation: ap-guiones 60s linear infinite; }
@keyframes ap-guiones { to { stroke-dashoffset: -480; } }
.ap-orbita__luz,
.ap-orbita__aparato { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) translate(calc(var(--x, 0) * var(--rx)), calc(var(--y, 0) * var(--ry))) scale(var(--s, 1)); }
/* La luz que da vueltas por el anillo */
.ap-orbita__luz { z-index: 1; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 3px rgba(41, 151, 255, 0.9), 0 0 28px 8px rgba(41, 151, 255, 0.4); opacity: calc(0.35 + 0.65 * (var(--y, 0) + 1) / 2); }
.ap-orbita__aparato {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px 8px 11px;
  border-radius: 980px;
  background: rgba(36, 37, 41, 0.6);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.45);
  color: var(--texto);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: var(--o, 1);
  will-change: transform, opacity;
}
.ap-orbita__dibujo { width: 22px; height: 22px; flex: none; }
/* Las apps en el medio: flotan y se reflejan en el piso de luz; siguen un
   poco al mouse (--px, --py: js/apps.js) */
.ap-orbita__centro { position: absolute; left: 50%; top: 47%; z-index: 2; display: flex; gap: clamp(16px, 2.8cqw, 40px); transform: translate(-50%, -50%) translate(calc(var(--px, 0) * 14px), calc(var(--py, 0) * 8px)); transition: transform 0.9s var(--curva); }
.ap-orbita__app { --t: clamp(84px, 14cqw, 168px); display: grid; justify-items: center; }
.ap-orbita__app .ap-icono { --t: inherit; box-shadow: 0 30px 50px -22px rgba(0, 0, 0, 0.9), 0 0 60px -12px rgba(41, 151, 255, 0.4); animation: ap-flotar 6.5s ease-in-out infinite; animation-delay: calc(var(--k, 0) * -2.6s); }
.ap-orbita__reflejo { display: block; width: var(--t); height: calc(var(--t) * 0.3); margin-top: 10px; overflow: hidden; border-radius: 0 0 22.5% 22.5% / 0 0 60% 60%; opacity: 0.18; -webkit-mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0)); mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0)); animation: ap-reflejo 6.5s ease-in-out infinite; animation-delay: calc(var(--k, 0) * -2.6s); }
.ap-orbita__reflejo img { width: 100%; transform: scaleY(-1); }
@keyframes ap-flotar { 50% { transform: translateY(-11px); } }
@keyframes ap-reflejo { 50% { transform: translateY(11px); opacity: 0.09; } }

/* --- Las tarjetas de «Hoy» ------------------------------------------------ */
.ap-apps { padding: clamp(40px, 6vw, 88px) 0 clamp(100px, 12vw, 160px); }
.ap-apps__grilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 2.6vw, 36px); align-items: start; }
.ap-app { min-width: 0; }
.ap-tarjeta {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: clamp(540px, 50vw, 660px);
  padding: clamp(24px, 2.6vw, 34px);
  overflow: hidden;
  border-radius: 30px;
  background: #131417;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 50px 90px -40px rgba(0, 0, 0, 0.9);
  transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--escala, 1));
  transition: transform 0.6s var(--resorte);
  -webkit-tap-highlight-color: transparent;
}
.ap-tarjeta:hover { --escala: 1.012; }
.ap-tarjeta:active { --escala: 0.97; transition-duration: 0.25s; }
/* La luz de los colores del ícono (o la foto), atrás de todo */
.ap-tarjeta__fondo { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.ap-tarjeta__fondo img { position: absolute; left: 50%; top: 60%; width: 78%; transform: translate(-50%, -50%); opacity: 0.5; filter: blur(80px) saturate(170%); }
.ap-tarjeta--foto .ap-tarjeta__fondo img { inset: 0; width: 100%; height: 100%; object-fit: cover; transform: none; opacity: 1; filter: none; }
.ap-tarjeta--foto .ap-tarjeta__fondo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.78)); }
/* La luz que sigue al mouse (--mx, --my) y el filo azul del borde */
.ap-tarjeta__brillo { position: absolute; inset: 0; z-index: -1; background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 60%); opacity: 0; transition: opacity 0.4s; pointer-events: none; }
.ap-tarjeta::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), rgba(41, 151, 255, 0.95), rgba(41, 151, 255, 0) 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.ap-tarjeta:hover .ap-tarjeta__brillo,
.ap-tarjeta:hover::after { opacity: 1; }
.ap-tarjeta__arriba { display: grid; justify-items: start; gap: 8px; }
.ap-tarjeta__cat { font-size: 13px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: rgba(245, 245, 247, 0.62); }
.ap-tarjeta__frase { font-size: clamp(30px, 3.1vw, 42px); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; }
.ap-tarjeta__resumen { max-width: 30em; font-size: 17px; line-height: 1.42; color: var(--texto-2); }
.ap-tarjeta__arte { flex: 1; display: grid; place-content: center; justify-items: center; padding: 32px 0 6px; }
.ap-icono--grande { --t: clamp(150px, 15vw, 212px); box-shadow: 0 40px 60px -28px rgba(0, 0, 0, 0.95); transform: translateY(var(--sube, 0px)); transition: transform 0.7s var(--resorte), box-shadow 0.5s; }
.ap-tarjeta:hover .ap-icono--grande { --sube: -10px; box-shadow: 0 54px 64px -28px rgba(0, 0, 0, 0.95); }
.ap-tarjeta__reflejo { display: block; width: clamp(150px, 15vw, 212px); height: 46px; margin-top: 10px; overflow: hidden; border-radius: 0 0 22.5% 22.5% / 0 0 60% 60%; opacity: 0.16; -webkit-mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0)); mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0)); transition: opacity 0.5s, transform 0.7s var(--resorte); }
.ap-tarjeta:hover .ap-tarjeta__reflejo { opacity: 0.08; transform: translateY(8px); }
.ap-tarjeta__reflejo img { width: 100%; transform: scaleY(-1); }
.ap-tarjeta__pie { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.ap-tarjeta--foto .ap-tarjeta__pie { margin-top: auto; }
.ap-icono--chico { --t: 52px; }
.ap-tarjeta__quien { flex: 1; display: grid; gap: 5px; min-width: 0; }
.ap-tarjeta__quien > b { overflow: hidden; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; text-overflow: ellipsis; }
.ap-tarjeta__datos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--texto-3); }
.ap-tarjeta__nota { margin-left: -4px; font-weight: 600; color: var(--texto-2); }
.ap-tarjeta__datos .ap-aparatos { gap: 6px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.ap-tarjeta__datos .ap-aparato__dibujo { width: 16px; height: 16px; }
/* «Ver», como el «Obtener» del App Store */
.ap-ver { display: inline-flex; flex: none; align-items: center; height: 32px; padding: 0 18px; border-radius: 980px; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; transition: background-color 0.25s; }
.ap-tarjeta:hover .ap-ver { background-color: var(--azul); }

/* --- La ficha de cada app -------------------------------------------------
   Sin JavaScript (y en el editor del panel), debajo de su tarjeta; con
   JavaScript vive escondida y js/apps.js la pasa a la hoja al abrirla. */
.ap-app > .ap-ficha { margin-top: 18px; padding: 0 clamp(22px, 3vw, 32px) clamp(22px, 3vw, 32px); border-radius: 26px; background: #131417; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.ap-con-hoja .ap-app > .ap-ficha { display: none; }
.ap-ficha__cabeza { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 26px); padding: 26px 0 24px; }
.ap-icono--ficha { --t: clamp(88px, 10vw, 118px); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.9); }
.ap-ficha__titulo { min-width: 0; }
.ap-ficha__titulo h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 700; line-height: 1.1; letter-spacing: -0.035em; }
.ap-ficha__titulo p { margin-top: 4px; font-size: 15px; color: var(--texto-3); }
.ap-ficha__acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
/* Los botones de las tiendas: blancos, como los distintivos oficiales */
.ap-tienda { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 18px 6px 13px; border-radius: 13px; background: #f5f5f7; color: #0d0e10; transition: background-color 0.2s, transform 0.2s var(--curva); }
.ap-tienda:hover { background: #fff; transform: translateY(-1px); }
.ap-tienda:active { transform: scale(0.97); }
.ap-tienda .lp-ic { width: 22px; height: 22px; }
.ap-tienda small { display: block; font-size: 10.5px; font-weight: 500; line-height: 1.15; opacity: 0.7; }
.ap-tienda b { display: block; font-size: 17px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
/* «Muy pronto en las tiendas», con su luz que late */
.ap-pronto { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 16px; border-radius: 980px; background: rgba(41, 151, 255, 0.14); color: #cfe6ff; font-size: 15px; font-weight: 500; }
.ap-pronto i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--azul-claro); animation: ap-late 2s var(--curva) infinite; }
@keyframes ap-late {
  0%   { box-shadow: 0 0 0 0 rgba(41, 151, 255, 0.6); }
  100% { box-shadow: 0 0 0 10px rgba(41, 151, 255, 0); }
}

/* La tira de datos, como la de arriba de cada app en el App Store */
.ap-ficha__tira { display: grid; grid-auto-columns: minmax(118px, 1fr); grid-auto-flow: column; padding: 16px 0; overflow-x: auto; border-block: 1px solid rgba(255, 255, 255, 0.1); scrollbar-width: none; }
.ap-ficha__tira::-webkit-scrollbar { display: none; }
.ap-ficha__tira li { display: grid; justify-items: center; align-content: start; gap: 5px; padding: 2px 14px; border-left: 1px solid rgba(255, 255, 255, 0.1); text-align: center; }
.ap-ficha__tira li:first-child { border-left: 0; }
.ap-ficha__tira small { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--texto-3); }
.ap-ficha__tira b { display: inline-flex; font-size: 24px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.ap-ficha__tira b.ap-ficha__palabra { display: block; padding-top: 4px; font-size: 17px; line-height: 1.2; }
.ap-ficha__tira span:not(.ap-estrellas) { font-size: 13px; color: var(--texto-3); }

.ap-ficha__bloque { padding: 30px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.ap-ficha__bloque:last-child { padding-bottom: 6px; border-bottom: 0; }
.ap-ficha__bloque h3 { margin-bottom: 16px; font-size: 22px; font-weight: 700; letter-spacing: -0.025em; }
.ap-ficha__sobre { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; }
.ap-ficha__texto p { font-size: 17px; line-height: 1.55; color: var(--texto-2); }
.ap-ficha__texto p + p { margin-top: 14px; }
.ap-ficha__texto .lp-enlace { margin-top: 18px; }
.ap-puntos { display: grid; align-content: start; gap: 14px; padding-top: 42px; }
.ap-puntos li { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; line-height: 1.4; }
/* El tilde de iOS: el círculo azul y la marca blanca, que se dibuja */
.ap-tilde { width: 24px; height: 24px; flex: none; overflow: visible; }
.ap-tilde circle { fill: var(--azul); transform-box: fill-box; transform-origin: center; }
.ap-tilde path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.ap-hoja .ap-puntos circle { animation: ap-circulo 0.5s var(--resorte) both; animation-delay: calc(var(--k, 0) * 90ms + 0.35s); }
.ap-hoja .ap-puntos path { animation: ap-trazo 0.45s var(--curva) both; animation-delay: calc(var(--k, 0) * 90ms + 0.55s); }
@keyframes ap-circulo { from { transform: scale(0); } }
@keyframes ap-trazo { from { stroke-dashoffset: 1; } }

/* Las capturas, de costado como en las tiendas */
.ap-capturas { display: grid; grid-auto-columns: clamp(180px, 27%, 250px); grid-auto-flow: column; gap: 14px; padding-bottom: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.ap-capturas li { scroll-snap-align: start; }
.ap-capturas img { width: 100%; border-radius: 20px; background: #1c1d21; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
.ap-capturas figcaption { margin-top: 8px; font-size: 13px; line-height: 1.4; color: var(--texto-3); }

/* La nota grande */
.ap-nota { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: end; gap: 6px 14px; }
.ap-nota > b { font-size: 68px; font-weight: 700; line-height: 0.88; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.ap-nota__de { padding-bottom: 6px; font-size: 15px; font-weight: 600; color: var(--texto-3); }
.ap-nota .ap-estrellas { justify-self: end; align-self: center; }
.ap-nota small { grid-column: 1 / -1; font-size: 13px; color: var(--texto-3); }

/* La calificación se anima cada vez que se abre la ficha (pedido de Nico,
   03-11: «que la puntuación esté animada»): el número rueda hasta la nota y
   las estrellas se llenan de a una, de izquierda a derecha, con un salto y
   un destello. La de arriba arranca cuando la ficha terminó de agrandarse;
   la nota grande, cuando se baja hasta ella (js/apps.js le pone
   .ap-puntaje--va). Hasta entonces, las cinco quedan grises. */
.ap-hoja [data-puntaje] .ap-estrellas svg + svg { clip-path: inset(0 100% 0 0); }
.ap-hoja [data-puntaje].ap-puntaje--va .ap-estrellas svg + svg { animation: ap-llena 0.55s var(--curva) both; animation-delay: calc(var(--k, 0) * 120ms); }
.ap-hoja [data-puntaje].ap-puntaje--va .ap-estrellas i { animation: ap-salta 0.6s var(--resorte) both; animation-delay: calc(var(--k, 0) * 120ms + 0.12s); }
@keyframes ap-llena {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 calc(100% - var(--lleno, 100%)) 0 0); }
}
/* El destello va en la estrella entera y no en la que se llena: recortada,
   la luz se veía como un cuadrado */
@keyframes ap-salta { 45% { transform: scale(1.3); filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.85)); } }

/* --- La hoja: la tarjeta agrandada y la ficha -----------------------------
   La <dialog> tapa la pantalla y la caja va en el medio; tocar afuera de la
   caja la cierra. Con View Transitions la tarjeta se agranda hasta la caja
   (ap-carta); sin ellas, la caja sube y aparece. */
.ap-hoja {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: clamp(16px, 4vh, 40px) 16px;
  border: 0;
  overflow: hidden;
  background: transparent;
  color: var(--texto);
}
.ap-hoja[open] { display: flex; align-items: center; justify-content: center; }
.ap-hoja::backdrop { background: rgba(0, 0, 0, 0.55); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); }
.ap-hoja__marco { position: relative; display: flex; width: min(920px, 100%); max-height: 100%; }
.ap-hoja__caja {
  flex: 1;
  min-width: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 32px;
  background: #121316;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 60px 120px -30px rgba(0, 0, 0, 0.9);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
/* La tarjeta, ya grande: arriba de la ficha, sin su pie (lo dice la ficha) */
.ap-tarjeta--abierta { min-height: 0; padding: clamp(28px, 4.4vw, 52px) clamp(24px, 4.4vw, 52px) 8px; border-radius: 32px 32px 0 0; box-shadow: none; transform: none; transition: none; }
.ap-tarjeta--abierta::after,
.ap-tarjeta--abierta .ap-tarjeta__brillo,
.ap-tarjeta--abierta .ap-tarjeta__pie { display: none; }
.ap-tarjeta--abierta .ap-tarjeta__frase { font-size: clamp(34px, 4.6vw, 54px); }
.ap-tarjeta--abierta .ap-tarjeta__arte { padding-top: 36px; }
.ap-tarjeta--abierta.ap-tarjeta--foto { min-height: min(520px, 62vh); }
.ap-hoja__ficha .ap-ficha { padding: 0 clamp(24px, 4.4vw, 52px) clamp(32px, 5vw, 56px); }
.ap-hoja__cerrar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(40, 41, 46, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background-color 0.2s, transform 0.2s var(--curva);
}
.ap-hoja__cerrar:hover { background-color: rgba(70, 71, 78, 0.8); }
.ap-hoja__cerrar:active { transform: scale(0.92); }
.ap-hoja__cerrar svg { width: 18px; height: 18px; }

/* Sin View Transitions: la caja sube y el velo aparece (y al revés al cerrar) */
.ap-hoja[open] .ap-hoja__marco { animation: ap-entra 0.5s var(--curva) both; }
.ap-hoja[open]::backdrop { animation: ap-velo 0.4s ease both; }
.ap-hoja--vt[open] .ap-hoja__marco,
.ap-hoja--vt[open]::backdrop { animation: none; }
.ap-hoja--sale[open] .ap-hoja__marco { animation: ap-sale 0.26s ease both; }
.ap-hoja--sale[open]::backdrop { animation: ap-velo 0.26s ease reverse both; }
@keyframes ap-entra { from { opacity: 0; transform: translateY(40px) scale(0.96); } }
@keyframes ap-sale { to { opacity: 0; transform: translateY(24px) scale(0.97); } }
@keyframes ap-velo { from { opacity: 0; } }
/* Lo de la ficha entra de a partes, detrás de la tarjeta */
.ap-hoja .ap-ficha > * { animation: ap-sube 0.7s var(--curva) both; }
.ap-hoja .ap-ficha > :nth-child(1) { animation-delay: 0.12s; }
.ap-hoja .ap-ficha > :nth-child(2) { animation-delay: 0.2s; }
.ap-hoja .ap-ficha > :nth-child(3) { animation-delay: 0.28s; }
.ap-hoja .ap-ficha > :nth-child(n + 4) { animation-delay: 0.36s; }
@keyframes ap-sube { from { opacity: 0; transform: translateY(22px); } }

/* La tarjeta que se agranda (View Transitions): con un poco de resorte, y la
   imagen de la tarjeta recortada arriba mientras cambia de forma */
::view-transition-group(ap-carta) { overflow: hidden; border-radius: 30px; animation-duration: 0.56s; animation-timing-function: cubic-bezier(0.3, 1.1, 0.4, 1); }
::view-transition-old(ap-carta),
::view-transition-new(ap-carta) { height: 100%; object-fit: cover; object-position: top; animation-duration: 0.36s; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.42s; }

/* --- Compatibilidad: la tabla --------------------------------------------- */
/* El position: relative deja adentro de la caja el «Sí» y el «No» escondidos
   para los lectores de pantalla (van con position: absolute): sin él, cuando
   la caja terminaba de aparecer se escapaban por la derecha y, en el celu,
   ensanchaban la página, que se corría hacia la izquierda */
.ap-tabla { position: relative; margin-top: clamp(48px, 6vw, 72px); overflow-x: auto; border-radius: 26px; background: #131417; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.ap-tabla table { width: 100%; min-width: 520px; border-collapse: collapse; }
.ap-tabla th,
.ap-tabla td { padding: 18px 22px; border-top: 1px solid rgba(255, 255, 255, 0.07); text-align: center; font-weight: 400; }
.ap-tabla thead th { padding-top: 28px; border-top: 0; vertical-align: bottom; }
.ap-tabla thead th b { display: block; margin-top: 12px; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.ap-icono--tabla { --t: 56px; margin: 0 auto; box-shadow: 0 14px 26px -14px rgba(0, 0, 0, 0.9); }
.ap-tabla th[scope="row"] { text-align: left; }
.ap-tabla__aparato { display: flex; align-items: center; gap: 14px; }
.ap-tabla__aparato .ap-aparato__dibujo { width: 28px; height: 28px; color: var(--texto-2); }
.ap-tabla__aparato b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.ap-tabla__aparato small { display: block; font-size: 13px; color: var(--texto-3); }
.ap-tabla .ap-tilde { width: 26px; height: 26px; vertical-align: middle; }
.ap-raya { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: rgba(255, 255, 255, 0.22); vertical-align: middle; }
.ap-tabla tbody tr { transition: background-color 0.2s; }
.ap-tabla tbody tr:hover { background-color: rgba(255, 255, 255, 0.03); }
/* Al aparecer: los renglones de a uno y los tildes que se dibujan */
.js .ap-tabla tbody tr { opacity: 0; transform: translateY(10px); transition: opacity 0.6s var(--curva), transform 0.7s var(--curva), background-color 0.2s; transition-delay: calc(var(--f, 0) * 90ms + 0.25s), calc(var(--f, 0) * 90ms + 0.25s), 0s; }
.js .ap-tabla.lp-visible tbody tr { opacity: 1; transform: none; }
.js .ap-tabla.lp-visible .ap-tilde circle { animation: ap-circulo 0.5s var(--resorte) both; animation-delay: calc(var(--f, 0) * 90ms + var(--c, 0) * 60ms + 0.45s); }
.js .ap-tabla.lp-visible .ap-tilde path { animation: ap-trazo 0.45s var(--curva) both; animation-delay: calc(var(--f, 0) * 90ms + var(--c, 0) * 60ms + 0.65s); }
.js .ap-tabla:not(.lp-visible) .ap-tilde path { stroke-dashoffset: 1; }

/* --- Tablet y celular ------------------------------------------------------ */
@media (max-width: 900px) {
  .ap-apps__grilla { grid-template-columns: minmax(0, 1fr); }
  .ap-tarjeta { min-height: 0; }
  .ap-ficha__sobre { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .ap-puntos { padding-top: 0; }
}
@media (max-width: 640px) {
  .ap-portada { padding-top: 112px; }
  .ap-orbita { --alto: 0.92; width: calc(100% - 8px); }
  .ap-orbita__aparato { padding: 9px; -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(36, 37, 41, 0.9); }
  .ap-orbita__aparato b { display: none; }
  .ap-orbita__dibujo { width: 20px; height: 20px; }
  .ap-orbita__app { --t: clamp(84px, 26cqw, 120px); }
  .ap-tarjeta { padding: 22px 20px 20px; border-radius: 26px; }
  .ap-tarjeta__frase { font-size: 30px; }
  .ap-icono--grande,
  .ap-tarjeta__reflejo { --t: 150px; width: 150px; }
  .ap-ficha__cabeza { align-items: flex-start; }
  .ap-nota > b { font-size: 56px; }
  /* La tabla, como la de comparar de apple.com en el celular: cada aparato a
     lo ancho y, debajo, sus tildes, en una columna por app bajo su ícono (de
     520 px, no entraba: los íconos quedaban afuera de la pantalla) */
  .ap-tabla table,
  .ap-tabla thead,
  .ap-tabla tbody { display: block; min-width: 0; }
  .ap-tabla tr { display: grid; grid-template-columns: repeat(var(--apps, 2), minmax(0, 1fr)); }
  .ap-tabla th,
  .ap-tabla td { padding: 12px 8px 18px; border-top: 0; }
  .ap-tabla thead th { padding: 26px 8px 20px; }
  .ap-tabla thead th b { overflow-wrap: anywhere; }
  .ap-tabla thead th:first-child { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .ap-tabla tbody tr { border-top: 1px solid rgba(255, 255, 255, 0.07); }
  .ap-tabla th[scope="row"] { grid-column: 1 / -1; padding: 16px 20px 0; }
  .ap-tabla__aparato { gap: 10px; }
  .ap-tabla__aparato .ap-aparato__dibujo { width: 22px; height: 22px; }
  .ap-tabla__aparato > span { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
  /* En el celular, la hoja ocupa toda la pantalla, como en el App Store */
  .ap-hoja { padding: 0; }
  .ap-hoja__marco { width: 100%; height: 100%; }
  .ap-hoja__caja { border-radius: 0; }
  .ap-tarjeta--abierta { border-radius: 0; padding-top: 64px; }
  .ap-hoja__cerrar { top: max(14px, env(safe-area-inset-top)); right: 14px; }
}

/* --- Con «reducir movimiento»: quieto -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .ap-orbita::before,
  .ap-orbita__anillo--dentro,
  .ap-orbita__app .ap-icono,
  .ap-orbita__reflejo,
  .ap-pronto i,
  .ap-hoja .ap-ficha > *,
  .ap-hoja .ap-puntos circle,
  .ap-hoja .ap-puntos path,
  .ap-hoja[open] .ap-hoja__marco,
  .ap-hoja[open]::backdrop,
  .js .ap-tabla.lp-visible .ap-tilde circle,
  .js .ap-tabla.lp-visible .ap-tilde path,
  .js .lp-visible .ap-estrellas svg + svg,
  .js .lp-visible .ap-aparato,
  .ap-hoja .ap-aparato,
  .ap-hoja [data-puntaje].ap-puntaje--va .ap-estrellas svg + svg,
  .ap-hoja [data-puntaje].ap-puntaje--va .ap-estrellas i { animation: none; }
  .js [data-aparecer]:not(.lp-visible) .ap-estrellas svg + svg { opacity: 1; }
  .ap-hoja [data-puntaje] .ap-estrellas svg + svg { clip-path: inset(0 calc(100% - var(--lleno, 100%)) 0 0); }
  .js .ap-tabla tbody tr { opacity: 1; transform: none; transition: none; }
  .js .ap-tabla:not(.lp-visible) .ap-tilde path { stroke-dashoffset: 0; }
  .ap-tarjeta,
  .ap-icono--grande,
  .ap-tarjeta__reflejo,
  .ap-orbita__centro { transition: none; }
  .ap-tarjeta:hover,
  .ap-tarjeta:active { --escala: 1; }
}

/* --- Con «reducir transparencia»: superficies sólidas --------------------- */
@media (prefers-reduced-transparency: reduce) {
  .ap-orbita__aparato { background: #24252a; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .ap-hoja::backdrop { background: rgba(0, 0, 0, 0.82); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .ap-hoja__cerrar { background: #2a2b30; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
