/* ============================================================
   NEXO DESIGN SYSTEM — Hoja de estilos compartida
   Adherida a STYLE_GUIDE.md v1.0
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root,
[data-theme="light"] {
  --bg-canvas: #FAFAFB;
  --bg-surface: #FFFFFF;
  --bg-surface-raised: #FFFFFF;
  --bg-surface-overlay: #FFFFFF;
  --bg-surface-sunken: #F4F5F7;
  --bg-muted: #F4F5F7;
  --bg-muted-hover: #ECEEF1;
  --fg-primary: #11141A;
  --fg-secondary: #353A45;
  --fg-tertiary: #6B7280;
  --fg-disabled: #C9CDD4;
  --fg-on-brand: #FFFFFF;
  --fg-on-accent: #1F232B;
  --border-subtle: #ECEEF1;
  --border-default: #E2E5EA;
  --border-strong: #C9CDD4;
  --brand-bg: #5057E8;
  --brand-bg-hover: #4046D4;
  --brand-fg: #5057E8;
  --brand-bg-subtle: #EEF0FF;
  --accent-bg: #D4F000;
  --accent-bg-hover: #BCD400;
  --accent-fg: #4A5500;
  --success-bg: #16A34A;
  --success-fg: #15803D;
  --success-bg-subtle: #DCFCE7;
  --warning-bg: #F59E0B;
  --warning-fg: #B45309;
  --warning-bg-subtle: #FEF3C7;
  --danger-bg: #EF4444;
  --danger-fg: #B91C1C;
  --danger-bg-subtle: #FEE2E2;
  --info-bg: #0EA5E9;
  --info-fg: #0284C7;
  --info-bg-subtle: #E0F2FE;
  --ring-focus: #5057E8;
  --shadow-xs: 0 1px 2px 0 rgb(17 20 26 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(17 20 26 / 0.08), 0 1px 2px -1px rgb(17 20 26 / 0.04);
  --shadow-md: 0 4px 6px -2px rgb(17 20 26 / 0.08), 0 2px 4px -2px rgb(17 20 26 / 0.04);
  --shadow-lg: 0 12px 24px -6px rgb(17 20 26 / 0.10), 0 4px 8px -4px rgb(17 20 26 / 0.06);
  --shadow-xl: 0 24px 48px -12px rgb(17 20 26 / 0.18);
}

[data-theme="dark"] {
  --bg-canvas: #0A0C10;
  --bg-surface: #11141A;
  --bg-surface-raised: #171A21;
  --bg-surface-overlay: #1F232B;
  --bg-surface-sunken: #0A0C10;
  --bg-muted: #171A21;
  --bg-muted-hover: #1F232B;
  --fg-primary: #FAFAFB;
  --fg-secondary: #C9CDD4;
  --fg-tertiary: #9AA0AB;
  --fg-disabled: #4B5563;
  --fg-on-brand: #FFFFFF;
  --fg-on-accent: #1F232B;
  --border-subtle: #1F232B;
  --border-default: #353A45;
  --border-strong: #4B5563;
  --brand-bg: #4046D4;
  --brand-bg-hover: #5057E8;
  --brand-fg: #8E99FF;
  --brand-bg-subtle: #1E2059;
  --accent-bg: #D4F000;
  --accent-bg-hover: #E2FF66;
  --accent-fg: #1F232B;
  --success-bg: #15803D;
  --success-fg: #86EFAC;
  --success-bg-subtle: #052E16;
  --warning-bg: #D97706;
  --warning-fg: #FCD34D;
  --warning-bg-subtle: #451A03;
  --danger-bg: #DC2626;
  --danger-fg: #FCA5A5;
  --danger-bg-subtle: #450A0A;
  --info-bg: #0284C7;
  --info-fg: #7DD3FC;
  --info-bg-subtle: #082F49;
  --ring-focus: #6D78F5;
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.30);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.40), 0 1px 2px -1px rgb(0 0 0 / 0.30);
  --shadow-md: 0 4px 6px -2px rgb(0 0 0 / 0.45), 0 2px 4px -2px rgb(0 0 0 / 0.35);
  --shadow-lg: 0 12px 24px -6px rgb(0 0 0 / 0.50), 0 4px 8px -4px rgb(0 0 0 / 0.40);
  --shadow-xl: 0 24px 48px -12px rgb(0 0 0 / 0.60);
}

/* ---------- 2. RESET + BASE ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--fg-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 200ms ease, color 200ms ease;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ring-focus) 40%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 3. LAYOUT ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 32px;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 48px;
  }
}

.container-narrow {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container-narrow {
    padding: 0 32px;
  }
}

section {
  padding: 80px 0;
}

@media (min-width: 1024px) {
  section {
    padding: 112px 0;
  }
}

/* ---------- 4. TIPOGRAFÍA ---------- */
.t-overline {
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  margin: 0;
}

