/* ============================================================
   hto-recursos — Portal Público de Recursos HTO
   Basado en el design system del portal de licensing
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300..900&family=Geist+Mono:wght@400..700&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:            #050505;
  --bg-card:       #0a0a0a;
  --bg-card-hover: #0d0d0d;
  --border:        rgba(255,255,255,.07);
  --border-hover:  rgba(255,255,255,.12);

  --green:         #00FF88;
  --green-rgb:     0, 255, 136;
  --green-light:   #33FFaa;
  --green-08:      rgba(0,255,136,.08);
  --green-18:      rgba(0,255,136,.18);
  --green-30:      rgba(0,255,136,.30);

  --text:          #f0f0f0;
  --text-dim:      #8a8a90;
  --text-muted:    rgba(255,255,255,.35);

  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', Consolas, monospace;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Noise overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ── Canvas de partículas ──────────────────────────────── */
#particleCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Layout ────────────────────────────────────────────── */
.page-wrap {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ── Header ────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5,5,5,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.header-brand img {
  height: 38px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: .9;
}

.header-badge {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-08);
  border: 1px solid var(--green-18);
  border-radius: 999px;
  padding: 3px 10px;
}

.header-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: -.003em;
  transition: color .18s ease;
}

.header-link:hover { color: var(--text); }

.header-link svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  height: 38px;
  background: linear-gradient(180deg, #0F2818 0%, #0A1A10 100%);
  border: 1px solid rgba(0,255,136,.35);
  border-radius: 10px;
  color: #00FF88;
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: -.003em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(0,255,136,.10), inset 0 1px 0 rgba(255,255,255,.05);
  transition: border-color .25s ease-out, color .25s ease-out, box-shadow .25s ease-out, transform .25s ease-out;
}

.header-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.06) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform .6s ease-out;
  pointer-events: none;
}

.header-cta:hover {
  border-color: rgba(0,255,136,.55);
  color: #A8FFD0;
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(0,255,136,.22), inset 0 1px 0 rgba(255,255,255,.08);
}

.header-cta:hover::before { transform: translateX(100%); }
.header-cta:active { transform: translateY(0); }

.header-cta > * { position: relative; z-index: 1; }

.header-cta svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  padding: 72px 0 52px;
  text-align: center;
}

.hero-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 20px;
}

.hero-title-label {
  font-size: clamp(11px, 1.2vw, 13px);
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.035em;
  margin-bottom: 1.6rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero-title .line {
  display: block;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-title .line-1 {
  background-image: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,.82) 100%);
}

.hero-title .line-2 {
  background-image: linear-gradient(90deg, #A8FFD0 0%, rgba(255,255,255,.95) 50%, #00FF88 100%);
  text-shadow: none;
  filter: drop-shadow(0 0 28px rgba(0,255,136,.35));
}

.hero-subtitle {
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 auto;
  letter-spacing: -.005em;
}

/* ── Filter Pills ──────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 36px 0 24px;
}

.filter-pill {
  height: 32px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: -.003em;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.filter-pill.active {
  background: var(--green-08);
  border-color: var(--green-30);
  color: var(--green-light);
}

/* ── Grid ──────────────────────────────────────────────── */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 40px;
}

/* ── Card ──────────────────────────────────────────────── */
.res-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .25s ease, transform .2s ease;
  isolation: isolate;
}

.res-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 70% at 80% 0%, rgba(var(--green-rgb),.04), transparent 60%);
  z-index: 0;
}

.res-card > * { position: relative; z-index: 1; }

.res-card:hover {
  border-color: rgba(var(--green-rgb),.32);
  box-shadow: 0 0 32px rgba(var(--green-rgb),.06), 0 8px 24px rgba(0,0,0,.5);
  transform: translateY(-2px);
}

/* Card head: icon + tag */
.res-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.res-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(var(--green-rgb),.08);
  border: 1px solid rgba(var(--green-rgb),.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.res-card-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--green-light);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.res-card-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.res-card-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  background: var(--green-08);
  border: 1px solid var(--green-18);
  border-radius: 999px;
  color: var(--green-light);
  font-family: var(--font-mono);
  font-size: .58rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.res-card-tag.is-new {
  background: var(--green);
  border-color: var(--green);
  color: #050505;
  font-weight: 700;
}

/* Card body */
.res-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.018em;
  margin: 0;
  line-height: 1.25;
}

.res-card-desc {
  flex: 1;
  font-size: .875rem;
  line-height: 1.55;
  color: var(--text-dim);
  letter-spacing: -.005em;
  margin: 0;
}

/* Card CTA */
.res-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 0;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: -.003em;
  transition: color .2s ease, gap .2s ease;
}

.res-card-cta svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

.res-card:hover .res-card-cta {
  color: var(--green-light);
  gap: 10px;
}

.res-card:hover .res-card-cta svg {
  transform: translateX(3px);
}

/* Próximamente card */
.res-card-soon {
  background: transparent;
  border-style: dashed;
  pointer-events: none;
  opacity: .45;
}

.res-card-soon .res-card-name {
  color: var(--text-muted);
}

/* ── Footer ────────────────────────────────────────────── */
main { flex: 1; }

.site-footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--border);
  padding: 28px;
  text-align: center;
}

.site-footer p {
  font-size: .78rem;
  color: var(--text-muted);
  letter-spacing: -.003em;
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 680px) {
  .container { padding: 0 20px; }
  .hero { padding: 52px 0 36px; }
  .res-grid { grid-template-columns: 1fr; }
  .filter-bar { gap: 5px; }
  .filter-pill { height: 30px; font-size: .74rem; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .res-card, .res-card-cta, .res-card-cta svg { transition: none !important; }
  #particleCanvas { display: none; }
}
