/* ============================================
   BIOINFINITO — Design System
   Dark futurista · biología molecular · datos
   ============================================ */

/* ---------- 1. Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.4vw + 0.9rem, 1.0625rem);
  line-height: 1.65;
  color: var(--color-text);
  background:
    radial-gradient(ellipse 90% 55% at 85% -5%,   rgba(0, 255, 178, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at -8% 58%,   rgba(100, 30, 240, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 75% 55% at 92% 105%,  rgba(15, 70, 255, 0.20) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 50% 50%,   rgba(0, 140, 110, 0.08) 0%, transparent 55%),
    linear-gradient(155deg, #152a50 0%, #0f2040 35%, #0d1a3a 60%, #111035 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
ul, ol { list-style: none; }

/* ---------- 2. Tokens ---------- */
:root {
  /* Color · paleta biohacking (cosmic navy) */
  --color-bg: #0f2040;
  --color-bg-2: #142848;
  --color-surface: #1c3158;
  --color-surface-2: #243b68;
  --color-border: rgba(255, 255, 255, 0.10);
  --color-border-strong: rgba(255, 255, 255, 0.20);

  --color-text: #eef3ff;
  --color-text-dim: #b8c4de;
  --color-text-muted: #8a96b8;

  /* Acentos */
  --color-bio: #00FFB2;          /* verde-cian molecular (life) */
  --color-bio-soft: #00d99a;
  --color-tech: #3D7BFF;         /* azul electric (data/tech) */
  --color-tech-soft: #6694ff;
  --color-warn: #FFB347;         /* longevidad / advertencia */
  --color-danger: #FF5470;       /* alertas / tóxicos */

  /* Glows */
  --glow-bio: 0 0 32px rgba(0, 255, 178, 0.35);
  --glow-tech: 0 0 32px rgba(61, 123, 255, 0.4);
  --glow-soft: 0 4px 30px rgba(0, 0, 0, 0.4);

  /* Tipografía */
  --font-display: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Espaciado (escala 4px) */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;
  --s-4: 1rem;     --s-5: 1.25rem;  --s-6: 1.5rem;
  --s-8: 2rem;     --s-10: 2.5rem;  --s-12: 3rem;
  --s-16: 4rem;    --s-20: 5rem;    --s-24: 6rem;
  --s-32: 8rem;

  /* Radios */
  --r-sm: 6px;  --r-md: 12px;  --r-lg: 20px;  --r-xl: 28px;  --r-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.5);

  /* Animación */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 150ms;
  --t-base: 280ms;
  --t-slow: 600ms;

  /* Anchos */
  --w-prose: 68ch;
  --w-container: 1240px;
  --w-narrow: 920px;
}

/* ---------- 3. Tipografía ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fff;
}

h1 { font-size: clamp(2.4rem, 5vw + 1rem, 5rem); font-weight: 800; }
h2 { font-size: clamp(1.85rem, 3vw + 0.6rem, 3.2rem); }
h3 { font-size: clamp(1.35rem, 1.5vw + 0.6rem, 1.85rem); letter-spacing: -0.015em; }
h4 { font-size: clamp(1.1rem, 0.7vw + 0.85rem, 1.3rem); }

p { color: var(--color-text-dim); }
strong { color: #fff; font-weight: 600; }
em { color: var(--color-bio); font-style: normal; }

a:hover { color: var(--color-bio); }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: rgba(0, 255, 178, 0.08);
  color: var(--color-bio);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

mark {
  background: linear-gradient(120deg, transparent 0%, rgba(0, 255, 178, 0.25) 50%, transparent 100%);
  color: #fff;
  padding: 0 0.15em;
}

::selection { background: var(--color-bio); color: #000; }

/* ---------- 4. Layout ---------- */
.container {
  width: 100%;
  max-width: var(--w-container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}
.container--narrow { max-width: var(--w-narrow); }

section { padding-block: clamp(4rem, 8vw, 7rem); position: relative; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-bio);
  margin-bottom: var(--s-4);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-bio);
  box-shadow: 0 0 10px var(--color-bio);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.lead {
  font-size: clamp(1.05rem, 0.5vw + 1rem, 1.25rem);
  color: var(--color-text);
  max-width: 56ch;
  line-height: 1.55;
}

/* ---------- 5. Navbar ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  background: rgba(10, 18, 38, 0.6);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.nav--scrolled {
  background: rgba(10, 18, 38, 0.92);
  box-shadow: 0 4px 32px rgba(0,0,0,0.4);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 3rem);
  height: 68px;
}
.nav__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: #fff;
}
.nav__logo-mark {
  display: inline-block;
  width: 28px; height: 28px;
  background:
    radial-gradient(circle at 35% 35%, var(--color-bio), transparent 60%),
    radial-gradient(circle at 70% 65%, var(--color-tech), transparent 60%);
  border-radius: 50%;
  box-shadow: var(--glow-bio);
  position: relative;
}
.nav__logo-mark::after {
  content: "";
  position: absolute; inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
}
.nav__logo span { color: var(--color-bio); }

.nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}
.nav__menu a {
  color: var(--color-text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--t-fast);
}
.nav__menu a:hover { color: #fff; }

.nav__cta {
  padding: 0.55rem 1.1rem;
  border-radius: var(--r-full);
  background: var(--color-bio);
  color: #001a10 !important;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--t-base) var(--ease);
}
.nav__cta:hover {
  background: #fff;
  box-shadow: var(--glow-bio);
  transform: translateY(-1px);
}

/* ---------- Nav · Dropdown Categorías ---------- */
.nav__dropdown {
  position: relative;
  display: inline-block;
}
/* Puente invisible que cubre el gap entre el toggle y el panel
   para que el hover no se rompa al cruzar (desktop). */
