/* ============================================================
   la IA en la PYME — the academy's own stylesheet (BRIEF.md §8).
   The AOS design system of packages/platform/docs/design/aos-legacy: cream canvas, black and ink
   type, rust as the one accent (wordmark period, anchor underline, reading progress, focus;
   well under 5 % of any surface), Instrument Serif / Inter / JetBrains Mono, hairlines,
   radius 0–2 px, no shadows, no gradients, no pure white, no dark mode.
   It never touches the site's compiled CSS; the fonts are the site's, in /fonts/.
   ============================================================ */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-400.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-400italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-var.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-var.woff2") format("woff2");
}

:root {
  --aos-cream: #f4f1eb;
  --aos-cream-2: #fefdfb;
  --aos-black: #111111;
  --aos-ink: #2a2a2a;
  --aos-muted: #777777;
  --aos-border: #e8e4dd;
  --aos-rust: #a63d20;

  --aos-font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --aos-font-sans: "Inter", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --aos-font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --aos-hairline: 1px solid var(--aos-border);
  --aos-radius: 2px;
  --aos-transition: 150ms ease;

  /* The reading column: 65–72 characters of body text. In `em`, not `ch`: a `ch` is the
     width of "0", wider than Inter's average letter, and 68ch measured 87 characters a line.
     34em of 17px Inter holds about 69. */
  --lectura: 34em;
  --gutter: 20px;
  --indice: 200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--aos-cream);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--aos-cream);
  color: var(--aos-ink);
  font-family: var(--aos-font-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--aos-rust);
  color: var(--aos-cream);
}

:focus-visible {
  outline: 2px solid var(--aos-rust);
  outline-offset: 2px;
}

a {
  color: var(--aos-black);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--aos-transition);
}
a:hover {
  color: var(--aos-rust);
}

/* Mono system label: uppercase, wide tracking. */
.etiqueta,
.indice-movil summary {
  font-family: var(--aos-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--aos-muted);
}
.etiqueta {
  margin: 0 0 12px;
}
.etiqueta a {
  color: inherit;
  text-decoration: none;
}
.etiqueta a:hover {
  color: var(--aos-black);
}

/* ---------- Header and footer ---------- */

/* The header is the site's main navigation, copied from the compiled home and /empieza/ rules
   (wordmark, centred links, black "Empieza" button; 72 px tall on phones, 120 px from 701 px),
   so crossing between the site and the academy does not change the menu. */
.cabecera {
  border-bottom: var(--aos-hairline);
}
.cabecera-interior {
  width: min(1180px, 100% - 32px);
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.marca-sitio {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.085em;
  text-transform: lowercase;
  color: var(--aos-black);
  text-decoration: none;
}
.marca-sitio span {
  margin-left: 0.05em;
  font-weight: 700;
  color: var(--aos-rust);
}
.marca-sitio:hover {
  color: var(--aos-black);
}
.cabecera-enlaces {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cabecera-enlaces a {
  font:
    700 12px/1 Arial,
    Helvetica,
    sans-serif;
  color: var(--aos-black);
  text-decoration: none;
}
.cabecera-enlaces a:hover,
.cabecera-enlaces a[aria-current] {
  color: var(--aos-rust);
}
.cabecera-boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--aos-black);
  background: var(--aos-black);
  color: var(--aos-cream);
  font:
    700 15px/1 Arial,
    Helvetica,
    sans-serif;
  text-decoration: none;
  transition:
    background var(--aos-transition),
    border-color var(--aos-transition);
}
.cabecera-boton:hover {
  background: var(--aos-rust);
  border-color: var(--aos-rust);
  color: var(--aos-cream);
}
@media (max-width: 420px) {
  .cabecera-interior {
    gap: 10px;
  }
  .marca-sitio {
    font-size: 32px;
  }
  .cabecera-enlaces {
    gap: 10px;
  }
  .cabecera-boton {
    padding: 10px 12px;
    font-size: 13px;
  }
}
@media (min-width: 701px) {
  .cabecera-interior {
    height: 120px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
  .marca-sitio {
    justify-self: start;
  }
  .cabecera-enlaces {
    justify-self: center;
    gap: 42px;
  }
  .cabecera-enlaces a {
    font-size: 18px;
  }
  .cabecera-boton {
    justify-self: end;
    min-width: 126px;
    min-height: 64px;
    padding: 0 24px;
  }
}
@media (min-width: 1101px) {
  .cabecera-interior {
    width: min(1508px, 100% - 48px);
  }
}

.pie-interior {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: baseline;
  gap: 24px;
}
.marca {
  font-family: var(--aos-font-serif);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--aos-black);
  text-decoration: none;
}
.marca .punto {
  color: var(--aos-rust);
}

.pie {
  margin-top: 96px;
  border-top: var(--aos-hairline);
}
.pie-interior {
  padding-top: 32px;
  padding-bottom: 48px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--aos-muted);
}
.pie-interior p {
  margin: 0;
}
.pie-interior a:not(.marca) {
  color: var(--aos-muted);
}
.pie .marca {
  font-size: 22px;
  margin-right: auto;
}

