/* =========================================================================
   Davin Díaz · estilos del sitio

   Tipografía: Source Serif 4 (títulos) y Source Sans 3 (texto), incluidas en
   assets/fonts/ bajo la SIL Open Font License 1.1. Así el sitio se ve igual en
   Windows, macOS, Android y Linux, sin depender de las fuentes instaladas.

   Los tamaños salen de una sola escala definida en :root. Para cambiar el
   tamaño de un componente, elegir otro paso de la escala; no añadir tamaños
   sueltos.
   ========================================================================= */

.case-status {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--line);
  background: var(--lightblue);
  font-size: var(--text-sm);
  color: var(--deep);
}

.prose img {
  max-width: 100%;
  height: auto;
}

.case-status p {
  margin: 0;
}

.prose figure {
  margin: 1.5rem 0;
  width: 100%;
}

.prose figcaption {
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--soft);
}

/* --- Fuentes ------------------------------------------------------------ */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-opsz-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-sans-3-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-sans-3-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Variables ---------------------------------------------------------- */

:root {
  /* Color */
  --paper: #fcfbf8;
  --muted: #f2f0e9;
  --ink: #202b30;
  --soft: #596167;
  --blue: #0d547a;
  --deep: #092a3c;
  --line: #dcded8;
  --lightblue: #e5edf0;

  /* Familias */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Escala tipográfica: un paso por función */
  --text-xs: 0.75rem;    /* 12 px · etiquetas en mayúsculas, metadatos */
  --text-sm: 0.875rem;   /* 14 px · navegación, botones, pies, notas */
  --text-base: 1rem;     /* 16 px · texto secundario en tarjetas y listas */
  --text-md: 1.125rem;   /* 18 px · texto corrido */
  --text-lg: 1.375rem;   /* 22 px · entradillas, subtítulos serif */
  --text-xl: 1.75rem;    /* 28 px · títulos de tarjeta y de apartado */
  --text-2xl: clamp(1.875rem, 1.5rem + 1.2vw, 2.5rem);    /* 30–40 px · títulos de sección */
  --text-3xl: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);     /* 36–56 px · título de página */
  --text-4xl: clamp(2.75rem, 2rem + 2.6vw, 4.5rem);       /* 44–72 px · portada */
  --text-figure: clamp(4.5rem, 3.6rem + 3vw, 5.25rem);    /* 72–84 px · cifra destacada */

  /* Interlineado y espaciado entre letras */
  --leading-tight: 1.08;
  --leading-heading: 1.15;
  --leading-body: 1.6;
  --tracking-display: -0.025em;
  --tracking-heading: -0.015em;
  --tracking-label: 0.12em;
}

