:root {
  --bg: #f6f7fb; --bg-2: #eceef5; --surface: #ffffff; --text: #151823; --muted: #586074;
  --border: #dfe2ec; --accent: #5b4bdb; --accent-2: #0e9f8e; --accent-contrast: #fff;
  --shadow: 0 1px 2px rgba(20,24,40,.06), 0 8px 24px rgba(20,24,40,.06);
  --ok: #0b7a4b; --ok-bg: #dcf5e8; --wip: #8a5300; --wip-bg: #fdefd3; --arch: #4f5568; --arch-bg: #e6e8ef;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117; --bg-2: #151925; --surface: #171b26; --text: #e9ebf3; --muted: #a2a9bc;
    --border: #2a3042; --accent: #9d90ff; --accent-2: #3dd6c2; --accent-contrast: #12101f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25);
    --ok: #6fe0a8; --ok-bg: #12382a; --wip: #ffc56b; --wip-bg: #3d2b0d; --arch: #c0c6d6; --arch-bg: #2a2f3e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1117; --bg-2: #151925; --surface: #171b26; --text: #e9ebf3; --muted: #a2a9bc;
  --border: #2a3042; --accent: #9d90ff; --accent-2: #3dd6c2; --accent-contrast: #12101f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25);
  --ok: #6fe0a8; --ok-bg: #12382a; --wip: #ffc56b; --wip-bg: #3d2b0d; --arch: #c0c6d6; --arch-bg: #2a2f3e;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px; line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; margin: 0; }
.wrap { width: min(1200px, 100% - 2rem); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: .5rem; background: var(--accent); color: var(--accent-contrast); padding: .5rem .9rem; border-radius: 8px; z-index: 10; }
.skip:focus { left: .5rem; }

.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 700; }
.brand img { border-radius: 8px; }
.topnav { display: flex; align-items: center; gap: .75rem; }
.topnav a { color: var(--text); text-decoration: none; font-weight: 600; padding: .4rem .6rem; border-radius: 8px; }
.topnav a:hover { background: var(--bg-2); }
.theme-toggle { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; } :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; } }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }

.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(1.5rem, 4vw, 2.5rem); background:
  radial-gradient(60rem 24rem at 10% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
  radial-gradient(40rem 20rem at 95% 0%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 70%); }
.eyebrow { margin: 0 0 .6rem; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent); }
.hero h1 { font-size: clamp(2.2rem, 6.5vw, 4.2rem); letter-spacing: -.02em; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 40rem; margin: 1rem 0 1.6rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }

.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; line-height: 1.2; }
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-sm { padding: .45rem .8rem; font-size: .9rem; }

section h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin-bottom: 1.1rem; }
.featured { padding: 1.5rem 0 1rem; }
.catalog { padding: 2rem 0 3.5rem; }
.subhead { font-size: 1.2rem; margin: 2.5rem 0 1rem; color: var(--muted); }

.controls { display: grid; gap: 1rem; margin-bottom: 1rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.search label, .chips legend { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.search label { display: block; margin-bottom: .4rem; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: .8rem; top: 50%; translate: 0 -50%; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; font: inherit; padding: .75rem .9rem .75rem 2.6rem; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.search input:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; min-width: 0; }
.chips legend { padding: 0; margin-bottom: .45rem; float: left; width: 100%; }
.chip { font: inherit; font-size: .9rem; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.chip .n { opacity: .7; font-size: .8em; margin-left: .25rem; }
.result-count { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }

.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.grid-featured { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease; }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.thumb { aspect-ratio: 16 / 10; background: var(--bg-2); border-bottom: 1px solid var(--border); overflow: hidden; }
.thumb img, .thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { display: flex; flex-direction: column; gap: .55rem; padding: 1rem 1.05rem 1.1rem; flex: 1; }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.badge { font-size: .74rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; background: var(--bg-2); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.badge.s-online { background: var(--ok-bg); color: var(--ok); }
.badge.s-en-desarrollo { background: var(--wip-bg); color: var(--wip); }
.badge.s-archivado { background: var(--arch-bg); color: var(--arch); }
.card h3 { font-size: 1.15rem; }
.card p.desc { margin: 0; color: var(--muted); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.tags li { font-size: .78rem; color: var(--muted); border: 1px dashed var(--border); padding: .1rem .5rem; border-radius: 6px; }
.card-foot { margin-top: auto; padding-top: .4rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.card-foot time { margin-left: auto; font-size: .8rem; color: var(--muted); }
.no-links { font-size: .85rem; color: var(--muted); font-style: italic; }

.empty { text-align: center; padding: 2.5rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.empty p { margin: .3rem 0; }
.linklike { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

.footer { border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
.footer p { margin: 0; }

@media (min-width: 760px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .search { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .brand span { font-size: .95rem; }
  .card-foot time { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover { transform: none; }
}
