/* ============================================================
   styles.css · Sistema de diseño · Repositorio IA · Diego Parrás
   Dark-first + tema claro · Space Grotesk / Inter / JetBrains Mono
   ============================================================ */

/* ---------- Tokens base ---------- */
:root {
  --f-display: 'Space Grotesk', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Marca */
  --orange: #ff7a18;
  --orange-2: #ff9d4d;
  --orange-soft: rgba(255, 122, 24, 0.14);

  --radius: 20px;
  --radius-lg: 28px;
  --maxw: 1180px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Tema oscuro (default) ---------- */
:root,
:root[data-theme="dark"] {
  --bg: #08080b;
  --bg-2: #0d0d12;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --text: #ece7de;
  --text-strong: #ffffff;
  --muted: #9a9488;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 122, 24, 0.30);
  --glow: rgba(255, 122, 24, 0.16);
  --grid-line: rgba(255, 255, 255, 0.022);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --header-bg: rgba(8, 8, 11, 0.72);
  color-scheme: dark;
}

/* ---------- Tema claro ---------- */
:root[data-theme="light"] {
  --bg: #f5f4f0;
  --bg-2: #efece6;
  --surface: rgba(20, 16, 12, 0.025);
  --surface-2: rgba(20, 16, 12, 0.045);
  --surface-hover: rgba(20, 16, 12, 0.06);
  --text: #2a251f;
  --text-strong: #14110d;
  --muted: #6e675c;
  --line: rgba(20, 16, 12, 0.12);
  --line-strong: rgba(255, 122, 24, 0.45);
  --glow: rgba(255, 122, 24, 0.12);
  --grid-line: rgba(20, 16, 12, 0.03);
  --shadow: 0 20px 50px rgba(60, 40, 20, 0.12);
  --header-bg: rgba(245, 244, 240, 0.78);
  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  letter-spacing: -0.003em;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Fondo: grilla técnica + halos suaves */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 85% -5%, var(--glow), transparent 60%),
    radial-gradient(50% 40% at 0% 100%, var(--glow), transparent 55%);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--orange); color: #0b0b0b; }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 20px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section--tight { padding: clamp(40px, 6vw, 68px) 0; }

/* Etiqueta mono superior (kicker) */
.kicker {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--orange-2);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--orange);
  display: inline-block;
}

/* Cabecera de sección */
.section-head { max-width: 760px; margin-bottom: 38px; }
.section-head h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin-top: 14px;
}
.section-head h2 em { color: var(--orange); font-style: normal; }
.section-head p { color: var(--muted); margin-top: 14px; font-size: 1.02rem; line-height: 1.7; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text-strong);
  font-family: var(--f-display);
  font-weight: 600;
  font-size: .96rem;
  letter-spacing: -0.01em;
  flex: 0 0 auto;
}
.brand .mark {
  width: 34px; height: 34px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #ffc187, #ff4d00);
  color: #1b0e04; font-weight: 800; font-size: .92rem;
  box-shadow: 0 6px 18px rgba(255, 92, 0, 0.32);
}
.brand small { display: block; color: var(--muted); font-weight: 400; font-size: .72rem; font-family: var(--f-body); }

.navlinks {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.navlinks a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 500;
  padding: 8px 11px;
  border-radius: 10px;
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.navlinks a:hover { color: var(--text-strong); background: var(--surface-2); }
.navlinks a[aria-current="page"] { color: var(--orange-2); }
.navlinks a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 11px; right: 11px; bottom: 2px;
  height: 2px; border-radius: 2px;
  background: var(--orange);
}

/* Grupos desplegables (dropdown) */
.navgroup { position: relative; display: inline-flex; }
.navgroup-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--f-body);
  font-size: .86rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 8px 11px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.navgroup-btn:hover { color: var(--text-strong); background: var(--surface-2); }
.navgroup-btn .chev { width: 13px; height: 13px; opacity: .8; transition: transform .25s var(--ease); }
.navgroup:hover .navgroup-btn .chev,
.navgroup.open .navgroup-btn .chev { transform: rotate(180deg); }
.navgroup.active > .navgroup-btn { color: var(--orange-2); }
/* puente invisible para no perder el hover en el espacio botón→menú */
.navgroup::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 10px; }
.submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 7px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  z-index: 120;
}
.navgroup:hover .submenu,
.navgroup:focus-within .submenu,
.navgroup.open .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.submenu a:hover { color: var(--text-strong); background: var(--surface-2); }
.submenu a[aria-current="page"] { color: var(--orange-2); background: var(--orange-soft); }

