/* ============================================================
   Caos Esmeralda — Hoja de estilos compartida
   Diseño sobrio · paleta monocroma · acento azul tenue
   ============================================================ */

:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1a2029;
  --line: #232830;
  --line-soft: #1c2128;
  --text: #e6edf3;
  --text-mute: #9aa5b1;
  --text-dim: #6e7681;
  --accent: #7aa7e8;
  --accent-soft: #2a3a52;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* === Back link === */
.back {
  display: inline-block;
  color: var(--text-mute);
  text-decoration: none;
  margin-top: 32px;
  font-size: 0.9em;
  transition: color 0.15s;
}
.back:hover { color: var(--accent); }

/* === Hero === */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: 2.2em;
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero .lead {
  color: var(--text-mute);
  margin: 0;
  font-size: 1.02em;
  max-width: 540px;
}
.hero .meta {
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 0.85em;
  letter-spacing: 0.02em;
}
.hero .meta span + span::before {
  content: '·';
  margin: 0 8px;
  color: var(--line);
}

/* === Sections === */
section.block {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}
section.block:last-of-type { border-bottom: none; }

h2 {
  font-size: 1.25em;
  font-weight: 600;
  margin: 36px 0 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}
h2:first-child { margin-top: 0; }
h3 {
  font-size: 1.02em;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text);
}
h4 {
  font-size: 0.95em;
  font-weight: 600;
  margin: 18px 0 8px;
  color: var(--text);
}

p { margin: 12px 0; color: var(--text); }
p.lead { color: var(--text-mute); }

ul, ol { padding-left: 22px; margin: 10px 0 14px; }
li { margin: 4px 0; color: var(--text); }
li > strong { color: var(--text); font-weight: 600; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { color: var(--text); font-weight: 600; }
em { color: var(--text-mute); font-style: italic; }

code {
  background: var(--panel);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.92em;
  color: var(--text);
  font-family: 'SF Mono', Consolas, 'Courier New', monospace;
}

.label {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 16px;
  font-weight: 600;
}

/* === Notas y bloques de aviso === */
.note, .info, .warn, .tip {
  margin: 16px 0;
  padding: 14px 18px;
  background: var(--line-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  color: var(--text-mute);
  font-size: 0.93em;
  line-height: 1.65;
}
.note strong, .info strong, .warn strong, .tip strong { color: var(--text); }
.note p, .info p, .warn p, .tip p { margin: 6px 0; }
.note p:first-child, .info p:first-child, .warn p:first-child, .tip p:first-child { margin-top: 0; }
.note p:last-child, .info p:last-child, .warn p:last-child, .tip p:last-child { margin-bottom: 0; }

/* === Cards (lista de navegación) === */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.card {
  background: var(--panel);
  padding: 22px 24px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: background 0.15s;
}
.card:hover { background: var(--panel-2); text-decoration: none; }
.card .icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1em;
}
.card .content { flex: 1; min-width: 0; }
.card h3 {
  margin: 0 0 3px;
  font-size: 1em;
  font-weight: 600;
  color: var(--text);
}
.card p {
  margin: 0;
  color: var(--text-mute);
  font-size: 0.88em;
  line-height: 1.5;
}
.card .arrow {
  color: var(--text-dim);
  font-size: 1.1em;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}
.card:hover .arrow { color: var(--accent); transform: translateX(2px); }
.card .new-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: #3fb950;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
}

/* === Collapsibles === */
details.fold { border-bottom: 1px solid var(--line); }
details.fold:last-of-type { border-bottom: none; }
details.fold summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  color: var(--text);
  font-size: 0.95em;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after {
  content: '+';
  color: var(--text-dim);
  font-size: 1.3em;
  font-weight: 300;
  transition: transform 0.2s;
  line-height: 1;
}
details.fold[open] summary::after { content: '−'; }
details.fold summary:hover { color: var(--accent); }
details.fold .body {
  padding: 0 0 22px;
  color: var(--text-mute);
  font-size: 0.92em;
  line-height: 1.7;
}
details.fold .body p { margin: 0 0 12px; color: var(--text-mute); }
details.fold .body p:last-child { margin-bottom: 0; }
details.fold .body strong { color: var(--text); }
details.fold .body ul { padding-left: 20px; margin: 8px 0 12px; }
details.fold .body li { color: var(--text-mute); margin: 4px 0; }

/* === Tablas === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.92em;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mute);
}
td { color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:nth-child(odd) td { background: var(--line-soft); }

/* === Footer === */
footer {
  margin-top: auto;
  padding: 32px 24px 28px;
  color: var(--text-dim);
  font-size: 0.82em;
  text-align: center;
  border-top: 1px solid var(--line);
}
footer a { color: var(--text-mute); text-decoration: none; }
footer a:hover { color: var(--accent); }
footer .disclaimer {
  margin-top: 14px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  color: var(--text-dim);
  font-size: 0.95em;
}

/* === TOC / Índice === */
.toc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 22px;
  margin: 20px 0;
}
.toc .label { margin-bottom: 10px; }
.toc ol { columns: 2; column-gap: 24px; margin: 0; padding-left: 22px; font-size: 0.9em; }
.toc li { margin: 3px 0; }
.toc a { color: var(--text-mute); }
.toc a:hover { color: var(--accent); }

/* === Responsive === */
@media (max-width: 600px) {
  .hero { padding: 44px 0 32px; }
  .hero h1 { font-size: 1.8em; }
  .hero .lead { font-size: 0.96em; }
  section.block { padding: 32px 0; }
  h2 { font-size: 1.15em; margin: 30px 0 12px; }
  .card { padding: 18px 20px; gap: 14px; }
  .card .icon { width: 32px; height: 32px; font-size: 0.9em; }
  .toc ol { columns: 1; }
  table { font-size: 0.85em; }
  th, td { padding: 8px 10px; }
}
@media (max-width: 400px) {
  .container { padding: 0 18px; }
  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 1.55em; }
}