.nav__dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 18px;
  background: transparent;
  pointer-events: none;
}
.nav__dropdown:hover::after,
.nav__dropdown:focus-within::after {
  pointer-events: auto;
}
.nav__dropdown-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.nav__dropdown-link {
  color: var(--color-text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--t-fast);
  padding: 0 2px;
}
.nav__dropdown-link:hover {
  color: #fff;
}
.nav__dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  padding: 0 2px;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color var(--t-fast);
}
.nav__dropdown-toggle:hover,
.nav__dropdown-toggle[aria-expanded="true"] {
  color: #fff;
}
.nav__dropdown-toggle svg {
  transition: transform var(--t-base) var(--ease);
  opacity: 0.6;
}
.nav__dropdown-toggle[aria-expanded="true"] svg,
.nav__dropdown:hover .nav__dropdown-toggle svg {
  transform: rotate(180deg);
  opacity: 1;
}

.nav__dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(720px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: var(--s-3);
  background: rgba(14, 20, 36, 0.96);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease), visibility 200ms;
  z-index: 110;
}
.nav__dropdown-panel--sm {
  width: min(340px, calc(100vw - 32px));
  grid-template-columns: 1fr;
}

.nav__dropdown:hover .nav__dropdown-panel,
.nav__dropdown-panel.is-open,
.nav__dropdown-toggle[aria-expanded="true"] + .nav__dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav__dropdown-panel::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: rgba(14, 20, 36, 0.96);
  border-left: 1px solid var(--color-border-strong);
  border-top: 1px solid var(--color-border-strong);
}
.nav__dropdown-panel a {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--t-fast);
  position: relative;
}
.nav__dropdown-panel a:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--color-border);
  color: #fff;
}
.nav__dropdown-panel a:hover .nav__dropdown-icon {
  transform: scale(1.1);
  box-shadow: 0 0 16px var(--cat-color, var(--color-bio));
}
.nav__dropdown-icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  color: var(--cat-color, var(--color-bio));
  font-size: 1rem;
  transition: all var(--t-base) var(--ease);
}
.nav__dropdown-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
  min-width: 0;
}
.nav__dropdown-text strong {
  font-size: 0.92rem;
  color: #fff;
  font-weight: 600;
}
.nav__dropdown-text span {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
}

/* Mobile: dropdown se vuelve acordeón inline dentro del menu vertical */
@media (max-width: 860px) {
  .nav__dropdown { width: 100%; }
  .nav__dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    padding: var(--s-2) 0;
    font-size: 1.05rem;
    color: #fff;
  }
  .nav__dropdown-panel {
    position: static;
    transform: none;
    width: 100%;
    grid-template-columns: 1fr;
    margin-top: var(--s-2);
    background: rgba(255,255,255,0.02);
    box-shadow: none;
    border: 1px solid var(--color-border);
    max-height: 0;
    padding: 0;
    overflow: hidden;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: max-height 280ms var(--ease), padding 280ms var(--ease);
  }
  .nav__dropdown-panel::before { display: none; }
  .nav__dropdown:hover .nav__dropdown-panel { max-height: 0; padding: 0; }
  .nav__dropdown-toggle[aria-expanded="true"] + .nav__dropdown-panel,
  .nav__dropdown-panel.is-open {
    max-height: 1200px;
    padding: var(--s-3);
    transform: none;
  }
}

.nav__toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--color-border);
  align-items: center;
  justify-content: center;
}
.nav__toggle span {
  width: 18px; height: 1.5px;
  background: #fff;
  position: relative;
}
.nav__toggle span::before, .nav__toggle span::after {
  content: ""; position: absolute; left: 0;
  width: 18px; height: 1.5px; background: #fff;
}
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }

@media (max-width: 980px) {
  .nav__menu { display: none; }
  .nav__menu.is-open {
    display: flex;
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    background: rgba(15, 23, 41, 0.95);
    backdrop-filter: blur(18px);
    padding: var(--s-6);
    gap: var(--s-4);
    border-bottom: 1px solid var(--color-border);
    align-items: stretch;
  }
  .nav__menu.is-open a { font-size: 1.1rem; }
  .nav__menu.is-open .nav__search-btn {
    width: 100%;
    justify-content: flex-start;
    padding: var(--s-2) 0;
  }
  .nav__toggle { display: inline-flex; }
}

/* ---------- Search button (lupa en header) ---------- */
.nav__search-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.4rem 0.7rem;
  border-radius: var(--r-md);
  border: 1px solid var(--color-border);
  background: rgba(255,255,255,0.03);
  color: var(--color-text-dim);
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t-fast);
}
.nav__search-btn:hover {
  border-color: var(--color-bio);
  color: var(--color-bio);
  background: rgba(0,255,178,0.05);
}
.nav__search-kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}
@media (max-width: 980px) {
  .nav__search-kbd { display: none; }
}