/* --- Base --------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  font-kerning: normal;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #1682b8;
  outline-offset: 5px;
}

::selection {
  background: #c2dbe7;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
}

p {
  margin-bottom: 1.2em;
}

code,
pre {
  font-family: var(--mono);
}

svg {
  display: block;
  max-width: 100%;
}

.wrap {
  max-width: 1200px;
  margin: auto;
  padding: 0 48px;
}

/* Etiqueta en mayúsculas: secciones, categorías, metadatos */
.eyebrow,
.project-meta,
.figure-title,
.experiment .label,
.evidence dt {
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.eyebrow {
  color: var(--blue);
}

.rule {
  border-top: 1px solid var(--line);
}

.skip {
  position: absolute;
  left: 20px;
  top: -80px;
  padding: 12px;
  background: white;
  z-index: 30;
}

.skip:focus {
  top: 10px;
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.nav {
  height: 87px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-family: var(--serif);
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--blue);
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: var(--text-sm);
}

nav a:hover {
  color: var(--blue);
}

.site-header nav a[aria-current="page"] {
  color: var(--blue);
  border-bottom: 1px solid var(--blue);
}

.contact-link {
  border-bottom: 1px solid var(--blue);
  padding-bottom: 3px;
}

.menu-button {
  display: none;
}

.preview {
  background: var(--deep);
  color: #dae5eb;
  padding: 6px 24px;
  text-align: center;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* --- Portada: presentación ---------------------------------------------- */

/* Dos columnas alineadas arriba: titular, entrada y acciones a la izquierda;
   presentación a la derecha, con una línea que recorre todo el bloque. */
.hero {
  padding: 56px 0 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 60px;
}

.hero-main {
  container-type: inline-size;
}

/* Cada frase ocupa una línea de su columna: el tamaño sigue el ancho de
   .hero-main (100cqi) sin pasar del paso --text-4xl. Si una frase no cabe
   (teléfono), se parte en líneas equilibradas. */
.hero h1 {
  font-size: min(100cqi / 12, var(--text-4xl));
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  margin: 18px 0 28px;
}

.hero h1 .line {
  display: block;
  text-wrap: balance;
}

.hero h1 em {
  font-weight: 400;
  color: var(--blue);
}

.hero-copy {
  font-size: var(--text-md);
  max-width: 570px;
  color: #465259;
}

.hero-copy strong {
  font-weight: 600;
  color: var(--ink);
}

.hero-side {
  padding-left: 26px;
  border-left: 1px solid var(--line);
}

.hero-side p {
  font-size: var(--text-base);
  color: var(--soft);
  max-width: 290px;
}

.hero-side .byline {
  font-family: var(--serif);
  font-size: var(--text-lg);
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 14px;
}

/* Cada frase en su línea; si una no cabe, se parte en líneas equilibradas */
.hero-side .byline span {
  display: block;
  text-wrap: balance;
}

.hero-side .eyebrow {
  display: block;
  margin-bottom: 14px;
}

/* --- Enlaces y botones -------------------------------------------------- */

.actions {
  display: flex;
  align-items: center;
  gap: 25px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.primary,
.prose a.contact-button {
  display: inline-flex;
  align-items: center;
  gap: 26px;
  background: var(--deep);
  color: white;
  padding: 12px 20px;
  font-size: var(--text-sm);
  text-decoration: none;
}

.primary:hover,
.prose a.contact-button:hover {
  background: var(--blue);
}

.text-link {
  display: inline-block;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
  padding: 3px 0;
}

.text-link:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.case-link {
  display: inline-flex;
  gap: 26px;
  align-items: center;
  font-weight: 600;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--blue);
  padding: 6px 0;
  color: var(--blue);
}

.case-link:hover {
  gap: 34px;
}

/* Flechas dibujadas, iguales en todos los sistemas (las fuentes no traen estos
   signos). → otra página del sitio · ↓ más abajo en la misma página ·
   ↗ fuera del sitio (LinkedIn, GitHub, correo) · ← volver. */
.icon,
.back-link::before {
  display: inline-block;
  flex: none;
  width: 0.85em;
  height: 0.85em;
  vertical-align: -0.08em;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.icon-next {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 8h11M9 3.5 13.5 8 9 12.5'/%3E%3C/svg%3E");
}

.icon-down {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2.5v11M3.5 9 8 13.5 12.5 9'/%3E%3C/svg%3E");
}

.icon-out {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 11.5 11.5 4.5M5.5 4.5h6v6'/%3E%3C/svg%3E");
}

.back-link::before {
  content: "";
  margin-right: 0.4em;
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 8h-11M7 3.5 2.5 8 7 12.5'/%3E%3C/svg%3E");
}

/* --- Portada: trabajo seleccionado -------------------------------------- */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 36px 0 26px;
}

.section-head h1,
.section-head h2 {
  margin: 10px 0 0;
}

.section-head h1 {
  font-size: var(--text-3xl);
}

.section-head h2,
.catalog h2,
.writing h2,
.method h2,
.about h2,
.contact h2 {
  font-size: var(--text-2xl);
}

.section-head p {
  max-width: 310px;
  margin: 0;
  color: var(--soft);
  font-size: var(--text-sm);
}

.feature {
  display: grid;
  grid-template-columns: 1.06fr 1fr;
  min-height: 350px;
  background: var(--muted);
  margin-bottom: 32px;
}

.feature-copy {
  padding: 36px 38px;
}

.project-meta {
  color: var(--soft);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.feature h3 {
  font-size: var(--text-2xl);
  margin: 22px 0 14px;
}

.feature .intro {
  font-family: var(--serif);
  font-size: var(--text-lg);
  line-height: 1.35;
  letter-spacing: var(--tracking-heading);
  margin-bottom: 18px;
}

.feature-copy > p:not(.intro) {
  font-size: var(--text-base);
  color: var(--soft);
  max-width: 410px;
}

.figure {
  background: #e6edf0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px 32px;
}

.figure-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.figure-title {
  color: #385564;
}

.figure-tag {
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--blue);
  border: 1px solid #adc2cc;
  padding: 2px 7px;
  white-space: nowrap;
}

.signal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.dots {
  display: flex;
  gap: 8px;
}

/* Relleno: los modelos que cuenta la cifra grande. Contorno: el resto. */
.dot {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--blue);
}

.dot.dot-alt {
  background: transparent;
  border: 1.5px solid #78919d;
}

.dot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 14px;
  font-size: var(--text-sm);
  color: #385564;
}

