/* Fuentes alojadas aquí (OFL): Geist, Geist Mono, Instrument Serif y Pixelify Sans, subconjuntos latin y latin-ext */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fuentes/geist-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fuentes/geist-latin.woff2) format('woff2');
  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: 'Geist Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fuentes/geist-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fuentes/geist-mono-latin.woff2) format('woff2');
  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: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fuentes/instrument-serif-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fuentes/instrument-serif-latin.woff2) format('woff2');
  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: 'Pixelify Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/fuentes/pixelify-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Pixelify Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/fuentes/pixelify-sans-latin.woff2) format('woff2');
  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; }

:root {
  --fondo: #0d0d0d;
  --panel: #151515;
  --texto: #ededed;
  --tenue: #9b9b9b;
  --raya: #2c2c2c;
  --vivo: #4ade80;
  --firma-oro: #d4a73a;   /* la corona de la firma del pie */
  --salida: cubic-bezier(0.23, 1, 0.32, 1);

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;

  --col: 45rem;
  --riel: max(0px, calc(50% - var(--col) / 2));
  --sangria: 1.25rem;
  --pad: calc(var(--riel) + var(--sangria));
  color-scheme: dark;
}

/* Tema claro: el del sistema, o el que se eligió con el botón */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --fondo: #fbfbf9; --panel: #f3f3f0; --texto: #171717; --tenue: #6a6a6a; --raya: #cfcdc6; --vivo: #15803d; --firma-oro: #9a7116; color-scheme: light; }
}
:root[data-theme="light"] { --fondo: #fbfbf9; --panel: #f3f3f0; --texto: #171717; --tenue: #6a6a6a; --raya: #cfcdc6; --vivo: #15803d; --firma-oro: #9a7116; color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 3.5rem; }   /* la barra fija no tapa el título al saltar a una sección */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  /* los dos rieles de la columna; la columna lisa y, a cada lado, una franja de puntos pegada al riel que se desvanece hacia fuera */
  background: repeating-linear-gradient(var(--raya) 0 3px, transparent 3px 6px) calc(50% - var(--col) / 2) 0 / 1px 100% no-repeat,
    repeating-linear-gradient(var(--raya) 0 3px, transparent 3px 6px) calc(50% + var(--col) / 2) 0 / 1px 100% no-repeat,
    linear-gradient(90deg, var(--fondo) calc(50% - var(--col) / 2 - 10rem), transparent calc(50% - var(--col) / 2 - 2rem), transparent calc(50% - var(--col) / 2), var(--fondo) calc(50% - var(--col) / 2),
      var(--fondo) calc(50% + var(--col) / 2), transparent calc(50% + var(--col) / 2), transparent calc(50% + var(--col) / 2 + 2rem), var(--fondo) calc(50% + var(--col) / 2 + 10rem)),
    radial-gradient(var(--raya) 1px, transparent 1.2px) 0 0 / 16px 16px;
  background-color: var(--fondo);
  color: var(--texto);
  font: .9rem/1.65 var(--sans);
  overflow-x: clip;
}
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; line-height: 1.1; }
h3, .obra h2 { font-size: 1.3rem; }
p { margin: 0 0 1rem; }
ul, ol { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration-color: var(--tenue); text-underline-offset: .2em; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--texto); outline-offset: 3px; border-radius: 4px; }
.icono { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aviso { color: var(--tenue); }

/* Barra de arriba */
/* La barra ocupa todo el ancho arriba del todo; al desplazar, el fondo se recoge hasta el ancho de la columna
   y queda como un panel de esquinas rectas, pegado arriba. --recoge va de 0 a 1: lo mueve el desplazamiento, o la clase .recogida de sitio.js */
@property --recoge { syntax: "<number>"; inherits: true; initial-value: 0; }
.indice {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .55rem var(--pad);
  border-bottom: 1px solid transparent;
}
.indice::before {
  content: ""; position: absolute; z-index: -1;
  /* al recogerse, los lados caen justo sobre los rieles de la columna (el riel derecho es el píxel siguiente) */
  inset: 0 calc(var(--recoge) * max(0px, 50% - var(--col) / 2 - 1px)) -1px calc(var(--recoge) * max(0px, 50% - var(--col) / 2));
  border: 1px solid color-mix(in srgb, var(--raya) calc(var(--recoge) * 100%), transparent);
  /* arriba del todo la raya de abajo es punteada; al recogerse se vuelve el borde del panel */
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--raya) calc(100% - var(--recoge) * 100%), transparent) 0 3px, transparent 3px 6px) 50% 100% / var(--col) 1px no-repeat border-box,
    color-mix(in srgb, var(--fondo) calc(100% - var(--recoge) * 16%), transparent);
  background-origin: border-box;
  backdrop-filter: blur(calc(var(--recoge) * 10px));
}
/* «Contacto» en la barra: en pantallas angostas no cabe y pasa al menú «Más» */
.mas .solo-movil { display: none; }
@media (max-width: 640px) {
  .indice-lista > li.solo-ancho { display: none; }
  .mas .solo-movil { display: block; }
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    :root { animation: recoger-barra linear both; animation-timeline: scroll(root); animation-range: 0 48px; }
  }
  @supports not (animation-timeline: scroll()) { :root { transition: --recoge .35s var(--salida); } }
}
:root.recogida { --recoge: 1; }
@keyframes recoger-barra { to { --recoge: 1; } }
.indice-nombre { font: 1.5rem/1 var(--serif); text-decoration: none; }
.indice-lista { display: flex; align-items: center; gap: 1.1rem; }
.indice-lista > li > a, .mas summary { position: relative; padding-block: .3rem; color: var(--tenue); font-size: .82rem; font-weight: 500; text-decoration: none; cursor: pointer; transition: color .15s ease; }
.indice-lista > li > a:hover, .mas summary:hover, .indice-lista [aria-current] { color: var(--texto); }
/* el punto marca la página en la que estás */
.indice-lista .punto { position: absolute; left: 50%; bottom: -.25rem; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: currentColor; }
.mas { position: relative; }
.mas summary { display: flex; align-items: center; gap: .3rem; list-style: none; }
.mas summary::-webkit-details-marker { display: none; }
.mas summary .icono { width: .9em; height: .9em; transition: transform .2s var(--salida); }
.mas[open] summary .icono { transform: rotate(180deg); }
.mas ul {
  position: absolute; right: 0; top: calc(100% + .6rem);
  min-width: 9rem; padding: .3rem;
  border: 1px solid var(--raya); border-radius: 10px; background: var(--fondo);
  transform-origin: top right;
}
.mas a { display: block; padding: .35rem .6rem; border-radius: 6px; font-size: .82rem; text-decoration: none; }
.mas a:hover { background: var(--panel); }
.tema { display: grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .5rem; border: 0; border-radius: 8px; background: none; color: var(--tenue); font: .72rem var(--mono); transition: transform .16s var(--salida), color .15s ease, background-color .15s ease; }
.tema:hover { color: var(--texto); background: var(--panel); }
.tema .icono { width: 1.15rem; height: 1.15rem; }
.tema:active, .chip-boton:active, .redes a:active, .copiar:active, .boton:active { transform: scale(.97); }