.t-display-lg {
  font-size: clamp(2.5rem, 5vw + 1rem, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0;
}

.t-h1 {
  font-size: clamp(1.875rem, 2vw + 1rem, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0;
}

.t-h2 {
  font-size: clamp(1.5rem, 1.5vw + 1rem, 1.875rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0;
}

.t-h3 {
  font-size: 1.25rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0;
}

.t-h4 {
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 600;
  margin: 0;
}

.t-body-lg {
  font-size: 1.125rem;
  line-height: 1.55;
}

.t-body {
  font-size: 1rem;
  line-height: 1.55;
}

.t-body-sm {
  font-size: 0.875rem;
  line-height: 1.5;
}

.t-caption {
  font-size: 0.8125rem;
  line-height: 1.45;
}

.t-label {
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.section-header {
  max-width: 720px;
  margin: 0 auto 64px;
  text-align: center;
}

.section-header .t-overline {
  margin-bottom: 12px;
  display: block;
}

.section-header h2 {
  margin: 0 0 16px;
}

.section-header p {
  color: var(--fg-secondary);
  font-size: 18px;
  line-height: 1.55;
  margin: 0;
}

/* ---------- 5. NAV ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-surface) 75%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.025em;
  color: var(--fg-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-on-brand);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: none;
  gap: 4px;
  align-items: center;
}

@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-secondary);
  text-decoration: none;
  transition: all 120ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--fg-primary);
  background: var(--bg-muted);
}

.nav-link.active {
  color: var(--fg-primary);
  background: var(--bg-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Mobile menu */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  cursor: pointer;
  color: var(--fg-secondary);
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle svg {
  width: 18px;
  height: 18px;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--bg-surface);
  padding: 24px;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  animation: slideDown 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu .nav-link {
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 8px;
}

.mobile-menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 12px 0;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  cursor: pointer;
  color: var(--fg-secondary);
  transition: all 120ms ease;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--fg-primary);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* ---------- 6. BOTONES ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  font: 500 14px 'Inter', sans-serif;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 120ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 16px;
}

.btn-xl {
  height: 56px;
  padding: 0 32px;
  font-size: 16px;
  font-weight: 600;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-primary {
  background: var(--brand-bg);
  color: var(--fg-on-brand);
}

.btn-primary:hover {
  background: var(--brand-bg-hover);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--fg-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--bg-muted);
}

.btn-tertiary {
  background: transparent;
  color: var(--fg-primary);
}

.btn-tertiary:hover {
  background: var(--bg-muted);
}

.btn-accent {
  background: var(--accent-bg);
  color: var(--accent-fg);
  font-weight: 600;
}

.btn-accent:hover {
  background: var(--accent-bg-hover);
  box-shadow: var(--shadow-sm);
}

.btn-block {
  width: 100%;
}

/* ---------- 7. CARDS ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

/* ---------- 8. FORM ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-secondary);
}

.field-required {
  color: var(--danger-fg);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0 12px;
  background: var(--bg-surface-sunken);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--fg-primary);
  font: 400 14px 'Inter', sans-serif;
  transition: all 120ms ease;
}

.input,
.select {
  height: 40px;
}

.textarea {
  padding: 12px;
  min-height: 120px;
  resize: vertical;
  line-height: 1.55;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--fg-tertiary);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--border-strong);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: 3px solid color-mix(in srgb, var(--ring-focus) 30%, transparent);
  outline-offset: 0;
  border-color: var(--brand-bg);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  background: var(--bg-muted);
  color: var(--fg-disabled);
  cursor: not-allowed;
}

.field-helper {
  font-size: 13px;
  color: var(--fg-tertiary);
}

.field-error {
  font-size: 13px;
  color: var(--danger-fg);
}

/* ---------- 9. BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font: 500 12px 'Inter', sans-serif;
  letter-spacing: 0.02em;
}

.badge-neutral {
  background: var(--bg-muted);
  color: var(--fg-secondary);
}

.badge-brand {
  background: var(--brand-bg-subtle);
  color: var(--brand-fg);
}

.badge-success {
  background: var(--success-bg-subtle);
  color: var(--success-fg);
}

.badge-warning {
  background: var(--warning-bg-subtle);
  color: var(--warning-fg);
}

.badge-danger {
  background: var(--danger-bg-subtle);
  color: var(--danger-fg);
}

.badge-pill {
  border-radius: 9999px;
  padding: 4px 10px;
}

/* ---------- 10. CALLOUT BOXES ---------- */
.callout {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  border-left: 3px solid var(--info-bg);
  background: var(--info-bg-subtle);
  margin: 24px 0;
}

.callout-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--info-fg);
  margin-top: 2px;
}