.dot-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot-legend .dot {
  width: 12px;
  height: 12px;
}

.figure-big {
  font-family: var(--serif);
  font-size: var(--text-figure);
  font-variant-numeric: lining-nums;
  color: var(--deep);
  line-height: 1;
  margin: 26px 0 8px;
  letter-spacing: -0.03em;
}

.figure-big small {
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-heading);
}

.figure-caption {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: #385564;
  max-width: 320px;
}

.figure-note {
  margin: 16px 0 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.project-card {
  border-bottom: 1px solid var(--line);
  padding-bottom: 26px;
  display: flex;
  flex-direction: column;
  min-width: 0; /* deja que .mini-art recorte su contenido en columnas estrechas */
}

.project-card h3,
.essay h3 {
  font-size: var(--text-xl);
}

.project-card h3 {
  margin: 20px 0 13px;
}

.project-card p {
  font-size: var(--text-base);
  color: var(--soft);
  margin-bottom: 18px;
}

.project-card .case-link {
  align-self: start;
  margin-top: auto;
}

.mini-art {
  height: 128px;
  background: #f1f0eb;
  margin-bottom: 20px;
  overflow: hidden;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-art.blue {
  background: #edf1f1;
}

.mini-art.dark {
  background: var(--deep);
  color: #dbe7ec;
}

/* Esquema de PISA: curvas características de un reactivo en dos sistemas */
.icc {
  width: 100%;
  max-width: 270px;
  height: auto;
  overflow: visible;
}

.icc path {
  fill: none;
  stroke-width: 2;
}

.icc .icc-axis {
  stroke: #b6c6cd;
  stroke-width: 1;
}

.icc .icc-a {
  stroke: var(--blue);
}

.icc .icc-b {
  stroke: #7399ac;
  stroke-dasharray: 5 4;
}

.icc text {
  font-family: var(--sans);
  font-size: 12px;
  fill: #385564;
}

.icc .icc-x {
  text-anchor: end;
  fill: var(--soft);
}

.schema {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--blue);
}

.schema span {
  border: 1px solid #b6c6cd;
  padding: 10px 12px;
  background: #fcfbf8;
}

.wave {
  height: 68px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.wave i {
  display: block;
  width: 4px;
  background: #b6d6e5;
  height: var(--h);
  opacity: 0.8;
}

.wave i:nth-child(3n) {
  background: #44befe;
}

.art-caption {
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--soft);
  margin: -13px 0 17px;
}

/* --- Portada: una decisión bajo la lupa --------------------------------- */

.method {
  margin-top: 76px;
  padding: 52px 0 58px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
}

.method h2 {
  margin: 18px 0 22px;
}

.method p {
  font-size: var(--text-base);
  color: var(--soft);
}

.experiment {
  background: #fff;
  padding: 28px;
  border: 1px solid var(--line);
  align-self: center;
}

.experiment .label {
  color: var(--soft);
}

.scale {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 22px 0 10px;
}

.scale span {
  padding: 12px 0;
  text-align: center;
  border: 1px solid var(--line);
  color: var(--blue);
  font-size: var(--text-md);
}

.scale span:first-child {
  background: var(--lightblue);
  border-color: #9bb8c6;
}

.scale-extremes {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: var(--text-sm);
  color: var(--soft);
}

.experiment button {
  margin: 22px 0 15px;
  padding: 9px 15px;
  border: 1px solid var(--blue);
  font-size: var(--text-sm);
  color: var(--blue);
  width: 100%;
}

.experiment button:hover {
  background: var(--lightblue);
}

.experiment .explain {
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  margin: 0;
  min-height: 68px;
}

.method .note {
  font-size: var(--text-sm);
  color: var(--soft);
  margin-bottom: 0;
}

/* --- Catálogo ----------------------------------------------------------- */

.catalog {
  padding: 58px 0;
}

.catalog h2 {
  margin: 14px 0 12px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 25px 0 12px;
}

.filter {
  font-size: var(--text-sm);
  border: 1px solid var(--line);
  padding: 7px 13px;
}

.filter[aria-pressed="true"] {
  background: var(--deep);
  border-color: var(--deep);
  color: white;
}

.catalog-row {
  display: grid;
  grid-template-columns: 35px 1.05fr 1.6fr 20px;
  gap: 20px;
  align-items: center;
  text-align: left;
  width: 100%;
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.catalog-row:hover h3 {
  color: var(--blue);
}

.catalog-row:focus-visible {
  outline-offset: 0;
}

.catalog-row .num {
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--soft);
}

.catalog-row h3 {
  font-size: var(--text-lg);
  margin: 0;
}

.catalog-row p {
  font-size: var(--text-base);
  color: var(--soft);
  margin: 0;
}

.catalog-row[hidden] {
  display: none;
}

#filter-count {
  margin-top: 12px;
  font-size: var(--text-sm);
  color: var(--soft);
}

