/* Monet · sitio. Sin recursos de terceros. Paleta y letra de docs/DESIGN.md (Outfit variable, OFL). */

@font-face {
  font-family: "Outfit Monet";
  src: url("assets/fonts/Outfit-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* Niebla clara */
:root {
  color-scheme: light dark;
  --ink: #14161a;
  --ink-soft: #545969;
  --ink-faint: #646a79;
  --paper: #eef1f7;
  --surface: rgb(255 255 255 / 0.62);
  --hairline: rgb(20 22 26 / 0.1);
  --edge: rgb(255 255 255 / 0.8);
  --lila: #b9bff5;
  --lila-deep: #4d54b8;
  --amanecer: #ffb48f;
  --estanque: #247a68;
  --haze-a: rgb(185 191 245 / 0.32);
  --haze-b: rgb(255 180 143 / 0.22);
  --shadow: 0 1px 2px rgb(20 22 26 / 0.04), 0 12px 32px rgb(20 22 26 / 0.06);
  --measure: 38rem;
  --page: 72rem;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-card: 30px;
  --accent: #5d64c8;
  --band: #e6eaf2;
  --card: #ffffff;
  /* Escala: cada paso es al menos 1,25 veces el anterior. */
  --t-small: 0.9375rem;
  --t-body: 1.125rem;
  --t-h3: 1.4375rem;
  --t-h2: clamp(1.875rem, 3.4vw, 2.25rem);
  --t-title: clamp(2.5rem, 5vw, 3.75rem);
  --t-doc: clamp(2.75rem, 6vw, 4.25rem);
  --t-display: clamp(3rem, 8vw, 6.5rem);
}

/* Estanque de noche */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4f5f7;
    --ink-soft: #a3a9b6;
    --ink-faint: #858b9a;
    --paper: #0b0c10;
    --surface: #15191e;
    --hairline: rgb(255 255 255 / 0.09);
    --edge: rgb(255 255 255 / 0.14);
    --lila: #8f97f0;
    --lila-deep: #aab0f6;
    --amanecer: #ff9e73;
    --estanque: #4fbfa4;
    --haze-a: rgb(20 74 67 / 0.55);
    --haze-b: rgb(34 33 74 / 0.6);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px rgb(0 0 0 / 0.25);
    --accent: #a3a9f6;
    --band: #101318;
    --card: #15191e;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Las nubes de las cabeceras pueden salirse por el borde: se recortan sin crear desplazamiento lateral. */
html,
body {
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--paper);
  background-image:
    radial-gradient(60rem 28rem at 8% -6rem, var(--haze-a), transparent 70%),
    radial-gradient(56rem 26rem at 96% -4rem, var(--haze-b), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: "Outfit Monet", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: var(--t-body);
  line-height: 1.6;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, var(--lila-deep) 55%, transparent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--lila-deep);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  z-index: 10;
}

.skip:focus {
  top: 0.75rem;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

/* Barra de navegación: completa arriba; al bajar se encoge en una píldora negra centrada, como la isla dinámica. */

.brand {
  display: inline-flex;
  text-decoration: none;
  border-radius: 8px;
}

.brand img {
  height: 34px;
  width: auto;
}

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  pointer-events: none;
}

.nav-bar {
  --island: #0b0c10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2 * var(--gutter), var(--page));
  height: 4.75rem;
  margin: 0 auto;
  padding: 0;
  border-radius: 0;
  background-color: transparent;
  color: var(--ink);
  pointer-events: auto;
  transition:
    width 0.55s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    height 0.55s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    padding 0.55s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    border-radius 0.55s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    translate 0.55s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    background-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
  border-radius: 999px;
}

.nav-mo {
  width: 30px;
  height: 30px;
  fill: currentColor;
  transition: width 0.45s ease, height 0.45s ease;
}

.nav-word {
  height: 20px;
  width: auto;
  transition: opacity 0.25s ease, width 0.45s ease;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--t-small);
}

.nav-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.85rem;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  background-color: color-mix(in srgb, var(--ink) 7%, transparent);
}

.nav.is-compact .nav-bar {
  width: min(100% - 1.5rem, 28rem);
  height: 3.25rem;
  padding: 0 0.4rem 0 0.75rem;
  border-radius: 999px;
  translate: 0 0.6rem;
  background-color: var(--island);
  color: #f4f5f7;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 10px 30px -12px rgb(0 0 0 / 0.45);
}

.nav.is-compact .nav-mo {
  width: 26px;
  height: 26px;
}

.nav.is-compact .nav-word {
  opacity: 0;
  width: 0;
}

.nav.is-compact .nav-links a {
  color: rgb(244 245 247 / 0.72);
}

.nav.is-compact .nav-links a:hover,
.nav.is-compact .nav-links a[aria-current="page"] {
  color: #f4f5f7;
}

.nav.is-compact .nav-links a[aria-current="page"] {
  background-color: rgb(255 255 255 / 0.12);
}