/* ---------- Reading progress ---------- */

.progreso {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 20;
  pointer-events: none;
}
.progreso span {
  display: block;
  height: 100%;
  background: var(--aos-rust);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- Layout: index + reading column ---------- */

.espina {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.lectura {
  max-width: var(--lectura);
  min-width: 0;
}
.lectura-sola {
  margin: 0 auto;
  padding: 56px var(--gutter) 0;
  box-sizing: content-box;
}
/* A page that opens with its label: the title follows the label, not the header. */
.lectura .etiqueta + h1 {
  margin-top: 0;
}

.indice-lateral {
  display: none;
}
.indice-lateral ol,
.indice-movil ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.indice-lateral a,
.indice-movil a {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--aos-muted);
  text-decoration: none;
}
.indice-lateral a:hover,
.indice-movil a:hover,
.indice-lateral a[aria-current],
.indice-movil a[aria-current] {
  color: var(--aos-black);
}
.indice-num {
  font-family: var(--aos-font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  padding-top: 2px;
}

/* Phone: a collapsible index that stays at the top while reading. */
.indice-movil {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--aos-cream);
  border-bottom: var(--aos-hairline);
  padding: 0 var(--gutter);
}
.indice-movil summary {
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
}
.indice-movil summary::-webkit-details-marker {
  display: none;
}
.indice-movil summary::after {
  content: "+";
  float: right;
  letter-spacing: 0;
}
.indice-movil[open] summary::after {
  content: "−";
}
.indice-movil ol {
  padding-bottom: 12px;
}

@media (min-width: 1024px) {
  :root {
    --gutter: 32px;
  }
  .indice-movil {
    display: none;
  }
  .espina {
    display: grid;
    grid-template-columns: var(--indice) minmax(0, var(--lectura));
    column-gap: 80px;
  }
  .indice-lateral {
    display: block;
    position: sticky;
    top: 48px;
    align-self: start;
    padding-top: 72px;
  }
}

/* ---------- Prose ---------- */

.lectura h1 {
  font-family: var(--aos-font-serif);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--aos-black);
  margin: 48px 0 16px;
}
.lectura h2 {
  font-family: var(--aos-font-serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--aos-black);
  margin: 72px 0 20px;
}
.lectura h3 {
  font-family: var(--aos-font-sans);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.3;
  color: var(--aos-black);
  margin: 40px 0 12px;
}
.lectura p,
.lectura ul,
.lectura ol {
  margin: 0 0 1.2em;
}
.lectura strong {
  color: var(--aos-black);
  font-weight: 600;
}
.entradilla {
  font-size: 20px;
  line-height: 1.5;
  color: var(--aos-black);
}
.meta,
.firma {
  font-size: 13px;
  color: var(--aos-muted);
}
.firma a {
  color: var(--aos-ink);
}

@media (min-width: 1024px) {
  .lectura h1 {
    font-size: 64px;
    letter-spacing: -2px;
    margin-top: 72px;
  }
  .lectura h2 {
    font-size: 36px;
  }
}

/* Each block opens with its number. */
.lectura {
  counter-reset: bloque;
}
section.bloque {
  counter-increment: bloque;
}
section.bloque > h2::before {
  content: "Bloque " counter(bloque, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  font-family: var(--aos-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--aos-muted);
}
/* The index and the way back from a node land a block or an anchor below the top edge. */
section.bloque {
  scroll-margin-top: 56px;
}
/* "Volver al artículo" lands on the anchor; leave room above it to read its paragraph from
   the start. The deepest anchor sits 8 lines into its paragraph on a 375px phone. */
.lectura a.ancla {
  scroll-margin-top: 16em;
}
/* Below 1024px the sticky index bar (about 48px) covers the top of the screen: add it. */
@media (max-width: 1023px) {
  .lectura a.ancla {
    scroll-margin-top: calc(16em + 56px);
  }
}

/* An anchor is the spine's own sentence: it keeps the text colour and gets a thin rust
   underline, so it reads as "there is more behind this", not as an ordinary link. */
.lectura a.ancla {
  color: inherit;
  text-decoration-color: var(--aos-rust);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
}
.lectura a.ancla:hover {
  color: var(--aos-black);
  text-decoration-thickness: 2px;
}

/* ---------- "Profundiza" cards ---------- */

.profundiza {
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: var(--aos-hairline);
}
.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tarjeta {
  display: block;
  padding: 24px;
  background: var(--aos-cream-2);
  border: var(--aos-hairline);
  border-radius: var(--aos-radius);
  color: var(--aos-ink);
  text-decoration: none;
  transition: border-color var(--aos-transition);
}
.tarjeta:hover {
  color: var(--aos-ink);
  border-color: var(--aos-black);
}
.tarjeta-titulo {
  display: block;
  font-family: var(--aos-font-serif);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--aos-black);
}
.tarjeta-autor {
  display: block;
  margin: 8px 0 12px;
  font-size: 13px;
  color: var(--aos-muted);
}
.lectura .tarjeta-ideas {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
}
.tarjeta-ideas li {
  padding-left: 16px;
  text-indent: -16px;
}
.tarjeta-ideas li + li {
  margin-top: 6px;
}
.tarjeta-ideas li::before {
  content: "—  ";
  color: var(--aos-muted);
}

