/* ==========================================================================
   estilo.css : aspecto (color, tipografía, bordes, sombras y movimiento).
   La disposición vive en layout.css y la impresión en impresion.css.
   Tipografías autoalojadas (sin peticiones a terceros). Tema claro de estética técnica (estilo Swiss + bento, JetBrains Mono +
   IBM Plex Sans, azul tecnológico) decidido con la skill UI/UX Pro Max.
   Sin clases ni identificadores: elementos, selectores estructurales y :has().
   Sin var(), sin redefiniciones de propiedades, sin media queries y sin
   animaciones (así tampoco hace falta prefers-reduced-motion), para
   que el validador CSS del W3C no emita ni un solo aviso.
   ========================================================================== */

body {
    font-family: "IBM Plex Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    background-color: #f8fafc;
    color: #0f172a;
}

body::before {
    content: "";
    background-image: radial-gradient(48rem 26rem at 90% -4%, #dbeafe, transparent 70%), radial-gradient(#dbe3ee 0.07rem, transparent 0.08rem);
    background-size: auto, 1.5rem 1.5rem;
    background-repeat: no-repeat, repeat;
}

::selection {
    background-color: #1e40af;
    color: #ffffff;
}

/* ---------- Texto ---------- */

h1 {
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: clamp(2.2rem, 6.2vw, 4.2rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.05em;
    background-color: transparent;
    color: #0f172a;
}

h2 {
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    background-color: transparent;
    color: #0f172a;
}

h3 {
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.03em;
    background-color: transparent;
    color: #0f172a;
}

h1 em {
    font-style: normal;
    background-color: transparent;
    color: #1e40af;
}

main > h1 + p,
main > header > p,
main > section:first-child > p {
    font-size: 1.15rem;
    background-color: transparent;
    color: #334155;
}

main > section > h2::before,
main > header > h2::before {
    content: "##";
    margin-right: 0.6rem;
    background-color: transparent;
    color: #1e40af;
}

small {
    font-size: 0.8em;
    background-color: transparent;
    color: #334155;
}

strong {
    background-color: transparent;
    color: #0f172a;
}

cite {
    font-style: italic;
}

/* ---------- Enlaces y foco ---------- */

a {
    color: #1e3a8a;
    background-color: transparent;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
}

a:hover {
    color: #0f172a;
    background-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
main:focus-visible {
    outline: 0.2rem solid #1e40af;
    outline-offset: 0.25rem;
}

a[target="_blank"]::after {
    content: " \2197";
}

/* ---------- Enlace de salto ---------- */

body > a:first-child {
    background-color: #1e40af;
    color: #ffffff;
    font-weight: 700;
    border-radius: 0 0 0.6rem 0.6rem;
    text-decoration: none;
}

/* ---------- Cabecera ---------- */

body > header {
    background-color: #ffffff;
    color: #0f172a;
    border-bottom: 0.1rem solid #e2e8f0;
    box-shadow: 0 0.4rem 1.2rem rgba(15, 23, 42, 0.05);
}

body > header a {
    color: #334155;
    background-color: transparent;
    text-decoration: none;
}

body > header > p {
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background-color: transparent;
    color: #0f172a;
}

body > header > p a {
    color: #0f172a;
    background-color: transparent;
}

body > header > p a::before {
    content: ">_";
    margin-right: 0.6rem;
    background-color: transparent;
    color: #1e40af;
}

body > header > nav:first-of-type a {
    border-radius: 0.5rem;
    font-size: 0.92rem;
    font-weight: 500;
}

body > header > nav:first-of-type a:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

body > header > nav:first-of-type a[aria-current] {
    background-color: #dbeafe;
    color: #1e3a8a;
    font-weight: 700;
}

body > header > nav:first-of-type a[aria-current]:hover {
    background-color: #dbeafe;
    color: #1e3a8a;
}

body > header > nav:last-of-type {
    border: 0.1rem solid #e2e8f0;
    border-radius: 0.5rem;
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 700;
    background-color: #f1f5f9;
    color: #334155;
}

body > header > nav:last-of-type a {
    border-radius: 0.4rem;
}

body > header > nav:last-of-type a:hover {
    background-color: #dbeafe;
    color: #1e3a8a;
}

body > header > nav:last-of-type a[aria-current] {
    background-color: #1e40af;
    color: #ffffff;
}

/* ---------- Formularios y botones ---------- */

input,
textarea {
    font: inherit;
    background-color: #ffffff;
    color: #0f172a;
    border: 0.1rem solid #334155;
    border-radius: 0.6rem;
}

input:focus,
textarea:focus {
    border-color: #1e40af;
    box-shadow: 0 0 0 0.25rem #dbeafe;
}

::placeholder {
    background-color: transparent;
    color: #334155;
    opacity: 1;
}

body > header input {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: #e2e8f0;
    font-size: 0.9rem;
}

body > header input::placeholder {
    background-color: transparent;
    color: #334155;
}

button,
main section > nav a,
main > p:last-child > a {
    font: inherit;
    font-weight: 600;
    background-color: #1e40af;
    color: #ffffff;
    border: 0.1rem solid transparent;
    border-radius: 0.6rem;
    text-decoration: none;
    box-shadow: 0 0.4rem 1rem rgba(37, 99, 235, 0.25);
    cursor: pointer;
}

button:hover,
main section > nav a:hover,
main > p:last-child > a:hover {
    background-color: #1e3a8a;
    color: #ffffff;
    box-shadow: 0 1.4rem 2.6rem rgba(37, 99, 235, 0.16);
}

main section > nav a:last-child {
    background-color: #ffffff;
    color: #1e3a8a;
    border-color: #1e40af;
    box-shadow: none;
}

main section > nav a:last-child:hover {
    background-color: #dbeafe;
    color: #1e3a8a;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ---------- Migas de pan ---------- */

body > nav {
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.82rem;
    background-color: transparent;
    color: #334155;
}

body > nav li:first-child::before {
    content: "~/";
    background-color: transparent;
    color: #1e40af;
}

body > nav li + li::before {
    content: "/";
    margin-right: 0.5rem;
    opacity: 0.6;
}

body > nav [aria-current] {
    color: #0f172a;
    background-color: transparent;
    font-weight: 700;
}

/* ---------- Tarjetas (bento) ---------- */

article {
    background-color: #ffffff;
    color: #0f172a;
    border: 0.1rem solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 0.1rem 0.2rem rgba(15, 23, 42, 0.05), 0 0.8rem 1.8rem rgba(15, 23, 42, 0.07);
}

article:hover {
    border-color: #1e40af;
    box-shadow: 0 0.2rem 0.4rem rgba(15, 23, 42, 0.06), 0 1.4rem 2.6rem rgba(37, 99, 235, 0.16);
}

article p,
article li {
    background-color: transparent;
    color: #334155;
}

article > p:has(> time) {
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.82rem;
    font-weight: 500;
    border-bottom: 0.1rem solid #e2e8f0;
    background-color: transparent;
    color: #1e3a8a;
}

article code {
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0.4rem;
    border: 0.1rem solid #e2e8f0;
    background-color: #f1f5f9;
    color: #0f172a;
}

article h3 a {
    color: #0f172a;
    background-color: transparent;
    text-decoration: none;
}

article img {
    border-radius: 0.6rem;
    object-fit: cover;
}

/* ---------- Figuras ---------- */

figure img {
    border-radius: 1rem;
    object-fit: cover;
    box-shadow: 0 0.2rem 0.4rem rgba(15, 23, 42, 0.06), 0 1.4rem 2.6rem rgba(37, 99, 235, 0.16);
}

figcaption {
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.8rem;
    background-color: transparent;
    color: #334155;
}

main > section:first-child > figure img {
    border: 0.35rem solid #ffffff;
    border-radius: 50%;
    outline: 0.12rem dashed #1e40af;
    outline-offset: 0.5rem;
}

video,
audio {
    border-radius: 0.8rem;
    box-shadow: 0 0.1rem 0.2rem rgba(15, 23, 42, 0.05), 0 0.8rem 1.8rem rgba(15, 23, 42, 0.07);
}

video {
    background-color: #0f172a;
    color: #ffffff;
}

/* ---------- Tablas: ventana de editor ---------- */

table {
    border-collapse: separate;
    border-spacing: 0;
    background-color: #ffffff;
    color: #0f172a;
    border: 0.1rem solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 0.1rem 0.2rem rgba(15, 23, 42, 0.05), 0 0.8rem 1.8rem rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

caption {
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.8rem;
    text-align: left;
    background-color: #f1f5f9;
    color: #334155;
    border-style: solid;
    border-width: 0.1rem 0.1rem 0;
    border-color: #e2e8f0;
    border-radius: 1rem 1rem 0 0;
}

caption::before {
    content: "";
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    margin-right: 3.2rem;
    border-radius: 50%;
    background-color: #ef4444;
    color: #0f172a;
    box-shadow: 1.1rem 0 #f59e0b, 2.2rem 0 #22c55e;
}

th,
td {
    text-align: left;
    border-bottom: 0.1rem solid #e2e8f0;
}

thead th {
    background-color: #ffffff;
    color: #334155;
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

tbody th {
    background-color: transparent;
    color: #0f172a;
    font-weight: 600;
}

tbody tr:last-child > * {
    border-bottom: 0;
}

/* ---------- Marcas, índice local y mapa ---------- */

mark {
    background-color: #dbeafe;
    color: #0f172a;
}

main > header > nav a {
    background-color: #ffffff;
    color: #1e3a8a;
    border: 0.1rem solid #e2e8f0;
    border-radius: 2rem;
    text-decoration: none;
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.9rem;
    font-weight: 700;
}

main > ul li {
    border-left: 0.3rem solid #1e40af;
    border-radius: 0 0.6rem 0.6rem 0;
    background-color: #ffffff;
    color: #334155;
    box-shadow: 0 0.1rem 0.2rem rgba(15, 23, 42, 0.05), 0 0.8rem 1.8rem rgba(15, 23, 42, 0.07);
}

main > ul a {
    font-weight: 700;
}

main:has(> section > form) > header dl > div {
    background-color: #ffffff;
    color: #0f172a;
    border: 0.1rem solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 0.1rem 0.2rem rgba(15, 23, 42, 0.05), 0 0.8rem 1.8rem rgba(15, 23, 42, 0.07);
}

main:has(> section > form) > header dt {
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-weight: 700;
    background-color: transparent;
    color: #0f172a;
}

main:has(> section > form) > section {
    background-color: #ffffff;
    color: #0f172a;
    border: 0.1rem solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 0.1rem 0.2rem rgba(15, 23, 42, 0.05), 0 0.8rem 1.8rem rgba(15, 23, 42, 0.07);
}

/* ---------- Pie ---------- */

body > footer {
    background-color: #ffffff;
    color: #334155;
    border-top: 0.1rem solid #e2e8f0;
    font-size: 0.95rem;
}

body > footer p {
    background-color: transparent;
    color: #334155;
}

body > footer a {
    color: #1e3a8a;
    background-color: transparent;
}

body > footer a:hover {
    color: #0f172a;
    background-color: transparent;
}

body > footer small {
    background-color: transparent;
    color: #334155;
}