/* ---------- Search Overlay ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 41, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  padding-top: clamp(60px, 12vh, 120px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
}
.search-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.search-modal {
  width: min(680px, calc(100vw - 32px));
  height: max-content;
  max-height: calc(100vh - 24vh);
  display: flex;
  flex-direction: column;
  background: rgba(14, 20, 36, 0.98);
  backdrop-filter: blur(24px);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  transform: translateY(-12px) scale(0.98);
  transition: transform 240ms var(--ease);
  overflow: hidden;
}
.search-overlay.is-open .search-modal { transform: translateY(0) scale(1); }

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--color-border);
}
.search-input-wrap svg {
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 1.05rem;
  color: #fff;
}
.search-input::placeholder { color: var(--color-text-muted); }
.search-close {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.search-close:hover {
  color: var(--color-bio);
  border-color: var(--color-bio);
  background: rgba(0,255,178,0.08);
}

.search-results {
  overflow-y: auto;
  padding: var(--s-2);
  flex: 1;
  min-height: 80px;
}
.search-result {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--color-text);
  transition: background var(--t-fast);
}
.search-result:hover,
.search-result.is-active {
  background: rgba(0,255,178,0.06);
  color: #fff;
}
.search-result__type {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--r-full);
  background: rgba(0,255,178,0.08);
  border: 1px solid rgba(0,255,178,0.2);
  color: var(--color-bio);
  flex-shrink: 0;
  min-width: 60px;
  text-align: center;
  font-weight: 600;
}
.search-result__type[data-k="cat"] { background: rgba(255,179,71,0.08); border-color: rgba(255,179,71,0.2); color: var(--color-warn); }
.search-result__type[data-k="tool"] { background: rgba(61,123,255,0.1); border-color: rgba(61,123,255,0.25); color: var(--color-tech-soft); }
.search-result__type[data-k="legal"] { background: rgba(255,255,255,0.04); border-color: var(--color-border); color: var(--color-text-muted); }
.search-result__type[data-k="page"] { background: rgba(192,132,252,0.08); border-color: rgba(192,132,252,0.2); color: #c084fc; }
.search-result__body {
  flex: 1;
  min-width: 0;
}
.search-result__body strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.search-result__body span {
  font-size: 0.82rem;
  color: var(--color-text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result.is-active .search-result__body strong { color: var(--color-bio); }
.search-result__arrow {
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.search-result.is-active .search-result__arrow { opacity: 1; color: var(--color-bio); }

.search-empty {
  padding: var(--s-8) var(--s-4);
  text-align: center;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.search-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}
.search-footer kbd {
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--color-border);
  color: var(--color-text-dim);
  font-size: 0.72rem;
}

@media (max-width: 640px) {
  .search-overlay { padding-top: 0; }
  .search-modal {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
  }
  .search-footer { display: none; }
}

/* ---------- 6. Hero ---------- */
.hero__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero__split .hero__badge { margin-bottom: var(--s-5); }
.hero__split h1,
.hero__split .hero__sub { text-align: left; }
.hero__split .hero__cta { justify-content: flex-start; }
.hero__split .hero__metrics { margin-top: clamp(2rem, 4vw, 3.5rem); }

.hero__split-visual {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 4/5;
  box-shadow: 0 0 80px rgba(0,255,178,0.12), 0 40px 80px rgba(0,0,0,0.5);
}
.hero__split-visual img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hero__split-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
  border: 1px solid rgba(0,255,178,0.25);
  pointer-events: none;
}
.hero__split-visual-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse at 50% 60%, rgba(0,255,178,0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}
@media (max-width: 900px) {
  .hero__split {
    grid-template-columns: 1fr;
  }
  .hero__split-visual {
    aspect-ratio: 16/9;
    max-height: 300px;
    order: -1;
  }
  .hero__split h1,
  .hero__split .hero__sub { text-align: center; }
  .hero__split .hero__cta { justify-content: center; }
}

.hero {
  position: relative;
  padding-top: 140px;
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
  isolation: isolate;
}
.hero__shader {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    radial-gradient(ellipse at center, rgba(15, 23, 41,0.85) 0%, rgba(15, 23, 41,0.35) 35%, transparent 70%),
    url('/assets/img/hero-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
  mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
}
.hero__shader::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(15, 23, 41,0.55) 75%, rgba(15, 23, 41,0.95) 100%);
  pointer-events: none;
}
@media (max-width: 720px) {
  .hero__shader {
    background-position: center 30%;
    background-size: 200% auto;
  }
}
.hero__shapes {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.shape {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--shape-color, rgba(0, 255, 178, 0.12)), transparent 70%);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2), inset 0 0 30px rgba(255,255,255,0.04);
  animation: float 14s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(20px) rotate(calc(var(--rot, 0deg) + 4deg)); }
}

.hero__content {
  text-align: center;
  max-width: 920px;
  margin-inline: auto;
  position: relative;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border-strong);
  font-size: 0.85rem;
  color: var(--color-text-dim);
  margin-bottom: var(--s-8);
  backdrop-filter: blur(8px);
}
.hero__badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-bio);
  box-shadow: 0 0 10px var(--color-bio);
}

