/* ==========================================================================
   Portada pública de Kolekto (js/landing.js): barra, portada con el binder en perspectiva,
   funciones en un bento con mini demos, los juegos, la llamada final y el pie.
   Casi negro y limpio; el marfil para el botón principal y el latón de la marca, contados.
   ========================================================================== */

body.landing-open { overflow: hidden; }
body.landing-open .app { visibility: hidden; }

.landing {
  --ld-w: 1200px; /* ancho del contenido */
  /* En vw y no en %: así vale igual dentro de la portada (para que el binder sangre hasta el borde) */
  --ld-gutter: max(20px, calc((100vw - var(--ld-w)) / 2));
  position: fixed;
  inset: 0;
  z-index: 150;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
}
.landing :target { scroll-margin-top: 80px; }

/* ---------- Barra ---------- */
.ld-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  height: 64px;
  padding: 0 var(--ld-gutter);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-2), border-color var(--dur-2);
}
.landing.scrolled .ld-bar { background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.ld-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.ld-brand .k-mark { width: 24px; height: 24px; }
.ld-brand .k-word { font-size: 21px; }
.ld-nav { display: flex; gap: var(--sp-6); }
.ld-nav a { color: var(--muted); font-size: var(--fs-md); font-weight: 500; text-decoration: none; transition: color var(--dur-1); }
.ld-nav a:hover { color: var(--text); }
.ld-bar-cta { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.ld-bar-cta .btn { height: 36px; }
/* El selector de idioma, antes de los botones (en el resto de la app, en el móvil, va después) */
.ld-bar-cta .lang-btn { order: 0; margin: 0; }
/* Los menús que se abren desde la portada (el de idioma) van por encima de ella, que tapa toda la app */
body.landing-open .menu { z-index: 160; }

/* ---------- Portada ---------- */
.ld-hero {
  position: relative;
  padding: 64px var(--ld-gutter) 0;
  background: radial-gradient(900px 420px at 30% -120px, color-mix(in srgb, var(--brass) 12%, transparent), transparent 70%);
  overflow-x: clip; /* el binder sangra hasta el borde sin dar scroll de lado */
}
.ld-hero-copy { position: relative; z-index: 2; max-width: 780px; }
.ld-kicker { display: inline-flex; align-items: center; gap: 9px; font-size: var(--fs-2xs); font-weight: 600; font-stretch: var(--label-stretch); letter-spacing: .16em; text-transform: uppercase; color: var(--brass-2); }
.ld-kicker::before { content: ""; width: 7px; height: 9px; border-radius: 1.5px; background: var(--brass); }
.ld-hero h1 { margin: 18px 0 0; font-family: var(--serif); font-size: clamp(40px, 5.4vw, 70px); font-weight: 400; line-height: 1.02; letter-spacing: -.032em; }
.ld-lead { margin: 22px 0 0; max-width: 62ch; color: var(--text-2); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; }
.ld-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: 32px; }
.ld-actions .btn-lg { min-width: 160px; }
.ld-actions .btn:not(.btn-primary) { background: transparent; }
.ld-note { margin: 16px 0 0; color: var(--muted); font-size: var(--fs-sm); }
/* «Jugar», junto a los principales: un botón más, con su icono (sin adornos: lo pide el dueño) */
.ld-play .i { width: 16px; height: 16px; }
/* «¿Ya tienes cuenta? Entrar», detrás de la nota (en el móvil, en su línea) */
.ld-have { margin-left: .9em; }
.ld-have .link-btn { font-size: inherit; }

/* El binder: el del álbum (binder.css), inclinado hacia atrás y fundido con el fondo */
.ld-stage {
  --tx: 0;
  --ty: 0;
  position: relative;
  height: 620px;
  margin: -36px calc(var(--ld-gutter) * -1) 0;
  perspective: 1700px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 94%);
  mask-image: linear-gradient(180deg, #000 40%, transparent 94%);
}
.ld-stage::before { /* luz cálida bajo el binder */
  content: "";
  position: absolute;
  left: 18%;
  right: 8%;
  top: 6%;
  height: 70%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  filter: blur(20px);
}
.ld-tilt {
  position: absolute;
  left: 57%;
  top: 24px;
  transform-origin: 50% 0;
  transform: translateX(-50%) rotateX(calc(40deg - var(--ty) * 5deg)) rotateZ(-11deg) rotateY(calc(var(--tx) * 6deg));
  transform-style: preserve-3d;
  transition: transform .8s var(--ease);
}
.ld-binder-host { --card-w: 168px; animation: ld-rise 1.1s var(--ease) both .1s; }
.ld-binder .cover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 -14px 34px rgba(0, 0, 0, .35), 0 60px 120px rgba(0, 0, 0, .7); }
.ld-binder .pocket { cursor: default; }
.ld-binder .card img { animation: ld-fade .6s ease both; }
/* El precio, en pequeño sobre la carta (abajo a la izquierda) */
.ld-price {
  position: absolute;
  z-index: 6;
  left: 7%;
  bottom: 4%;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  background: rgba(11, 11, 12, .86);
  border: 1px solid rgba(255, 255, 255, .14);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@keyframes ld-rise { from { opacity: 0; transform: translateY(60px); } }
@keyframes ld-fade { from { opacity: 0; } }

/* ---------- Secciones ---------- */
.ld-sec { padding: 72px var(--ld-gutter) 24px; }
.ld-sec-head { max-width: 720px; margin-bottom: 36px; }
.ld-sec-head h2, .ld-final h2 { margin: 14px 0 0; font-family: var(--serif); font-size: clamp(30px, 3.6vw, 46px); font-weight: 400; line-height: 1.08; letter-spacing: -.025em; }
.ld-sec-head p { margin: 14px 0 0; color: var(--text-2); font-size: var(--fs-lg); line-height: 1.6; }

/* Bento: tarjetas de borde fino, icono en una pastilla de color y una mini demo */
.ld-bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ld-card {
  --c: var(--brass);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 300px;
  padding: 24px 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 40%), var(--surface);
  box-shadow: var(--hairline-top);
  overflow: hidden;
  transition: border-color var(--dur-2);
}
.ld-card:hover { border-color: var(--line-2); }
.ld-card.wide, .ld-card.half { grid-column: span 2; }
.ld-card h3 { margin: 8px 0 0; font-family: var(--serif); font-size: 23px; font-weight: 500; line-height: 1.15; letter-spacing: -.012em; }
.ld-card p { margin: 0; max-width: 46ch; color: var(--text-2); font-size: var(--fs-md); line-height: 1.55; }
.ld-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-md); background: color-mix(in srgb, var(--c) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); color: var(--c); }
.ld-ic .i { width: 18px; height: 18px; }
.ld-ic-portfolio { --c: var(--ok); }
.ld-ic-market { --c: var(--info); }
.ld-ic-mesa { --c: #e0955c; }
.ld-ic-games { --c: var(--g-yugioh); }
.ld-ic-langs { --c: var(--g-digimon); }
.ld-ic-cloud { --c: var(--g-pokemon); }
.ld-ic-export { --c: var(--ivory-2); }
.ld-demo { margin-top: auto; padding-top: 16px; }
.ld-cap { display: block; font-size: var(--fs-2xs); font-weight: 600; font-stretch: var(--label-stretch); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--muted); }
.ld-meter { position: relative; display: block; height: 6px; border-radius: var(--r-pill); background: var(--surface-4); overflow: visible; }
.ld-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.ld-tagline { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; padding: 5px 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 560; }
.ld-tagline .i { width: 14px; height: 14px; color: var(--accent-2); }
.ld-tagline.ok .i { color: var(--ok); }