/* Botón de tema */
.theme-toggle {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
  margin-left: 6px;
}
.theme-toggle:hover { border-color: var(--line-strong); background: var(--surface-hover); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Hamburguesa */
.hamburger {
  display: none;
  flex: 0 0 auto;
  width: 40px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  cursor: pointer;
  padding: 0;
  position: relative;
}
.hamburger span {
  position: absolute; left: 10px; right: 10px; height: 2px;
  background: var(--text); border-radius: 2px; transition: .26s var(--ease);
}
.hamburger span:nth-child(1) { top: 13px; }
.hamburger span:nth-child(2) { top: 18px; }
.hamburger span:nth-child(3) { top: 23px; }
.nav.open .hamburger span:nth-child(1) { top: 18px; transform: rotate(45deg); }
.nav.open .hamburger span:nth-child(2) { opacity: 0; }
.nav.open .hamburger span:nth-child(3) { top: 18px; transform: rotate(-45deg); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: .92rem;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  color: var(--text-strong);
  background: var(--surface-2);
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); background: var(--surface-hover); }
.btn.primary {
  background: linear-gradient(135deg, var(--orange), #ff5a14);
  border-color: transparent;
  color: #160c04;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(255, 92, 0, 0.28);
}
.btn.primary:hover { box-shadow: 0 16px 36px rgba(255, 92, 0, 0.4); }
.btn.ghost { background: transparent; }

/* ---------- Hero ---------- */
.hero { padding: clamp(54px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); position: relative; }
.hero h1 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2.3rem, 6.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--text-strong);
  margin-top: 22px;
  max-width: 16ch;
}
.hero h1 .grad {
  background: linear-gradient(110deg, var(--orange-2), var(--orange) 45%, #ff4d00);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero .lead {
  margin-top: 24px;
  max-width: 60ch;
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  color: var(--muted);
  line-height: 1.7;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 52px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.stat b {
  font-family: var(--f-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: var(--orange-2);
  display: block;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat span { color: var(--muted); font-size: .86rem; display: block; margin-top: 10px; line-height: 1.5; }

/* ---------- Tarjetas / paneles ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px;
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.panel h2, .panel h3 { font-family: var(--f-display); color: var(--text-strong); letter-spacing: -0.01em; }
.panel h3 { font-size: 1.18rem; }
.panel p, .panel li { color: var(--text); line-height: 1.7; }
.panel p + p { margin-top: 14px; }
.panel ul { margin: 14px 0 0; padding-left: 20px; }
.panel ul li { margin-bottom: 8px; color: var(--muted); }
.panel strong { color: var(--orange-2); font-weight: 600; }

/* Grilla genérica de paneles */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* Grilla auto-ajustable (módulos compactos) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.module {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  transition: border-color .25s, transform .25s, background .25s;
}
.module:hover { border-color: var(--line-strong); transform: translateY(-3px); background: var(--surface-2); }
.module b {
  color: var(--text-strong);
  display: block;
  margin-bottom: 8px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.04rem;
  letter-spacing: -0.01em;
}
.module > span { color: var(--muted); line-height: 1.6; font-size: .92rem; display: block; }
.module strong { color: var(--orange-2); font-weight: 600; }
.module .meta-line {
  margin-top: 12px;
  color: var(--orange);
  font-family: var(--f-mono);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .01em;
}
.module .pill {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--orange-soft);
  border: 1px solid var(--line-strong);
  color: var(--orange-2);
  font-family: var(--f-mono);
  font-size: .66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
}
/* Tarjeta módulo clicleable hacia su fuente */
a.module { text-decoration: none; color: inherit; cursor: pointer; position: relative; }
a.module::after {
  content: "↗";
  position: absolute;
  top: 16px; right: 16px;
  color: var(--muted);
  font-size: .82rem;
  transition: color .2s, transform .2s;
}
a.module:hover::after { color: var(--orange-2); transform: translate(2px, -2px); }
a.module .meta-line { padding-right: 18px; }
/* Enlaces dentro de prosa (timeline, etc.) */
.era-body a { color: var(--orange-2); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s; }
.era-body a:hover { border-bottom-color: var(--orange-2); }

/* Nota / callout */
.map-note {
  border: 1px solid var(--line-strong);
  background: var(--orange-soft);
  border-radius: var(--radius);
  padding: 18px 22px;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 22px;
  font-size: .95rem;
}
.map-note strong { color: var(--orange-2); }

/* Caja de actualidad destacada */
.flash {
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--orange-soft), transparent);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  line-height: 1.7;
  position: relative;
  overflow: hidden;
}
.flash::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--orange), #ff4d00);
}
.flash .flash-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--orange);
  color: #0b0b0b;
  font-family: var(--f-mono);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.flash h3 { margin: 4px 0 10px; font-family: var(--f-display); color: var(--text-strong); font-size: 1.34rem; letter-spacing: -0.01em; }
