/* =========================================================
   IA Fácil — hoja de estilos principal
   Diseño: editorial premium, oscuro, con acentos degradados,
   textura sutil de grano y micro-interacciones.
   ========================================================= */

:root {
  --bg: #08090d;
  --bg-soft: #0f1218;
  --card: #12151d;
  --card-hover: #161a24;
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.14);
  --text: #f4f5f8;
  --text-muted: #97a0b3;
  --text-dim: #6b7386;

  --brand: #8b5cf6;
  --brand-2: #6366f1;
  --brand-light: #b49bff;
  --brand-soft: rgba(139,92,246,.14);
  --accent: #2dd8c0;
  --accent-light: #6ee9d6;
  --accent-soft: rgba(45,216,192,.14);
  --warn: #ffb648;

  --grad-brand: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 55%, var(--accent) 130%);
  --grad-text: linear-gradient(135deg, #cbb9ff 0%, #9c8cff 45%, #6ee9d6 100%);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --maxw: 1120px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  --shadow-glow: 0 0 0 1px rgba(139,92,246,.15), 0 20px 60px -20px rgba(139,92,246,.35);
  --ease: cubic-bezier(.22,1,.36,1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Textura de grano sutil, sensación editorial premium */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; border-radius: var(--radius-sm); }

a { color: var(--brand-light); text-decoration: none; transition: color .15s ease; }
a:hover { text-decoration: underline; }

::selection { background: var(--brand); color: #fff; }

/* Scrollbar a juego */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #262b38; border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Texto en degradado, reutilizable */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8,9,13,.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -.01em;
  color: var(--text);
}
.logo::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--grad-brand);
  box-shadow: 0 0 18px -2px rgba(139,92,246,.6);
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo .dot { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .93rem;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color .18s ease, background .18s ease;
}
.nav-links a:hover { color: var(--text); text-decoration: none; background: rgba(255,255,255,.05); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    inset: 66px 0 0 0;
    background: var(--bg);
    flex-direction: column;
    padding: 24px 20px;
    transform: translateY(-110%);
    transition: transform .3s var(--ease);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 14px; }
  .nav-toggle {
    display: inline-flex;
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 8px 10px;
    font-size: 1.1rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 92px 0 64px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  isolation: isolate;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  animation: drift 22s ease-in-out infinite alternate;
}
.hero::before {
  width: 480px; height: 480px;
  top: -220px; left: -120px;
  background: radial-gradient(circle, var(--brand) 0%, transparent 70%);
}
.hero::after {
  width: 420px; height: 420px;
  top: -180px; right: -140px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  animation-delay: -9s;
  animation-direction: alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(30px,40px) scale(1.08); }
}

.hero .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-soft);
  color: var(--brand-light);
  border: 1px solid rgba(139,92,246,.3);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.02em;
  font-size: clamp(2.1rem, 4.8vw, 3.5rem);
  line-height: 1.08;
  margin: 0 0 18px;
  max-width: 17ch;
}
.hero h1 .accent { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead {
  font-size: 1.18rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 0 32px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  font-family: var(--font);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s ease, border-color .18s ease, background .18s ease;
  overflow: hidden;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--grad-brand);
  background-size: 160% 160%;
  color: #fff;
  box-shadow: 0 8px 24px -6px rgba(139,92,246,.55);
}
.btn-primary:hover { box-shadow: 0 12px 32px -6px rgba(139,92,246,.7); background-position: 100% 0; }
.btn-ghost {
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-color: var(--border-strong);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { border-color: var(--brand-light); background: rgba(255,255,255,.06); }

/* ---------- Sections ---------- */
.section { padding: 60px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; font-size: 1.7rem; }
.section-head p { color: var(--text-muted); margin: 6px 0 0; }
.section-head .see-all { font-weight: 700; white-space: nowrap; }

.kicker {
  color: var(--accent);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------- Cards / Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .28s var(--ease), border-color .28s ease, box-shadow .28s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(139,92,246,.45);
  box-shadow: var(--shadow-glow);
}
.card .thumb {
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
  background:
    radial-gradient(120% 140% at 15% 0%, var(--brand-soft), transparent 60%),
    radial-gradient(120% 140% at 100% 100%, var(--accent-soft), transparent 60%),
    var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
}
.card .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 40px rgba(0,0,0,.35);
}
.card .body { padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card .cat {
  color: var(--accent);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.card h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; line-height: 1.35; letter-spacing: -.01em; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--brand-light); text-decoration: none; }