.callout-body {
  flex: 1;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-secondary);
}

.callout-body strong {
  color: var(--fg-primary);
}

.callout-info {
  border-color: var(--info-bg);
  background: var(--info-bg-subtle);
}

.callout-info .callout-icon {
  color: var(--info-fg);
}

.callout-success {
  border-color: var(--success-bg);
  background: var(--success-bg-subtle);
}

.callout-success .callout-icon {
  color: var(--success-fg);
}

.callout-warning {
  border-color: var(--warning-bg);
  background: var(--warning-bg-subtle);
}

.callout-warning .callout-icon {
  color: var(--warning-fg);
}

.callout-danger {
  border-color: var(--danger-bg);
  background: var(--danger-bg-subtle);
}

.callout-danger .callout-icon {
  color: var(--danger-fg);
}

/* ---------- 11. PAGE HEADER ---------- */
.page-header {
  padding: 128px 0 48px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, black 0%, transparent 80%);
  opacity: 0.5;
  pointer-events: none;
}

.page-header>* {
  position: relative;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-tertiary);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--fg-tertiary);
  text-decoration: none;
  transition: color 120ms;
}

.breadcrumb a:hover {
  color: var(--fg-primary);
}

.breadcrumb svg {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

.page-header h1 {
  margin: 0 0 12px;
}

.page-header .lead {
  color: var(--fg-secondary);
  font-size: 18px;
  line-height: 1.55;
  max-width: 640px;
  margin: 0;
}

.page-header-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--fg-tertiary);
}

.page-header-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: var(--border-strong);
}

/* ---------- 12. PROSE (contenido legal/largo) ---------- */
.prose {
  color: var(--fg-secondary);
  font-size: 16px;
  line-height: 1.7;
  max-width: 720px;
}

.prose h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--fg-primary);
  margin: 48px 0 16px;
  scroll-margin-top: 96px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--fg-primary);
  margin: 32px 0 12px;
  scroll-margin-top: 96px;
}

.prose h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-primary);
  margin: 24px 0 8px;
}

.prose p {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  margin: 16px 0;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 8px;
}

.prose li strong {
  color: var(--fg-primary);
}

.prose a {
  color: var(--brand-fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 120ms;
}

.prose a:hover {
  color: var(--brand-bg-hover);
}

.prose strong {
  color: var(--fg-primary);
  font-weight: 600;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 32px 0;
}

/* ---------- 13. LEGAL LAYOUT (sidebar + prose) ---------- */
.legal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: 64px 0;
}

@media (min-width: 1024px) {
  .legal-layout {
    grid-template-columns: 240px 1fr;
    gap: 64px;
  }
}