.flash p { color: var(--text); }
.flash p + p { margin-top: 13px; }
.flash strong { color: var(--orange-2); }
.flash a { color: var(--orange-2); font-weight: 600; }

/* ---------- Cards de navegación (hub) ---------- */
.nav-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.nav-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .25s, transform .25s, background .25s, box-shadow .25s;
  position: relative;
}
.nav-card:hover { border-color: var(--line-strong); transform: translateY(-4px); background: var(--surface-2); box-shadow: var(--shadow); }
.nav-card .nc-idx { font-family: var(--f-mono); font-size: .74rem; color: var(--orange); letter-spacing: .1em; }
.nav-card h3 { font-family: var(--f-display); font-weight: 600; font-size: 1.28rem; color: var(--text-strong); letter-spacing: -0.01em; }
.nav-card p { color: var(--muted); font-size: .92rem; line-height: 1.6; }
.nav-card .nc-go { margin-top: auto; color: var(--orange-2); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; transition: gap .2s; }
.nav-card:hover .nc-go { gap: 11px; }

/* ---------- Filtros (search + selects) ---------- */
.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 18px;
}
.filters input, .filters select {
  font-family: var(--f-body);
  font-size: .92rem;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  width: 100%;
}
.filters input::placeholder { color: var(--muted); }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--orange); }
.clear-btn {
  font-family: var(--f-body);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.clear-btn:hover { color: var(--text-strong); border-color: var(--line-strong); }
.counter { font-family: var(--f-mono); font-size: .78rem; color: var(--muted); margin-bottom: 16px; }

/* ---------- Grilla de papers ---------- */
.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.paper {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .25s, transform .25s, background .25s;
}
.paper:hover { border-color: var(--line-strong); transform: translateY(-3px); background: var(--surface-2); }
.paper-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.paper .year { font-family: var(--f-mono); font-size: .72rem; color: var(--orange); font-weight: 600; }
.paper .ptype {
  font-family: var(--f-mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}
.paper h3 { font-family: var(--f-display); font-size: 1.05rem; color: var(--text-strong); line-height: 1.25; letter-spacing: -0.01em; }
.paper .authors { font-size: .82rem; color: var(--orange-2); font-weight: 500; }
.paper .why { font-size: .9rem; color: var(--muted); line-height: 1.6; }
.paper a.paper-link { margin-top: auto; font-size: .85rem; color: var(--orange-2); font-weight: 600; text-decoration: none; }
.paper a.paper-link:hover { text-decoration: underline; }

/* ---------- Grilla de plataformas ---------- */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.platform-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .25s, transform .25s, background .25s;
}
.platform-card:hover { border-color: var(--line-strong); transform: translateY(-3px); background: var(--surface-2); }
.platform-card .pc-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.platform-card h3 { font-family: var(--f-display); font-size: 1.12rem; color: var(--text-strong); letter-spacing: -0.01em; }
.platform-card .company { font-size: .82rem; color: var(--orange-2); }
.platform-card .region {
  font-family: var(--f-mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.platform-card .access { font-size: .8rem; color: var(--muted); font-family: var(--f-mono); }
.platform-card .note { font-size: .9rem; color: var(--text); line-height: 1.6; }
.platform-card .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.platform-card .links a {
  font-size: .78rem; color: var(--orange-2); text-decoration: none; font-weight: 500;
  border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; transition: border-color .2s, background .2s;
}
.platform-card .links a:hover { border-color: var(--line-strong); background: var(--surface-2); }

/* ---------- Grilla de sitios ---------- */
.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.site-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .25s, transform .25s, background .25s;
}
.site-card:hover { border-color: var(--line-strong); transform: translateY(-3px); background: var(--surface-2); }
.site-card .cat { font-family: var(--f-mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; color: var(--orange); }
.site-card h3 { font-family: var(--f-display); font-size: 1.06rem; color: var(--text-strong); }
.site-card p { font-size: .88rem; color: var(--muted); line-height: 1.55; }
.site-card .go { margin-top: auto; font-size: .82rem; color: var(--orange-2); font-weight: 600; }

/* ---------- Timeline (historia) ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.era-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.era-row:last-child { border-bottom: 1px solid var(--line); }
.era-row .era-year { font-family: var(--f-mono); color: var(--orange); font-size: .92rem; font-weight: 600; letter-spacing: .02em; }
.era-row .era-body h3 { font-family: var(--f-display); font-size: 1.3rem; color: var(--text-strong); margin-bottom: 8px; letter-spacing: -0.01em; }
.era-row .era-body p { color: var(--muted); line-height: 1.7; }
.era-row:hover .era-year { color: var(--orange-2); }

/* ---------- Módulos de diplomatura ---------- */
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* Author / frameworks */
.author { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.author-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.author-tag {
  font-family: var(--f-mono); font-size: .68rem; color: var(--orange-2);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 11px; background: var(--orange-soft);
}
.author-cta { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.framework-list { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.framework b { display: block; color: var(--orange-2); font-family: var(--f-display); font-weight: 600; margin-bottom: 4px; }
.framework span { color: var(--muted); font-size: .9rem; line-height: 1.55; }

/* ---------- CTA ---------- */
.cta {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 56px);
  background: linear-gradient(150deg, var(--orange-soft), transparent 70%);
  text-align: center;
}
.cta h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.5rem, 3.4vw, 2.3rem); color: var(--text-strong); margin: 14px auto; max-width: 22ch; line-height: 1.12; letter-spacing: -0.02em; }
.cta h2 em { color: var(--orange); font-style: normal; }
.cta p { color: var(--muted); max-width: 62ch; margin: 0 auto; line-height: 1.7; }
.cta .hero-actions { justify-content: center; }

/* ---------- Notice institucional ---------- */
.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  border-radius: 14px;
  padding: 16px 20px;
  background: var(--surface);
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
  margin-top: 26px;
}
.notice strong { color: var(--orange-2); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 30px; padding: 52px 0 28px; }
.site-footer h3 { font-family: var(--f-display); font-size: 1.02rem; color: var(--text-strong); margin-bottom: 14px; }
.site-footer p { color: var(--muted); font-size: .9rem; line-height: 1.6; }
.site-footer p.small { font-size: .82rem; margin-top: 10px; }
.site-footer a { display: block; color: var(--muted); text-decoration: none; font-size: .9rem; padding: 5px 0; transition: color .2s; }
.site-footer a:hover { color: var(--orange-2); }
.footer-meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 20px 0; border-top: 1px solid var(--line);
  font-family: var(--f-mono); font-size: .76rem; color: var(--muted);
}

/* ---------- To-top ---------- */
.to-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 46px; height: 46px; border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  color: var(--text);
  cursor: pointer; font-size: 1.1rem;
  opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .2s, background .2s;
  z-index: 90;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--orange); color: #0b0b0b; transform: translateY(-3px); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .author { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input { grid-column: 1 / -1; }
  .era-row { grid-template-columns: 1fr; gap: 8px; }

  .hamburger { display: block; order: 3; }
  .theme-toggle { order: 2; margin-left: auto; }
  .navlinks {
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .34s var(--ease), opacity .26s, padding .26s;
    margin: 0 -24px;
    padding: 0 24px;
  }
  .nav.open .navlinks { max-height: 80vh; overflow-y: auto; opacity: 1; padding: 8px 24px 16px; }
  .navlinks a { padding: 14px 6px; font-size: 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .navlinks a[aria-current="page"]::after { display: none; }
  .navlinks a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--orange); padding-left: 14px; }

  /* Grupos como acordeón (no hay hover en touch) */
  .navgroup { display: block; width: 100%; }
  .navgroup::after { display: none; }
  .navgroup-btn {
    width: 100%;
    justify-content: space-between;
    padding: 14px 6px;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .navgroup.active > .navgroup-btn { box-shadow: inset 3px 0 0 var(--orange); padding-left: 12px; }
  .submenu {
    position: static;
    min-width: 0;
    background: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s var(--ease);
  }
  .navgroup.open .submenu { max-height: 360px; }
  .navlinks .submenu a { padding: 13px 6px 13px 24px; font-size: .96rem; color: var(--muted); }
  .navlinks .submenu a[aria-current="page"] { color: var(--orange-2); background: none; box-shadow: inset 3px 0 0 var(--orange); padding-left: 22px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .panel { padding: 22px; }
  .footer-meta { flex-direction: column; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .to-top, .filters, .hero-actions, .theme-toggle { display: none !important; }
  body::before, body::after { display: none; }
  * { color: #000 !important; background: #fff !important; }
}