.hero h1 {
  margin-bottom: var(--s-6);
}
.hero h1 .gradient {
  background: linear-gradient(135deg, var(--color-bio) 0%, var(--color-tech) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.hero__sub {
  font-size: clamp(1.1rem, 0.6vw + 1rem, 1.35rem);
  color: var(--color-text-dim);
  max-width: 680px;
  margin: 0 auto var(--s-10);
  line-height: 1.55;
}

.hero__cta {
  display: flex;
  gap: var(--s-3);
  justify-content: center;
  flex-wrap: wrap;
}

.hero__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-6);
  margin-top: clamp(3rem, 6vw, 5rem);
  max-width: 760px;
  margin-inline: auto;
  padding-top: var(--s-8);
  border-top: 1px solid var(--color-border);
}
.hero__metric { text-align: center; }
.hero__metric strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.5vw + 1rem, 2.4rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-bio), var(--color-tech));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__metric span {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- 7. Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.85rem 1.6rem;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--t-base) var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(135deg, var(--color-bio), var(--color-bio-soft));
  color: #001a10;
  box-shadow: 0 4px 20px rgba(0, 255, 178, 0.3);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 255, 178, 0.45);
  color: #001a10;
}
.btn--ghost {
  border-color: var(--color-border-strong);
  color: #fff;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--color-bio);
  color: #fff;
}
.btn--lg { padding: 1rem 1.9rem; font-size: 1rem; }

/* ---------- 8. Categorías (silos) ---------- */
.categories {
  background: linear-gradient(180deg, transparent 0%, rgba(13, 18, 36, 0.6) 100%);
  padding-top: clamp(2rem, 4vw, 3rem);
}
.categories__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-5);
  margin-top: var(--s-12);
}
.categories__grid .cat-card {
  padding: var(--s-6);
}
@media (max-width: 900px) {
  .categories__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .categories__grid .cat-card {
    padding: var(--s-7);
  }
}
.cat-card {
  position: relative;
  padding: var(--s-8);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: all var(--t-base) var(--ease);
  isolation: isolate;
}
.cat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, var(--cat-glow, rgba(0,255,178,0.15)), transparent 50%);
  opacity: 0;
  transition: opacity var(--t-base);
  z-index: -1;
}
.cat-card:hover {
  transform: translateY(-4px);
  border-color: var(--cat-color, var(--color-bio));
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.cat-card:hover::before { opacity: 1; }
.cat-card__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.cat-card__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  transition: transform 0.65s var(--ease), opacity 0.45s;
  filter: saturate(0.7);
}
.cat-card:hover .cat-card__bg img {
  transform: scale(1.07);
  opacity: 0.28;
  filter: saturate(1);
}
.cat-card__icon {
  width: 52px; height: 52px;
  border-radius: var(--r-md);
  background: rgba(0, 255, 178, 0.08);
  display: grid; place-items: center;
  margin-bottom: var(--s-5);
  border: 1px solid var(--color-border);
  font-size: 1.4rem;
  color: var(--cat-color, var(--color-bio));
}
.cat-card h3 { margin-bottom: var(--s-3); font-size: 1.4rem; }
.cat-card p { font-size: 0.95rem; line-height: 1.55; }
.cat-card__topics {
  margin-top: var(--s-5);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cat-card__topics span {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.cat-card__meta {
  margin-top: var(--s-4);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  opacity: 0.7;
}

/* ---------- 9. Section título ---------- */
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--s-8);
}
.section-head--left { text-align: left; max-width: 100%; margin-inline: 0; }
.section-head h2 { margin-bottom: var(--s-4); }
.section-head p { font-size: 1.1rem; color: var(--color-text-dim); }

/* ---------- 10. Pillar callout (full-width banner) ---------- */
.pillar {
  position: relative;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 255, 178, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(61, 123, 255, 0.12) 0%, transparent 40%),
    linear-gradient(135deg, rgba(20, 26, 48, 0.6), rgba(14, 20, 36, 0.6));
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  isolation: isolate;
}
.pillar__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-12);
  align-items: center;
}
@media (max-width: 860px) {
  .pillar__grid { grid-template-columns: 1fr; gap: var(--s-8); }
}
.pillar h2 { margin-bottom: var(--s-4); }
.pillar__list { display: flex; flex-direction: column; gap: var(--s-4); margin-top: var(--s-6); }
.pillar__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  font-size: 0.95rem;
  color: var(--color-text);
}
.pillar__list li::before {
  content: "→";
  color: var(--color-bio);
  font-weight: 700;
  flex-shrink: 0;
}

.pillar__viz {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-lg);
  background: radial-gradient(circle at center, rgba(0,255,178,0.08), transparent 70%);
  display: grid;
  place-items: center;
}
.pillar__viz svg { width: 80%; height: 80%; }