/* La píldora compacta solo tiene sitio para tres enlaces. */
.nav.is-compact .nav-optional {
  display: none;
}

@media (max-width: 560px) {
  .nav-optional {
    display: none;
  }

  .nav-links a {
    padding-inline: 0.7rem;
  }
}

@media (max-width: 380px) {
  .nav-word {
    display: none;
  }

  .nav-links a {
    padding-inline: 0.55rem;
  }
}

/* Tarjeta: radio 30, un paso de tono sobre el papel. Solo un nivel. */
.card {
  max-width: 46rem;
  margin-top: 2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius-card);
  background: var(--card);
}

.card p {
  margin: 0;
}

.card p + p {
  margin-top: 1rem;
}

.card .original {
  font-size: 1.0625rem;
  color: var(--ink);
}

.card .translation {
  color: var(--ink-soft);
  font-size: 1rem;
}

.commitments {
  max-width: var(--measure);
  margin: 2rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.commitments li + li {
  margin-top: 0.4rem;
}

.more {
  margin-top: 1.75rem;
}

/* Páginas de texto: índice fijo a la izquierda con avance de lectura, artículo de 65–72 caracteres a la derecha. */

.doc-page main {
  padding-top: 7.5rem;
}

.doc-simple {
  min-height: 40vh;
}

.doc-simple-links {
  max-width: 40rem;
  margin: 1.5rem 0 0;
}

.doc-layout {
  display: grid;
  gap: 2rem;
  padding-bottom: 2rem;
}

@media (min-width: 1000px) {
  .doc-layout {
    grid-template-columns: 15rem minmax(0, 38rem);
    justify-content: space-between;
    gap: clamp(3rem, 7vw, 7rem);
  }
}

.doc {
  min-width: 0;
}

.doc-head h1 {
  margin: 0;
  font-weight: 650;
  font-size: var(--t-doc);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.meta {
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
  font-size: var(--t-small);
}

.summary {
  margin-top: 2.5rem;
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius-card);
  background: var(--card);
}

.summary h2 {
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: var(--t-h3);
}

.summary ul {
  margin: 0;
  padding-left: 1.2rem;
}

.summary li + li {
  margin-top: 0.45rem;
}

.summary-note {
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
  font-size: var(--t-small);
}

/* Índice */

.doc-aside {
  min-width: 0;
}

.toc {
  position: sticky;
  top: 6.5rem;
}

.toc summary {
  list-style: none;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--ink);
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc-current {
  display: none;
}

.toc-body {
  position: relative;
  margin-top: 1rem;
}

.toc-rail {
  position: absolute;
  left: 5px;
  top: 0.65rem;
  bottom: 0.65rem;
  width: 2px;
  border-radius: 2px;
  background: var(--hairline);
}

.toc-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: top;
  transform: scaleY(var(--read, 0));
}

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--t-small);
  line-height: 1.35;
}

.toc-list li {
  position: relative;
}

.toc-list a {
  display: block;
  padding: 0.55rem 0 0.55rem 1.6rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s ease;
}

.toc-list a::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--hairline);
  transition: background-color 0.25s ease, box-shadow 0.25s ease, scale 0.25s ease;
}

.toc-list a:hover {
  color: var(--ink);
}

.toc-list a.is-read::before {
  background: var(--accent);
  box-shadow: none;
  scale: 0.75;
}

.toc-list a.is-active {
  color: var(--ink);
  font-weight: 500;
}

.toc-list a.is-active::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
  scale: 1.15;
}

.read-progress {
  display: none;
}

/* En el teléfono y la tableta: barra de avance arriba y el índice como desplegable fijo. */
@media (max-width: 999px) {
  /* Una sola columna, centrada, del ancho de lectura. */
  .doc-layout {
    grid-template-columns: minmax(0, 38rem);
    justify-content: center;
  }

  .read-progress {
    display: block;
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 31;
    height: 3px;
  }

  .read-progress span {
    display: block;
    height: 100%;
    background: var(--accent);
    transform-origin: left;
    transform: scaleX(var(--read, 0));
  }

  .doc-aside {
    position: sticky;
    top: 4.6rem;
    z-index: 5;
    order: 0;
  }

  .toc {
    position: static;
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 0 0 1px var(--hairline);
  }

  .toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
  }

  .toc summary::after {
    content: "";
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border: solid var(--ink-soft);
    border-width: 0 2px 2px 0;
    rotate: 45deg;
    translate: 0 -2px;
    transition: rotate 0.2s ease;
  }

  .toc[open] summary::after {
    rotate: -135deg;
    translate: 0 2px;
  }

  .toc-label {
    flex: none;
  }

  .toc-current {
    display: block;
    min-width: 0;
    margin-left: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
    color: var(--ink-soft);
  }

  .toc-body {
    margin: 0;
    padding: 0 1.1rem 0.9rem;
    max-height: 55vh;
    overflow-y: auto;
  }

  .toc-rail {
    left: calc(1.1rem + 5px);
  }
}