.toc {
  position: sticky;
  top: 96px;
  align-self: start;
  font-size: 13px;
  display: none;
}

@media (min-width: 1024px) {
  .toc {
    display: block;
  }
}

.toc-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border-subtle);
}

.toc-list a {
  display: block;
  padding: 6px 12px;
  color: var(--fg-tertiary);
  text-decoration: none;
  transition: all 120ms;
  border-left: 1px solid transparent;
  margin-left: -1px;
}

.toc-list a:hover {
  color: var(--fg-primary);
}

.toc-list a.active {
  color: var(--brand-fg);
  border-left-color: var(--brand-bg);
  font-weight: 500;
}

/* ---------- 14. FOOTER ---------- */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  margin-bottom: 48px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  }
}

.footer-brand p {
  color: var(--fg-tertiary);
  font-size: 14px;
  line-height: 1.6;
  margin: 16px 0 0;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  margin: 0 0 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  color: var(--fg-tertiary);
  font-size: 14px;
  text-decoration: none;
  transition: color 120ms;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-col a:hover {
  color: var(--fg-primary);
}

.footer-col .footer-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--success-fg);
}

.footer-col .footer-status .pulse {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--success-bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success-bg) 25%, transparent);
  animation: pulse 2s ease-in-out infinite;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--fg-tertiary);
}

/* ---------- 15. ANIMACIONES ---------- */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-up-delay-1 {
  animation-delay: 80ms;
}

.fade-up-delay-2 {
  animation-delay: 160ms;
}

.fade-up-delay-3 {
  animation-delay: 240ms;
}

.fade-up-delay-4 {
  animation-delay: 320ms;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---------- 16. ARTICLE / DOCS LAYOUT ---------- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: 48px 0;
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: 240px 1fr 220px;
    gap: 64px;
  }
}

@media (min-width: 1280px) {
  .article-layout {
    grid-template-columns: 260px 1fr 240px;
    gap: 80px;
  }
}

.article-sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  font-size: 14px;
  display: none;
}

@media (min-width: 1024px) {
  .article-sidebar {
    display: block;
  }
}

.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  margin: 0 0 12px;
  padding-left: 12px;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-list a {
  display: block;
  padding: 7px 12px;
  color: var(--fg-secondary);
  text-decoration: none;
  transition: all 120ms;
  border-radius: 6px;
  line-height: 1.4;
}

.sidebar-list a:hover {
  background: var(--bg-muted);
  color: var(--fg-primary);
}

.sidebar-list a.active {
  background: var(--brand-bg-subtle);
  color: var(--brand-fg);
  font-weight: 500;
}

.article-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  font-size: 13px;
  display: none;
}

@media (min-width: 1024px) {
  .article-toc {
    display: block;
  }
}

.article-toc-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  margin: 0 0 12px;
}

.article-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border-subtle);
}

.article-toc a {
  display: block;
  padding: 6px 12px;
  color: var(--fg-tertiary);
  text-decoration: none;
  transition: all 120ms;
  border-left: 1px solid transparent;
  margin-left: -1px;
}

.article-toc a:hover {
  color: var(--fg-primary);
}

.article-toc a.active {
  color: var(--brand-fg);
  border-left-color: var(--brand-bg);
  font-weight: 500;
}

.article-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: var(--fg-tertiary);
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.article-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 9999px;
  background: var(--border-strong);
}

.article-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-muted);
  border-radius: 4px;
  font-size: 12px;
  color: var(--fg-secondary);
  font-weight: 500;
}

.article-feedback {
  margin: 64px 0 32px;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  text-align: center;
}

.article-feedback h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.article-feedback-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.article-nav {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .article-nav {
    grid-template-columns: 1fr 1fr;
  }
}

.article-nav-link {
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-nav-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.article-nav-link .label {
  font-size: 12px;
  color: var(--fg-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.article-nav-link .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-primary);
}

.article-nav-link.next {
  text-align: right;
}

.article-nav-link.next .label {
  justify-content: flex-end;
}

.prose pre {
  background: var(--bg-surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0;
}

.prose code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  background: var(--bg-muted);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--fg-primary);
}

