@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Newsreader:wght@400;500;600&display=swap');

:root {
  color-scheme: dark;
  --bg-primary: #020617;
  --bg-elevated: rgba(4, 12, 32, 0.88);
  --bg-soft: rgba(6, 12, 28, 0.75);
  --bg-card: rgba(12, 24, 52, 0.85);
  --bg-highlight: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(16, 185, 129, 0.12));
  --surface-border: rgba(148, 163, 184, 0.25);
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #22d3ee;
  --accent-strong: #4ade80;
  --accent-warm: #f472b6;
  --danger: #fb7185;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-soft: 0 15px 45px rgba(2, 6, 23, 0.55);
  --shadow-strong: 0 25px 85px rgba(15, 23, 42, 0.65);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Newsreader', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.25), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(192, 132, 252, 0.2), transparent 60%),
    linear-gradient(180deg, #01010a 0%, #020617 40%, #010213 100%);
  color: var(--text-primary);
  line-height: 1.65;
  letter-spacing: 0.01em;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 60% 10%, rgba(14, 165, 233, 0.15), transparent 55%);
  z-index: -1;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem clamp(1.5rem, 5vw, 4rem) 5rem;
}

.wiki-beam {
  position: fixed;
  top: 24px;
  left: clamp(1.5rem, 5vw, 4rem);
  right: clamp(1.5rem, 5vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background: rgba(6, 12, 28, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  z-index: 10;
}

.wiki-beam__brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.wiki-beam__eyebrow {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.4em;
  color: rgba(148, 163, 184, 0.8);
}

.wiki-beam__title {
  font-family: 'Newsreader', serif;
  font-size: 1.05rem;
  margin: 0;
  color: var(--text-primary);
}

.wiki-back-button {
  position: fixed;
  top: 24px;
  right: clamp(1.5rem, 5vw, 4rem);
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.8);
  background: radial-gradient(circle at 30% 30%, rgba(45, 212, 191, 0.2), rgba(6, 12, 28, 0.95));
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 11;
}

.wiki-back-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.35);
}

.wiki-shell {
  margin-top: 120px;
  background: var(--bg-soft);
  border-radius: clamp(28px, 4vw, 40px);
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--shadow-strong);
}

/* El margen de 120px reserva sitio al botón fijo de retorno; el índice no lo lleva. */
.wiki-shell--flush {
  margin-top: 0;
}

.wiki-hero {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2.5rem;
}

.wiki-hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.8);
}

.wiki-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  margin: 0;
  color: var(--accent-strong);
}

.wiki-hero__lead {
  max-width: 780px;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.section {
  margin-top: clamp(2rem, 4vw, 3.5rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}

.section h2 {
  margin-top: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--accent);
}

.section h3 {
  font-size: 1.15rem;
  margin-top: 2rem;
  color: var(--accent-strong);
}

.section h4 {
  font-size: 1rem;
  margin-top: 1.2rem;
  color: var(--text-muted);
}

.section p {
  margin: 1rem 0;
}

.section ul,
.section ol {
  margin: 1rem 0 0;
  padding-left: 1.5rem;
}

.section li + li {
  margin-top: 0.4rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.card {
  padding: 1.25rem 1.35rem;
  border-radius: 18px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 12px 35px rgba(2, 6, 23, 0.5);
}

.card h3,
.card h4 {
  margin-top: 0;
  color: #7dd3fc;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.data-table th {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: rgba(203, 213, 225, 0.85);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.45);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note,
.warning,
.highlight {
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.95rem;
}

.warning {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
}

.highlight {
  border-color: rgba(94, 234, 212, 0.6);
  background: rgba(45, 212, 191, 0.12);
  color: #ccfbf1;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.stat-card {
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(10, 15, 33, 0.95);
}

.stat-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.stat-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent);
}

.stat-card__scope {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: rgba(148, 163, 184, 0.8);
}

.stat-card ul {
  margin: 0.6rem 0;
  padding-left: 1.2rem;
}

.table-responsive {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  margin-top: 1rem;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.icon-card {
  padding: 1.5rem;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.icon-card__glyph {
  font-size: 2.75rem;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.5));
}

.icon-card__title {
  margin: 0;
  font-size: 1.35rem;
  color: var(--accent-strong);
}

.icon-card__meta {
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  color: rgba(203, 213, 225, 0.8);
}

.kbd,
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: inset 0 -2px 0 rgba(148, 163, 184, 0.3);
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
  color: #e2e8f0;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.table legend,
.section small {
  color: var(--text-muted);
}

figure {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

figcaption {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.8);
}

@media (max-width: 768px) {
  .wiki-beam {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .wiki-back-button {
    position: static;
    align-self: flex-end;
    margin-top: 0.75rem;
  }

  main {
    padding: 2.5rem 1.25rem 4rem;
  }

  .wiki-shell {
    margin-top: 1rem;
    padding: 1.5rem;
  }
}