/* Artículo */

.prose {
  max-width: 38rem;
  margin-top: 1rem;
}

/* En pantallas anchas el cuerpo va justificado con guiones en español (se comparó con alineado a la izquierda: con
   guiones no deja ríos a esta medida). En el teléfono, a la izquierda: la columna es demasiado estrecha. */
@media (min-width: 1000px) {
  @supports (hyphens: auto) {
    .prose p,
    .prose li {
      text-align: justify;
      hyphens: auto;
      -webkit-hyphens: auto;
    }
  }
}

.doc-sec {
  padding-top: 2.75rem;
}

/* Al saltar a un ancla, el título queda por debajo de la píldora de arriba (y del índice fijo en el teléfono). */
.prose h2,
.prose h3[id],
.summary {
  scroll-margin-top: 6.5rem;
}

@media (max-width: 999px) {
  .prose h2,
  .prose h3[id],
  .summary {
    scroll-margin-top: 9.5rem;
  }
}

.doc-sec + .doc-sec {
  margin-top: 0.75rem;
}

.prose h2 {
  position: relative;
  margin: 0 0 0.85rem;
  font-weight: 600;
  font-size: var(--t-h2);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.anchor {
  position: absolute;
  left: -1.4em;
  width: 1.2em;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.prose h2:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}

@media (max-width: 999px) {
  .anchor {
    display: none;
  }
}

.prose h3 {
  margin: 1.75rem 0 0.5rem;
  font-weight: 600;
  font-size: var(--t-h3);
  line-height: 1.3;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0.85rem 0 0;
}

.prose ul,
.prose ol {
  padding-left: 1.3rem;
}

.prose li + li {
  margin-top: 0.45rem;
}

.prose strong {
  font-weight: 600;
}

.prose code {
  font-size: 0.92em;
  padding: 0.1em 0.5em;
  border-radius: 6px;
  background: var(--card);
  overflow-wrap: anywhere;
}

.prose blockquote {
  margin: 1.25rem 0 0;
  padding: 1.25rem 1.5rem;
  background: color-mix(in srgb, var(--lila) 16%, var(--card));
  border-radius: 22px;
}

.prose blockquote p:first-child {
  margin-top: 0;
}

.prose table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: var(--t-small);
  line-height: 1.45;
}

.prose th,
.prose td {
  padding: 0.75rem 0.875rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--hairline);
}

.prose th {
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: 18px;
  background: var(--card);
}

.table-scroll table {
  margin-top: 0;
}

/* Tablas de muchas columnas (proveedores): en un teléfono se desplazan de lado en vez de apretarse. */
.table-scroll .table-wide {
  min-width: 44rem;
}

.steps li::marker {
  color: var(--ink-faint);
}

/* Pie: el claro de arriba se funde con la noche, donde Mo asoma hecho de puntos. */

.site-foot {
  position: relative;
  margin-top: clamp(3rem, 6vw, 5rem);
  color: var(--ink);
  font-size: var(--t-small);
}

.foot-top {
  display: grid;
  gap: 2.5rem;
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
}

@media (min-width: 860px) {
  .foot-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 4rem;
  }
}

.foot-brand .brand img {
  height: 32px;
  width: auto;
}

.foot-brand p {
  max-width: 20rem;
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: var(--t-body);
  line-height: 1.45;
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 2rem;
}

.foot-cols h2 {
  margin: 0 0 0.9rem;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--ink);
}

.foot-cols ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-cols li + li {
  margin-top: 0.55rem;
}

.foot-cols a {
  color: var(--ink-soft);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.foot-cols a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
  color: var(--ink-soft);
}

.foot-base p {
  margin: 0;
}

.foot-scene {
  display: block;
  width: 100%;
  height: clamp(300px, 40vw, 560px);
  margin-top: clamp(1rem, 3vw, 2.5rem);
  background:
    radial-gradient(55% 60% at 28% 100%, rgb(20 74 67 / 0.55), transparent 70%),
    radial-gradient(50% 60% at 74% 100%, rgb(34 33 74 / 0.7), transparent 70%),
    linear-gradient(to bottom, var(--paper) 0%, color-mix(in srgb, var(--paper) 70%, #10141d) 18%, color-mix(in srgb, var(--paper) 30%, #10141d) 40%, #10141d 68%, #0b0c10 100%);
}

/* No hay animaciones; aun así, si el sistema pide menos movimiento, el desplazamiento a un ancla tampoco se anima. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .hero::before,
  .doc-head::before,
  .top nav,
  .skip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-bar,
  .nav-mo,
  .nav-word,
  .toc-list a::before {
    transition: none;
  }
}

/* Pantallas táctiles: cada enlace de lista mide al menos 44 px de alto. */
@media (pointer: coarse) {
  .foot-cols a,
  .toc-list a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .foot-cols li + li {
    margin-top: 0;
  }

  .toc-list a::before {
    top: 50%;
    translate: 0 -50%;
  }
}