.prose pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

.prose blockquote {
  margin: 24px 0;
  padding: 8px 0 8px 20px;
  border-left: 3px solid var(--brand-bg);
  color: var(--fg-primary);
  font-size: 17px;
  line-height: 1.6;
  font-style: italic;
}

.prose blockquote p {
  margin: 0;
}

.prose figure {
  margin: 24px 0;
}

.prose figure img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.prose figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--fg-tertiary);
  text-align: center;
}

.prose .step-list {
  counter-reset: step;
  padding: 0;
  list-style: none;
  margin: 24px 0;
}

.prose .step-list>li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  padding-bottom: 16px;
  margin: 0;
}

.prose .step-list>li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: var(--brand-bg);
  color: var(--fg-on-brand);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 17. BLOG ---------- */
.blog-hero {
  padding-top: 128px;
  padding-bottom: 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--border-subtle) 1px, transparent 1px), linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 0%, transparent 80%);
  opacity: 0.5;
  pointer-events: none;
}

.blog-hero>* {
  position: relative;
}

.blog-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
}

.blog-category-pill {
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  font: 500 13px 'Inter';
  color: var(--fg-secondary);
  text-decoration: none;
  transition: all 120ms ease;
}

.blog-category-pill:hover {
  border-color: var(--border-strong);
  color: var(--fg-primary);
}

.blog-category-pill.active {
  background: var(--fg-primary);
  color: var(--bg-canvas);
  border-color: var(--fg-primary);
}

.blog-featured {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  margin-bottom: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 1024px) {
  .blog-featured {
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    align-items: center;
  }
}

.blog-featured-image {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--brand-bg-subtle) 0%, var(--accent-bg) 100%);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-featured-image-svg {
  max-width: 70%;
  max-height: 70%;
  opacity: 0.9;
}

.blog-featured-content .badge {
  margin-bottom: 12px;
}

.blog-featured-content h2 {
  font-size: clamp(1.5rem, 2vw + 1rem, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--fg-primary);
}

.blog-featured-content p.excerpt {
  color: var(--fg-secondary);
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.blog-featured-content .author-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.blog-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.blog-card-image {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--brand-bg-subtle), var(--bg-muted));
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
}

.blog-card-image-svg {
  max-width: 60%;
  max-height: 60%;
  opacity: 0.85;
}

.blog-card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-content .badge {
  margin-bottom: 8px;
  align-self: flex-start;
}

.blog-card-content h3 {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.blog-card-content p {
  color: var(--fg-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--fg-tertiary);
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.blog-card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 9999px;
  background: var(--border-strong);
}

.author-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: var(--brand-bg);
  color: var(--fg-on-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.author-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-primary);
}

.author-meta {
  font-size: 12px;
  color: var(--fg-tertiary);
}

.blog-article-hero {
  padding: 128px 0 48px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.blog-article-hero h1 {
  font-size: clamp(1.875rem, 2vw + 1rem, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 16px 0;
  max-width: 760px;
}

.blog-article-hero .lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--fg-secondary);
  max-width: 720px;
  margin: 0;
}

/* ---------- 18. UTILITIES ---------- */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.gap-6 {
  gap: 24px;
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 8px;
}

.mt-4 {
  margin-top: 16px;
}

.mt-6 {
  margin-top: 24px;
}