/* ---------- 11. Articles grid (masonry-like) ---------- */
.articles {
  background: linear-gradient(180deg, transparent 0%, rgba(10, 14, 26, 0.5) 100%);
}
.articles__masonry {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--s-6);
  margin-top: var(--s-12);
}
.articles__masonry .article-card:first-child {
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
}
.articles__masonry .article-card:first-child .article-card__media {
  flex: 1;
  aspect-ratio: unset;
  min-height: 240px;
}
@media (max-width: 1024px) {
  .articles__masonry {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .articles__masonry .article-card:first-child {
    grid-row: auto;
    grid-column: 1 / 3;
    flex-direction: row;
  }
  .articles__masonry .article-card:first-child .article-card__media {
    flex: 0 0 45%;
    min-height: 0;
    aspect-ratio: unset;
  }
}
@media (max-width: 640px) {
  .articles__masonry {
    grid-template-columns: 1fr;
  }
  .articles__masonry .article-card:first-child {
    grid-column: auto;
    flex-direction: column;
  }
  .articles__masonry .article-card:first-child .article-card__media {
    flex: unset;
    aspect-ratio: 16/9;
  }
}

.article-card {
  display: block;
  margin-bottom: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--color-border);
  transition: all var(--t-base) var(--ease);
  position: relative;
}
.article-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-border-strong);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.article-card__media {
  aspect-ratio: 16/10;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0,255,178,0.1), rgba(61,123,255,0.1));
}
.article-card__media svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.4;
}
.article-card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease);
}
.article-card:hover .article-card__media img {
  transform: scale(1.05);
}
.article-card--tall .article-card__media { aspect-ratio: 4/5; }
.article-card__cat {
  position: absolute;
  top: var(--s-4); left: var(--s-4);
  padding: 0.25rem 0.7rem;
  border-radius: var(--r-full);
  background: rgba(15, 23, 41, 0.7);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-bio);
  border: 1px solid var(--color-border);
}
.article-card__body { padding: var(--s-6); }
.article-card__body h3 {
  font-size: 1.2rem;
  margin-bottom: var(--s-3);
  line-height: 1.25;
}
.article-card:hover h3 { color: var(--color-bio); }
.article-card__meta {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-4);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

/* ---------- 12. CTA / Newsletter (full-width banner) ---------- */
.cta-final {
  position: relative;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 255, 178, 0.15) 0%, transparent 50%),
    linear-gradient(180deg, rgba(20, 26, 48, 0.8), rgba(10, 14, 26, 0.8));
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  isolation: isolate;
}
.cta-final h2 { margin-bottom: var(--s-4); max-width: 22ch; margin-inline: auto; }
.cta-final p { max-width: 52ch; margin: 0 auto var(--s-8); font-size: 1.05rem; }
.newsletter {
  display: flex;
  gap: var(--s-2);
  max-width: 460px;
  margin: 0 auto;
  padding: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  border-radius: var(--r-full);
}
.newsletter input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 0.65rem 1rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}
.newsletter input::placeholder { color: var(--color-text-muted); }

/* ---------- 13. Footer ---------- */
.footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--s-8) var(--s-6);
  margin-top: var(--s-10);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--s-8);
  padding-bottom: var(--s-8);
  border-bottom: 1px solid var(--color-border);
}
@media (max-width: 860px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); }
}
@media (max-width: 480px) {
  .footer__grid { grid-template-columns: 1fr; }
}
.footer__brand p {
  margin-top: var(--s-4);
  max-width: 32ch;
  font-size: 0.95rem;
}
.footer__col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  margin-bottom: var(--s-4);
}
.footer__col ul { display: flex; flex-direction: column; gap: var(--s-2); }
.footer__ver-todas {
  font-size: 0.82rem;
  color: var(--color-bio) !important;
  font-family: var(--font-mono);
}
.footer__ver-todas:hover { text-decoration: underline; }
.footer__col a {
  color: var(--color-text-dim);
  font-size: 0.95rem;
  transition: color var(--t-fast);
}
.footer__col a:hover { color: var(--color-bio); }
.footer__bottom {
  padding-top: var(--s-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-4);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}
.footer__bottom-links {
  display: flex;
  gap: var(--s-5);
}
.footer__bottom-links a {
  color: var(--color-text-muted);
  transition: color var(--t-fast);
}
.footer__bottom-links a:hover { color: var(--color-bio); }

/* ---------- 14. Article (long-form) ---------- */
.article-hero {
  padding-top: 120px;
  padding-bottom: var(--s-12);
  position: relative;
  overflow: hidden;
}
.article-hero__breadcrumb {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  margin-bottom: var(--s-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.article-hero__breadcrumb a:hover { color: var(--color-bio); }
.article-hero__breadcrumb span { color: var(--color-text-muted); }
.article-hero h1 { max-width: 22ch; margin-bottom: var(--s-6); }
.article-hero__meta {
  display: flex;
  gap: var(--s-6);
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  padding-top: var(--s-6);
  border-top: 1px solid var(--color-border);
}
.article-hero__meta strong { color: var(--color-bio); font-weight: 600; }

.article-hero__img {
  max-width: 900px;
  margin: var(--s-10) auto 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.article-hero__img img {
  width: 100%;
  height: auto;
  display: block;
}

.article-figure {
  margin: var(--s-10) 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.article-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.toc {
  position: sticky;
  top: 88px;
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--color-border);
}
.toc h4 {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-bio);
  margin-bottom: var(--s-4);
}
.toc ol {
  list-style: decimal-leading-zero;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.toc ol li::marker {
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.toc a {
  color: var(--color-text-dim);
  font-size: 0.92rem;
  line-height: 1.4;
  display: block;
  transition: color var(--t-fast);
}
.toc a:hover { color: var(--color-bio); }

.article-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--s-12);
  align-items: start;
}
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: relative; top: auto; }
}

