/* Índice raíz — bicolor, escala de grises */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #171717;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --border: #333333;
  --emphasis: #ffffff;
  --inverse: #0d0d0d;
  --link: #d4d4d4;
  --link-hover: #ffffff;
  --link-visited: #b0b0b0;
  --accent-dim: #b8b8b8;
  --radius: 8px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f7;
  --surface: #ffffff;
  --text: #141414;
  --muted: #5c5c5c;
  --border: #d6d6d6;
  --emphasis: #000000;
  --inverse: #ffffff;
  --link: #2a2a2a;
  --link-hover: #000000;
  --link-visited: #4a4a4a;
  --accent-dim: #3d3d3d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

a:link { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover { color: var(--link-hover); }

.wrap {
  max-width: 520px;
  padding: 2rem 1.5rem;
  text-align: center;
  width: 100%;
}

.page-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

h1 {
  font-size: 1.75rem;
  margin: 0;
}

.version {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.theme-toggle {
  font-family: system-ui, sans-serif;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.theme-toggle:hover { border-color: var(--accent-dim); }

.lead {
  color: var(--muted);
  margin: 1.25rem 0 2rem;
  font-family: system-ui, sans-serif;
}

.portals {
  display: grid;
  gap: 1rem;
}

.portal {
  display: block;
  text-align: left;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.portal:hover { border-color: var(--emphasis); }

.portal strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.portal span {
  font-size: 0.9rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
}

footer {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
}

/* —— Landing transmedia —— */
.landing-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.landing-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.logo-frame {
  display: inline-flex;
  background: #ffffff;
  border-radius: 50%;
  padding: 3px;
  line-height: 0;
  text-decoration: none;
}

.provenance-logo.landing-logo {
  max-height: 48px;
  width: auto;
  border-radius: 50%;
}

.serie-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.serie-tag {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.serie-tag a {
  color: var(--muted);
}

.serie-tag a:hover {
  color: var(--link-hover);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.provenance-footer-chain,
.provenance-footer-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

.provenance-footer-meta {
  margin-top: 0.35rem;
  font-size: 0.72rem;
}

.provenance-footer a {
  color: var(--muted);
  text-decoration: none;
}

.provenance-footer a:hover {
  color: var(--link-hover);
}

.provenance-sep {
  margin: 0 0.3em;
  opacity: 0.55;
}

/* —— Catálogo de modelizaciones —— */
.wrap { max-width: 720px; }
.catalogo { display: grid; gap: 1rem; text-align: left; }
.modelo-card {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  font-family: system-ui, sans-serif;
}
.modelo-card h2 { margin: 0 0 0.35rem; font-size: 1.15rem; font-family: Georgia, "Times New Roman", serif; }
.modelo-card h2 a { text-decoration: none; }
.modelo-card p { margin: 0.35rem 0; font-size: 0.9rem; color: var(--muted); }
.modelo-meta { font-size: 0.8rem; color: var(--muted); }
.modelo-meta code { font-family: ui-monospace, "Cascadia Code", monospace; font-size: 0.78rem; }
.modelo-actions { margin-top: 0.7rem; font-size: 0.86rem; }
.modelo-actions a { margin-right: 0.9rem; text-decoration: none; font-weight: 500; }
.modelo-actions a:hover { text-decoration: underline; }
.badge {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1em 0.5em;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  vertical-align: middle;
}
.badge-latest { border-color: var(--emphasis); color: var(--emphasis); }
.portals { margin-top: 1.25rem; }

/* —— Grafo nodos/aristas —— */
.seccion-h { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; text-align: left; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-family: system-ui, sans-serif; }
.grafo { text-align: left; }
.grafo-svg { width: 100%; height: auto; max-height: 360px; display: block; margin: 0.5rem 0 1rem; color: var(--text); font-family: system-ui, sans-serif; }
.grafo-svg .nodo circle { fill: var(--surface); stroke: var(--emphasis); stroke-width: 2; }
.grafo-svg .nodo:hover circle { fill: var(--emphasis); }
.grafo-svg .nodo-label { font-size: 12px; fill: var(--text); }
.grafo-svg .arista line { stroke: var(--muted); stroke-width: 2; }
.grafo-svg .arista-pausa line { stroke-dasharray: 6 5; }
.grafo-svg .arista-label { font-size: 11px; fill: var(--muted); }
.grafo-svg a { text-decoration: none; }
.arista-card { border-style: dashed; }
.badge-pausa { border-style: dashed; }
