/* Estilos comunes del sitio: portada y página 404 (con su cara animada) (la barra de arriba es de /css/common.css).
   Lo que es de las guías con índice lateral (Networking y Videojuegos) está en /css/guide-kit.css,
   y una guía con identidad propia puede no cargar este archivo (campo noBaseStyles). */
/* Base: márgenes, tamaño de caja y espacio para las zonas seguras del celular */
:root {color-scheme:light;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
html {scroll-padding-top:env(safe-area-inset-top,0px)}
body {margin:0;padding:0}
img {max-width:100%}
[hidden]:not([hidden=until-found i]) {display:none!important}
/* Colores y tipografía del sitio. Las tarjetas de la portada toman sus acentos de la familia --f-* (heredada
   del código de colores de la fibra óptica de Networking); las guías con identidad propia definen los suyos. */
:root {
  --sea: #FCFCFB;
  --surface: #FFFFFF;
  --tint: #EFEDE4;
  --ink: #12253A;
  --muted: #66615A;
  --rule: #DDD9CC;
  --on-strand: #FFFFFF;
  /* Títulos en Pirata One de la portada: pergamino viejo en claro y crema en oscuro; al pasar el mouse, sepia en claro y dorado en oscuro */
  --home-title: #8A6F3E;
  --home-title-hover: #4E3718;
  /* Código de colores de fibra (TIA-598) */
  --f-blue: #1B62C2;
  --f-orange: #C55F08;
  --f-green: #137F48;
  --f-violet: #6A40B4;
  --f-slate: #56687A;
  --f-aqua: #08858A;
  --font-display: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.55rem;
  --step-3: clamp(1.9rem, 1.3rem + 2.4vw, 2.7rem);
  --step-4: clamp(2.7rem, 1.4rem + 5.4vw, 5.2rem);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sea: #151515; --surface: #1A1A19; --tint: #1F1F1E; --ink: #EEEDE8; --muted: #A3A198; --rule: #2E2E2C;
    --on-strand: #151515; --home-title: #F3ECDC; --home-title-hover: #D8B25A;
    --f-blue: #63A3FF; --f-orange: #FF9F4A; --f-green: #4CD593; --f-violet: #B094F5; --f-slate: #A3B4C4; --f-aqua: #45D8D8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sea: #151515; --surface: #1A1A19; --tint: #1F1F1E; --ink: #EEEDE8; --muted: #A3A198; --rule: #2E2E2C;
  --on-strand: #151515; --home-title: #F3ECDC; --home-title-hover: #D8B25A;
  --f-blue: #63A3FF; --f-orange: #FF9F4A; --f-green: #4CD593; --f-violet: #B094F5; --f-slate: #A3B4C4; --f-aqua: #45D8D8;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  background: var(--sea);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--strand, var(--f-blue)); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--strand, var(--f-blue)); }
:focus-visible { outline: 2.5px solid var(--f-blue); outline-offset: 3px; border-radius: 4px; }
code, .mono { font-family: var(--font-mono); font-size: .88em; }
code { background: var(--tint); padding: .08em .35em; border-radius: 5px; white-space: nowrap; }
strong { font-weight: 700; }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
.wrap { --pad: clamp(16px, 4vw, 48px); padding-inline: var(--pad); }
.btn {
  font: inherit; font-size: .9rem; color: var(--ink); background: var(--surface); border: 1px solid var(--rule);
  border-radius: 999px; padding: .42rem .9rem; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; line-height: 1.2;
}
.btn:hover { border-color: var(--muted); }
.btn svg { width: 16px; height: 16px; flex: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
/* Página principal: lista de documentos. Cada documento lleva el color de fibra de su tema. */
.hub { max-width: 52rem; margin: 0 auto; padding-block: clamp(32px, 7vw, 88px) 72px; }
.hub-title { font-size: var(--step-3); font-weight: 760; line-height: 1.05; margin: 0 0 12px; }
.hub-intro { margin: 0 0 clamp(20px, 3vw, 32px); color: var(--muted); max-width: var(--common-intro-width); }
.doc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.doc-list li { border-bottom: 1px solid var(--rule); }
.doc { display: grid; gap: 6px; padding: 22px 4px; text-decoration: none; position: relative; border-radius: 6px; }
.doc:hover .doc-title { color: var(--strand); }
.doc-title { font-family: var(--font-display); font-size: var(--step-2); font-weight: 720; line-height: 1.15; text-wrap: balance; transition: color .2s; }
.doc-desc { color: var(--ink); max-width: 40rem; }
/* Portada con artículos: el título y los de cada artículo en Pirata One (la carga index.njk). Tiene un solo grosor, así que va en 400,
   y es angosta: necesita más tamaño que Inter para verse igual de grande. */
.hub-home .hub-title, .hub-home .doc-title { font-family: "Pirata One", var(--font-display); font-weight: 400; letter-spacing: .01em; color: var(--home-title); }
.hub-home .hub-title { font-size: clamp(48px, 6.4vw, 84px); line-height: .95; margin-bottom: 20px; }
.hub-home .doc-title { font-size: clamp(32px, 3.4vw, 46px); line-height: 1.1; }
.hub-home .doc:hover .doc-title { color: var(--home-title-hover); }
/* 404: una cara que se arma (ojos, nariz y boca), mira a los costados y parpadea. Adaptada de «Card» de preet_7613 en Uiverse
   (https://uiverse.io/preet_7613/new-cougar-63), con licencia MIT. Toma el color del texto; con movimiento reducido queda quieta, ya armada. */
.lost-face { display: block; width: clamp(96px, 18vw, 140px); height: auto; margin: 0 0 clamp(20px, 3vw, 32px); color: var(--ink); overflow: visible; }
.lost-face__eyes, .lost-face__lid, .lost-face__pupil, .lost-face__nose, .lost-face__mouth-left, .lost-face__mouth-right { animation: lost-face-eyes 1s .3s forwards; }
.lost-face__lid, .lost-face__pupil { animation-duration: 4s; animation-delay: 1.3s; animation-iteration-count: infinite; }
.lost-face__lid { animation-name: lost-face-lid; }
.lost-face__pupil { animation-name: lost-face-pupil; }
.lost-face__nose { animation-name: lost-face-nose; }
.lost-face__mouth-left { animation-name: lost-face-mouth-left; }
.lost-face__mouth-right { animation-name: lost-face-mouth-right; }
@media (prefers-reduced-motion: reduce) {
  .lost-face * { animation-duration: 0s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
}
@keyframes lost-face-eyes { from { transform: translateY(112.5px); } to { transform: translateY(15px); } }
@keyframes lost-face-lid { 0%, 40%, 45%, 100% { transform: translateY(0); } 42.5% { transform: translateY(17.5px); } }
@keyframes lost-face-pupil {
  0%, 37.5%, 40%, 45%, 87.5%, 100% { stroke-dashoffset: 0; transform: translate(0, 0); }
  12.5%, 25%, 62.5%, 75% { transform: translate(-35px, 0); }
  42.5% { stroke-dashoffset: 35; transform: translate(0, 17.5px); }
}
@keyframes lost-face-nose { from { transform: translate(0, 0); } to { transform: translate(0, 22.5px); } }
@keyframes lost-face-mouth-left { from, 50% { stroke-dashoffset: -102; } to { stroke-dashoffset: 0; } }
@keyframes lost-face-mouth-right { from, 50% { stroke-dashoffset: 102; } to { stroke-dashoffset: 0; } }
/* Barra del sitio (site-bar.njk), con artículos publicados: «rusocode» arriba a la izquierda, donde las guías tienen «Volver», y las
   secciones a la derecha, antes del foco (16 px de borde + 44 del foco + 16 de aire = 76). Son fijos, como «Volver» y el foco (la posición está en common.css). */
.brand, .site-nav { display: flex; align-items: center; min-height: 44px; font-family: var(--common-font); font-size: 1.0625rem; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.site-nav { right: 76px; gap: clamp(14px, 3vw, 28px); }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--f-blue); }
/* Lista de artículos: la fecha arriba del título (el resto es la lista de documentos de la portada) y el enlace a todos */
.doc-date { color: var(--muted); font-size: .9rem; }
.hub-more { margin: 24px 0 0; }