.prose {
  max-width: var(--w-prose);
  font-size: 1.05rem;
  line-height: 1.75;
}
.prose > * + * { margin-top: var(--s-6); }
.prose h2 {
  margin-top: var(--s-16);
  margin-bottom: var(--s-4);
  padding-top: var(--s-8);
  border-top: 1px solid var(--color-border);
  font-size: clamp(1.6rem, 2vw + 0.5rem, 2.2rem);
  scroll-margin-top: 100px;
}
.prose h3 {
  margin-top: var(--s-10);
  margin-bottom: var(--s-3);
  font-size: clamp(1.2rem, 1vw + 0.7rem, 1.5rem);
  color: var(--color-bio);
  scroll-margin-top: 100px;
}
.prose h2 + p { margin-top: var(--s-4); }
.prose p { color: var(--color-text); }
.prose ul, .prose ol {
  padding-left: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.prose ul { list-style: none; padding-left: 0; }
.prose ul li {
  padding-left: var(--s-6);
  position: relative;
  color: var(--color-text);
}
.prose ul li::before {
  content: "▸";
  position: absolute; left: 0;
  color: var(--color-bio);
}
.prose ol { list-style: decimal; }
.prose ol li { color: var(--color-text); padding-left: var(--s-2); }
.prose ol li::marker { color: var(--color-bio); font-weight: 600; }

.prose a {
  color: var(--color-bio);
  text-decoration: underline;
  text-decoration-color: rgba(0,255,178,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t-fast);
}
.prose a:hover { text-decoration-color: var(--color-bio); }

.prose blockquote {
  border-left: 3px solid var(--color-bio);
  padding: var(--s-4) var(--s-6);
  background: rgba(0,255,178,0.04);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin-block: var(--s-8);
  font-style: italic;
  color: #fff;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--s-8);
  font-size: 0.95rem;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.prose th, .prose td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.prose th {
  background: rgba(0,255,178,0.06);
  color: var(--color-bio);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.prose tr:last-child td { border-bottom: 0; }
.prose tr:hover td { background: rgba(255,255,255,0.02); }

.callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-4);
  padding: var(--s-6);
  border-radius: var(--r-md);
  background: rgba(0, 255, 178, 0.05);
  border: 1px solid rgba(0, 255, 178, 0.2);
  margin-block: var(--s-8);
}
.callout--warn {
  background: rgba(255, 179, 71, 0.05);
  border-color: rgba(255, 179, 71, 0.25);
}
.callout--data {
  background: rgba(61, 123, 255, 0.05);
  border-color: rgba(61, 123, 255, 0.25);
}
.callout__icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: rgba(0,255,178,0.12);
  display: grid; place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.callout--warn .callout__icon { background: rgba(255,179,71,0.15); }
.callout--data .callout__icon { background: rgba(61,123,255,0.15); }
.callout strong { display: block; color: #fff; margin-bottom: var(--s-1); }
.callout p { font-size: 0.95rem; line-height: 1.55; margin: 0 !important; color: var(--color-text-dim); }

/* Inter-link block */
.related-inline {
  margin-block: var(--s-10);
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(0,255,178,0.04), rgba(61,123,255,0.04));
  border: 1px solid var(--color-border);
}
.related-inline span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-bio);
}
.related-inline h4 {
  font-size: 1.15rem;
  margin: var(--s-2) 0 0;
}
.related-inline a {
  color: #fff;
  text-decoration: none;
}
.related-inline a:hover h4 { color: var(--color-bio); }

/* End of article — related */
.related {
  margin-top: var(--s-16);
  padding-top: var(--s-12);
  border-top: 1px solid var(--color-border);
}
.related h3 { margin-bottom: var(--s-8); }
.related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-5);
}

/* ---------- 15. Animaciones de scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 16. Utilidades ---------- */
.glow-text {
  text-shadow: 0 0 24px rgba(0, 255, 178, 0.4);
}
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border-strong), transparent);
  margin-block: var(--s-12);
}
.kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--color-border);
  color: #fff;
}

/* ---------- 17. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================
   BIOINFINITO — Componentes Premium
   ============================================ */

/* ---------- 18. Reading progress bar ---------- */
.read-progress {
  position: fixed;
  top: 68px;
  left: 0; right: 0;
  height: 2px;
  z-index: 99;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}
.read-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-bio), var(--color-tech));
  box-shadow: 0 0 12px rgba(0, 255, 178, 0.4);
  transition: width 100ms linear;
}

/* ---------- 19. TOC active state ---------- */
.toc a.is-active {
  color: var(--color-bio);
  font-weight: 600;
  position: relative;
}
.toc a.is-active::before {
  content: "";
  position: absolute;
  left: -1.4rem;
  top: 0.35em;
  width: 2px;
  height: 1em;
  background: var(--color-bio);
  border-radius: 2px;
}

/* ---------- 20. Biomarker card ---------- */
.biomarker {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-6);
  border-radius: var(--r-lg);
  border: 1px solid var(--color-border);
  background: rgba(255,255,255,0.02);
  position: relative;
  overflow: hidden;
}
.biomarker::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--color-bio);
}
.biomarker--warn::before { background: var(--color-warn); }
.biomarker--danger::before { background: var(--color-danger); }
.biomarker--tech::before { background: var(--color-tech); }

.biomarker__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
}
.biomarker__value {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2vw + 1rem, 2.6rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--color-bio), var(--color-tech));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.biomarker__unit {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text-dim);
  margin-left: var(--s-2);
  font-weight: 500;
}
.biomarker__sparkline {
  width: 100%;
  height: 40px;
  display: block;
}
.biomarker__range {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
}
.biomarker__range::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-bio);
  box-shadow: 0 0 10px var(--color-bio);
  animation: pulse 2s ease-in-out infinite;
}
.biomarker--warn .biomarker__range::before {
  background: var(--color-warn);
  box-shadow: 0 0 10px var(--color-warn);
}
.biomarker--danger .biomarker__range::before {
  background: var(--color-danger);
  box-shadow: 0 0 10px var(--color-danger);
}