/* --- Escritura, sobre mí y contacto ------------------------------------- */

.writing {
  padding: 42px 0 58px;
  border-top: 1px solid var(--line);
}

.writing h2 {
  margin: 14px 0;
}

.writing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 32px;
}

.essay h3 {
  margin: 15px 0;
}

.essay p {
  font-size: var(--text-base);
  color: var(--soft);
}

.about {
  padding: 52px 0;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 80px;
  border-top: 1px solid var(--line);
}

.about h2 {
  margin-top: 18px;
}

.about p {
  font-size: var(--text-base);
  color: var(--soft);
}

.about a {
  color: var(--blue);
}

.contact {
  background: var(--deep);
  color: #edf3f5;
  padding: 55px 0;
}

.contact-inner {
  display: flex;
  justify-content: space-between;
  gap: 45px;
  align-items: center;
}

.contact h2 {
  margin: 12px 0 20px;
}

.contact p {
  max-width: 470px;
  font-size: var(--text-base);
  color: #c4d5de;
}

.contact .eyebrow {
  color: #99c3d9;
}

.contact a.email {
  font-size: var(--text-md);
  border-bottom: 1px solid #7e9fae;
  padding-bottom: 7px;
  white-space: nowrap;
}

.contact .secondary {
  font-size: var(--text-sm);
  margin: 12px 0 0;
}

.contact .secondary a {
  text-decoration: underline;
}

.contact .secondary .text-link {
  color: #d9e8ef;
}

/* --- Pie de página ------------------------------------------------------ */

.footer {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--soft);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.footer a {
  margin-left: 20px;
}

.footer a:hover {
  color: var(--blue);
}

/* --- Estado de la evidencia --------------------------------------------- */

.evidence {
  margin-top: 30px;
  background: #edf1f1;
  border-top: 3px solid var(--blue);
  padding: 24px;
}

.evidence-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: start;
}

.evidence h3 {
  font-size: var(--text-lg);
  margin: 0 0 20px;
}

.evidence time {
  font-size: var(--text-xs);
  color: var(--soft);
  white-space: nowrap;
}

.evidence dl {
  margin: 0;
}

.evidence dt {
  color: var(--blue);
  margin-top: 18px;
}

.evidence dd {
  margin: 5px 0 0;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: #45535a;
}

.source-note {
  font-size: var(--text-sm) !important;
  color: var(--soft);
  margin: 15px 0 0 !important;
}

/* --- Integración con Quarto: conserva la composición editorial ---------- */

#quarto-content {
  display: block !important;
  padding: 0 !important;
}

main.content {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}

#title-block-header {
  display: none;
}

body {
  width: 100%;
}

.page-columns {
  display: block !important;
}