.mt-8 {
  margin-top: 32px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-6 {
  margin-bottom: 24px;
}

.mb-8 {
  margin-bottom: 32px;
}

.text-tertiary {
  color: var(--fg-tertiary);
}

.text-secondary {
  color: var(--fg-secondary);
}

.text-brand {
  color: var(--brand-fg);
}

.text-success {
  color: var(--success-fg);
}

.text-danger {
  color: var(--danger-fg);
}

.text-warning {
  color: var(--warning-fg);
}

/* ---------- 17. ARTÍCULO: layout y componentes editoriales ---------- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: 48px 0 96px;
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: 240px minmax(0, 1fr) 240px;
    gap: 64px;
  }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .article-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .article-layout .toc {
    display: none;
  }
}

.article-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .article-sidebar {
    display: block;
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 8px;
  }
}

.article-sidebar-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  margin: 0 0 12px;
  padding: 0 12px;
}

.article-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.article-sidebar a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--fg-secondary);
  text-decoration: none;
  transition: all 120ms;
  line-height: 1.4;
}

.article-sidebar a:hover {
  background: var(--bg-muted);
  color: var(--fg-primary);
}

.article-sidebar a.active {
  background: var(--brand-bg-subtle);
  color: var(--brand-fg);
  font-weight: 500;
}

.article-main {
  max-width: 720px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--fg-tertiary);
  margin-bottom: 16px;
}

.article-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 9999px;
  background: var(--border-strong);
}

.article-meta .badge {
  font-size: 11px;
}

.article-title {
  font-size: clamp(1.875rem, 2vw + 1rem, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--fg-primary);
}

.article-lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-secondary);
  margin: 0 0 32px;
}

.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin: 32px 0;
}

.byline-avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: var(--brand-bg);
  color: var(--fg-on-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.byline-info {
  flex: 1;
  min-width: 0;
}

.byline-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-primary);
}

.byline-role {
  font-size: 13px;
  color: var(--fg-tertiary);
}

.article-body {
  color: var(--fg-secondary);
  font-size: 17px;
  line-height: 1.7;
}

.article-body>*+* {
  margin-top: 24px;
}

.article-body h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--fg-primary);
  margin-top: 48px;
  scroll-margin-top: 96px;
}

.article-body h3 {
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--fg-primary);
  margin-top: 32px;
  scroll-margin-top: 96px;
}

.article-body p {
  margin: 0;
}

.article-body strong {
  color: var(--fg-primary);
  font-weight: 600;
}

.article-body a {
  color: var(--brand-fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: var(--brand-bg-hover);
}

.article-body ul,
.article-body ol {
  margin: 0;
  padding-left: 24px;
}

.article-body li+li {
  margin-top: 8px;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 48px 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 24px 0 !important;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.steps>li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  align-items: start;
  padding: 0 !important;
}

.steps>li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: var(--brand-bg);
  color: var(--fg-on-brand);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
  flex-shrink: 0;
}

.steps>li>* {
  margin: 0 !important;
  grid-column: 2;
}

.steps>li>*:first-child {
  font-weight: 600;
  color: var(--fg-primary);
  font-size: 16px;
}

.steps>li>*:not(:first-child) {
  margin-top: 8px !important;
  font-size: 15px;
  line-height: 1.55;
}

.steps strong {
  color: var(--fg-primary);
}

.code-block {
  background: var(--bg-surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-primary);
  overflow-x: auto;
  margin: 24px 0;
}

.code-block .comment {
  color: var(--fg-tertiary);
}

.code-block .string {
  color: var(--success-fg);
}

.code-block .keyword {
  color: var(--brand-fg);
}

.article-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--bg-muted);
  border-radius: 4px;
  color: var(--fg-primary);
  border: 1px solid var(--border-subtle);
}

.article-body pre code {
  padding: 0;
  background: transparent;
  border: none;
  font-size: 13px;
}

.figure {
  margin: 32px 0;
}

.figure-img {
  background: var(--bg-surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
  color: var(--fg-tertiary);
  background-image:
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 24px 24px;
  position: relative;
  overflow: hidden;
}

.figure-caption {
  font-size: 13px;
  color: var(--fg-tertiary);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
  font-style: italic;
}

.ui-mock {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.ui-mock-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.ui-mock-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--border-default);
}

.ui-mock-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-secondary);
  margin-left: 4px;
}

.ui-mock-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}

.ui-mock-row+.ui-mock-row {
  border-top: 1px dashed var(--border-subtle);
}

.ui-mock-row .label {
  color: var(--fg-secondary);
}

.ui-mock-row .value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--fg-primary);
}

.article-quote {
  border-left: 3px solid var(--brand-bg);
  padding: 8px 0 8px 24px;
  margin: 32px 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-primary);
  font-weight: 500;
}

.article-quote cite {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  font-style: normal;
  color: var(--fg-tertiary);
  font-weight: 400;
}

.article-feedback {
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  text-align: center;
  margin-top: 48px;
}

.article-feedback h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}

.article-feedback-buttons {
  display: inline-flex;
  gap: 8px;
}

.feedback-btn {
  padding: 8px 16px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 120ms;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-secondary);
}

.feedback-btn:hover {
  border-color: var(--border-strong);
  color: var(--fg-primary);
}

.feedback-btn.selected {
  background: var(--brand-bg);
  color: var(--fg-on-brand);
  border-color: var(--brand-bg);
}

.feedback-btn svg {
  width: 16px;
  height: 16px;
}

.related-articles {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border-subtle);
}

.related-articles h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  margin: 0 0 16px;
}

.related-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .related-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.related-card .meta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}

.related-card .title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-primary);
  line-height: 1.3;
}

.article-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  display: none;
}

@media (min-width: 1200px) {
  .article-toc {
    display: block;
  }
}

.article-toc-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  margin: 0 0 12px;
}

.article-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid var(--border-subtle);
}

.article-toc li.depth-3 {
  padding-left: 16px;
}

.article-toc a {
  display: block;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--fg-tertiary);
  text-decoration: none;
  line-height: 1.4;
  border-left: 1px solid transparent;
  margin-left: -1px;
  transition: all 120ms;
}

.article-toc a:hover {
  color: var(--fg-primary);
}

.article-toc a.active {
  color: var(--brand-fg);
  border-left-color: var(--brand-bg);
  font-weight: 500;
}

/* ---------- 18. CATEGORY INDEX (centro de ayuda) ---------- */
.help-category-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .help-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.help-article-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.help-article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.help-article-card .title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-primary);
  line-height: 1.35;
}