/* Biomarker grid for use in articles */
.biomarker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-4);
  margin-block: var(--s-8);
}

/* ---------- 21. Evidence rating ---------- */
.evidence {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--r-full);
  background: rgba(0, 255, 178, 0.05);
  border: 1px solid rgba(0, 255, 178, 0.15);
  color: var(--color-text-dim);
  vertical-align: middle;
}
.evidence__label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-bio);
  font-weight: 600;
}
.evidence__stars {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.evidence__stars span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-bio);
  display: inline-block;
}
.evidence__stars span.is-empty {
  background: transparent;
  border: 1px solid var(--color-border-strong);
}
.evidence__count {
  padding: 0.15em 0.55em;
  border-radius: var(--r-full);
  border: 1px solid var(--color-border);
  background: rgba(255,255,255,0.03);
  color: var(--color-text-dim);
  white-space: nowrap;
}

/* ---------- 22. Protocol card ---------- */
.protocol-card {
  position: relative;
  padding: var(--s-6);
  border-radius: var(--r-lg);
  border: 1px solid var(--color-border);
  background: rgba(255,255,255,0.02);
  margin-block: var(--s-8);
  overflow: hidden;
}
.protocol-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-bio), var(--color-tech));
}
.protocol-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
}
.protocol-card__title {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.protocol-card__icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: rgba(0, 255, 178, 0.12);
  display: grid;
  place-items: center;
  color: var(--color-bio);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.protocol-card__difficulty {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}
.protocol-card__difficulty span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-bio);
  display: inline-block;
}
.protocol-card__difficulty span.is-empty {
  background: transparent;
  border: 1px solid var(--color-border-strong);
}
.protocol-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s-4);
}
.protocol-card__field {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.protocol-card__field-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}
.protocol-card__field-value {
  color: #fff;
  font-weight: 500;
  font-size: 0.98rem;
}
.protocol-card__warn {
  margin-top: var(--s-5);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  background: rgba(255, 179, 71, 0.08);
  border-left: 3px solid var(--color-warn);
  font-size: 0.9rem;
  color: var(--color-text-dim);
}

/* ---------- 23. Glossary tooltip ---------- */
.gloss-tip {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(0,255,178,0.45);
  text-underline-offset: 4px;
  cursor: help;
  color: inherit;
  font-style: normal;
  position: relative;
}
.gloss-tip:hover { text-decoration-color: var(--color-bio); }

.gloss-tip__bubble {
  position: absolute;
  z-index: 200;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 300px;
  padding: var(--s-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--r-md);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  color: var(--color-text-dim);
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}
.gloss-tip__bubble.is-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.gloss-tip__bubble strong {
  display: block;
  font-family: var(--font-display);
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: var(--s-2);
}
.gloss-tip__bubble a {
  display: inline-block;
  margin-top: var(--s-2);
  color: var(--color-bio);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
}
.gloss-tip__bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--color-border-strong);
}

@media (max-width: 640px) {
  .gloss-tip__bubble {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    width: 100%;
    max-width: none;
    transform: translateY(100%);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 0;
    padding: var(--s-6);
    padding-bottom: var(--s-8);
  }
  .gloss-tip__bubble.is-open { transform: translateY(0); }
  .gloss-tip__bubble::after { display: none; }
}

/* ---------- 24. Headings copy-link ---------- */
.prose h2, .prose h3 { position: relative; }
.heading-anchor {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 8px;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--color-text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  opacity: 0;
  transition: opacity 150ms, color 150ms, transform 150ms;
  font-size: 14px;
  text-decoration: none;
}
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.heading-anchor:focus-visible { opacity: 1; }
.heading-anchor:hover { color: var(--color-bio); transform: translateY(-50%) scale(1.05); }
.heading-anchor.is-copied { color: var(--color-bio); }
@media (max-width: 1024px) {
  .heading-anchor { display: none; }
}

/* ---------- 25. Author box (E-E-A-T) ---------- */
.author-box {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--color-border);
  margin-block: var(--s-8);
}
.author-box__avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, var(--color-bio), transparent 60%),
    radial-gradient(circle at 70% 65%, var(--color-tech), transparent 60%);
  flex-shrink: 0;
  position: relative;
  box-shadow: var(--glow-bio);
}
.author-box__avatar::after {
  content: "";
  position: absolute; inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
}
.author-box__name {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
  margin: 0 0 2px 0;
}
.author-box__role {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.author-box__bio {
  font-size: 0.9rem;
  color: var(--color-text-dim);
  margin-top: var(--s-2);
}

/* ---------- 26. Glossary page ---------- */
.glossary-tools {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  margin-bottom: var(--s-8);
}
.glossary-search {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--r-full);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.glossary-search:focus {
  border-color: var(--color-bio);
  box-shadow: 0 0 0 3px rgba(0,255,178,0.15);
}
.glossary-search::placeholder { color: var(--color-text-muted); }

.glossary-az {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--color-border);
}
.glossary-az a {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  color: var(--color-text-dim);
  text-decoration: none;
  transition: all var(--t-fast);
}
.glossary-az a:hover {
  background: rgba(0,255,178,0.08);
  color: var(--color-bio);
}
.glossary-az a.is-empty {
  color: var(--color-text-muted);
  opacity: 0.4;
  pointer-events: none;
}

