:root {
  --bg: #02010A;
  --ink: #EDE7F6;
  --ink-dim: rgba(237, 231, 246, 0.62);
  --ink-mute: rgba(237, 231, 246, 0.42);
  --edge: rgba(145, 107, 191, 0.28);
  --edge-strong: rgba(145, 107, 191, 0.6);
  --card: rgba(6, 4, 32, 0.42);
  --card-hover: rgba(15, 11, 50, 0.55);
  --radius: 18px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui,
    sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  height: 100%;
  overflow: hidden; /* hard guarantee: this page never scrolls, mobile or desktop */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

.frame {
  height: 100dvh;
  max-width: 1520px;
  margin: 0 auto;
  padding: clamp(12px, 3vw, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  overflow: hidden;
}

/* --- brand ------------------------------------------------------------ */

.brand {
  text-align: center;
  margin-top: clamp(4px, 2vh, 18px);
  padding: 0 8px;
}

.wordmark {
  margin: 0;
  line-height: 0;
  display: block;
}

.wordmark img {
  display: block;
  height: auto;
  /* Bigger floor + steeper vw scaling on mobile — the logo is very wide
     and short (≈5:1), so going bigger here costs very little vertical
     space even under the no-scroll budget. */
  width: clamp(260px, 62vw, 420px);
  max-width: 100%;
  margin: 0 auto;
  filter: drop-shadow(0 8px 40px rgba(0, 0, 0, 0.5));
}

.tagline {
  margin: 8px auto 0;
  max-width: 44ch;
  color: var(--ink-dim);
  font-size: clamp(16px, 4.2vw, 19px);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* --- cards ------------------------------------------------------------ */

/* Mobile-first: cards stack full-width, one above the other — the native
   Linktree pattern — sized in dvh so two stacked cards + header + footer
   always fit inside 100dvh without scrolling. Desktop switches to
   side-by-side further down. */
.grid {
  width: 100%;
  flex: 1 1 auto;           /* grow to fill vertical space in .frame */
  min-height: 0;            /* allow this box to shrink below content size */
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(10px, 2dvh, 20px);
  align-content: center;    /* center the column of cards vertically */
  margin-top: clamp(8px, 2dvh, 20px);
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(20px, 2.5vw, 32px);
    margin-top: clamp(20px, 4dvh, 56px);
  }
}

/* stack a "live" badge above each card */
.stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1dvh, 14px);
  min-width: 0;
  min-height: 0;
}

@media (min-width: 720px) {
  .stack { height: 100%; }
}

.card {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--edge);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: inherit;
  text-decoration: none;
  transition: transform 220ms ease, border-color 220ms ease,
    background 220ms ease, box-shadow 220ms ease;
}

.card:hover {
  transform: translateY(-4px);
  background: var(--card-hover);
  border-color: var(--edge-strong);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

.card:focus-visible {
  outline: 2px solid var(--edge-strong);
  outline-offset: 4px;
}

/* thumbnail block: hero image, hidden until it successfully loads */
.thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  /* Height still targets 16:9 of the card's width, but never taller than
     this share of the viewport — keeps the whole page inside 100dvh.
     Smaller cap on mobile since two cards stack vertically there; desktop
     gets a much taller cap since it's a single row of two side-by-side. */
  max-height: clamp(90px, 21dvh, 260px);
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgba(61, 44, 141, 0.45),
    rgba(4, 5, 46, 0.65)
  );
  border-bottom: 1px solid var(--edge);
}

.thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1);
  transform-origin: center;
  transition: opacity 320ms ease,
    transform 700ms cubic-bezier(0.2, 0.7, 0.15, 1);
  will-change: transform;
}

.card.has-thumb .thumb { opacity: 1; }

@media (min-width: 720px) {
  .thumb-wrap { max-height: clamp(200px, 32dvh, 460px); }
}

/* soft top-shading over the thumb for extra depth + hover-time tint */
.thumb-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(2, 1, 10, 0) 55%,
    rgba(2, 1, 10, 0.45) 100%
  );
  pointer-events: none;
  opacity: 1;
  transition: opacity 500ms ease, background 500ms ease;
}

/* elegant hover: subtle zoom + a warm tint sweep across the thumb */
.card:hover .thumb {
  transform: scale(1.06);
}

.card:hover .thumb-wrap::after {
  background: linear-gradient(
    180deg,
    rgba(145, 107, 191, 0.12) 0%,
    rgba(2, 1, 10, 0) 45%,
    rgba(2, 1, 10, 0.55) 100%
  );
}

/* --- "personas leyendo ahora" live badge (above the card) ------------ */

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  background: rgba(2, 1, 10, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

@media (min-width: 720px) {
  .live {
    gap: 10px;
    padding: clamp(9px, 0.9vw, 12px) clamp(16px, 1.4vw, 20px) clamp(9px, 0.9vw, 12px) clamp(13px, 1.1vw, 16px);
    font-size: clamp(13px, 1vw, 15px);
  }
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  animation: livePulse 1.8s ease-in-out infinite;
}

.live-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
  text-align: right;
  transition: color 260ms ease;
}

.live-count.is-up,
.live-count.is-down {
  animation: countBump 480ms ease;
}
.live-count.is-up { color: #a7f3d0; }
.live-count.is-down { color: #fecaca; }

/* Small scoreboard-style "tick" on every change — the motion itself reads
   as "this is updating live" even before you register the new number. */
@keyframes countBump {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-2px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

.live-label {
  color: var(--ink-dim);
  font-size: 11px;
}

@keyframes livePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(74, 222, 128, 0);
    transform: scale(0.9);
  }
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
}

@media (min-width: 720px) {
  .meta {
    gap: 8px;
    padding: clamp(20px, 2.2vw, 30px) clamp(22px, 2.4vw, 32px) clamp(22px, 2.6vw, 34px);
  }
}

.kicker {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}

@media (min-width: 720px) {
  .kicker { font-size: clamp(10px, 0.9vw, 12px); }
}

.card-title {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.32;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 720px) {
  .card-title { font-size: clamp(15px, 1.7vw, 21px); line-height: 1.35; }
}

.card-date {
  color: var(--ink-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-height: 1em;
}

@media (min-width: 720px) {
  .card-date { font-size: clamp(12px, 0.9vw, 14px); }
}

/* --- footer ----------------------------------------------------------- */

.footer {
  flex: 0 0 auto;
  color: var(--ink-mute);
  font-size: clamp(9px, 1.6vw, 11px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-top: clamp(8px, 2dvh, 32px);
  padding-bottom: clamp(6px, 1.2dvh, 12px);
  text-align: center;
}

/* --- responsive tightening ------------------------------------------- */

@media (max-width: 719px) {
  .frame { padding: 14px 16px; }
}

/* Extra-short viewports (small phones in landscape, short laptop windows):
   shrink the header and the thumbnail cap further so nothing pushes past
   the fold. */
@media (max-height: 700px) {
  .wordmark img { width: clamp(180px, 40vw, 320px); }
  .tagline { display: none; }
}

@media (max-height: 700px) and (max-width: 719px) {
  .thumb-wrap { max-height: 16dvh; }
}

@media (max-height: 520px) {
  .brand { margin-top: 2px; }
  .thumb-wrap { max-height: 16dvh; }
  .meta { padding: 6px 10px 8px; }
  .kicker { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .thumb,
  .thumb-wrap::after { transition: none; }
  .card:hover { transform: none; }
  .card:hover .thumb { transform: none; }
  .live-count.is-up,
  .live-count.is-down { animation: none; }
}