/* Álbum: una página de tres por tres y el progreso del set */
.ld-d-album { display: flex; align-items: flex-end; gap: 24px; }
.ld-mini-pockets { display: grid; grid-template-columns: repeat(3, 30px); gap: 5px; padding: 8px; border-radius: var(--r-md); background: #121216; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 14px 30px -10px rgba(0, 0, 0, .7); }
.ld-mini-pockets i { aspect-ratio: 63 / 88; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09); }
.ld-mini-pockets i.on { background: linear-gradient(160deg, #e9e6de, #b9b5ab); box-shadow: none; }
.ld-mini-pockets i.hit { background: linear-gradient(160deg, var(--brass-2), var(--brass)); }
.ld-progress { flex: 1; display: grid; gap: 10px; padding-bottom: 6px; }
.ld-progress b { font-family: var(--serif); font-size: 40px; font-weight: 400; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums lining-nums; }
.ld-progress b small { font-size: .5em; color: var(--muted); letter-spacing: 0; }

/* Portfolio: la cifra, el cambio y su curva */
.ld-d-pf { display: grid; gap: 4px; }
.ld-fig { font-family: var(--serif); font-size: 34px; font-weight: 400; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums lining-nums; }
.ld-chg { display: inline-flex; align-items: center; gap: 5px; justify-self: start; height: 22px; padding: 0 7px; border-radius: var(--r-xs); background: var(--ok-soft); color: var(--ok-2); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.ld-chg .i { width: 13px; height: 13px; }
.ld-spark { display: block; width: 100%; height: 56px; margin-top: 8px; overflow: visible; }
.ld-spark .l { fill: none; stroke: var(--ok); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ld-spark .a { fill: var(--ok); opacity: .12; }

/* Mercado: lo que devuelve cada caja, con la marca del 100 % */
.ld-d-market { display: grid; gap: 10px; }
.ld-ev { display: grid; grid-template-columns: 42px minmax(0, 1fr) 44px; align-items: center; gap: 10px; font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.ld-ev > span:first-child { color: var(--text-2); }
.ld-ev b { text-align: right; font-weight: 650; }
.ld-ev .ld-meter.up i { background: var(--ok); }
.ld-ev .ld-meter.down i { background: var(--bad); opacity: .85; }
.ld-ev .ld-meter em { position: absolute; left: 70%; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--text-2); opacity: .6; }
.ld-ev b.up { color: var(--ok-2); }
.ld-ev b.down { color: var(--bad-2); }

/* Mesa: un tapete de madera con dos binders y unas cartas */
.ld-d-mesa { display: grid; justify-items: start; }
.ld-wood {
  position: relative;
  width: 100%;
  height: 132px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background:
    radial-gradient(60% 90% at 35% 40%, rgba(255, 196, 128, .28), transparent 70%),
    repeating-linear-gradient(8deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 13px),
    linear-gradient(170deg, #5a3a22, #2c1b10);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 170, .08), inset 0 -30px 40px rgba(0, 0, 0, .4);
}
.ld-wood i { position: absolute; border-radius: 4px; box-shadow: 0 10px 18px rgba(0, 0, 0, .55); }
.ld-wood .b1 { left: 9%; top: 18%; width: 86px; height: 104px; background: linear-gradient(150deg, #2a3f63, #172238); transform: rotate(-8deg); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 14px 24px rgba(0, 0, 0, .6); }
.ld-wood .b2 { left: 26%; top: 34%; width: 86px; height: 104px; background: linear-gradient(150deg, #5a1f28, #33121a); transform: rotate(6deg); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 14px 24px rgba(0, 0, 0, .6); }
.ld-wood .c1, .ld-wood .c2, .ld-wood .c3 { width: 40px; height: 56px; background: linear-gradient(160deg, #ecebe6, #bdb8ad); }
.ld-wood .c1 { left: 58%; top: 30%; transform: rotate(-14deg); }
.ld-wood .c2 { left: 67%; top: 24%; transform: rotate(4deg); background: linear-gradient(160deg, var(--brass-2), var(--brass)); }
.ld-wood .c3 { left: 76%; top: 36%; transform: rotate(18deg); }

/* Juegos: chips con el color de cada uno */
.ld-d-games { display: flex; flex-wrap: wrap; gap: 7px; }
.ld-gchip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--g) 34%, transparent); background: color-mix(in srgb, var(--g) 8%, transparent); color: var(--text); font-size: var(--fs-xs); font-weight: 560; white-space: nowrap; }
.ld-gchip i { width: 7px; height: 9px; border-radius: 1.5px; background: var(--g); }

/* Idiomas: la misma carta en tres impresiones, cada una con su precio */
.ld-d-langs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ld-print { display: grid; justify-items: center; gap: 5px; padding: 12px 6px 10px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--bg-2); }
.ld-print.on { border-color: var(--accent-line); background: var(--accent-glow); }
.ld-print .flag { width: 24px; height: 16px; }
.ld-print b { font-size: var(--fs-xs); font-weight: 650; letter-spacing: .08em; }
.ld-print small { color: var(--text-2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }

/* Nube: ordenador y móvil, al día */
.ld-d-cloud { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.ld-dev { position: relative; display: block; border: 1.5px solid var(--line-3); background: var(--bg-2); }
.ld-dev i { position: absolute; inset: 6px; border-radius: 2px; background: linear-gradient(160deg, var(--surface-3), var(--surface)); box-shadow: inset 0 0 0 1px var(--line); }
.ld-dev.laptop { width: 132px; height: 84px; border-radius: 6px 6px 2px 2px; }
.ld-dev.laptop::after { content: ""; position: absolute; left: -14px; right: -14px; bottom: -8px; height: 6px; border-radius: 0 0 6px 6px; background: var(--line-3); }
.ld-dev.phone { width: 46px; height: 84px; border-radius: 9px; }
.ld-dev.phone i { inset: 5px; border-radius: 5px; }
.ld-sync { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 26px; border-radius: 50%; background: var(--info-soft); color: var(--info); }
.ld-sync .i { width: 15px; height: 15px; }
.ld-d-cloud .ld-tagline { margin: 0 0 4px auto; }

/* Exportar: los archivos */
.ld-d-export { display: flex; flex-wrap: wrap; gap: 10px; }
.ld-file { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); }
.ld-file .i { width: 16px; height: 16px; color: var(--muted); }
.ld-file b { font-size: var(--fs-sm); font-weight: 650; letter-spacing: .06em; color: var(--text); }

/* ---------- Juegos: una tira con filetes y el color de cada uno ---------- */
/* Cada fila se llena sola, sean los que sean y quepan los que quepan: ninguno se queda suelto con un hueco al lado */
.ld-games { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); overflow: hidden; }
.ld-game { flex: 1 1 150px; min-width: 0; position: relative; display: grid; align-content: space-between; gap: 18px; min-height: 132px; padding: 24px 20px 20px; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.ld-game::before { content: ""; position: absolute; left: 20px; top: 0; width: 28px; height: 3px; border-radius: 0 0 2px 2px; background: var(--g); }
.ld-game b { font-family: var(--serif); font-size: var(--fs-xl); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
.ld-game b a { color: inherit; text-decoration: none; }
.ld-game b a:hover { text-decoration: underline; }
.ld-game span { font-size: var(--fs-2xs); font-weight: 600; font-stretch: var(--label-stretch); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--muted); }
.ld-game.live { background: linear-gradient(180deg, color-mix(in srgb, var(--g) 10%, transparent), transparent 70%); }
.ld-game.live span { color: var(--ok-2); }

/* ---------- Llamada final ---------- */
.ld-final {
  display: grid;
  justify-items: center;
  margin: 72px var(--ld-gutter) 0;
  padding: 72px 24px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background:
    radial-gradient(520px 240px at 50% 0, color-mix(in srgb, var(--brass) 14%, transparent), transparent 70%),
    var(--surface);
}
.ld-final > .k-mark { width: 40px; height: 40px; }
.ld-final h2 { margin-top: 22px; }
.ld-final p { margin: 14px 0 0; max-width: 52ch; color: var(--text-2); font-size: var(--fs-lg); line-height: 1.6; }
.ld-final .ld-actions { justify-content: center; }

/* ---------- Pie ---------- */
.ld-foot { margin-top: 72px; padding: 32px var(--ld-gutter) 40px; border-top: 1px solid var(--line); }
.ld-foot-top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.ld-tag { color: var(--muted); font-size: var(--fs-sm); }
.ld-links { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-left: auto; }
.ld-links a, .ld-links .link-btn { color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; white-space: nowrap; }
.ld-links a:hover, .ld-links .link-btn:hover { color: var(--text); text-decoration: underline; }
.ld-lang { margin: 0; }
.ld-disclaimer { margin: 26px 0 0; max-width: 92ch; color: var(--muted); font-size: var(--fs-xs); line-height: 1.6; }
.ld-copy { margin: 10px 0 0; color: var(--faint); font-size: var(--fs-xs); }

/* ---------- Aparición al hacer scroll ---------- */
.ld-rv { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.ld-rv.in { opacity: 1; transform: none; }
.ld-rv.ld-static { transition: none; } /* ya estaba a la vista: la portada escrita en index.html */

/* ---------- Pantallas medianas y móvil ---------- */
@media (max-width: 1100px) {
  .ld-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-binder-host { --card-w: 120px; }
  .ld-stage { height: 500px; }
}
/* Con el dedo: los enlaces de la portada, de 40 px de alto como poco (mobile.css no se carga aparte aquí) */
@media (pointer: coarse) {
  .ld-brand, .ld-links a, .ld-links .link-btn { display: inline-flex; align-items: center; min-height: 40px; }
  .ld-game b a { display: inline-flex; align-items: center; min-height: 40px; }
}
@media (max-width: 700px) {
  .ld-bar { gap: var(--sp-3); height: 58px; }
  .ld-nav { display: none; }
  /* Arriba solo «Entrar»: probar sin cuenta (y jugar) está justo debajo */
  .ld-bar-cta .ld-bar-try { display: none; }
  .ld-bar-cta .btn { height: 40px; }
  .ld-hero { padding-top: 48px; }
  .ld-hero h1 { font-size: 40px; }
  .ld-actions { margin-top: 26px; }
  .ld-actions .btn { flex: 1; min-width: 0; }
  /* El principal, en su fila; debajo, «Jugar» y «Empezar gratis», uno al lado del otro */
  .ld-actions .btn-primary { flex-basis: 100%; }
  .ld-have { display: block; margin: 6px 0 0; }
  .ld-stage { height: 330px; margin-top: 4px; }
  .ld-tilt { left: 50%; top: 18px; transform: translateX(-50%) rotateX(38deg) rotateZ(-12deg); }
  .ld-binder-host { --card-w: 74px; }
  .ld-price { font-size: 9px; padding: 1px 4px; }
  .ld-sec { padding-top: 56px; }
  .ld-bento { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ld-card.wide, .ld-card.half { grid-column: auto; }
  .ld-card { min-height: 0; padding: 20px; }
  .ld-game { min-height: 108px; padding: 20px 16px 16px; }
  .ld-final { margin-top: 56px; padding: 48px 20px; }
  .ld-foot-top { flex-direction: column; align-items: flex-start; }
  .ld-links { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ld-rv { opacity: 1; transform: none; transition: none; }
  .ld-binder-host, .ld-binder .card img { animation: none; }
  .ld-tilt { transition: none; }
}
