/* ===== Kodex — estilos ===== */
:root {
  --bg: #0d0f14;
  --bg-2: #13161d;
  --surface: #181c25;
  --surface-2: #20252f;
  --line: #262b36;
  --text: #eef0f5;
  --muted: #9aa1b2;
  --accent: #8b7bff;
  --accent-2: #b3a8ff;
  --accent-ink: #0d0f14;
  --free: #3ddc97;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  position: relative; overflow: hidden; isolation: isolate;
  translate: var(--bx, 0px) var(--by, 0px);
  transition: transform .15s, background .2s, border-color .2s, box-shadow .3s, translate .35s cubic-bezier(.2,.8,.2,1);
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { background: rgba(255,255,255,.06); border-color: var(--line); }
.btn--ghost:hover { background: rgba(255,255,255,.1); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }

/* ===== Barra superior ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 15, 20, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 20px var(--display); letter-spacing: .02em; }
.brand__mark { width: 30px; height: 30px; color: var(--accent); }
.topbar__nav { display: flex; gap: 22px; color: var(--muted); font-weight: 500; font-size: 14px; }
.topbar__nav a:hover { color: var(--text); }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 14px; height: 40px; width: 260px; transition: border-color .2s;
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { background: none; border: 0; outline: 0; color: var(--text); font: inherit; width: 100%; }
.search input::placeholder { color: var(--muted); }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero__bg { position: absolute; inset: 0; opacity: .55; }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 25%, rgba(13,15,20,.55) 65%, rgba(13,15,20,.2)),
              linear-gradient(0deg, var(--bg), transparent 40%);
}
.hero__inner {
  position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px;
  align-items: center; padding: 72px 0 64px;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px; color: var(--accent-2);
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px;
}
.hero__eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.hero h1 { font-size: clamp(36px, 5.5vw, 60px); font-weight: 700; }
.hero p { color: var(--muted); font-size: 17px; max-width: 520px; margin: 16px 0 24px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__art {
  position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08);
  transform: perspective(1200px) rotateX(var(--rx, 4deg)) rotateY(var(--ry, -10deg));
  transition: transform .7s cubic-bezier(.2,.8,.2,1);
  animation: artIn 1.3s .35s cubic-bezier(.2,.8,.2,1) backwards;
}

/* ===== Portada generada ===== */
.cover {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  display: flex; align-items: flex-end; padding: 18px;
  background: var(--c2);
}
.cover::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(circle at 75% 25%, var(--c1) 0, transparent 45%),
    radial-gradient(circle at 15% 90%, color-mix(in srgb, var(--c1) 55%, transparent) 0, transparent 40%);
  opacity: .85;
}
.cover::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to top, transparent, #000 70%);
}
.cover__title {
  position: relative; z-index: 1; font: 700 clamp(20px, 2.2vw, 28px)/1.05 var(--display);
  text-transform: uppercase; letter-spacing: .02em; text-shadow: 0 2px 16px rgba(0,0,0,.4);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ===== Stats ===== */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-top: -28px; margin-bottom: 28px;
  position: relative; z-index: 2;
}
.stats > div { background: var(--bg-2); padding: 18px 22px; display: flex; align-items: baseline; gap: 10px; }
.stats strong { font: 700 26px var(--display); }
.stats span { color: var(--muted); font-size: 14px; }

/* ===== Catálogo ===== */
.catalog { padding: 24px 0 72px; }
.catalog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.catalog__head h2 { font-size: 30px; }
.catalog__controls { display: flex; gap: 10px; flex-wrap: wrap; }
.catalog__count { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

.segmented { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.segmented button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); }
.segmented button.is-active { background: var(--surface-2); color: var(--text); }

.select select {
  appearance: none; height: 38px; padding: 0 36px 0 14px; border-radius: 999px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa1b2' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line); color: var(--text); font: 500 13px var(--font);
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  transition: all .2s;
}
.chip:hover { color: var(--text); border-color: #3a4150; }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }

.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-align: left; padding: 0; color: inherit;
  position: relative;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
  transition: transform .45s cubic-bezier(.2,.8,.2,1), border-color .25s, box-shadow .35s;
  animation: cardIn .7s cubic-bezier(.2,.8,.2,1) backwards;
}
.card:hover { --ty: -6px; border-color: #353c4b; box-shadow: 0 24px 50px -12px rgba(0,0,0,.55); }
.card__media { position: relative; aspect-ratio: 16 / 10; }
.card__media .cover { transition: transform .5s; }
.card:hover .card__media .cover { transform: scale(1.04); }
.card__badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }
.card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card__title { font: 600 17px var(--display); }
.card__tagline { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.card__genre { font-size: 12px; color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  background: rgba(13,15,20,.75); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.12);
}
.badge--new { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tag { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 500; }

.price { font: 600 15px var(--display); }
.price--free { color: var(--free); }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.rating svg { width: 14px; height: 14px; fill: #ffc857; }
.platforms { display: flex; gap: 6px; color: var(--muted); }
.platforms svg { width: 15px; height: 15px; fill: currentColor; }

.empty { text-align: center; padding: 56px 0; color: var(--muted); }

/* ===== Nosotros ===== */
.about {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center;
  padding: 40px; margin-bottom: 72px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 20px;
}
.about h2 { font-size: 28px; margin-bottom: 12px; }
.about p { color: var(--muted); margin: 0; }
.about__cta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.about__cta h3 { font-size: 19px; margin-bottom: 6px; }
.about__cta p { margin-bottom: 18px; font-size: 14px; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer__inner { display: flex; justify-content: space-between; padding: 24px 0; gap: 16px; flex-wrap: wrap; }
.footer a:hover { color: var(--text); }

/* ===== Modal ===== */
.modal {
  width: min(880px, 100% - 32px); max-height: calc(100% - 48px); padding: 0;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: auto;
}
.modal::backdrop { background: rgba(5, 6, 9, .7); backdrop-filter: blur(4px); }
.modal[open] { animation: modalIn .55s cubic-bezier(.2,.8,.2,1); }
.modal__media { position: relative; aspect-ratio: 21 / 9; }
.modal__media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 3; width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.15); background: rgba(13,15,20,.7);
  display: grid; place-items: center; backdrop-filter: blur(6px);
}
.modal__close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.5; }
.modal__content { display: grid; grid-template-columns: 1fr 260px; gap: 32px; padding: 28px; }
.modal__content h2 { font-size: 30px; margin-bottom: 8px; }
.modal__desc { color: var(--muted); margin: 14px 0 18px; }
.modal__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.modal__shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 20px; }
.modal__shots img { border-radius: var(--radius-sm); aspect-ratio: 16/9; object-fit: cover; border: 1px solid var(--line); }
.modal__side { display: flex; flex-direction: column; gap: 14px; }
.buybox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.buybox .price { font-size: 26px; }
.buybox .btn { width: 100%; }
.facts { margin: 0; display: grid; gap: 10px; font-size: 13px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .topbar__nav { display: none; }
  .hero__inner { grid-template-columns: 1fr; padding: 40px 0 56px; gap: 28px; }
  .hero__art { order: -1; transform: none; aspect-ratio: 16 / 9; }
  .about { grid-template-columns: 1fr; padding: 24px; }
  .modal__content { grid-template-columns: 1fr; padding: 20px; }
}
@media (max-width: 600px) {
  .topbar__inner { gap: 12px; }
  .search { width: auto; flex: 1; }
  .brand { font-size: 18px; }
  .stats { grid-template-columns: 1fr; }
  .stats > div { padding: 12px 18px; }
  .modal__media { aspect-ratio: 16 / 9; }
  .hero__actions .btn { flex: 1; }
}
