/* ============================================================
   cosasamedias.com — estilos
   Un solo archivo. Variables arriba, todo lo demas debajo.
   ============================================================ */

:root {
  --bg:        #12100E;
  --bg-2:      #1A1613;
  --card:      #1C1815;
  --card-hov:  #221D19;
  --line:      rgba(240, 234, 226, 0.10);
  --line-2:    rgba(240, 234, 226, 0.18);
  --text:      #F0EAE2;
  --muted:     #A2988B;
  --muted-2:   #6F675D;
  --accent:    #E8683A;

  --max:       1120px;
  --radius:    14px;

  --font-head: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Grano de fondo (textura sutil, sin imagenes) ───────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image:
    radial-gradient(circle at 1px 1px, #fff 1px, transparent 0);
  background-size: 3px 3px;
}

.page { position: relative; z-index: 1; }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.hero__eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 28px;
}

/* El titulo: la mitad de abajo va desplazada y en el color de acento,
   como si alguien hubiera cortado la palabra por la mitad. */
.hero__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(48px, 11vw, 116px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0;
  position: relative;
  display: inline-block;
  color: var(--text);
}

/* El span solo reserva el sitio (texto invisible); lo que se ve son sus dos
   pseudo-elementos. No se puede recortar el span y confiar en el ::after:
   el clip-path del padre recorta tambien a los hijos, incluidos los pseudo. */
.hero__title span {
  position: relative;
  display: inline-block;
  color: transparent;
}

.hero__title span::before,
.hero__title span::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
}

/* mitad de arriba, en crema */
.hero__title span::before {
  color: var(--text);
  clip-path: inset(0 0 var(--corte-inv, 51%) 0);
}

/* mitad de abajo, en naranja y corrida a la derecha */
.hero__title span::after {
  color: var(--accent);
  clip-path: inset(var(--corte, 49%) 0 0 0);
  transform: translateX(0.035em);
}

/* La linea del corte */
.hero__cut {
  height: 1px;
  background: var(--line-2);
  margin: 18px 0 34px;
  max-width: 640px;
}

.hero__claim {
  font-family: var(--font-head);
  font-size: clamp(19px, 2.6vw, 25px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
  max-width: 660px;
  color: var(--text);
}

.hero__intro {
  color: var(--muted);
  max-width: 620px;
  margin: 0;
  font-size: 16.5px;
}

/* ── Contadores ─────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 56px 0 0;
}

.stat {
  background: var(--bg);
  padding: 22px 20px;
}

.stat__num {
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  display: block;
}

.stat__label {
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 8px;
  display: block;
}

.stat--accent .stat__num { color: var(--accent); }

/* ============================================================
   FILTROS
   ============================================================ */

.filters {
  padding: 46px 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  align-items: flex-start;
}

.filter-group__label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 10px;
}

.filter-group__row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  line-height: 1.4;
}

.chip:hover { color: var(--text); border-color: var(--muted-2); }

.chip--on {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
  font-weight: 600;
}

.chip__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
}

/* ============================================================
   TARJETAS
   ============================================================ */

.section { padding: 0; }

.section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 44px 0 20px;
}

.section__title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
  color: var(--muted);
}

.section__rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 24px 20px 26px;
  overflow: hidden;
  transition: background .18s, border-color .18s, transform .18s;
}

/* barra vertical con el color del proyecto */
.card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--c, var(--accent));
}

a.card:hover {
  background: var(--card-hov);
  border-color: var(--line-2);
  transform: translateY(-2px);
}

.card--dead { opacity: 0.62; }

.card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card__name {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.card__tagline {
  font-size: 12.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c, var(--accent));
  margin: 6px 0 0;
  font-weight: 500;
}

.card__desc {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 14px 0 0;
  flex: 1;
}

.card__badge {
  flex-shrink: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
  margin-top: 2px;
}

/* barra de progreso */
.bar {
  margin: 20px 0 0;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.bar__fill {
  height: 100%;
  background: var(--c, var(--accent));
  border-radius: 2px;
  width: 0;
  transition: width 1.1s cubic-bezier(.2, .8, .2, 1);
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 11px 0 0;
  font-size: 12.5px;
  color: var(--muted-2);
}

.card__pct { font-variant-numeric: tabular-nums; }

.card__author { letter-spacing: 0.04em; }

.card__go {
  color: var(--muted-2);
  transition: transform .18s, color .18s;
  display: inline-block;
}

a.card:hover .card__go {
  color: var(--text);
  transform: translateX(3px);
}

.card__nourl {
  color: var(--muted-2);
  font-style: italic;
}

/* ── Tarjeta destacada ──────────────────────────────────────── */
.card--hero {
  grid-column: 1 / -1;
  padding: 34px 34px 28px 36px;
}

.card--hero .card__name { font-size: 34px; }
.card--hero .card__desc { font-size: 16px; max-width: 720px; }
.card--hero::before { width: 4px; }

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

/* ============================================================
   PIE
   ============================================================ */

.foot {
  margin-top: 90px;
  border-top: 1px solid var(--line);
  padding: 42px 0 60px;
  color: var(--muted-2);
  font-size: 14px;
}

.foot__row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: baseline;
  justify-content: space-between;
}

.foot a {
  color: var(--muted);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 1px;
  transition: color .15s, border-color .15s;
}

.foot a:hover { color: var(--accent); border-color: var(--accent); }

.foot__note { margin: 22px 0 0; max-width: 560px; line-height: 1.6; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .hero { padding: 62px 0 46px; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: 42px; }
  .grid { grid-template-columns: 1fr; }
  .card--hero { padding: 26px 24px 22px 26px; }
  .card--hero .card__name { font-size: 27px; }
  .card--hero .card__desc { font-size: 15px; }
  .filters { gap: 20px; }
}

@media (max-width: 420px) {
  .card__top { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Respeta a quien no quiere animaciones */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