/* Portada: banner y ficha */
.inicio { padding: 0 var(--pad) 1.75rem; }
.banner { display: block; width: calc(100% + 2 * var(--sangria)); max-width: none; height: auto; aspect-ratio: 10 / 3; margin: 0 calc(-1 * var(--sangria)); border-bottom: 1px dashed var(--raya); image-rendering: pixelated; }
.ficha-cab { display: flex; align-items: center; gap: 1.1rem; margin-top: 1.1rem; }
.ficha-cab:has(.avatar-zona) { margin-top: 2.9rem; }   /* hueco para el globo, que no toca el banner */
/* el personaje se inclina hacia el cursor dentro de su marco: --mx y --my van de -1 a 1 */
.avatar { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transform: translate(calc(var(--mx, 0) * 3px), calc(2px + var(--my, 0) * 2px)) rotate(calc(var(--mx, 0) * 4deg)); transform-origin: 50% 100%; transition: transform .25s var(--salida); }
.nombre { font-size: clamp(2.2rem, 8vw, 2.9rem); }
.lema { margin: .1rem 0 .35rem; color: var(--tenue); font: .78rem var(--mono); }
.datos { display: flex; flex-wrap: wrap; gap: .4rem 1.75rem; margin-top: 1.1rem; color: var(--tenue); font: .74rem/1.5 var(--mono); }
.datos li { display: flex; align-items: center; gap: .5rem; }
.datos li[hidden] { display: none; }
.redes { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.redes a { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .7rem; border: 1px solid var(--raya); border-radius: 8px; font-size: .8rem; text-decoration: none; transition: transform .16s var(--salida), background-color .15s ease, border-color .15s ease; }
.redes a:hover { border-color: var(--tenue); background: var(--panel); }

/* Secciones: franja punteada, título y contenido */
.seccion { padding: 0 var(--pad) 2rem; }
/* la línea de separación y la del título van de riel a riel, sin salir de la columna */
.seccion::before { content: ""; display: block; height: 1.5rem; margin: 0 calc(-1 * var(--pad)); border-top: 1px dashed var(--raya); border-bottom: 1px dashed var(--raya); }
.seccion-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; margin: 0 calc(-1 * var(--pad)) 1.25rem; padding: .6rem var(--pad) .65rem; position: relative; background: var(--panel); }
.seccion-cab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: 1px dashed var(--raya); pointer-events: none; }
.seccion-cab h1, .seccion-cab h2 { font-size: 1.6rem; }
.seccion > :last-child { margin-bottom: 0; }
.texto { max-width: 62ch; color: color-mix(in srgb, var(--texto) 82%, var(--tenue)); }
/* Sobre mí: puntos cortos */
.puntos { display: grid; gap: .9rem; padding-left: 1.1rem; color: color-mix(in srgb, var(--texto) 82%, var(--tenue)); }
.puntos li { position: relative; }
.puntos li::before { content: ""; position: absolute; left: -1.1rem; top: .65em; width: 4px; height: 4px; background: var(--tenue); }
.puntos strong { color: var(--texto); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Tecnologías: filtros y chips */
.filtros { display: flex; flex-wrap: wrap; gap: .15rem; }
.chip-boton { flex: none; white-space: nowrap; padding: .2rem .6rem; border: 0; border-radius: 6px; background: none; color: var(--tenue); font-size: .76rem; font-weight: 600; transition: transform .16s var(--salida), color .15s ease, background-color .15s ease; }
.chip-boton:hover { color: var(--texto); }
.chip-boton[aria-pressed="true"] { background: var(--panel); color: var(--texto); box-shadow: inset 0 0 0 1px var(--raya); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 640px) { .filtros { gap: .25rem .15rem; margin-inline: -.25rem; } }
.chips li { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .65rem; border: 1px solid var(--raya); border-radius: 8px; color: color-mix(in srgb, var(--texto) 80%, var(--tenue)); font-size: .82rem; font-weight: 500; transition: opacity .2s ease, transform .2s var(--salida), border-color .15s ease; }
/* el filtro oculta lo que no es de la categoría */
.chips li.fuera, .texto.fuera { display: none; }
.chips i { width: .95rem; height: .95rem; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; opacity: .8; }

/* Actividad en GitHub */
.mapa-scroll { overflow-x: auto; padding: 2px 2px .4rem; }
.mapa-meses, .mapa-grid { display: grid; grid-auto-columns: minmax(10px, 1fr); gap: 3px; min-width: min-content; }
.mapa-meses { grid-auto-flow: column; height: 1.3rem; color: var(--tenue); font-size: .72rem; }
.mapa-meses button { grid-row: 1; justify-self: start; padding: 0; border: 0; background: none; color: inherit; font: inherit; white-space: nowrap; cursor: pointer; }
.mapa-meses button:hover, .mapa-meses button[aria-pressed="true"] { color: var(--texto); }
.mapa-meses button[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 3px; }
.mapa-grid { grid-template-rows: repeat(7, auto); grid-auto-flow: column; }
.celda { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--raya); }
.celda.vacia { visibility: hidden; }
.mapa-grid .celda { transition: opacity .2s ease; }
.mapa-grid .celda:hover { outline: 1px solid var(--texto); outline-offset: 1px; }
.mapa-grid.con-mes .celda:not(.del-mes) { opacity: .25; }
.mapa-total { font-variant-numeric: tabular-nums; }
.celda[data-n="1"] { background: color-mix(in srgb, var(--texto) 28%, var(--raya)); }
.celda[data-n="2"] { background: color-mix(in srgb, var(--texto) 50%, var(--raya)); }
.celda[data-n="3"] { background: color-mix(in srgb, var(--texto) 75%, var(--raya)); }
.celda[data-n="4"] { background: var(--texto); }
.mapa-pie { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .5rem 0 0; font-size: .78rem; }
.mapa-leyenda { display: flex; align-items: center; gap: 4px; color: var(--tenue); }
.mapa-leyenda .celda { width: 10px; }
@media (max-width: 640px) { .mapa-pie { flex-direction: column; align-items: flex-start; gap: .5rem; } }

.meta { display: block; color: var(--tenue); font: .72rem var(--mono); }

/* Contacto */
.correo { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 1.1rem 0 0; }
.correo a { font: clamp(1.25rem, 5vw, 1.5rem)/1.1 var(--serif); overflow-wrap: anywhere; }
.copiar { padding: .25rem .6rem; border: 1px solid var(--raya); border-radius: 6px; background: var(--fondo); color: var(--tenue); font: .72rem var(--mono); transition: transform .16s var(--salida), color .15s ease, border-color .15s ease; }
.copiar:hover { color: var(--texto); border-color: var(--tenue); }

.pie { padding: 1.25rem var(--pad) 2.5rem; /* raya punteada solo a lo ancho de la columna */ background: repeating-linear-gradient(90deg, var(--raya) 0 3px, transparent 3px 6px) 50% 0 / var(--col) 1px no-repeat; color: var(--tenue); font: .72rem var(--mono); }
.pie p { margin: 0; display: flex; align-items: center; gap: .6rem; }
.pie .firma { color: var(--texto); line-height: 0; }

/* Proyectos: tarjetas con imagen */
.tira { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.obra { position: relative; display: flex; flex-direction: column; border: 1px solid var(--raya); overflow: clip; transition: border-color .2s ease; }
.obra-img { aspect-ratio: 16 / 9; background: var(--panel); border-bottom: 1px solid var(--raya); overflow: hidden; }
.obra-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--salida); }
.obra-img img[src$="escaner-lidar.webp"] { object-position: 62% 50%; }
.obra-cuerpo { display: flex; flex-direction: column; flex: 1; gap: .5rem; padding: .9rem 1rem 1rem; }
.obra-cab { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.obra h2 a, .obra h3 a { text-decoration: none; }
/* toda la tarjeta lleva al proyecto */
.obra h2 a::after, .obra h3 a::after { content: ""; position: absolute; inset: 0; }
.obra h2 a:focus-visible, .obra h3 a:focus-visible { outline: 2px solid var(--texto); outline-offset: 3px; }
@supports selector(:has(*)) {
  .obra h2 a:focus-visible, .obra h3 a:focus-visible { outline: 0; }
  .obra:has(h2 a:focus-visible, h3 a:focus-visible) { outline: 2px solid var(--texto); outline-offset: 3px; }
}
.estado { flex: none; display: inline-flex; align-items: center; gap: .35rem; color: var(--tenue); font-size: .72rem; }
.estado::before { content: ""; width: 6px; height: 6px; background: var(--tenue); }
.estado.activo::before { background: var(--vivo); }
.obra p { margin: 0; color: var(--tenue); font-size: .82rem; line-height: 1.55; }
.etiquetas { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .4rem; }
.etiquetas li { padding: .1rem .5rem; border: 1px solid var(--raya); color: var(--tenue); font: .6875rem var(--mono); }
.lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem 1rem; padding: .7rem 0; border-top: 1px dashed var(--raya); }
.lista li:first-child { border-top: 0; padding-top: 0; }
.lista a { font-weight: 500; text-decoration: none; }
.lista a:hover { text-decoration: underline; }
.lista p { grid-column: 1 / -1; margin: 0; color: var(--tenue); font-size: .82rem; }
.sub { margin: 2rem 0 1rem; }
.seccion-cab + .sub { margin-top: 0; }

/* Experiencia: fecha a la izquierda, hecho a la derecha */
.linea li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1.25rem; padding: .8rem 0; border-top: 1px dashed var(--raya); }
.linea li:first-child { border-top: 0; padding-top: 0; }
.linea time { color: var(--tenue); font: .72rem/2 var(--mono); }
.linea p { margin: 0; }

/* Páginas de cada proyecto */
.idioma { color: var(--tenue); font-size: .82rem; text-decoration: none; }
.idioma:hover { color: var(--texto); }
.proyecto { padding: 2.5rem var(--pad) 3rem; }
.proyecto h1 { font-size: clamp(2.5rem, 9vw, 3.75rem); margin-bottom: 1rem; }
.obra-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin: 0 0 .6rem; color: var(--tenue); font: .72rem var(--mono); }
.proyecto-intro { max-width: 60ch; font-size: 1.05rem; }
.proyecto-codigo { margin: 1.5rem 0 0; }
.boton { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: 8px; background: var(--texto); color: var(--fondo); font-size: .85rem; font-weight: 500; text-decoration: none; transition: transform .16s var(--salida); }
.bloque { margin-top: 2.75rem; }
.bloque h2 { font-size: 1.6rem; margin-bottom: .9rem; }
.bloque p, .bloque li { max-width: 62ch; color: color-mix(in srgb, var(--texto) 82%, var(--tenue)); }
.bloque ol { list-style: decimal; padding-left: 1.25rem; }
.bloque ul:not(.etiquetas) { list-style: disc; padding-left: 1.25rem; }
.bloque li { margin-bottom: .4rem; }
.bloque .etiquetas li { margin: 0; color: var(--tenue); }
.ficha { width: 100%; border-collapse: collapse; }
.ficha th, .ficha td { text-align: left; padding: .55rem 1rem .55rem 0; border-top: 1px dashed var(--raya); vertical-align: top; }
.ficha th { font-weight: 500; white-space: nowrap; }
.ficha td { color: var(--tenue); }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 1rem; }
.fotos figure.ancha { grid-column: 1 / -1; }
.fotos figure { margin: 0; cursor: zoom-in; border: 1px solid var(--raya); border-radius: 12px; overflow: hidden; background: var(--panel); }
.fotos img { display: block; width: 100%; height: auto; max-height: 28rem; object-fit: contain; background: var(--panel); }
.fotos figcaption { padding: .5rem .8rem; color: var(--tenue); font-size: .8rem; }
.visor { max-width: min(92vw, 70rem); padding: 1rem; border: 1px solid var(--raya); border-radius: 12px; background: var(--fondo); color: var(--texto); }
.visor::backdrop { background: rgb(0 0 0 / .8); }
/* con un diálogo modal abierto, la rueda o el dedo sobre el fondo o el propio diálogo no desplazan la página de abajo (donde el navegador no lo respeta, queda como antes) */
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overflow: hidden; overscroll-behavior: contain; }
.visor img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; }
.visor p { color: var(--tenue); margin: .75rem 0; }
.visor button { padding: .4rem .9rem; border: 1px solid var(--raya); border-radius: 6px; background: none; }
.otros { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px dashed var(--raya); }
.otros h2 { font-size: 1.3rem; margin-bottom: .75rem; }
.otros ul { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }

