/* =========================================================
   Almack · hoja de estilos principal
   Colores en variables: cambia aquí la paleta de toda la web.
   ========================================================= */
:root {
  --fondo: #f7f8fb;
  --superficie: #ffffff;
  --texto: #14213d;
  --texto-suave: #4a5672;
  --borde: #e2e6ef;
  --primario: #1d3fbf;
  --primario-oscuro: #142d8a;
  --acento: #10b39b;
  --sombra: 0 10px 30px rgba(20, 33, 61, .08);
  --radio: 16px;
  --ancho: 1120px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0d1220;
    --superficie: #151c2f;
    --texto: #e8ecf6;
    --texto-suave: #a7b1c9;
    --borde: #26304a;
    --primario: #6d8cff;
    --primario-oscuro: #8ea6ff;
    --acento: #2fd6bc;
    --sombra: 0 10px 30px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--texto);
  background: var(--fondo);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--primario); }
a:hover { color: var(--primario-oscuro); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 20px; }
.saltar { position: absolute; left: -9999px; }
.saltar:focus { left: 16px; top: 16px; background: var(--superficie); padding: 8px 12px; z-index: 10; }

/* ---------- Cabecera ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--fondo) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--borde);
}
.cabecera .contenedor { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texto); font-weight: 700; font-size: 1.2rem; }
.marca img { width: 34px; height: 34px; }
.menu { display: flex; gap: 4px 20px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.menu a { color: var(--texto-suave); text-decoration: none; font-weight: 500; font-size: .95rem; }
.menu a:hover { color: var(--primario); }

/* ---------- Portada ---------- */
.portada { padding: 80px 0 64px; position: relative; overflow: hidden; }
.portada::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 620px; height: 620px;
  background: radial-gradient(circle, color-mix(in srgb, var(--acento) 28%, transparent), transparent 65%);
  pointer-events: none;
}
.portada .contenedor { position: relative; display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }
.etiqueta {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: color-mix(in srgb, var(--acento) 15%, transparent); color: var(--acento); margin-bottom: 16px;
}
.portada p.entrada { font-size: 1.15rem; color: var(--texto-suave); max-width: 560px; }
.botones { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.boton {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px;
  font-weight: 600; text-decoration: none; border: 1px solid transparent; transition: transform .15s ease;
}
.boton:hover { transform: translateY(-1px); }
.boton-primario { background: var(--primario); color: #fff; }
.boton-primario:hover { color: #fff; background: var(--primario-oscuro); }
.boton-secundario { border-color: var(--borde); color: var(--texto); background: var(--superficie); }

.movil {
  justify-self: center; width: 230px; aspect-ratio: 9 / 18.5; border-radius: 36px; padding: 12px;
  background: linear-gradient(160deg, var(--primario), var(--acento)); box-shadow: var(--sombra);
}
.movil .pantalla {
  width: 100%; height: 100%; border-radius: 26px; background: var(--superficie);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 36px 18px; align-content: start;
}
.movil .pantalla span { aspect-ratio: 1; border-radius: 12px; background: var(--borde); }
.movil .pantalla span:nth-child(1) { background: var(--primario); }
.movil .pantalla span:nth-child(5) { background: var(--acento); }
.movil .pantalla span:nth-child(9) { background: color-mix(in srgb, var(--primario) 45%, var(--acento)); }

/* ---------- Secciones ---------- */
.seccion { padding: 72px 0; }
.seccion-alt { background: var(--superficie); border-top: 1px solid var(--borde); border-bottom: 1px solid var(--borde); }
.seccion .intro { color: var(--texto-suave); max-width: 680px; margin-bottom: 36px; }

.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.tarjeta {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 24px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 10px;
}
.seccion-alt .tarjeta { background: var(--fondo); box-shadow: none; }
.tarjeta p { color: var(--texto-suave); margin: 0; }
.icono {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--primario) 12%, transparent); color: var(--primario);
}
.icono svg { width: 26px; height: 26px; }

/* ---------- Fichas de aplicación ---------- */
.app-icono { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; }
.app-icono.vacio {
  background: repeating-linear-gradient(45deg, var(--borde) 0 8px, transparent 8px 16px);
  border: 1px dashed var(--texto-suave); opacity: .6;
}
.estado {
  align-self: flex-start; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--acento) 15%, transparent); color: var(--acento);
}
.tiendas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.tienda {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
  background: #111; color: #fff; text-decoration: none; font-size: .85rem; font-weight: 600;
}
.tienda:hover { color: #fff; background: #333; }
.tienda svg { width: 18px; height: 18px; fill: currentColor; }
.tienda.desactivada { opacity: .4; pointer-events: none; }

/* ---------- Contacto ---------- */
.contacto { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.datos { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.datos li { display: flex; gap: 12px; }
.datos strong { display: block; }

/* ---------- Páginas legales / texto ---------- */
.texto { max-width: 820px; padding: 56px 20px 80px; }
.texto h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.texto h2 { font-size: 1.3rem; margin-top: 2em; }
.texto .actualizado { color: var(--texto-suave); font-size: .95rem; }
.texto table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.texto th, .texto td { border: 1px solid var(--borde); padding: 10px; text-align: left; vertical-align: top; }
.texto th { background: var(--superficie); }
.tabla-scroll { overflow-x: auto; }

/* ---------- Pie ---------- */
.pie { padding: 40px 0; border-top: 1px solid var(--borde); color: var(--texto-suave); font-size: .9rem; }
.pie .contenedor { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pie ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px 20px; flex-wrap: wrap; }
.pie a { color: var(--texto-suave); }

/* ---------- Móvil ---------- */
@media (max-width: 820px) {
  .portada { padding: 48px 0 40px; }
  .portada .contenedor { grid-template-columns: 1fr; }
  .movil { width: 180px; }
  .contacto { grid-template-columns: 1fr; }
  .seccion { padding: 52px 0; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .contenedor { padding: 0 16px; }
  .cabecera .contenedor { padding-top: 10px; padding-bottom: 10px; }
  .menu { gap: 4px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boton { transition: none; }
}

/* Ajustes de contraste en modo oscuro */
@media (prefers-color-scheme: dark) {
  .boton-primario, .boton-primario:hover { color: #0d1220; }
  .tienda { border: 1px solid #3a4560; }
}

/* =========================================================
   Catálogo de aplicaciones y fichas de app
   ========================================================= */
.menu a[aria-current="page"] { color: var(--primario); }
.migas { font-size: .9rem; color: var(--texto-suave); margin: 0 0 18px; }
.migas a { color: inherit; }
.migas span[aria-hidden] { margin: 0 6px; }

/* Tarjeta de app del catálogo */
.tarjeta-app { position: relative; }
.tarjeta-app .app-cabeza { display: flex; align-items: center; gap: 14px; }
.tarjeta-app .app-icono { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.tarjeta-app h3 { margin: 0; }
.tarjeta-app h3 a { color: inherit; text-decoration: none; }
.tarjeta-app h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radio); }
.tarjeta-app .plataformas { font-size: .85rem; color: var(--texto-suave); }
.tarjeta-app .boton { align-self: flex-start; margin-top: auto; position: relative; z-index: 1; }
.tarjeta-app:hover { border-color: color-mix(in srgb, var(--primario) 45%, var(--borde)); }
.tarjeta-app:focus-within { outline: 2px solid var(--primario); outline-offset: 2px; }

/* ---------- Tema de «Ajedrez con Avellana» ---------- */
@font-face {
  font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/assets/fonts/fredoka-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/assets/fonts/fredoka-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
.tema-avellana {
  --musgo: #2f8f5b; --avellana: #c98b4b; --cielo: #3ea7e0; --bellota: #6b3f1d;
  --hoja: #f2b33d; --tinta: #2a2118; --papel: #fffaf0;
  --fondo: var(--papel); --superficie: #ffffff; --texto: var(--tinta); --texto-suave: #5a4a3a;
  --borde: #eadcc4; --primario: var(--musgo); --acento: var(--avellana);
  --primario-oscuro: #237046;
  --sombra: 0 10px 30px rgba(107, 63, 29, .10);
  color-scheme: light;
}
.tema-avellana h1, .tema-avellana h2, .tema-avellana h3, .tema-avellana .fredoka {
  font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; letter-spacing: 0;
}
.tema-avellana .boton-primario, .tema-avellana .boton-primario:hover { color: #fff; }
.tema-avellana .estado { background: color-mix(in srgb, var(--hoja) 30%, transparent); color: var(--bellota); }

/* Cabecera de la ficha */
.app-portada { position: relative; color: #fff; background: var(--musgo); overflow: hidden; }
.app-portada picture, .app-portada .fondo { position: absolute; inset: 0; }
.app-portada .fondo { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.app-portada::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(42,33,24,.82) 0%, rgba(42,33,24,.55) 45%, rgba(42,33,24,.05) 80%);
}
.app-portada .contenedor { position: relative; z-index: 1; padding-top: 56px; padding-bottom: 56px; min-height: 420px; display: flex; flex-direction: column; justify-content: center; }
.app-portada .migas, .app-portada .migas a { color: rgba(255,255,255,.85); }
.app-portada .app-id { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.app-portada .app-icono { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 8px 24px rgba(0,0,0,.35); flex: none; }
.app-portada h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.app-portada .frase { font-size: 1.2rem; max-width: 520px; margin: 0 0 22px; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.descarga { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.insignia-play img { height: 60px; width: auto; }
.proximamente {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px;
  background: #000; color: #fff; font-weight: 600; border: 1px solid rgba(255,255,255,.35);
}
.proximamente svg { width: 22px; height: 22px; }

/* Bloques de la ficha */
.ficha-dos { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
.lista-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.lista-check li { position: relative; padding-left: 34px; }
.lista-check li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 22px; height: 22px; border-radius: 50%;
  background: var(--hoja) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b3f1d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.galeria {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 16px; margin: 0; list-style: none;
  overscroll-behavior-x: contain;
}
.galeria li { scroll-snap-align: start; }
.galeria figure { margin: 0; }
.galeria a { display: block; border-radius: 18px; overflow: hidden; box-shadow: var(--sombra); border: 1px solid var(--borde); background: var(--superficie); }
.galeria img { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; }
.galeria figcaption { font-size: .9rem; color: var(--texto-suave); text-align: center; padding-top: 8px; }
.familias { background: color-mix(in srgb, var(--hoja) 18%, var(--superficie)); border-color: color-mix(in srgb, var(--hoja) 45%, var(--borde)); }
.familias .tarjeta { background: var(--superficie); }
.familias .rejilla { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.enlaces-legales { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0 0 20px; }
.enlaces-legales a {
  display: inline-block; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--tinta, var(--texto));
  color: var(--texto); text-decoration: none; font-weight: 600; font-size: .92rem;
}
.enlaces-legales a:hover { background: var(--primario); border-color: var(--primario); color: #fff; }

/* Páginas legales de las apps: el texto legal se conserva tal cual */
.legal-app main nav, .legal-app .texto > nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 24px; }
.legal-app .texto > nav a {
  border: 2px solid var(--texto); border-radius: 999px; padding: 4px 12px; color: var(--texto);
  text-decoration: none; font-weight: 600; font-size: 14px;
}
.legal-app .texto > nav a.on, .legal-app .texto > nav a:hover { background: var(--primario); color: #fff; border-color: var(--primario); }
.legal-app .texto .lic { font-size: 13px; color: var(--texto-suave); }
.legal-app .texto > footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--borde); font-size: 13px; color: var(--texto-suave); }

@media (max-width: 820px) {
  .ficha-dos { grid-template-columns: 1fr; gap: 24px; }
  .app-portada .contenedor { min-height: 0; padding-top: 32px; padding-bottom: 36px; }
  .app-portada { background: var(--bellota); }
  .app-portada picture { position: static; display: block; }
  .app-portada .fondo { position: static; height: auto; aspect-ratio: 1024 / 500; }
  .app-portada::after { display: none; }
  .app-portada .app-icono { width: 72px; height: 72px; border-radius: 18px; }
  .galeria { grid-auto-columns: 62%; }
}
@media (max-width: 520px) {
  .insignia-play img { height: 52px; }
}