.home-en {
  padding-bottom: 70px;
}

.home-en .project-card {
  padding: 25px;
  background: var(--muted);
}

/* --- Páginas de texto (.prose) ------------------------------------------ */

.prose {
  max-width: 850px;
  margin: 0 auto;
  padding: 62px 40px 80px;
}

.prose h1 {
  font-size: var(--text-3xl);
  margin: 16px 0 26px;
}

.prose h2 {
  font-size: var(--text-xl);
  margin: 42px 0 18px;
}

.prose h3 {
  font-size: var(--text-lg);
  margin-top: 30px;
}

.prose a:not(.primary):not(.contact-button) {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Los títulos enlazados (Escritura) no se subrayan como un enlace en el texto */
.prose h2 a:not(.primary):not(.contact-button),
.prose h3 a:not(.primary):not(.contact-button) {
  color: inherit;
  text-decoration: none;
}

.prose h2 a:hover,
.prose h3 a:hover {
  color: var(--blue);
}

.prose .lead {
  font-family: var(--serif);
  font-size: var(--text-lg);
  line-height: 1.45;
  color: var(--soft);
}

.prose p {
  max-width: 75ch;
}

/* Las URL de las referencias no tienen dónde partirse */
.prose :is(p, li) {
  overflow-wrap: break-word;
}

.prose .project-meta {
  margin: 36px 0 10px;
}

.prose .project-meta p {
  margin: 0;
}

.prose .project-meta + h2 {
  margin-top: 0;
}

.prose img {
  max-width: 100%;
  height: auto;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
  display: block;
  overflow: auto;
}

/* Las tablas de gt traen su propia familia (system-ui) en un estilo con id;
   aquí heredan la del sitio. El tamaño lo sigue fijando cada artículo. */
.prose .gt_table {
  font-family: var(--sans) !important;
}

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

.prose pre {
  background: var(--muted);
  padding: 20px;
  overflow: auto;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.prose code {
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* Quarto pone white-space: pre en todo code; fuera de los bloques eso impide
   partir un nombre de archivo largo aunque overflow-wrap lo permita. */
.prose :not(pre) > code {
  white-space: pre-wrap;
}

.prose pre code {
  font-size: inherit;
}

.prose blockquote {
  border-left: 3px solid var(--blue);
  margin: 25px 0;
  padding: 10px 22px;
  background: var(--muted);
}

.prose .evidence {
  margin-top: 40px;
}

.prose .evidence h3 {
  margin: 0 0 12px;
}

.prose .evidence-head {
  flex-wrap: wrap;
}

.prose .source-note + p {
  margin-top: 32px;
}

.prose .contact-card {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

.prose .contact-card p:has(.contact-button) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.prose .ficha {
  background: var(--muted);
  padding: 25px;
}

.prose .ficha dt {
  font-weight: 600;
}

.prose .ficha dd {
  font-size: var(--text-base);
  color: var(--soft);
}

.prose .accesos p {
  display: flex;
  gap: 8px 24px;
  flex-wrap: wrap;
}

.sourceCode span {
  color: inherit;
}

.language {
  font-size: var(--text-sm);
}

/* --- Pantallas grandes -------------------------------------------------- */

@media (min-width: 1400px) {
  .wrap {
    max-width: 1320px;
    padding: 0 60px;
  }

  .hero {
    gap: 95px;
  }
}

/* --- Tableta ------------------------------------------------------------ */

@media (max-width: 900px) {
  .wrap {
    padding: 0 28px;
  }

  /* En tableta y teléfono el titular a media columna quedaría pequeño: el
     bloque se apila y la presentación pasa debajo, separada por una línea. */
  .hero {
    display: block;
  }

  .hero h1 {
    font-size: var(--text-4xl);
  }

  .hero-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 22px 0 0;
    margin-top: 32px;
  }

  .hero-side p {
    max-width: 60ch;
  }

  .hero-side .eyebrow {
    display: none;
  }

  .feature-copy,
  .figure {
    padding: 28px;
  }

  .project-grid {
    gap: 20px;
  }

  .schema {
    gap: 5px;
  }

  .schema span {
    padding: 8px;
  }

  .method {
    gap: 30px;
  }

  .about {
    gap: 40px;
  }

  .contact-inner {
    align-items: start;
    flex-direction: column;
    gap: 15px;
  }

  .writing-grid {
    gap: 30px;
  }

  /* Menú desplegable: en tableta la navegación en inglés ya no cabe en una línea */
  .nav {
    position: relative;
  }

  .menu-button {
    display: block;
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--line);
    padding: 6px 0;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 20px;
    z-index: 10;
    flex-direction: column;
    align-items: start;
    gap: 18px;
    font-size: var(--text-base);
  }

  nav.open {
    display: flex;
  }
}

/* --- Teléfono ----------------------------------------------------------- */

@media (max-width: 640px) {
  html {
    scroll-padding-top: 20px;
  }

  .wrap {
    padding: 0 22px;
  }

  .preview {
    padding: 6px 15px;
  }

  .nav {
    height: 72px;
  }

  .brand {
    font-size: var(--text-lg);
  }

  .hero {
    padding: 45px 0 38px;
  }

  .hero h1 {
    margin-bottom: 28px;
  }

  .hero h1 {
    margin-top: 20px;
  }

  .hero-side p {
    max-width: none;
  }

  .actions {
    gap: 20px;
  }

  .section-head {
    display: block;
    margin: 28px 0 24px;
  }

  .section-head p {
    margin-top: 15px;
    max-width: none;
  }

  .feature {
    display: flex;
    flex-direction: column;
  }

  .feature-copy {
    padding: 25px;
  }

  .figure {
    padding: 25px;
    min-height: 260px;
  }

  .figure-big {
    margin: 22px 0 8px;
  }

  .project-grid {
    display: block;
  }

  .project-card {
    margin-bottom: 30px;
  }

  .mini-art {
    height: 150px;
  }

  .method {
    margin-top: 25px;
    display: block;
    padding: 35px 0;
  }

  .experiment {
    margin-top: 28px;
    padding: 22px;
  }

  .catalog {
    padding: 38px 0;
  }

  .catalog-row {
    grid-template-columns: 22px 1fr 18px;
    gap: 12px;
    padding: 18px 0;
  }

  .catalog-row p {
    grid-column: 2;
    grid-row: 2;
  }

  .catalog-row > .arrow {
    grid-column: 3;
    grid-row: 1;
  }

  .catalog-row .num {
    align-self: start;
    padding-top: 6px;
  }

  .filters {
    gap: 6px;
  }

  .filter {
    padding: 7px 10px;
  }

  .writing {
    padding: 32px 0;
  }

  .writing-grid {
    display: block;
  }

  .essay {
    margin-bottom: 35px;
  }

  .about {
    display: block;
    padding: 35px 0;
  }

  .contact {
    padding: 38px 0;
  }

  .contact a.email {
    font-size: var(--text-base);
  }

  .footer {
    align-items: start;
  }

  .footer a {
    margin-left: 12px;
  }

  .evidence {
    padding: 18px;
  }

  .evidence-head {
    display: block;
  }

  .evidence h3 {
    margin-bottom: 4px;
  }

  .evidence time {
    display: block;
    margin-bottom: 16px;
  }

  .prose {
    padding: 35px 22px 55px;
  }

  .prose pre {
    margin-left: -8px;
    margin-right: -8px;
    padding: 12px;
  }

  .home-en .project-card {
    margin-bottom: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

/* Glosario: términos enlazados en las entradas y su ventanita (assets/site.js) */
.prose a.glosa:not(.primary):not(.contact-button) {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a.glosa:hover,
.prose a.glosa:focus-visible {
  color: var(--blue);
}

.glosa-pop {
  position: absolute;
  z-index: 50;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgb(32 43 48 / 0.12);
  font-family: var(--sans);
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--ink);
}

.glosa-pop strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.glosa-pop p {
  margin: 0;
  color: var(--soft);
}

.glosa-pop a {
  display: inline-block;
  margin-top: 8px;
  color: var(--blue);
  text-underline-offset: 3px;
}

/* Página del glosario */
.prose .glosario-termino {
  margin-top: 36px;
  scroll-margin-top: 24px;
}

.prose .glosario-ver p {
  font-size: var(--text-base);
  color: var(--soft);
}