/* ---------- Node ---------- */

/* The direct answer: the node's first paragraph, set larger, in black. */
.lectura p.respuesta {
  margin: 32px 0 32px;
  padding-left: 20px;
  border-left: 2px solid var(--aos-black);
  font-size: 20px;
  line-height: 1.55;
  color: var(--aos-black);
}

.relacionado {
  margin-top: 56px;
  padding-top: 24px;
  border-top: var(--aos-hairline);
}
.relacionado ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.relacionado li {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  column-gap: 16px;
  padding: 14px 0;
  border-bottom: var(--aos-hairline);
  line-height: 1.4;
}
.rel-tipo {
  grid-row: span 2;
  padding-top: 3px;
  font-family: var(--aos-font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--aos-muted);
}
.rel-titulo {
  color: var(--aos-black);
}
.rel-autor {
  display: block;
  font-size: 13px;
  color: var(--aos-muted);
}
/* Not written yet: title and planned voice, in grey. */
.relacionado li.pendiente .rel-titulo {
  color: var(--aos-muted);
}
.articulos li {
  grid-template-columns: minmax(0, 1fr);
}

.acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin-top: 40px;
}
.accion {
  padding: 10px 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--aos-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--aos-ink);
}
.accion:hover {
  border-bottom-color: var(--aos-rust);
}

@media (max-width: 480px) {
  .relacionado li {
    grid-template-columns: minmax(0, 1fr);
  }
  .rel-tipo {
    grid-row: auto;
  }
}

/* ---------- Map ---------- */

.indice-mapa {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: var(--aos-hairline);
  font-size: 14px;
}
.indice-movil .indice-mapa {
  margin: 0 0 12px;
}
.indice-mapa a {
  color: var(--aos-ink);
}

.grafo-figura {
  margin: 40px 0 8px;
}
.grafo {
  display: block;
  width: 100%;
  height: auto;
  border: var(--aos-hairline);
  border-radius: var(--aos-radius);
  background: var(--aos-cream-2);
}
.grafo-bloque {
  font-family: var(--aos-font-mono);
  font-size: 13px;
  letter-spacing: 0.15em;
  fill: var(--aos-muted);
}
.grafo-arista {
  fill: none;
  stroke: var(--aos-black);
  stroke-width: 1.25;
}
.grafo-arista-pendiente {
  stroke: var(--aos-muted);
  stroke-dasharray: 4 4;
}
.grafo-nodo {
  fill: var(--aos-cream-2);
  stroke: var(--aos-muted);
  stroke-width: 1.25;
}
.grafo-publicado {
  fill: var(--aos-black);
  stroke: var(--aos-black);
}
a:hover .grafo-publicado {
  fill: var(--aos-rust);
  stroke: var(--aos-rust);
}
.grafo-figura figcaption {
  margin-top: 8px;
}

.mapa-bloque h2 {
  margin: 0 0 8px;
  font-size: 28px;
}
.mapa-bloque h2 a {
  color: var(--aos-black);
  text-decoration: none;
}
.mapa-bloque h2 a:hover {
  color: var(--aos-rust);
}

/* ---------- The two doors into a node ---------- */

/* Origin strip: for the reader who arrives from LinkedIn and has never seen the spine. */
.origen {
  margin: 0 0 40px;
  padding: 20px 0;
  border-top: var(--aos-hairline);
  border-bottom: var(--aos-hairline);
  font-size: 15px;
  line-height: 1.55;
  color: var(--aos-ink);
}
.lectura .origen p {
  margin: 0 0 12px;
}
.origen cite {
  font-family: var(--aos-font-serif);
  font-size: 1.2em;
  font-style: italic;
}
.origen blockquote {
  margin: 0;
  padding-left: 16px;
  border-left: 2px solid var(--aos-border);
  font-family: var(--aos-font-serif);
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.3px;
}
.origen blockquote a {
  color: var(--aos-black);
  text-decoration-color: var(--aos-rust);
  text-underline-offset: 0.2em;
}

/* "Seguir leyendo": the routes into the spine, then the LinkedIn conversation. */
.seguir {
  margin-top: 56px;
  padding-top: 24px;
  border-top: var(--aos-hairline);
}
.ruta {
  display: block;
  padding: 16px 0;
  border-bottom: var(--aos-hairline);
  color: var(--aos-ink);
  text-decoration: none;
}
.ruta-nombre {
  display: block;
  font-family: var(--aos-font-serif);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--aos-black);
}
.ruta-nombre::after {
  content: " →";
  font-family: var(--aos-font-sans);
  font-size: 18px;
}
.ruta-nombre cite {
  font-style: italic;
}
.ruta-detalle {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--aos-muted);
}
.ruta:hover .ruta-nombre {
  color: var(--aos-rust);
}