@media (hover: hover) and (pointer: fine) {
  .obra:hover { border-color: var(--tenue); }
  .obra:hover .obra-img img { transform: scale(1.04); }
  .avatar-caja:hover .con-arduino { opacity: 1; }
  .chips li:hover { border-color: var(--tenue); }
}
@media (max-width: 640px) {
  .indice-nombre { display: none; }
  .indice { justify-content: flex-end; }
  .tira { grid-template-columns: minmax(0, 1fr); }
  .linea li { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* Cambio de página: la barra se queda quieta y la página nueva se descubre con un barrido (ver «Barrido» al final).
   Con el cambio de tema (clase cambia-tema) no se nombra nada: ahí manda el círculo. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
:root:not(.cambia-tema) .indice { view-transition-name: barra; }
:root:not(.cambia-tema) .punto { view-transition-name: marca-pagina; }
::view-transition-group(barra) { z-index: 5; }
::view-transition-group(marca-pagina) { z-index: 6; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-group(marca-pagina) { animation-duration: .4s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
}
.cambia-tema::view-transition-old(root), .cambia-tema::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.cambia-tema::view-transition-old(root) { z-index: 1; }
.cambia-tema::view-transition-new(root) { z-index: 2; animation: abrir-tema 1s cubic-bezier(.22, 1, .36, 1) forwards; }
@keyframes abrir-tema { from { clip-path: circle(0 at var(--tx) var(--ty)); } 45% { clip-path: circle(45vmax at var(--tx) var(--ty)); } to { clip-path: circle(150vmax at var(--tx) var(--ty)); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none; }
}
@media (prefers-reduced-motion: no-preference) {
  /* Entrada: la página se arma en cascada una sola vez */
  .banner, .ficha-cab, .datos, .redes, .proyecto > * { animation: entrar .5s var(--salida) both; }
  .banner { animation-name: aclarar; }
  .ficha-cab { animation-delay: 60ms; }
  .datos { animation-delay: 120ms; }
  .redes { animation-delay: 180ms; }
  .mas[open] ul { animation: abrir .16s var(--salida); }
}
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } }
@keyframes aclarar { from { opacity: 0; } }
@keyframes abrir { from { opacity: 0; transform: scale(.96); } }

/* Banner interactivo */
.banner-caja { position: relative; margin: 0 calc(-1 * var(--sangria)); border-bottom: 1px dashed var(--raya); background: var(--panel); }
.banner-caja .banner { width: 100%; margin: 0; border: 0; cursor: pointer; touch-action: pan-y; }
.banner-hora { position: absolute; left: .6rem; top: .6rem; padding: .3rem .55rem; border: 1px solid rgb(255 255 255 / .18); border-radius: 6px; background: rgb(0 0 0 / .72); color: #f2f2f2; font: .6875rem var(--mono); transition: transform .16s var(--salida), background-color .15s ease; }
.banner-hora:hover { background: rgb(0 0 0 / .75); }
.banner-hora:active { transform: scale(.97); }
.banner-pista { position: absolute; right: .6rem; top: .6rem; padding: .3rem .55rem; border-radius: 6px; background: rgb(0 0 0 / .72); color: #f2f2f2; font: .6875rem var(--mono); pointer-events: none; transition: opacity .4s ease; }
.banner-pista.vista { opacity: 0; }

/* Cajón de piezas */
.banner.jugando { touch-action: none; }
.cajon { display: block; width: 100%; aspect-ratio: 360 / 110; border: 1px dashed var(--raya); border-radius: 10px; background: var(--panel) radial-gradient(var(--raya) 1px, transparent 1px) 0 0 / 12px 12px; image-rendering: pixelated; cursor: grab; touch-action: none; }
.cajon.agarrando { cursor: grabbing; }
.cajon-pista { margin: .5rem 0 0; color: var(--tenue); font: .72rem var(--mono); }
.cajon-ordenar { box-shadow: inset 0 0 0 1px var(--raya); }

/* El avatar enseña el Arduino al pasar el cursor o al tocarlo */
.avatar-caja { position: relative; flex: none; display: block; width: 5rem; height: 5rem; padding: 0; border: 1px solid var(--raya); border-radius: 14px; background: var(--panel); overflow: hidden; line-height: 0; transition: transform .16s var(--salida); }
.avatar-caja picture { position: absolute; inset: 0; }
.avatar-caja .con-arduino { opacity: 0; transition: opacity .15s ease, transform .25s var(--salida); }
.avatar-caja[aria-pressed="true"] .con-arduino { opacity: 1; }
.avatar-caja:active { transform: scale(.97); }

/* Avatar vivo y su globo de texto */
.avatar-zona { position: relative; flex: none; }
.avatar-caja canvas { position: absolute; inset: 0; }
.avatar-caja.vivo picture { display: none; }
.globo {
  position: absolute; left: 3.6rem; bottom: calc(100% + .55rem); z-index: 5;
  width: max-content; max-width: min(16rem, calc(100vw - 7.5rem)); margin: 0; padding: .3rem .55rem;
  background: var(--texto); color: var(--fondo); font: 500 .85rem/1.25 "Pixelify Sans", var(--mono);
  /* el mismo color sale 3 px por cada lado, en cruz: quedan las esquinas escalonadas del pixel art */
  box-shadow: 0 -3px 0 var(--texto), 0 3px 0 var(--texto), -3px 0 0 var(--texto), 3px 0 0 var(--texto);
  opacity: 0; transform: scale(.9); transform-origin: 0 100%; pointer-events: none;
  transition: opacity .15s ease, transform .18s var(--salida);
}
.globo.visible { opacity: 1; transform: none; }
/* la cola: dos escalones hacia el personaje */
.globo::after { content: ""; position: absolute; left: .5rem; top: calc(100% + 3px); width: 9px; height: 3px; background: var(--texto); box-shadow: -3px 3px 0 -0px var(--texto), -6px 6px 0 -0px var(--texto); clip-path: inset(0 0 -9px -9px); }

/* Entrada en forma de hoja de PCB: capas F.Cu (--vivo), B.Cu (--tenue), F.SilkS (--texto) y Edge.Cuts (la columna).
   Fases: contorno y marco, huellas, ratsnest, pistas, vertido de cobre, DRC y fabricación (el barrido final). */
.entrada body { visibility: hidden; }
/* portada: da al navegador el gesto que exige para que la música suene desde el primer trazo de la hoja */
.portada { position: fixed; inset: 0; z-index: 101; visibility: visible; display: grid; place-content: center; justify-items: center; gap: 1.6rem; padding: 1.5rem; background: var(--fondo); color: var(--texto); }
.portada .firma { display: block; width: min(78vw, 480px); text-align: center; line-height: 0; }
.portada-entrar { padding: .85rem 1.8rem; border: 1px solid var(--texto); background: var(--texto); color: var(--fondo); font: .78rem var(--mono); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.portada-entrar:hover { background: transparent; color: var(--texto); }
.portada-silencio { padding: .4rem; border: 0; background: none; color: var(--tenue); font: .6875rem var(--mono); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.portada button:focus-visible { outline: 2px solid var(--texto); outline-offset: 3px; }
.plano { position: fixed; inset: 0; z-index: 100; visibility: visible; overflow: hidden; color: var(--tenue); --silk: color-mix(in srgb, var(--texto) 62%, transparent); --borde: color-mix(in srgb, #e0c34a 78%, var(--texto)); }   /* Edge.Cuts en amarillo apagado */
.plano.resuelve { pointer-events: none; }
.plano-hoja { position: absolute; inset: 0; }
.plano-fondo {
  position: absolute; inset: 0;
  --fina: color-mix(in srgb, var(--texto) 5%, transparent); --gruesa: color-mix(in srgb, var(--texto) 11%, transparent);
  /* cuadrícula menuda y otra mayor cada ocho cuadros */
  background: linear-gradient(var(--gruesa) 1px, transparent 1px) 0 0 / 96px 96px, linear-gradient(90deg, var(--gruesa) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(var(--fina) 1px, transparent 1px) 0 0 / 12px 12px, linear-gradient(90deg, var(--fina) 1px, transparent 1px) 0 0 / 12px 12px;
  background-color: var(--fondo);
  animation: abrir-hoja .4s var(--salida) both;
}
.plano-marca { position: absolute; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--tenue); animation: aclarar .4s ease .05s both;
  background: linear-gradient(var(--tenue) 0 0) 50% 0 / 1px 100% no-repeat, linear-gradient(var(--tenue) 0 0) 0 50% / 100% 1px no-repeat; }
.plano-marca:nth-of-type(1) { left: 10px; top: 10px; } .plano-marca:nth-of-type(2) { right: 10px; top: 10px; }
.plano-marca:nth-of-type(3) { left: 10px; bottom: 10px; } .plano-marca:nth-of-type(4) { right: 10px; bottom: 10px; }
/* marco con coordenadas, como en una hoja de KiCad o ISO 5457: números arriba y abajo, letras a los lados, marcas de centrado */
.plano-marco { position: absolute; inset: 8px; border: 1px solid var(--tenue); animation: aclarar .4s ease .05s both; }
.plano-marco::after { content: ""; position: absolute; inset: 14px; border: 1px solid var(--tenue); }
.plano-marco .m { position: absolute; font: .5rem/14px var(--mono); text-align: center; }
.plano-marco .m span { position: absolute; translate: -50% 0; }
.plano-marco .l span, .plano-marco .r span { translate: 0 -50%; left: 0; width: 14px; }
.plano-marco .t, .plano-marco .b { left: 14px; right: 14px; height: 14px; background: repeating-linear-gradient(90deg, var(--tenue) 0 1px, transparent 1px calc(100% / var(--nx))); }
.plano-marco .t { top: 0; } .plano-marco .b { bottom: 0; }
.plano-marco .l, .plano-marco .r { top: 14px; bottom: 14px; width: 14px; background: repeating-linear-gradient(var(--tenue) 0 1px, transparent 1px calc(100% / var(--ny))); }
.plano-marco .l { left: 0; } .plano-marco .r { right: 0; }
.plano-marco .cm { position: absolute; border: 0 solid var(--silk); }
.plano-marco .cm.t, .plano-marco .cm.b { left: 50%; height: 30px; border-left-width: 1px; } .plano-marco .cm.t { top: -9px; } .plano-marco .cm.b { bottom: -9px; }
.plano-marco .cm.l, .plano-marco .cm.r { top: 50%; width: 30px; border-top-width: 1px; } .plano-marco .cm.l { left: -9px; } .plano-marco .cm.r { right: -9px; }
/* borde de placa (Edge.Cuts): sólido, cerrado abajo, con sus agujeros de montaje */
.plano-riel { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--borde); transform-origin: top; animation: bajar-riel .45s var(--salida) .05s both; }
.plano:not(.movil) .plano-riel { bottom: 48px; }
.plano-borde { position: absolute; height: 0; border-top: 1px solid var(--borde); transform-origin: left; animation: abrir-eje .35s var(--salida) .3s both; }
.plano-agujero { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border: 1px solid var(--borde); border-radius: 50%; animation: aparecer-caja .25s var(--salida) .45s both;
  background: radial-gradient(circle, var(--fondo) 0 2.5px, transparent 3px); }
.plano-agujero::after { content: ""; position: absolute; inset: -4px; border: 1px dashed color-mix(in srgb, var(--texto) 25%, transparent); border-radius: 50%; }
/* fiducial: punto de cobre con su apertura de máscara */
.plano-fid { position: absolute; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--vivo); box-shadow: 0 0 0 4px var(--fondo), 0 0 0 5px var(--tenue); animation: aparecer-caja .25s var(--salida) .5s both; }
/* ejes de centro: se abren desde el cruce, que cae en el centro del banner */
.plano-eje { position: absolute; --eje: color-mix(in srgb, var(--vivo) 55%, transparent); }
.plano-eje.v { top: 0; bottom: 0; width: 1px; background: repeating-linear-gradient(var(--eje) 0 14px, transparent 14px 18px, var(--eje) 18px 20px, transparent 20px 24px); animation: bajar-riel .6s var(--salida) .1s both; transform-origin: 50% 50%; }
.plano-eje.h { left: 0; right: 0; height: 1px; background: repeating-linear-gradient(90deg, var(--eje) 0 14px, transparent 14px 18px, var(--eje) 18px 20px, transparent 20px 24px); animation: abrir-eje .6s var(--salida) .15s both; transform-origin: 50% 50%; }
.plano-cruz { position: absolute; width: 11px; height: 11px; margin: -5px 0 0 -5px; border: 1px solid var(--vivo); border-radius: 50%; animation: aparecer-caja .3s var(--salida) .4s both; }
.plano-cota-col { position: absolute; height: 9px; margin-top: -4px; border-left: 1px solid var(--tenue); border-right: 1px solid var(--tenue); background: linear-gradient(var(--tenue) 0 0) 0 50% / 100% 1px no-repeat; animation: abrir-eje .5s var(--salida) .15s both; }
.plano-cota-col::before, .plano-cota-col::after, .plano-caja u::before, .plano-caja u::after { content: ""; position: absolute; top: 50%; margin-top: -3px; border: 3px solid transparent; }
.plano-cota-col::before, .plano-caja u::before { left: 1px; border-right: 6px solid currentColor; border-left: 0; }
.plano-cota-col::after, .plano-caja u::after { right: 1px; border-left: 6px solid currentColor; border-right: 0; }
.plano-cota-col em { position: absolute; left: 50%; top: 50%; z-index: 1; translate: -50% -50%; padding: 0 .4rem; background: var(--fondo); color: var(--tenue); font: .6rem/1.5 var(--mono); font-style: normal; font-variant-numeric: tabular-nums; }

/* pistas: el ratsnest (rectas tenues) se rutea con quiebres a 45° y vías; F.Cu en --vivo, B.Cu en --tenue */
.plano-pistas { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; }
.rata { stroke: var(--tenue); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; transition: opacity .2s ease; }
.rata.v { opacity: .6; } .rata.v.fuera { opacity: 0; }
.pista { stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.pista.f { stroke: var(--vivo); } .pista.b { stroke: color-mix(in srgb, var(--texto) 55%, transparent); }
.ruteada .pista { animation: trazar-linea var(--t) linear var(--d) both; }
.via { fill: var(--fondo); stroke: var(--vivo); stroke-width: 1.2; opacity: 0; } .agujero { fill: var(--tenue); opacity: 0; }
.ruteada .via, .ruteada .agujero { opacity: 1; animation: aclarar .2s ease var(--d) both; }
.red { fill: var(--silk); font: 7.5px var(--mono); text-anchor: middle; opacity: 0; }
.ruteada .red { animation: aclarar .3s ease var(--d) both; opacity: 1; }
.plano-punta { position: absolute; left: 0; top: 0; width: 5px; height: 5px; margin: -2px; background: var(--vivo); offset-rotate: 0deg; opacity: 0; }
.plano-punta.ruteada { animation: punta var(--t) linear both; }

/* vertido de cobre: una zona de relleno (trama a 45°) con su aislamiento alrededor de huellas y pistas; el hueco sale de una máscara */
.plano-cobre { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; clip-path: circle(0 at var(--cx) var(--cy)); }
.plano-cobre.vierte { animation: verter .6s cubic-bezier(.3, .6, .35, 1) both; }
.plano-cobre .tinte { fill: color-mix(in srgb, var(--vivo) 6%, transparent); }
.plano-cobre line { stroke: color-mix(in srgb, var(--vivo) 40%, transparent); stroke-width: 1; }
@keyframes verter { to { clip-path: circle(150vmax at var(--cx) var(--cy)); } }

/* marcadores del DRC: un anillo ámbar con su flecha que se comprueba (pasa a verde) y se borra */
.plano-drc { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; opacity: 0; }
.plano-drc.activo { animation: drc .75s linear both; }
.plano-drc::before, .plano-drc::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.plano-drc::before { border: 1px solid var(--borde); }
.plano-drc.activo::before { animation: drc-fallo .75s linear both; }
.plano-drc::after { border: 1.5px solid var(--vivo); opacity: 0; }
.plano-drc.activo::after { animation: drc-ok .75s linear both; }
.plano-drc u { position: absolute; left: -17px; top: -3px; width: 17px; height: 1px; background: var(--borde); rotate: 45deg; transform-origin: right center; text-decoration: none; }
.plano-drc em { position: absolute; left: 28px; top: 50%; translate: 0 -50%; padding: 0 .25rem; background: color-mix(in srgb, var(--fondo) 85%, transparent); color: var(--texto); font: .5rem/1.5 var(--mono); font-style: normal; white-space: nowrap; }
.plano-drc.izq em { left: auto; right: 28px; }
@keyframes drc { 0% { opacity: 0; transform: scale(1.8); } 14% { opacity: 1; transform: none; } 82% { opacity: 1; } 100% { opacity: 0; transform: scale(.85); } }
@keyframes drc-fallo { 0%, 50% { opacity: 1; } 60%, 100% { opacity: 0; } }
@keyframes drc-ok { 0%, 50% { opacity: 0; } 60%, 100% { opacity: 1; } }

/* huellas: contorno de serigrafía, designador, valor y pads de cobre; caen en su sitio una tras otra */
.plano-caja { position: absolute; opacity: 0; }
.plano-caja.dibujada { opacity: 1; animation: caer .3s var(--salida) both; }
.plano-caja svg { position: absolute; inset: 0; overflow: visible; fill: none; stroke: var(--silk); stroke-width: 1; }
.plano-caja svg :is(rect, .t) { stroke-dasharray: 1; stroke-dashoffset: 1; }
.dibujada svg :is(rect, .t) { animation: trazar-linea .55s var(--salida) both; }
.dibujada svg .sim { animation-delay: .2s; }   /* el símbolo (resistencia, condensador…) se dibuja después del cuerpo */
/* patas de los circuitos integrados (F.Cu) */
.plano-caja svg .pat { fill: var(--vivo); stroke: none; opacity: 0; }
.dibujada svg .pat { opacity: 1; animation: aclarar .3s ease .3s both; }
/* la punta recorre el contorno a la par del trazo y se apaga al llegar */
.plano q::before, .plano q::after { content: none; }
.plano-caja q { position: absolute; left: 0; top: 0; width: 5px; height: 5px; margin: -2px; background: var(--vivo); offset-rotate: 0deg; opacity: 0; }
.dibujada q { animation: punta .55s var(--salida) both; }
.plano-caja.tipo-p, .plano-caja.tipo-o { border: 1px dashed var(--silk); border-radius: 6px; }
.plano-caja.tipo-o { border-radius: 50%; }
/* pads (F.Cu) y la marca del pin 1 */
.plano-caja::before { content: ""; position: absolute; inset: -3px; pointer-events: none; --pad: var(--vivo); opacity: 0; }
.dibujada::before { animation: aclarar .3s ease .3s both; opacity: 1; }
.tipo-r::before, .tipo-c::before, .tipo-p::before, .tipo-o::before, .tipo-j::before { background: linear-gradient(var(--pad) 0 0) 0 50% / 5px 8px no-repeat, linear-gradient(var(--pad) 0 0) 100% 50% / 5px 8px no-repeat; }
/* pads de agujero pasante (enlaces y botones): anillo de cobre con su taladro */
.tipo-p::before, .tipo-o::before, .tipo-j::before { background: radial-gradient(circle, var(--fondo) 0 1.5px, var(--pad) 2px 4.5px, transparent 5px) left -2px center / 10px 10px no-repeat, radial-gradient(circle, var(--fondo) 0 1.5px, var(--pad) 2px 4.5px, transparent 5px) right -2px center / 10px 10px no-repeat; }
/* courtyard de las huellas grandes */
.dibujada.tipo-u, .dibujada.tipo-k, .dibujada.tipo-q { outline: 1px dashed color-mix(in srgb, var(--texto) 26%, transparent); outline-offset: 6px; }
.tipo-r::after, .tipo-c::after, .tipo-u::after, .tipo-k::after, .tipo-q::after, .tipo-j::after { content: ""; position: absolute; left: -2px; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--texto); }
.tipo-v { border: 2px solid var(--vivo); border-radius: 50%; }
.tipo-v::after { content: ""; position: absolute; inset: 0; margin: auto; width: 4px; height: 4px; border-radius: 50%; background: var(--tenue); }
/* pines del conector: el primero cuadrado, los demás redondos, con su taladro */
.plano-caja .pin { position: absolute; bottom: -4px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: radial-gradient(circle, var(--fondo) 0 1.2px, var(--vivo) 1.7px); }
.plano-caja .pin.p1 { border-radius: 0; }
.dibujada .pin { animation: aclarar .3s ease .3s both; }
.plano-caja b { position: absolute; left: 4px; top: 3px; z-index: 1; padding: 0 .2rem; background: color-mix(in srgb, var(--fondo) 80%, transparent); color: var(--texto); font: 600 .56rem/1.5 var(--mono); white-space: nowrap; transition: opacity .3s ease; }
.plano-caja.corto b { top: 50%; translate: 0 -50%; }
.dibujada b { animation: aclarar .25s ease .1s both; }
.plano.asentado .plano-caja b { opacity: .55; }
.plano-caja i { position: absolute; right: .4rem; bottom: .2rem; padding: 0 .2rem; background: color-mix(in srgb, var(--fondo) 80%, transparent); font: .52rem/1.5 var(--mono); font-style: normal; }
.plano-caja.corto i { bottom: auto; top: 50%; translate: 0 -50%; }
.dibujada i { animation: aclarar .25s ease .45s both; }
.plano.movil .plano-caja i { display: none; }
/* la cota: una línea con topes, flechas y la medida al centro, bajo cada párrafo */
.plano-caja u { position: absolute; left: 0; right: 0; top: calc(100% + 5px); height: 7px; border-left: 1px solid currentColor; border-right: 1px solid currentColor; background: linear-gradient(currentColor 0 0) 0 50% / 100% 1px no-repeat; text-decoration: none; clip-path: inset(0 100% 0 0); }
.dibujada u { animation: barrer .5s var(--salida) .35s both; }
.plano-caja u em { position: absolute; left: 50%; top: 50%; z-index: 1; translate: -50% -50%; padding: 0 .25rem; background: var(--texto); color: var(--fondo); font: .52rem/1.5 var(--mono); font-style: normal; font-variant-numeric: tabular-nums; }
/* leyenda de capas, abajo a la izquierda */
.plano-leyenda { position: absolute; left: 30px; bottom: 30px; display: grid; gap: 1px; font: .55rem/1.7 var(--mono); animation: aclarar .4s ease .3s both; }
.plano-leyenda p { display: flex; align-items: center; gap: .5rem; margin: 0; }
.plano-leyenda span { width: 16px; height: 2px; background: var(--tenue); }
.plano-leyenda .f { background: var(--vivo); } .plano-leyenda .s { background: var(--silk); } .plano-leyenda .e { background: var(--borde); height: 1px; }
.plano-leyenda .b { background: repeating-linear-gradient(90deg, var(--tenue) 0 4px, transparent 4px 6px); }
/* cajetín del plano, abajo a la derecha, con la disposición del de KiCad: cada valor se escribe letra por letra y el DRC cierra con su veredicto */
.plano-cajetin { position: absolute; right: 23px; bottom: 23px; width: 16rem; border: 1px solid var(--silk); background: var(--fondo); font: .6rem/1.9 var(--mono); animation: aclarar .3s ease .1s both; }
.plano-cajetin > p, .plano-cajetin .fila { margin: 0; border-top: 1px solid color-mix(in srgb, var(--tenue) 55%, transparent); }
.plano-cajetin > :first-child { border-top: 0; }
.plano-cajetin p { margin: 0; padding: 0 .6rem; white-space: nowrap; color: var(--texto); }
.plano-cajetin em { font-style: normal; color: var(--tenue); }
.plano-cajetin .emp { font-weight: 700; letter-spacing: .04em; }
.plano-cajetin .tit { font-size: .68rem; font-weight: 700; font-style: italic; line-height: 2.2; }
.plano-cajetin .fila { display: flex; } .plano-cajetin .fila p { flex: 1; } .plano-cajetin .fila p + p { border-left: 1px solid color-mix(in srgb, var(--tenue) 55%, transparent); }
.plano-cajetin .fila .d { flex: 2; }
.plano-cajetin span { display: inline-block; vertical-align: top; white-space: nowrap; clip-path: inset(0 100% 0 0); animation: escribir calc(var(--n) * 30ms) steps(var(--n)) var(--d) both; }
.plano-cajetin .ok { color: var(--vivo); font-weight: 600; }
.plano.movil .plano-cajetin { right: 14px; bottom: 14px; width: 15rem; }
.plano.movil .plano-cajetin .extra { display: none; }
/* la leyenda, el cajetín y la barra de estado quedan sobre las huellas que se asoman por abajo */
.plano-leyenda, .plano-cajetin, .plano-estado { z-index: 2; } .plano-cursor { z-index: 3; }
/* barra de estado (coordenadas, capa y la acción en curso) y la herramienta, que cambia de forma según la fase */
.plano-estado { position: absolute; left: 150px; bottom: 26px; width: 27rem; padding: 0 .5rem; overflow: hidden; background: var(--fondo); font: .55rem/1.4 var(--mono); white-space: pre; color: var(--tenue); animation: aclarar .3s ease .15s both; }
.plano.movil .plano-estado { left: auto; right: 14px; width: 15rem; }
.plano-cursor { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.plano-cursor::before, .plano-cursor::after { content: ""; position: absolute; background: var(--texto); opacity: .7; }
/* cruz: colocar y conectar */
.c-cruz::before { left: -9px; top: 0; width: 19px; height: 1px; } .c-cruz::after { top: -9px; left: 0; height: 19px; width: 1px; }
/* punta: rutear */
.c-punta::before { left: 0; top: 0; width: 11px; height: 15px; opacity: .85; clip-path: polygon(0 0, 100% 68%, 46% 70%, 0 100%); } .c-punta::after { content: none; }
/* cuadro: verter la zona */
.c-cuadro::before { left: -6px; top: -6px; width: 11px; height: 11px; background: none; border: 1px solid var(--texto); } .c-cuadro::after { left: -1px; top: -1px; width: 3px; height: 3px; }
/* anillo: comprobar */
.c-anillo::before { left: -9px; top: -9px; width: 17px; height: 17px; border-radius: 50%; background: none; border: 1px solid var(--texto); } .c-anillo::after { left: -1px; top: -1px; width: 3px; height: 3px; }
/* fabricación: una línea baja por la hoja; a su paso el dibujo se abre y deja ver la página, y las imágenes se deshacen en píxeles */
.plano-barrido { position: absolute; inset: 0; border-bottom: 1px solid var(--vivo); transform: translateY(-100%); }
.plano-barrido::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 5px; background: repeating-linear-gradient(90deg, var(--vivo) 0 1px, transparent 1px 10px); opacity: .6; }
.plano.resuelve .plano-barrido { animation: barrido var(--bar) linear both; }
.plano.resuelve .plano-hoja { animation: abrir-placa var(--bar) linear both; }
.plano-vela { position: absolute; background: var(--panel); animation: pixelar .3s steps(1, end) var(--d) both; }
@keyframes pixelar {
  0%   { mask-image: conic-gradient(#000 25%, #0000 0 50%, #000 0 75%, #0000 0), conic-gradient(#0000 75%, #000 0); mask-size: 12px 12px; }
  25%  { mask-image: conic-gradient(#000 25%, #0000 0 50%, #000 0 75%, #0000 0); mask-size: 12px 12px; }
  50%  { mask-image: conic-gradient(#0000 75%, #000 0); mask-size: 12px 12px; }
  75%  { mask-image: radial-gradient(#000 2px, #0000 2.5px); mask-size: 12px 12px; }
  100% { mask-image: linear-gradient(#0000, #0000); mask-size: 100% 100%; }
}
@keyframes abrir-hoja { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes abrir-eje { from { transform: scaleX(0); } }
@keyframes escribir { to { clip-path: inset(0); } }
@keyframes barrido { to { transform: none; } }
@keyframes abrir-placa { from { clip-path: inset(0); } to { clip-path: inset(100% 0 0 0); } }
@keyframes punta { from { offset-distance: 0%; opacity: 1; } 85% { opacity: 1; } to { offset-distance: 100%; opacity: 0; } }
@keyframes aparecer-caja { from { opacity: 0; transform: scale(.92); } }
@keyframes caer { from { opacity: 0; transform: translateY(-9px) scale(1.03); } }
@keyframes trazar-linea { to { stroke-dashoffset: 0; } }
@keyframes barrer { to { clip-path: inset(0 0 0 0); } }
@keyframes bajar-riel { from { transform: scaleY(0); } }

/* Índice lateral: iconos que saltan a cada sección, a la derecha de la columna */
.lateral { position: fixed; left: calc(50% + var(--col) / 2 + 1rem); top: 50%; z-index: 10; display: none; flex-direction: column; gap: .15rem; transform: translateY(-50%); }
@media (min-width: 72rem) { .lateral { display: flex; } }
.lateral a { position: relative; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; color: var(--tenue); transition: color .15s ease, background-color .15s ease; }
.lateral a:hover, .lateral a[aria-current] { color: var(--texto); background: var(--panel); }
.lateral .icono { width: 1rem; height: 1rem; }
/* el nombre de la sección aparece al lado */
.lateral a::after { content: attr(data-rotulo); position: absolute; left: calc(100% + .4rem); padding: .1rem .45rem; border-radius: 6px; background: var(--texto); color: var(--fondo); font: .6875rem var(--mono); white-space: nowrap; opacity: 0; transform: translateX(-4px); pointer-events: none; transition: opacity .12s ease, transform .15s var(--salida); }
.lateral a:hover::after, .lateral a:focus-visible::after { opacity: 1; transform: none; }
.ver-todos { padding-block: .25rem; color: var(--tenue); font-size: .8rem; text-decoration: none; transition: color .15s ease; }
.ver-todos:hover { color: var(--texto); }

/* Combate de minisumo en el banner */
.banner-jugar { position: absolute; right: .6rem; bottom: .6rem; padding: .25rem .7rem; border: 1px solid rgb(255 255 255 / .25); border-radius: 6px; background: rgb(0 0 0 / .7); color: #f2f2f2; font: 500 .8rem "Pixelify Sans", var(--mono); transition: transform .16s var(--salida), background-color .15s ease; }
.banner-jugar:hover { background: #000; }
.banner-jugar:active { transform: scale(.97); }
.banner-marcador { position: absolute; left: 50%; top: .6rem; translate: -50% 0; padding: .1rem .7rem; border: 1px solid rgb(255 255 255 / .25); border-radius: 6px; background: rgb(0 0 0 / .75); color: #f2f2f2; font: 500 1rem "Pixelify Sans", var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.banner.jugando { cursor: crosshair; }

/* la pista del banner aparece al acercar el cursor; en pantallas chicas estorba */
@media (hover: hover) and (pointer: fine) { .banner-caja:not(:hover) .banner-pista { opacity: 0; } }
@media (max-width: 640px) { .banner-pista { display: none; } }

/* Enlace para saltar la barra: solo se ve al llegar con el teclado */
.saltar { position: absolute; left: .5rem; top: -4rem; z-index: 200; padding: .4rem .7rem; border-radius: 6px; background: var(--texto); color: var(--fondo); font-size: .82rem; text-decoration: none; }
.saltar:focus { top: .5rem; }
/* Cajón con teclado: el lienzo recibe foco y marca la pieza elegida */
.cajon:focus-visible { outline: 2px solid var(--texto); outline-offset: 3px; }

/* Iconos en pixel art: rejilla de 24x24 a 24 px, un píxel de pantalla por celda (dos en pantallas densas) */
.icono.px { width: 24px; height: 24px; fill: currentColor; stroke: none; shape-rendering: crispEdges; }
/* Junto al texto el dibujo ocupa menos de la rejilla: se recorta el margen sobrante para no estirar la línea */
.mas summary .icono.px, .datos .icono.px, .enlace .icono.px, .exp-org .icono.px, .boton .icono.px, .exp-mas .icono.px, .contacto-fila a > .icono.px, .redes a > .icono.px { margin: -3px; }
.recs .icono.px { margin: -1px -3px -3px; }

/* Contacto: una fila de celdas separadas por líneas, con el icono en su cajita y una flecha que sale */
.contacto-fila { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: -1.25rem calc(-1 * var(--sangria)) -2rem; }
.contacto-fila li + li { border-left: 1px dashed var(--raya); }
.contacto-fila a { display: flex; align-items: center; justify-content: flex-start; gap: .55rem; height: 4rem; padding: 0 1rem; color: var(--tenue); font-size: .8rem; font-weight: 500; text-decoration: none; transition: background-color .2s ease, color .15s ease; }
/* dos hileras: arriba lo de trabajo (GitHub, LinkedIn, correo), abajo lo personal */
@media (min-width: 641px) { .contacto-fila li:nth-child(3n + 1) { border-left: 0; } .contacto-fila li:nth-child(-n + 3) { border-bottom: 1px dashed var(--raya); } }
.contacto-texto { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.contacto-texto small { overflow: hidden; color: var(--tenue); font: .6875rem var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.contacto-fila a > .icono.px { margin: -3px -3px -3px auto; }   /* la flecha al borde derecho de cada celda */
.contacto-icono { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border: 1px solid var(--raya); border-radius: 8px; background: var(--panel); }
.contacto-fila a > .icono { opacity: .6; transition: transform .2s var(--salida); }
.contacto-fila a:hover { background: var(--panel); color: var(--texto); }
.contacto-fila a:hover > .icono { transform: translate(2px, -2px); }
@media (max-width: 640px) { .contacto-fila { grid-template-columns: repeat(2, minmax(0, 1fr)); } .contacto-fila li { border-top: 1px dashed var(--raya); } .contacto-fila li:nth-child(-n + 2) { border-top: 0; } .contacto-fila li:nth-child(odd) { border-left: 0; } .contacto-fila li:last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* Etiqueta que sigue al cursor con un resorte y dice qué hace lo que hay debajo */
.etiqueta-cursor { position: fixed; left: 0; top: 0; z-index: 300; padding: .2rem .5rem; background: var(--texto); color: var(--fondo); font: 500 .8rem/1.3 "Pixelify Sans", var(--mono); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .16s ease;
  box-shadow: 0 -2px 0 var(--texto), 0 2px 0 var(--texto), -2px 0 0 var(--texto), 2px 0 0 var(--texto); }
.etiqueta-cursor.visible { opacity: 1; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }

/* Proyectos y experiencia: destacado, enlaces, filtro, tabla de repos, entradas, reconocimientos y cierre */
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.obra .obra-datos { display: flex; gap: .5rem; color: var(--tenue); font: .6875rem var(--mono); letter-spacing: .04em; }
.obra-datos span::before { content: "·"; margin-right: .5rem; }
.obra-enlaces { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; padding-top: .8rem; border-top: 1px dashed var(--raya); }
.enlace { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .65rem; border: 1px solid var(--raya); color: var(--texto); font: .75rem var(--mono); text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.enlace:hover { border-color: var(--tenue); background: var(--panel); }
.enlace .icono:last-child:not(:first-child) { transition: transform .2s var(--salida); }
.enlace:hover .icono:last-child:not(:first-child) { transform: translateX(2px); }
.obra-destacada { grid-column: 1 / -1; flex-direction: row; }
.obra-destacada .obra-img { flex: 0 0 52%; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--raya); }
.obra-destacada .obra-cuerpo { justify-content: center; gap: .65rem; padding: 1.4rem 1.4rem 1.3rem; }
.obra-destacada h2 { font-size: 1.9rem; }
.obra-destacada p { font-size: .88rem; }
.filtrable { transition: opacity .14s ease; }
.filtrable.cambiando { opacity: 0; }
.filtrable [hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .filtrable { transition: none; } }
/* los efectos de hover con transform no se animan con movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  html .mas summary .icono,
  html .tema,
  html .avatar,
  html .redes a,
  html .chip-boton,
  html .chips li,
  html .copiar,
  html .obra-img img,
  html .boton,
  html .banner-hora,
  html .avatar-caja,
  html .avatar-caja .con-arduino,
  html .globo,
  html .lateral a::after,
  html .banner-jugar,
  html .contacto-fila a > .icono,
  html .enlace .icono:last-child:not(:first-child),
  html .cierre .boton .icono,
  html .exp-mas .icono,
  html .celda-c .redes a .icono:last-child,
  html .enviar .icono { transition-duration: .01ms; }
}
.repos-caja { margin-top: 2rem; }
.repos-caja .sub { margin-top: 0; }
.repos { width: 100%; border-collapse: collapse; font-size: .82rem; }
.repos th, .repos td { padding: .65rem 1rem .65rem 0; text-align: left; vertical-align: baseline; border-top: 1px dashed var(--raya); }
.repos thead th { padding-block: 0 .5rem; border-top: 0; color: var(--tenue); font: .6875rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.repos tbody tr:first-child > * { border-top: 0; }
.repos th:last-child, .repos td:last-child { padding-right: 0; text-align: right; }
.repos .r-nombre { font-weight: 500; white-space: nowrap; }
.repos .r-nombre a { text-decoration: none; }
.repos .r-nombre a:hover { text-decoration: underline; }
.repos .r-desc { width: 100%; max-width: 0; color: var(--tenue); }
.repos .r-desc p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repos .r-len, .repos .r-fecha { color: var(--tenue); font: .72rem var(--mono); white-space: nowrap; }
@media (max-width: 640px) {
  .repos thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .repos tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem 1rem; padding: .7rem 0; border-top: 1px dashed var(--raya); }
  .repos tbody tr:first-child { border-top: 0; padding-top: 0; }
  .repos th, .repos td { display: block; padding: 0; border: 0; }
  .repos .r-nombre { grid-area: 1 / 1; }
  .repos .r-fecha { grid-area: 1 / 2; }
  .repos .r-desc { grid-area: 2 / 1 / 3 / -1; max-width: none; }
  .repos .r-desc p { white-space: normal; }
  .repos .r-len { grid-area: 3 / 1 / 4 / -1; }
  .repos .r-len:empty { display: none; }
  .obra-destacada { flex-direction: column; }
  .obra-destacada .obra-img { flex: none; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--raya); }
  .obra-destacada .obra-cuerpo { padding: .9rem 1rem 1rem; }
  .obra-destacada h2 { font-size: 1.5rem; }
}
.exp > li { padding: 1.1rem 0; border-top: 1px dashed var(--raya); }
.exp > li:first-child { border-top: 0; padding-top: 0; }
.exp-cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; }
.exp-puesto { font: 600 .95rem/1.4 var(--sans); }
.exp-puesto::after { content: "·"; margin-left: .6rem; color: var(--tenue); font-weight: 400; }
.exp-org { display: inline-flex; align-items: center; gap: .35rem; color: var(--tenue); font-weight: 500; text-decoration: none; }
a.exp-org:hover { color: var(--texto); }
.exp-org .icono { opacity: .7; }
.exp-fecha { margin-left: auto; color: var(--tenue); font: .72rem var(--mono); white-space: nowrap; }
.exp-logros { display: grid; gap: .35rem; margin: .55rem 0 0; color: color-mix(in srgb, var(--texto) 82%, var(--tenue)); font-size: .85rem; line-height: 1.6; }
.exp-logros li { position: relative; padding-left: 1rem; }
.exp-logros li::before { content: ""; position: absolute; left: 0; top: .7em; width: 4px; height: 4px; background: var(--tenue); }
.exp .etiquetas { margin-top: .5rem; padding-top: 0; }
.recs li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: .1rem .8rem; padding: .75rem 0; border-top: 1px dashed var(--raya); }
.recs li:first-child { border-top: 0; padding-top: 0; }
.recs .icono { align-self: start; margin-top: .2rem; color: var(--tenue); }
.recs p { margin: 0; }
.rec-t { font-size: .88rem; color: color-mix(in srgb, var(--texto) 85%, var(--tenue)); }
.rec-t strong { color: var(--texto); font-weight: 600; }
.recs time { color: var(--tenue); font: .72rem var(--mono); white-space: nowrap; }
.rec-d { grid-column: 2 / -1; color: var(--tenue); font-size: .8rem; }
.cierre .boton { margin-top: .25rem; }
.cierre .boton .icono { transition: transform .2s var(--salida); }
.cierre .boton:hover .icono { transform: translateX(2px); }

/* Esquinas rectas: controles, menú, lienzo, rótulos del banner, avatar y páginas de proyecto */
.boton, .copiar, .chip-boton, .chips li, .mas ul, .mas a, .tema, .redes a, .contacto-icono, .cajon, .banner-hora, .banner-pista, .banner-jugar, .banner-marcador,
.lateral a, .lateral a::after, .avatar-caja, .saltar, .fotos figure, .visor, .visor button { border-radius: 0; }
.mapa-scroll { overflow: hidden; }   /* inicio.js dibuja solo las semanas que caben */

/* Experiencia: enlace discreto a la formación */
.exp-mas { margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px dashed var(--raya); font: .75rem var(--mono); }
.exp-mas a { display: inline-flex; align-items: center; gap: .45rem; color: var(--tenue); text-decoration: none; transition: color .15s ease; }
.exp-mas a:hover { color: var(--texto); }
.exp-mas .icono { transition: transform .2s var(--salida); }
.exp-mas a:hover .icono { transform: translateX(2px); }
.formacion li { grid-template-columns: minmax(0, 1fr) auto; }
.formacion .rec-d { grid-column: 1 / -1; }

/* Proyectos: si queda una tarjeta suelta, ocupa las dos columnas como el destacado */
.obra-ancha { grid-column: 1 / -1; flex-direction: row; }
.obra-ancha .obra-img { flex: 0 0 52%; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--raya); }
.obra-ancha .obra-cuerpo { justify-content: center; gap: .65rem; padding: 1.4rem 1.4rem 1.3rem; }
.obra-ancha h2 { font-size: 1.6rem; }
.obra-ancha p { font-size: .88rem; }
@media (max-width: 640px) {
  .obra-ancha { flex-direction: column; }
  .obra-ancha .obra-img { flex: none; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--raya); }
  .obra-ancha .obra-cuerpo { padding: .9rem 1rem 1rem; }
  .obra-ancha h2 { font-size: 1.5rem; }
}

/* Página de cada proyecto */
.fotos figure, .visor { border-style: dashed; }
.visor button { border-style: dashed; color: var(--texto); }
.otros a { display: inline-block; padding: .3rem .65rem; border: 1px solid var(--raya); font: .75rem var(--mono); text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.otros a:hover { border-color: var(--tenue); background: var(--panel); }
.otros ul { gap: .5rem; }
.proyecto + .cierre { margin-top: 0; }

/* Animaciones: pista que se rutea bajo cada cabecera de sección, barrido entre páginas y LED de la hora */
/* La pista (la raya de .seccion-cab) la oculta solo el script (pista-oculta) y se traza por pasos con una cabeza de cobre */
.seccion-cab.pista-oculta::after { clip-path: inset(0 100% 0 0); }
.seccion-cab::before { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; background: linear-gradient(var(--vivo), var(--vivo)) 0 0 / 4px 100% no-repeat; opacity: 0; }
.seccion-cab.pista-traza::after { animation: pista-traza .5s steps(10) both; }
.seccion-cab.pista-traza::before { animation: pista-cabeza .5s steps(10) both, pista-apaga .01s linear .5s both; }
@keyframes pista-traza { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes pista-cabeza { from { opacity: 1; background-position: 0 0; } to { opacity: 1; background-position: 100% 0; } }
@keyframes pista-apaga { from { opacity: 1; } to { opacity: 0; } }

/* LED de la hora (contacto): se atenúa en los segundos impares */
.verde.apagado { opacity: .25; }
/* Barrido: una línea de --vivo recorre la página y va descubriendo la nueva; la barra no se mueve */
@media (prefers-reduced-motion: no-preference) {
  :root:not(.cambia-tema)::after { content: ""; position: fixed; left: 0; top: 0; width: 3px; height: 100vh; pointer-events: none; view-transition-name: barrido; }
  :root:not(.cambia-tema)::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
  :root:not(.cambia-tema)::view-transition-new(root) { mix-blend-mode: normal; animation: barrido-pagina .4s steps(14) both; }
  :root:not(.cambia-tema)::view-transition-old(barra) { display: none; }
  :root:not(.cambia-tema)::view-transition-new(barra) { animation: none; }
  :root:not(.cambia-tema)::view-transition-group(barrido) { z-index: 7; background: var(--vivo); animation: barrido-linea .4s steps(14) both; }
  :root:not(.cambia-tema)::view-transition-image-pair(barrido) { display: none; }
}
@keyframes barrido-pagina { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes barrido-linea { from { transform: translateX(0); } to { transform: translateX(calc(100vw - 3px)); } }
@media (prefers-reduced-motion: reduce) {
  .seccion-cab.pista-oculta::after { clip-path: none; }
  .seccion-cab::before { display: none; }
  .verde.apagado { opacity: 1; }
}

/* Proyectos: sello «Nuevo» y sprite de 16x16 junto al nombre de cada tarjeta */
.estado.nuevo { color: var(--texto); padding: .05rem .4rem; border: 1px solid currentColor; clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px), 0 2px, 2px 2px); }
.estado.nuevo::before { display: none; }
.obra h2 { display: inline-flex; align-items: center; gap: .6rem; }
.obra h2 .icono.sprite { width: 32px; height: 32px; margin: 0; color: var(--tenue); }

/* Mapa de contribuciones: foco visible al recorrerlo con teclado */
.mapa-grid .celda:focus-visible { outline: 2px solid var(--texto); outline-offset: 1px; }
.obra-cab { align-items: center; }

/* Proyectos: la foto va en un marco según el tipo (plano, ventana, lienzo); lo decorativo es aria-hidden */
[class*="marco-"] { position: relative; background: var(--fondo) radial-gradient(var(--raya) 1px, transparent 1.2px) 8px 8px / 16px 16px; font-family: var(--mono); }
[class*="marco-"] > img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; box-sizing: border-box; }
.obra:hover [class*="marco-"] > img { transform: none; }
.obra-img i, .obra-img em, .obra-img b, .obra-img u { font-style: normal; text-decoration: none; font-weight: 400; }
.hj-caj { position: absolute; display: flex; background: var(--fondo); color: var(--texto); font-size: .62rem; line-height: 1; letter-spacing: .06em; white-space: nowrap; overflow: hidden; }
.hj-sp { display: flex; align-items: center; justify-content: center; flex: none; }
.hj-sp .icono { width: 26px; height: 26px; margin: 0; color: var(--texto); }
.hj-tx { display: flex; flex: 1; min-width: 0; }
.hj-n { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.hj-h { color: var(--tenue); font-size: .5rem; }
.hj-h u { color: var(--vivo); }

/* plano: hoja con coordenadas, doble borde y fiducial */
.marco-plano::before, .marco-plano::after { content: ""; position: absolute; pointer-events: none; }
.marco-plano::before { left: 8px; top: 8px; right: 8px; bottom: 8px; border: 1px solid var(--tenue); }
.marco-plano::after { left: 13px; top: 13px; right: 13px; bottom: 13px; border: 1px solid var(--raya); }
.marco-plano img { left: 30px; top: 22px; width: calc(100% - 60px); height: calc(100% - 52px); border: 1px solid var(--tenue); }
.pl-x { position: absolute; left: 30px; right: 30px; top: 3px; display: flex; justify-content: space-between; color: var(--tenue); font-size: .5rem; line-height: 10px; letter-spacing: .08em; }
.pl-y { position: absolute; left: 3px; top: 22px; bottom: 30px; display: flex; flex-direction: column; justify-content: space-around; color: var(--tenue); font-size: .5rem; line-height: 10px; }
.pl-x i { padding: 0 3px; background: var(--fondo); }
.pl-y i { padding: 2px 0; background: var(--fondo); }
.pl-fid { position: absolute; right: 18px; top: 36px; width: 5px; height: 5px; border-radius: 50%; background: var(--vivo); box-shadow: 0 0 0 2px var(--fondo), 0 0 0 3px var(--tenue); }
.hj-rot { position: absolute; left: 30px; bottom: 15px; max-width: calc(100% - 215px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tenue); font-size: .5rem; line-height: 1; letter-spacing: .08em; }
.marco-plano .hj-caj { right: 22px; bottom: 15px; width: 150px; height: 38px; border: 1px solid var(--texto); }
.marco-plano .hj-sp { width: 36px; border-right: 1px solid var(--texto); }
.marco-plano .hj-tx { flex-direction: column; }
.marco-plano .hj-n { flex: 1; display: block; padding: 11px 0 0 9px; border-bottom: 1px solid var(--texto); }
.marco-plano .hj-h { display: flex; justify-content: space-between; padding: 4px 8px 0; height: 14px; }

/* ventana: barra de título y barra de estado con el cajetín */
.marco-ventana img { top: 22px; height: calc(100% - 44px); object-position: top left; }
.vt-b { position: absolute; left: 0; top: 0; right: 0; height: 22px; padding: 0 .7rem 0 2.6rem; border-bottom: 1px solid var(--raya); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tenue); font-size: .6rem; line-height: 21px; letter-spacing: .02em;
  background: linear-gradient(var(--raya) 0 0) .7rem 50% / 6px 6px no-repeat, linear-gradient(var(--raya) 0 0) 1.25rem 50% / 6px 6px no-repeat, linear-gradient(var(--raya) 0 0) 1.8rem 50% / 6px 6px no-repeat, var(--panel); }
.marco-ventana .hj-caj { left: 0; right: 0; bottom: 0; height: 22px; align-items: center; border-top: 1px solid var(--raya); background: var(--panel); }
.marco-ventana .hj-sp { width: 22px; height: 21px; }
.marco-ventana .hj-sp .icono { width: 16px; height: 16px; color: var(--tenue); }
.marco-ventana .hj-tx { align-items: center; justify-content: space-between; padding-right: .7rem; }
.marco-ventana .hj-n { font-size: .55rem; color: var(--tenue); }
.marco-ventana .hj-h { display: flex; gap: .4em; }

/* lienzo: marcas de corte, regla y muestras de color */
.marco-lienzo img { left: 30px; top: 24px; width: calc(100% - 60px); height: calc(100% - 68px); border: 1px solid var(--raya); }
.lz-m { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none;
  background:
    linear-gradient(var(--tenue), var(--tenue)) 8px 24px / 16px 1px no-repeat, linear-gradient(var(--tenue), var(--tenue)) 30px 6px / 1px 14px no-repeat,
    linear-gradient(var(--tenue), var(--tenue)) right 8px top 24px / 16px 1px no-repeat, linear-gradient(var(--tenue), var(--tenue)) right 30px top 6px / 1px 14px no-repeat,
    linear-gradient(var(--tenue), var(--tenue)) 8px bottom 44px / 16px 1px no-repeat, linear-gradient(var(--tenue), var(--tenue)) 30px bottom 28px / 1px 14px no-repeat,
    linear-gradient(var(--tenue), var(--tenue)) right 8px bottom 44px / 16px 1px no-repeat, linear-gradient(var(--tenue), var(--tenue)) right 30px bottom 28px / 1px 14px no-repeat; }
.lz-r { position: absolute; left: 30px; right: 30px; top: 8px; height: 6px; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--tenue) 0 1px, transparent 1px 8px) 0 100% / 100% 4px no-repeat, linear-gradient(var(--raya), var(--raya)) 0 100% / 100% 1px no-repeat; }
.lz-s { position: absolute; left: 30px; bottom: 11px; display: flex; gap: 3px; }
.lz-s i { width: 10px; height: 10px; border: 1px solid var(--tenue); background: var(--texto); }
.lz-s i:nth-child(2) { background: var(--tenue); }
.lz-s i:nth-child(3) { background: var(--raya); }
.lz-s i:nth-child(4) { background: var(--vivo); }
.lz-s i:nth-child(5) { background: var(--panel); }
.marco-lienzo .hj-caj { right: 30px; bottom: 6px; width: 150px; height: 26px; border: 1px solid var(--tenue); }
.marco-lienzo .hj-sp { width: 24px; border-right: 1px solid var(--tenue); }
.marco-lienzo .hj-sp .icono { width: 18px; height: 18px; }
.marco-lienzo .hj-tx { flex-direction: column; justify-content: center; gap: 3px; padding-left: 7px; }
.marco-lienzo .hj-n { font-size: .56rem; }
.marco-lienzo .hj-h { display: flex; gap: .4em; }

@media (max-width: 640px) {
  .marco-plano::before { left: 5px; top: 5px; right: 5px; bottom: 5px; }
  .marco-plano::after, .pl-y, .pl-fid, .hj-rot { display: none; }
  .pl-x { left: 14px; right: 14px; top: 0; }
  .marco-plano img { left: 12px; top: 12px; width: calc(100% - 24px); height: calc(100% - 36px); }
  .marco-plano .hj-caj { right: 10px; bottom: 8px; width: 110px; height: 28px; }
  .marco-plano .hj-sp { width: 26px; }
  .marco-plano .hj-sp .icono { width: 20px; height: 20px; }
  .marco-plano .hj-n { padding: 6px 0 0 6px; font-size: .5rem; }
  .marco-plano .hj-h { height: 10px; padding: 2px 6px 0; }
  .pl-x { display: none; }
  .marco-lienzo img { left: 18px; top: 14px; width: calc(100% - 36px); height: calc(100% - 46px); }
  .lz-r, .lz-m, .lz-s { display: none; }
  .marco-lienzo .hj-caj { right: 18px; bottom: 5px; width: 120px; height: 22px; }
  .marco-lienzo .hj-sp { width: 20px; }
  .marco-lienzo .hj-sp .icono { width: 14px; height: 14px; }
  .marco-lienzo .hj-tx { gap: 2px; }
}
@media (max-width: 640px) { .fotos img { max-height: 16rem; } .fotos { gap: .75rem; } }

/* Homelab: el enlace invisible sobre el rack del banner, el icono del menú y la tarjeta de la portada */
.banner-homelab { position: absolute; left: 0; top: 32%; width: 4.7%; height: 39%; border-radius: 3px; }
.banner-homelab:focus-visible { outline: 2px solid var(--texto); outline-offset: 2px; }
@media (pointer: coarse) { .banner-homelab { width: 8%; } }
.mas a.con-icono { display: flex; align-items: center; gap: .3rem; }
.mas a.con-icono .icono.px { margin: -3px -2px -3px -4px; }
.homelab-tarjeta { display: flex; align-items: stretch; border: 1px solid var(--raya); border-radius: 12px; background: var(--panel); overflow: hidden; }
.homelab-sala { flex: none; width: clamp(8rem, 34%, 13rem); border-right: 1px solid var(--raya); shape-rendering: crispEdges; }
@media (max-width: 640px) {
  .homelab-tarjeta { flex-direction: column; }
  .homelab-sala { width: 100%; height: 10.5rem; border-right: 0; border-bottom: 1px solid var(--raya); }
}
.homelab-texto { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .7rem; min-width: 0; padding: 1rem 1.25rem; }
.homelab-texto p { margin: 0; }
.hl-estado { display: flex; align-items: center; gap: .5rem; color: var(--tenue); font: .75rem var(--mono); }
.hl-punto { flex: none; width: 8px; height: 8px; background: var(--tenue); }
[data-hl="ok"] .hl-punto { background: var(--vivo); }
[data-hl="falla"] .hl-punto { background: #d99a1e; }
.homelab-sala .led { fill: #3a3f47; }
[data-hl="ok"] .led.e, [data-hl="falla"] .led.e { fill: #7ef0a6; }
[data-hl="falla"] .led.f { fill: #ff5d5d; }
[data-hl="ok"] .led.a, [data-hl="falla"] .led.a { fill: #ffab30; }
@keyframes hl-parpadeo { 0%, 45%, 100% { opacity: 1; } 50%, 70% { opacity: .3; } }
@media (prefers-reduced-motion: no-preference) {
  [data-hl="ok"] .led.a, [data-hl="falla"] .led.a { animation: hl-parpadeo 2.4s steps(1) infinite; }
  .homelab-sala rect:nth-of-type(3n) { animation-duration: 3.3s !important; animation-delay: -.9s; }
  .homelab-sala rect:nth-of-type(3n + 1) { animation-duration: 2.8s !important; animation-delay: -1.7s; }
}
