:root {
  --accent: #d4d4d4;

  --bg: #000000;
  --surface: #080808;
  --surface-2: #0d0d0d;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --muted: #9b9b9b;
  --muted-2: #6d6d6d;

  --radius: 20px;
  --wrap: 1240px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Resplandor ambiental, muy sutil, detrás del hero */
body::before {
  content: "";
  position: fixed;
  inset: -120px -10% auto -10%;
  height: 620px;
  pointer-events: none;
  background: radial-gradient(50% 55% at 50% 0%,
      color-mix(in srgb, #ffffff 9%, transparent),
      transparent 70%);
  opacity: 0.4;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.025em; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

[hidden] { display: none !important; }

::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap {
  width: min(var(--wrap), calc(100% - 40px));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  padding: 10px 16px;
  background: #e5e5e5;
  color: #000;
  border-radius: 0 0 10px 10px;
  font-weight: 600;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip:focus { top: 0; }

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(150deg,
      color-mix(in srgb, var(--accent) 92%, #fff),
      color-mix(in srgb, var(--accent) 70%, #000));
  color: #000;
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  padding-bottom: 2px;
  box-shadow: 0 0 22px -6px color-mix(in srgb, var(--accent) 75%, transparent);
}

.brand__name { font-size: 17px; }
.brand__tld { color: var(--muted-2); font-weight: 500; }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

/* ---------------- Toolbar ---------------- */

.catalog { position: relative; z-index: 1; padding: 26px 0 80px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }

.chip[aria-pressed="true"] {
  color: color-mix(in srgb, var(--accent) 82%, #fff);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}

.chip--featured[aria-pressed="true"] {
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg {
  position: absolute;
  left: 11px;
  color: var(--muted-2);
  pointer-events: none;
}

.search input {
  width: 250px;
  max-width: 62vw;
  padding: 9px 12px 9px 33px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: #101010;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.count {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--muted-2);
}

/* ---------------- Grid ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  align-items: stretch;
}

/* ---------------- Card ---------------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(140% 110% at var(--mx, 0%) var(--my, 0%),
      color-mix(in srgb, var(--accent) 18%, transparent),
      transparent 62%),
    linear-gradient(180deg, #111111 0%, #090909 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 26px 50px -32px #000;
}

.card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, #171717, #0a0a0a);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line-2));
  box-shadow: 0 0 24px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}

.icon__letters {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: color-mix(in srgb, var(--accent) 85%, #fff);
  padding-bottom: 1px;
}

.icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.card__ident { min-width: 0; padding-top: 1px; }

.card__name {
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #a1a1a1;
  line-height: 1.5;
}

.tag--featured {
  color: color-mix(in srgb, var(--accent) 88%, #fff);
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, #ffffff 9%, transparent);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: #b4b4b4;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-top: 2px;
}
.meta-chip .dot { opacity: 0.45; font-size: 9px; }

.card__desc {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feats {
  margin: auto 0 0;
  padding: 18px 0 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.feats li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #0e0e0e;
  font-size: 12.5px;
  color: #d6d6d6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feats li::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 0 color-mix(in srgb, var(--accent) 70%, transparent);
}

.card__foot {
  margin-top: 16px;
  padding: 11px 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #111111;
}


.foot__actions {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--ghost {
  background: #161616;
  border-color: var(--line-2);
  color: #e8e8e8;
}
.btn--ghost:hover { background: #1f1f1f; border-color: rgba(255, 255, 255, 0.22); }

.btn--primary {
  background: #ffffff;
  color: #000000;
  font-weight: 650;
}
.btn--primary:hover { background: #ececec; }
.btn--primary svg { stroke-width: 2.1; }

.btn.is-disabled {
  background: #131313;
  border-color: var(--line);
  color: #7b7b7b;
  cursor: default;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  background: #141414;
  color: #cfcfcf;
  border-color: var(--line);
}

/* ---------------- Empty / noscript ---------------- */

.empty {
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty strong { color: var(--text); font-size: 16px; }
.empty__sub { margin: 6px 0 20px; font-size: 13.5px; color: var(--muted-2); }

.noscript {
  margin-block: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
}

/* ---------------- Modal ---------------- */

.modal {
  width: min(600px, calc(100vw - 32px));
  max-height: min(86vh, 780px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: #070707;
  color: var(--text);
  overflow: auto;
  box-shadow: 0 40px 120px -40px #000;
}
.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modal[open] { animation: modal-in 0.18s ease-out; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.modal__body { padding: 22px; }

.modal__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.modal__head .icon { width: 68px; height: 68px; border-radius: 16px; }
.modal__head .icon__letters { font-size: 23px; }
.modal__head h2 { font-size: 22px; font-weight: 750; }

.modal__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #101010;
  color: var(--muted);
  cursor: pointer;
}
.modal__close:hover { color: var(--text); background: #171717; }

.modal__desc {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.62;
}

.modal h3 {
  margin: 24px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.specs > div {
  background: #0b0b0b;
  padding: 10px 12px;
}
.specs dt {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.specs dd { margin: 2px 0 0; font-size: 13.5px; color: #e4e4e4; }

.modal__feats {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.modal__changelog {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 24px;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; max-width: none; }
  .nav a { padding: 7px 8px; }
  .specs { grid-template-columns: 1fr; }
  .modal__feats { grid-template-columns: 1fr; }
  .modal__actions { grid-template-columns: 1fr; }
  .modal__actions .btn { width: 100%; }
}

@media (max-width: 420px) {
  .card__head { grid-template-columns: auto minmax(0, 1fr); }
  .meta-chip { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
  .feats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .card:hover { transform: none; }
}

/* ============================================================
   Logo, galería GUI y lightbox
   ============================================================ */

.brand__mark { position: relative; overflow: hidden; }
.brand__fallback { display: block; font-size: 16px; font-weight: 900; line-height: 1; }
.brand__logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}


.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gallery .shot {
  position: relative;
  padding: 0;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #0b0b0b;
  cursor: zoom-in;
}

.gallery .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery .shot:hover img { transform: scale(1.04); }

.gallery__empty {
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  padding: 26px 16px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.7;
}

.gallery__empty code { color: #c9c9c9; font-size: 12px; }

dialog.lightbox {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 24px;
  border: 0;
  background: transparent;
  place-items: center;
  cursor: zoom-out;
}

dialog.lightbox[open] { display: grid; }

dialog.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 30px 90px -30px #000;
}

@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
}

/* ajustes: specs impares y placeholder de galería a todo el ancho */
.specs > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.gallery__empty { grid-column: 1 / -1; }

.card__foot .foot__actions { margin-top: 0; }
.gallery .shot:only-child { grid-column: 1 / -1; }


/* acento gris al pasar el mouse */
.card:hover .feats li,
.card:focus-within .feats li {
  border-color: rgba(255, 255, 255, 0.16);
  background: #141414;
}
.card:hover .icon,
.card:focus-within .icon {
  border-color: rgba(255, 255, 255, 0.3);
}
.card:hover .card__foot,
.card:focus-within .card__foot {
  background: #161616;
  border-color: rgba(255, 255, 255, 0.14);
}

/* ============================================================
   Estrellas blancas cayendo (fondo)
   ============================================================ */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-repeat: repeat;

  background-image:
    /* capa cercana: más grandes y brillantes */
    radial-gradient(2px 2px at 40px 60px,   #fff, transparent 100%),
    radial-gradient(2px 2px at 220px 180px, #fff, transparent 100%),
    radial-gradient(1.5px 1.5px at 130px 300px, #fff, transparent 100%),
    /* capa media */
    radial-gradient(1.5px 1.5px at 90px 120px,  rgba(255,255,255,.75), transparent 100%),
    radial-gradient(1.5px 1.5px at 340px 260px, rgba(255,255,255,.75), transparent 100%),
    radial-gradient(1.5px 1.5px at 460px 420px, rgba(255,255,255,.75), transparent 100%),
    /* capa lejana: pequeñas y tenues */
    radial-gradient(1px 1px at 60px 80px,   rgba(255,255,255,.45), transparent 100%),
    radial-gradient(1px 1px at 250px 330px, rgba(255,255,255,.45), transparent 100%),
    radial-gradient(1px 1px at 520px 150px, rgba(255,255,255,.45), transparent 100%),
    radial-gradient(1px 1px at 380px 560px, rgba(255,255,255,.45), transparent 100%);

  background-size:
    300px 340px, 300px 340px, 300px 340px,
    520px 480px, 520px 480px, 520px 480px,
    700px 640px, 700px 640px, 700px 640px, 700px 640px;

  animation: stars-fall 40s linear infinite;
  opacity: 0.85;
}

/* Cada capa se mueve exactamente un "tile", así el loop es perfecto.
   Distinta distancia en la misma duración = distinta velocidad. */
@keyframes stars-fall {
  from {
    background-position:
      0 0, 0 0, 0 0,
      0 0, 0 0, 0 0,
      0 0, 0 0, 0 0, 0 0;
  }
  to {
    background-position:
      -60px 1020px, -60px 1020px, -60px 1020px,
      -40px 960px,  -40px 960px,  -40px 960px,
      -20px 640px,  -20px 640px,  -20px 640px, -20px 640px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}
