/* ═══════════════════════════════════════════════════════════
   CAJÓN DE RECURSOS · hoja de estilos
   Dos pieles: [data-theme="light"] editorial · [data-theme="dark"] premium
   Referencias: recursos.arcadiamedia.io · niksetting.com · scaled.llc
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, p, figure { margin: 0; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }

/* ── tipografía compartida ───────────────────────────────── */
:root {
  --f-display: "Neue Machina", "Satoshi", ui-sans-serif, system-ui, sans-serif;
  --f-body:    "Satoshi", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --f-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --f-serif:   "Instrument Serif", Georgia, serif;

  --wrap: 1180px;
  --pad: clamp(20px, 5vw, 48px);
  --r-card: 14px;
  --r-pill: 999px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* ── piel clara · editorial ──────────────────────────────── */
[data-theme="light"] {
  --bg:        #FBFBF9;
  --bg-alt:    #F3F3EF;
  --surface:   #FFFFFF;
  --ink:       #0A0A0A;
  --ink-2:     #3D3D3A;
  --muted:     #8A8A83;
  --line:      #E6E6E0;
  --line-2:    #D2D2CA;
  --accent:    #0F6738;
  --accent-ink:#FFFFFF;
  --badge-bg:  #0A0A0A;
  --badge-ink: #FFFFFF;
  --inv-bg:    #0A0A0A;
  --inv-ink:   #FFFFFF;
  --inv-muted: #9A9A93;
  --shadow:    0 1px 2px rgba(10,10,10,.04);
  --shadow-up: 0 12px 34px -12px rgba(10,10,10,.16), 0 2px 6px rgba(10,10,10,.05);
  --texture:   none;
}

/* ── piel oscura · premium ───────────────────────────────── */
[data-theme="dark"] {
  --bg:        #050606;
  --bg-alt:    #0A0B0B;
  --surface:   #0E0F0F;
  --ink:       #E8E8E8;
  --ink-2:     #C4C8CA;
  --muted:     #7E8486;
  --line:      #1D1F1F;
  --line-2:    #2C2F2F;
  --accent:    #F1E9DA;
  --accent-ink:#0A0A0A;
  --badge-bg:  #F1E9DA;
  --badge-ink: #0A0A0A;
  --inv-bg:    #F1E9DA;
  --inv-ink:   #0A0A0A;
  --inv-muted: #55524B;
  --shadow:    0 1px 2px rgba(0,0,0,.5);
  --shadow-up: 0 18px 44px -14px rgba(0,0,0,.85), 0 0 0 1px rgba(241,233,218,.06);
  --texture:
    radial-gradient(900px 520px at 78% -8%, rgba(241,233,218,.05), transparent 62%),
    radial-gradient(700px 420px at 10% 4%, rgba(241,233,218,.03), transparent 60%);
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  background-image: var(--texture);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ── microetiqueta mono ──────────────────────────────────── */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--inv { color: var(--inv-muted); }

/* ── barra de aviso ──────────────────────────────────────── */
.announce {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  font-size: 12.5px;
  letter-spacing: .01em;
  color: var(--ink-2);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.announce__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.announce__sep, .announce__muted { color: var(--muted); }
@media (max-width: 560px) { .announce__sep, .announce__muted { display: none; } }

/* ── cabecera ────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.header.is-stuck { border-bottom-color: var(--line); }
.header__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 66px; }
.header__right { display: flex; align-items: center; gap: 12px; }

.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.logo__mark {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--badge-bg); color: var(--badge-ink);
}
.logo__text {
  font-family: var(--f-display); font-weight: 800;
  font-size: 15px; letter-spacing: -.02em;
}

/* ── píldora / botón ─────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--inv-bg); color: var(--inv-ink);
  font-family: var(--f-display); font-weight: 700; font-size: 12.5px;
  letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s;
}
.pill svg { transition: transform .25s var(--ease); }
.pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-up); }
.pill:hover svg { transform: translateX(3px); }
.pill--big { padding: 15px 26px; font-size: 14px; }
.pill--inv { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .pill--inv { background: #0A0A0A; color: #F1E9DA; }

@media (max-width: 720px) { .header .pill span { display: none; } .header .pill { padding: 10px 12px; } }

/* ── interruptor de piel (temporal) ──────────────────────── */
.skin {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface);
}
.skin__btn {
  border: 0; cursor: pointer; background: transparent; color: var(--muted);
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 11px; border-radius: var(--r-pill);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.skin__btn.is-on { background: var(--ink); color: var(--bg); }
@media (max-width: 860px) { .skin { display: none; } }

/* ── hero ────────────────────────────────────────────────── */
.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(28px, 4vw, 40px); }
.hero .eyebrow { margin-bottom: 18px; }
.hero__title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(38px, 6.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -.035em;
  max-width: 16ch;
  text-wrap: balance;
}
.hero__title em {
  display: block;
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .12em;
}
.hero__sub {
  margin-top: 22px; max-width: 58ch;
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.62; color: var(--ink-2);
}

/* ── herramientas ────────────────────────────────────────── */
.tools {
  position: sticky; top: 66px; z-index: 40;
  padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.tools__in { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.search { position: relative; flex: 0 0 300px; max-width: 100%; }
.search__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; padding: 10px 40px 10px 36px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink);
  font-size: 14px; outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  border-color: var(--line-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__kbd {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  font-family: var(--f-mono); font-size: 10px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px;
  background: var(--bg-alt);
}
.search input:focus ~ .search__kbd { opacity: 0; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: var(--r-pill); padding: 8px 15px;
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip__n { font-family: var(--f-mono); font-size: 10.5px; opacity: .55; margin-left: 5px; }

@media (max-width: 640px) {
  .tools { position: static; }
  .search { flex: 1 1 100%; }
  .chips { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); }
  .chips::-webkit-scrollbar { display: none; }
}

/* ── rejilla ─────────────────────────────────────────────── */
.grid-wrap { padding: clamp(28px, 4vw, 44px) 0 clamp(56px, 8vw, 92px); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid { grid-template-columns: 1fr; } }

.card {
  position: relative; display: flex; flex-direction: column;
  min-height: 208px; padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
  animation: rise .5s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-up); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 26px; }
.card__n {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--badge-bg); color: var(--badge-ink);
  font-family: var(--f-mono); font-size: 10.5px; font-weight: 500;
}
.card__tag {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.card__new {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--r-pill); padding: 2px 7px; margin-right: 6px;
}
.card__tags { display: flex; align-items: center; }

.card__title {
  font-family: var(--f-display); font-weight: 700;
  font-size: 16px; line-height: 1.28; letter-spacing: -.018em;
  text-wrap: balance;
}
.card__desc { margin-top: 8px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

.card__go {
  margin-top: auto; padding-top: 18px;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink);
}
.card__go svg { transition: transform .25s var(--ease); }
.card:hover .card__go svg { transform: translateX(4px); }

/* tarjeta bloqueada */
.card--lock { background: var(--bg-alt); border-style: dashed; }
.card--lock .card__n { background: transparent; color: var(--muted); border: 1px dashed var(--line-2); }
.card--lock .card__go { color: var(--accent); }

.empty { text-align: center; padding: 60px 0; color: var(--muted); font-size: 15px; }

/* ── cierre ──────────────────────────────────────────────── */
.close { padding: 0 0 clamp(56px, 8vw, 96px); }
.close__card {
  background: var(--inv-bg); color: var(--inv-ink);
  border-radius: 20px;
  padding: clamp(36px, 6vw, 64px);
  text-align: center;
  border: 1px solid var(--line);
}
.close__title {
  margin-top: 14px;
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(26px, 3.6vw, 40px); line-height: 1.1; letter-spacing: -.03em;
  text-wrap: balance;
}
.close__text {
  margin: 16px auto 26px; max-width: 52ch;
  font-size: 15.5px; line-height: 1.6;
  color: color-mix(in srgb, var(--inv-ink) 68%, transparent);
}

/* ── pie ─────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); padding: 26px 0; }
.foot__in {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
}
.foot__links { display: flex; gap: 18px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── accesibilidad ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