.glossary-letter {
  scroll-margin-top: 100px;
}
.glossary-letter h2 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--color-bio);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-6);
  margin-top: var(--s-12);
}
.glossary-item {
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: 100px;
}
.glossary-item h3 {
  font-size: 1.25rem;
  margin: 0 0 var(--s-2) 0;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.glossary-cat {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-full);
  background: rgba(0,255,178,0.08);
  color: var(--color-bio);
  border: 1px solid rgba(0,255,178,0.2);
  font-weight: 500;
}
.glossary-item p {
  color: var(--color-text-dim);
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: var(--s-3);
}
.glossary-item a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-bio);
  text-decoration: none;
}
.glossary-item.is-hidden { display: none; }
.glossary-empty {
  text-align: center;
  padding: var(--s-12);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  display: none;
}
.glossary-empty.is-visible { display: block; }

/* ---------- 27. Calculator (fasting) ---------- */
.calculator {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 0% 0%, rgba(0,255,178,0.08), transparent 50%),
    rgba(255,255,255,0.02);
  border: 1px solid var(--color-border-strong);
  margin-block: var(--s-8);
}
.calculator__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}
.calculator__field { display: flex; flex-direction: column; gap: var(--s-2); }
.calculator__field label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}
.calculator__field input,
.calculator__field select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 0.7rem 0.9rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}
.calculator__field input:focus,
.calculator__field select:focus {
  border-color: var(--color-bio);
  box-shadow: 0 0 0 3px rgba(0,255,178,0.12);
}
.calculator__field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300FFB2' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.4rem;
}
.calculator__cta {
  margin-top: var(--s-4);
}
.calc-result {
  margin-top: var(--s-6);
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(0,255,178,0.08), rgba(61,123,255,0.08));
  border: 1px solid rgba(0,255,178,0.25);
  display: none;
}
.calc-result.is-visible { display: block; }
.calc-result__window {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw + 1rem, 3.4rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-bio), var(--color-tech));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  margin-bottom: var(--s-2);
  line-height: 1;
}
.calc-result__sub {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--s-5);
}
.calc-result__expl {
  color: var(--color-text);
  font-size: 0.98rem;
  line-height: 1.65;
}
.calc-result__warn {
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  background: rgba(255, 179, 71, 0.08);
  border-left: 3px solid var(--color-warn);
  font-size: 0.9rem;
  color: var(--color-text-dim);
}

/* ============================================================
   Cookies banner (informativo, sin consentimiento previo)
   ============================================================ */
.cookies-banner {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%) translateY(120%);
  width: min(680px, calc(100vw - 2rem));
  background: rgba(15, 23, 41, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 9000;
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1), opacity 0.3s;
  opacity: 0;
}
.cookies-banner.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.cookies-banner__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
}
.cookies-banner p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-dim);
  flex: 1;
  line-height: 1.5;
}
.cookies-banner p strong { color: var(--color-bio); font-weight: 600; }
.cookies-banner p a { color: var(--color-tech); text-decoration: underline; text-underline-offset: 3px; }
.cookies-banner__ack {
  flex-shrink: 0;
  padding: 0.6rem 1.1rem;
  font-size: 0.88rem;
}
@media (max-width: 600px) {
  .cookies-banner__inner { flex-direction: column; align-items: stretch; gap: 0.85rem; }
  .cookies-banner__ack { width: 100%; }
  .cookies-banner p { font-size: 0.85rem; }
}

/* ============================================================
   Feedback widget en artículos
   ============================================================ */
.feedback-widget {
  margin: 4rem 0 2rem;
  padding: 1.75rem 1.5rem;
  background: linear-gradient(135deg, rgba(0,255,178,0.04), rgba(61,123,255,0.04));
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  text-align: center;
}
.feedback-widget__head { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.1rem; }
.feedback-widget__head strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #fff;
  font-weight: 700;
}
.feedback-widget__head span { color: var(--color-text-muted); font-size: 0.88rem; }
.feedback-widget__actions { display: inline-flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.feedback-widget__actions button {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-md);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.feedback-widget__actions button:hover {
  border-color: var(--color-bio);
  background: rgba(0,255,178,0.06);
  transform: translateY(-1px);
}
.feedback-widget__actions button:focus-visible {
  outline: 2px solid var(--color-bio);
  outline-offset: 2px;
}
.feedback-widget__thanks {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--color-text-dim);
  font-size: 0.92rem;
  animation: feedbackFadeIn 0.4s ease;
}
.feedback-widget__thanks strong { color: var(--color-bio); font-family: var(--font-display); font-size: 1.1rem; }
@keyframes feedbackFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   404 suggestions cards
   ============================================================ */
.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  text-align: left;
}
.suggestion-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.2rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: #fff;
  transition: all var(--t-fast);
}
.suggestion-card:hover {
  border-color: var(--color-bio);
  background: rgba(0,255,178,0.03);
  transform: translateY(-2px);
}
.suggestion-card__type {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--color-bio);
  font-weight: 700;
}
.suggestion-card strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.suggestion-card__desc { font-size: 0.85rem; color: var(--color-text-dim); line-height: 1.4; }

/* ============================================================
   Breadcrumb móvil — más compacto y legible
   ============================================================ */
@media (max-width: 600px) {
  .article-hero__breadcrumb {
    font-size: 0.78rem;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
  }
  .article-hero__breadcrumb span,
  .article-hero__breadcrumb a {
    word-break: keep-all;
  }
}
