/* ═══════════════════════════════════════════════════════
   PONTEGEEK — BASE STYLES & SHARED COMPONENTS
   Solo componentes reutilizables en todas las páginas.
   CSS específico de página va en <style> inline o en su propio archivo.
   ═══════════════════════════════════════════════════════ */

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--tx);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s, color 0.4s;
  overflow-x: hidden;
  min-width: 320px;
}
::selection { background: var(--pop); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--body); }

/* ── Layout ──────────────────────────────────── */
.wrap { max-width: 1380px; margin: 0 auto; padding: 0 30px; }
@media (max-width: 600px) { .wrap { padding: 0 20px; } }
@media (max-width: 400px) { .wrap { padding: 0 16px; } }

/* ── Reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── Logo ────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}
/* Icono más grande; el wordmark mantiene font-size de .logo */
.logo img { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; }

/* ══════════════════════════════════════════════
   BOTONES
   ══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  border-radius: var(--r-pill);
  padding: 11px 22px;
  background: var(--pop);
  color: #fff;
  transition: transform 0.15s, filter 0.2s;
}
.btn:hover  { filter: brightness(1.08); }
.btn:active { transform: scale(0.96); }

.big-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: var(--r-pill);
  padding: 17px 38px;
  background: var(--pop);
  color: #fff;
  transition: transform 0.15s, filter 0.2s;
}
.big-btn:hover  { filter: brightness(1.08); }
.big-btn:active { transform: scale(0.97); }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--tx);
  border-radius: var(--r-pill);
  padding: 15px 32px;
  transition: border-color 0.2s, color 0.2s;
}
.ghost-btn:hover { border-color: var(--mint); color: var(--mint); }

.icon-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--tx);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: border-color 0.2s, transform 0.2s;
}
.icon-btn:hover { border-color: var(--line-2); transform: translateY(-2px); }

/* ══════════════════════════════════════════════
   NAV — sticky, glassmorphism
   ══════════════════════════════════════════════ */
nav {
  position: sticky;
  top: 0;
  z-index: 300;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}
.nav-search {
  flex: 1;
  max-width: 440px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 10px 18px;
  color: var(--tx-3);
  font-size: 14px;
  cursor: text;
  transition: border-color 0.2s;
}
.nav-search:hover { border-color: var(--line-2); }
.nav-r {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-left: auto;
}
@media (max-width: 880px) { .nav-search { display: none; } }
@media (max-width: 560px) {
  .nav-in { gap: 12px; }
  .btn { font-size: 13px; padding: 9px 16px; }
}

/* ══════════════════════════════════════════════
   TARJETA BASE (masonry + grid)
   ══════════════════════════════════════════════ */
.card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  /* background-color en transition para prevenir flash negro en GPU layer promotion */
  transition-property: background-color, border-color, box-shadow;
  transition-duration: 0.2s, 0.28s, 0.28s;
  transition-timing-function: ease, ease, ease;
  display: block;
  break-inside: avoid;
  margin-bottom: 16px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
/* Hover solo cuando la tarjeta ya entró (evita pelea con el reveal) */
.card.reveal.in:hover {
  background-color: var(--surf-2);
  transform: translate3d(0, -4px, 0);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}

/* media area */
.card .media { position: relative; overflow: hidden; }
.card .ph {
  background: linear-gradient(135deg, var(--c1, #FF5C28), var(--c2, #E0427B));
  aspect-ratio: var(--ar, 1.4);
  width: 100%;
}
.card .kind {
  position: absolute;
  top: 11px;
  left: 11px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card .kind .d { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

/* play overlay (video cards) */
.card .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .play span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: transform 0.25s;
}
.card:hover .play span { transform: scale(1.13); }

/* prompt variant */
.card .prompt-m {
  background: var(--surf-2);
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.card .pp {
  font-size: 12.5px;
  color: var(--tx-2);
  line-height: 1.7;
}
.card .pp b { color: var(--pop); font-weight: 600; }

/* body */
.card .body { padding: 15px 16px; }
.card .body h4 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.32;
  letter-spacing: -0.01em;
}
.card .body p {
  font-size: 12.5px;
  color: var(--tx-2);
  margin-top: 7px;
  line-height: 1.5;
}

/* meta row */
.card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.card .av {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pop), var(--berry));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.card .nm { font-size: 11.5px; font-weight: 500; color: var(--tx-2); }
.card .tm { margin-left: auto; font-size: 11px; color: var(--tx-3); }

/* ══════════════════════════════════════════════
   REVEAL (IntersectionObserver + timeline)
   Curva suave, sin scale agresivo — solo opacidad + ligero desplazamiento
   ══════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition-property: opacity, transform;
  transition-duration: 0.48s, 0.48s;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1), cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms);
}
.reveal.in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 0ms, 0ms;
}
.card.reveal {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition-property: opacity, transform, background-color, border-color, box-shadow;
  transition-duration: 0.48s, 0.48s, 0.2s, 0.28s, 0.28s;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1), cubic-bezier(0.22, 1, 0.36, 1), ease, ease, ease;
  transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0ms, 0ms, 0ms;
}
.card.reveal:not(.in) {
  will-change: opacity, transform;
}
.card.reveal.in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 0ms, 0ms, 0ms, 0ms, 0ms;
  will-change: transform;
}
/* Entrada al cambiar filtro (tarjetas que vuelven al layout) */
.card.filter-in {
  animation: card-filter-in 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes card-filter-in {
  from {
    opacity: 0.35;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
/* Salida suave antes de display:none */
.card.filter-out {
  opacity: 0 !important;
  transform: translate3d(0, 6px, 0) !important;
  pointer-events: none;
  transition-property: opacity, transform !important;
  transition-duration: 0.3s, 0.3s !important;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1), cubic-bezier(0.4, 0, 0.2, 1) !important;
  transition-delay: 0ms, 0ms !important;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.in,
  .card.reveal,
  .card.reveal.in,
  .card.filter-out,
  .card.filter-in {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}

/* ══════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════ */
footer { border-top: 1px solid var(--line); padding: 42px 0; }
.ft {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.ft .lks { display: flex; gap: 24px; font-size: 13px; color: var(--tx-2); }
.ft .lks a { transition: color 0.2s; }
.ft .lks a:hover { color: var(--tx); }
.ft .cr { font-size: 12px; color: var(--tx-3); }