.card p.excerpt { color: var(--text-muted); font-size: .92rem; margin: 0; flex: 1; }
.card .meta { color: var(--text-dim); font-size: .8rem; display: flex; gap: 10px; align-items: center; }

.card.featured {
  grid-column: span 2;
}
.card.featured .thumb { aspect-ratio: 21/9; font-size: 3.4rem; }
.card.featured h3 { font-size: 1.35rem; }
@media (max-width: 900px) { .card.featured { grid-column: span 2; } }
@media (max-width: 620px) { .card.featured { grid-column: span 1; } }

/* ---------- Newsletter / CTA box ---------- */
.cta-box {
  position: relative;
  background: linear-gradient(135deg, var(--card) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  overflow: hidden;
}
.cta-box::before {
  content: "";
  position: absolute;
  width: 260px; height: 260px;
  right: -80px; top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--brand) 0%, transparent 70%);
  opacity: .3;
  filter: blur(40px);
}
.cta-box h3 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.cta-box p { margin: 0; color: var(--text-muted); }

/* ---------- Article page ---------- */
.article-header { padding: 52px 0 26px; border-bottom: 1px solid var(--border); }
.breadcrumbs { font-size: .85rem; color: var(--text-dim); margin-bottom: 20px; }
.breadcrumbs a { color: var(--text-dim); }
.article-header h1 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.015em; font-size: clamp(1.9rem, 3.8vw, 2.7rem); line-height: 1.18; margin: 0 0 16px; }
.article-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-muted); font-size: .9rem; align-items: center; }
.author-chip { display: flex; align-items: center; gap: 8px; }
.author-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; color: #0f1116;
  box-shadow: 0 0 14px -2px rgba(139,92,246,.6);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 280px;
  gap: 48px;
  padding: 44px 0 68px;
  align-items: start;
}
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } }

.prose { max-width: 74ch; }
.prose h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; font-size: 1.55rem; margin: 2.2em 0 .7em; scroll-margin-top: 90px; }
.prose h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.22rem; margin: 1.8em 0 .6em; scroll-margin-top: 90px; }
.prose p { margin: 0 0 1.15em; color: #dde2eb; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.4em; color: #dde2eb; }
.prose li { margin-bottom: .5em; }
.prose strong { color: #fff; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote {
  margin: 1.7em 0;
  padding: 18px 22px;
  background: var(--bg-soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}
.prose .callout {
  position: relative;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid rgba(45,216,192,.28);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 1.7em 0;
}
.prose .callout strong { color: var(--accent-light); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.7em 0; font-size: .92rem; border-radius: var(--radius-sm); overflow: hidden; }
.prose th, .prose td { border: 1px solid var(--border); padding: 11px 14px; text-align: left; }
.prose th { background: var(--bg-soft); font-family: var(--font-display); font-weight: 600; }
.prose tbody tr:hover { background: rgba(255,255,255,.02); }
.prose code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; font-size: .88em; border: 1px solid var(--border); }

.ad-slot {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: .8rem;
  margin: 2.2em 0;
  background: var(--bg-soft);
}

.sidebar { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 22px; }
.toc {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.toc h4 { margin: 0 0 12px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.toc ol { margin: 0; padding-left: 1.1em; font-size: .9rem; }
.toc li { margin-bottom: 9px; }
.toc a { color: var(--text-muted); transition: color .15s ease; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--brand-light); font-weight: 600; }

.related-box {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.related-box h4 { margin: 0 0 14px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.related-box ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.related-box a { color: var(--text); font-size: .92rem; font-weight: 600; }
.related-box a:hover { color: var(--brand-light); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 52px 0 28px;
  background: var(--bg-soft);
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h5 { font-family: var(--font-display); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); margin: 0 0 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { color: var(--text-muted); font-size: .92rem; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .85rem;
}

/* ---------- Legal pages ---------- */
.legal-content { max-width: 74ch; padding: 52px 0 84px; }
.legal-content h1 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }
.legal-content .updated { color: var(--text-dim); font-size: .9rem; margin-bottom: 2em; }
.legal-content h2 { font-family: var(--font-display); font-weight: 600; margin-top: 2em; font-size: 1.25rem; }
.legal-content p, .legal-content li { color: #dde2eb; }

/* ---------- Utility ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

.badge {
  display: inline-block;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
}

.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(10,11,16,.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 18px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  box-shadow: 0 -10px 40px rgba(0,0,0,.45);
}
.cookie-banner p { margin: 0; color: var(--text-muted); font-size: .88rem; max-width: 62ch; }
.cookie-banner .actions { display: flex; gap: 10px; }
.cookie-banner.hidden { display: none; }

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