.help-article-card .desc {
  font-size: 13px;
  color: var(--fg-secondary);
  line-height: 1.5;
  flex: 1;
}

.help-article-card .meta {
  font-size: 12px;
  color: var(--fg-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.help-article-card .meta svg {
  width: 12px;
  height: 12px;
}

/* ---------- 19. BLOG INDEX ---------- */
.blog-featured {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 48px;
  align-items: center;
}

@media (min-width: 768px) {
  .blog-featured {
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    padding: 48px;
  }
}

.blog-featured-thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--brand-bg-subtle) 0%, var(--bg-surface-sunken) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-fg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  position: relative;
  overflow: hidden;
}

.blog-featured-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--brand-bg) 15%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--brand-bg) 15%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 90%);
}

.blog-featured-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--fg-tertiary);
  margin-bottom: 12px;
}

.blog-featured-title {
  font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 12px;
}

.blog-featured-title a {
  color: var(--fg-primary);
  text-decoration: none;
}

.blog-featured-title a:hover {
  color: var(--brand-fg);
}

.blog-featured-excerpt {
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-secondary);
  margin: 0 0 16px;
}

.blog-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 200ms ease;
  padding-bottom: 20px;
}

.blog-card:hover {
  transform: translateY(-2px);
}

.blog-card:hover .blog-card-title {
  color: var(--brand-fg);
}

.blog-card-thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-tertiary);
  position: relative;
  overflow: hidden;
}

.blog-card-thumb svg {
  width: 36px;
  height: 36px;
  opacity: 0.4;
}

.blog-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--fg-tertiary);
  flex-wrap: wrap;
  padding: 0 20px;
}

.blog-card-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg-primary);
  transition: color 120ms;
  padding: 0 20px;
}

.blog-card-excerpt {
  font-size: 14px;
  color: var(--fg-secondary);
  line-height: 1.55;
  padding: 0 20px;
}

.blog-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 32px;
  overflow-x: auto;
}

.blog-tab {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font: 500 14px 'Inter';
  color: var(--fg-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 120ms;
}

.blog-tab:hover {
  background: var(--bg-muted);
  color: var(--fg-primary);
}

.blog-tab.active {
  background: var(--bg-muted);
  color: var(--fg-primary);
  font-weight: 600;
}