/* jetbrains-mono-cyrillic-ext-wght-normal */
@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(data:font/woff2;base64,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) format('woff2-variations');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

/* jetbrains-mono-cyrillic-wght-normal */
@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/_astro/jetbrains-mono-cyrillic-wght-normal.D73BlboJ.woff2) format('woff2-variations');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

/* jetbrains-mono-greek-wght-normal */
@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/_astro/jetbrains-mono-greek-wght-normal.Bw9x6K1M.woff2) format('woff2-variations');
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

/* jetbrains-mono-vietnamese-wght-normal */
@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/_astro/jetbrains-mono-vietnamese-wght-normal.Bt-aOZkq.woff2) format('woff2-variations');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

/* jetbrains-mono-latin-ext-wght-normal */
@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/_astro/jetbrains-mono-latin-ext-wght-normal.DBQx-q_a.woff2) format('woff2-variations');
  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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* jetbrains-mono-latin-wght-normal */
@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/_astro/jetbrains-mono-latin-wght-normal.B9CIFXIH.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;
}/* Estilos del portfolio: tema terminal / ASCII (noviembre de 2026).
   Este archivo solo guarda las variables (colores, tipografías y medidas). El resto de estilos está
   repartido en archivos por sección, en esta misma carpeta; el orden de carga está en BaseLayout.astro.
   Idea: toda la web es una sesión de terminal. Cada sección es un comando (whoami, history,
   ls proyectos/...) y su contenido es lo que ese comando escribe. Todo en letra monoespaciada
   (cada letra ocupa lo mismo, como en una terminal), sobre papel gris con rejilla.
   Colores: papel gris, tinta negra y un único verde ácido, usado poco (comandos, cursor, batería).
   Todo color, tipografía y medida sale de las variables de :root. */

:root {
  /* Paleta: papel gris claro, blanco de etiqueta, tinta negra y un verde de aviso. Nada más. */
  --paper: #e9e9e6;
  --label: #fafaf8;
  --ink: #0b0b0b;
  --muted: #5f5f5a;
  --signal: #b6ff3c;

  /* Todo el texto va en JetBrains Mono, también los titulares: en una terminal no hay otra letra.
     Se mantienen varios nombres para poder separar alguno más adelante sin tocar el resto del CSS. */
  --font-display: 'JetBrains Mono Variable', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-body: 'JetBrains Mono Variable', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-label: 'JetBrains Mono Variable', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-mono: 'JetBrains Mono Variable', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --line: 1.5px solid var(--ink);
  --hairline: 1px solid rgb(11 11 11 / 28%);
  /* Alto de la barra de terminal fija de arriba (terminal.css) y de la barra de estado fija de abajo
     (status-bar.css). La página deja ese hueco para que nada quede tapado. */
  --header-height: 34px;
  --status-height: 28px;
  --page-width: 1180px;
  --gutter: clamp(16px, 3.4vw, 44px);

  color-scheme: light;
}
/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  margin: 0;
  padding-top: var(--header-height);
  padding-bottom: var(--status-height);
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
pre {
  margin: 0;
}

/* Titulares: la misma letra que el texto, solo más gruesa. En una terminal todo es igual de ancho. */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-size: inherit;
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

a {
  color: inherit;
}

/* height: auto hace que una imagen con ancho y alto apuntados en el HTML mantenga su proporción
   cuando el CSS le cambia el ancho. Sin esto se estira. */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--signal);
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  inset: 8px auto auto 8px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--signal);
  color: var(--ink);
  font: 500 14px/1 var(--font-mono);
  translate: 0 -200%;
}
.skip-link:focus {
  translate: 0 0;
}

/* Nada puede asomar por los lados y crear scroll horizontal.
   "clip" (y no "hidden") porque no rompe las piezas que se quedan fijas con sticky. */
main {
  overflow-x: clip;
}
/* Grano de papel: una capa de ruido muy suave encima de toda la página, como una fotocopia.
   No recibe clics ni la lee nadie: es solo textura. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  /* Sin mezcla con lo de debajo: mezclar una capa fija con toda la página obliga a repintarla entera
     en cada paso del scroll. Con poca opacidad se ve prácticamente igual. */
  opacity: 0.1;
  pointer-events: none;
}
/* ---------- Estilo terminal ----------
   Idea: la web se ve como un programa de texto antiguo sobre papel cuadriculado. Arriba, una barra
   de menús hecha solo de texto, con la tecla de cada orden al lado en una casilla gris. Debajo de todo,
   la rejilla fina de un cuaderno técnico. Mismos colores de siempre: papel gris, tinta negra y verde.
   El HTML está en src/components/layout/TerminalBar.astro y los estados los pone terminal-bar.js. */

:root {
  /* Tamaño de cada cuadradito de la rejilla y color de sus líneas (tinta muy rebajada). */
  --grid-size: 22px;
  --grid-line: rgb(11 11 11 / 7%);
  /* Gris de las casillas de tecla y del panel: la misma tinta, muy aguada sobre el papel. */
  --key-fill: color-mix(in srgb, var(--ink) 12%, var(--paper));
  --panel-fill: color-mix(in srgb, var(--ink) 7%, var(--paper));
  --paper-grid:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size);
}

/* ---------- Papel cuadriculado ----------
   Va en el cuerpo de la página. Ninguna sección tiene fondo propio, así que se ve en todas. */
html:not([data-grid='off']) body {
  background: var(--paper-grid), var(--paper);
}

/* ---------- La barra ---------- */
.terminal-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: var(--header-height);
  padding: 4px var(--gutter);
  border-bottom: var(--hairline);
  background: var(--paper);
  font: 500 13px/1 var(--font-mono);
  text-transform: uppercase;
}

/* Cada orden es un botón con dos casillas: el nombre (clara) y su tecla (gris), pegadas. */
.terminal-command {
  display: inline-flex;
  align-items: stretch;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.terminal-command-name,
.terminal-key {
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
}
.terminal-command-name {
  background: var(--label);
}
.terminal-key {
  background: var(--key-fill);
  font: inherit;
}
/* Al pasar el ratón o con la orden activa, el nombre se invierte: negro con letra clara. */
.terminal-command:hover .terminal-command-name,
.terminal-command[aria-expanded='true'] .terminal-command-name {
  background: var(--ink);
  color: var(--label);
}
/* La rejilla apagada se nota en su botón: el nombre queda tachado. */
.terminal-command[aria-pressed='false'] .terminal-command-name {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.terminal-command:focus-visible {
  outline-offset: 1px;
}

/* ---------- Panel "Ir a" ---------- */
.terminal-menu {
  position: relative;
  display: flex;
}
.terminal-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  display: none;
  min-width: 330px;
  border: var(--line);
  background: var(--panel-fill);
  box-shadow: 6px 6px 0 rgb(11 11 11 / 14%);
  text-transform: none;
}
.terminal-bar[data-open] .terminal-panel {
  display: block;
}
.terminal-list {
  padding: 6px 0;
  list-style: none;
}
.terminal-list a {
  display: grid;
  grid-template-columns: 15ch 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  font-size: 14px;
  text-decoration: none;
}
.terminal-list .pixel-icon {
  width: 9px;
  height: 9px;
}
/* El comando de cada sección (whoami, history...) va en negrita y el significado en gris. */
.terminal-item-command {
  font-weight: 700;
}
.terminal-item-label {
  color: var(--muted);
}
.terminal-item-key {
  color: var(--muted);
  font: inherit;
  font-size: 12px;
}
/* La línea elegida (ratón o teclado) se pinta como el cursor de una terminal: barra negra, letra clara. */
.terminal-list a:is(:hover, :focus-visible) {
  outline: none;
  background: var(--ink);
  color: var(--label);
}
.terminal-list a:is(:hover, :focus-visible) :is(.terminal-item-command, .terminal-item-key) {
  color: var(--signal);
}
.terminal-list a:is(:hover, :focus-visible) .terminal-item-label {
  color: var(--paper);
}
.terminal-panel-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: var(--hairline);
  background: var(--key-fill);
  font-size: 13px;
}
.terminal-close {
  display: inline-flex;
  align-items: stretch;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-transform: uppercase;
  cursor: pointer;
}
.terminal-close > * {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--label);
}
.terminal-space {
  border-right: var(--hairline);
  font: inherit;
}
.terminal-close:hover > * {
  background: var(--ink);
  color: var(--label);
}

/* ---------- Línea de comandos ----------
   "adri@porfolio:~/proyectos$" y un cursor que parpadea. Solo decora: el lector de pantalla la salta. */
.terminal-prompt {
  display: flex;
  align-items: center;
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-transform: none;
  white-space: nowrap;
}
.terminal-prompt-user {
  color: var(--ink);
}
.terminal-caret {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 4px;
  background: var(--ink);
}
@media (prefers-reduced-motion: no-preference) {
  .terminal-caret {
    animation: caret-blink 1.1s steps(1) infinite;
  }
}

/* Sin JavaScript el botón "Ir a" no puede abrir la lista. Entonces los botones se esconden y la lista
   se enseña como una fila de enlaces normales dentro de la propia barra. */
html:not(.js) .terminal-panel {
  position: static;
  display: block;
  min-width: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
html:not(.js) .terminal-command,
html:not(.js) .terminal-panel-foot,
html:not(.js) .terminal-list :is(.pixel-icon, .terminal-item-key, .terminal-item-command) {
  display: none;
}
html:not(.js) .terminal-list {
  display: flex;
  height: 100%;
  padding: 0;
}
html:not(.js) .terminal-list a {
  display: flex;
  height: 100%;
  padding: 0 9px;
  font-size: 12px;
}

/* ---------- Móvil ----------
   La barra se queda arriba (como en la referencia), con letra un poco menor. La línea de comandos
   enseña solo la carpeta, sin "adri@porfolio", para que quepa. */
@media (max-width: 959px) {
  .terminal-bar {
    padding-inline: 10px;
    font-size: 12px;
  }
  .terminal-command-name,
  .terminal-key {
    padding: 0 7px;
  }
  .terminal-prompt-user {
    display: none;
  }
  .terminal-panel {
    position: fixed;
    top: calc(var(--header-height) + 6px);
    left: 10px;
    right: 10px;
    min-width: 0;
  }
  .terminal-list a {
    padding-block: 11px;
    font-size: 15px;
  }
  /* Con la lista abierta, la página se apaga para que se lea bien encima de cualquier cosa. */
  main,
  .site-footer {
    transition: opacity 0.25s;
  }
  body:has(.terminal-bar[data-open]) :is(main, .site-footer) {
    opacity: 0.16;
  }
}
/* ---------- Piezas comunes de la terminal ----------
   Lo que comparten todas las secciones: la línea de comandos que hace de título, la salida de debajo,
   los enlaces y botones de texto, la ficha con puntos de relleno y la animación de "escribir".
   El HTML de la línea de comandos está en src/components/terminal/Prompt.astro. */

/* Cada sección es un comando con su salida. Una raya discontinua separa un comando del siguiente,
   como cuando se deja una línea en blanco entre órdenes. */
.term-section {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 104px) var(--gutter);
  border-top: 1px dashed rgb(11 11 11 / 30%);
}

/* ---------- Línea de comandos ----------
   "adri@porfolio:~$" en gris, el comando sobre verde (lo que se ha escrito) y el comentario
   "# Quién soy" en gris. El comentario es lo único que lee el lector de pantalla. */
.term-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 1ch;
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.4;
}
.term-prompt-user {
  color: var(--muted);
  font-weight: 500;
}
.term-prompt-path {
  color: var(--ink);
}
.term-prompt-command {
  display: inline-block;
  overflow: hidden;
  background: var(--signal);
  color: var(--ink);
  white-space: pre;
  vertical-align: bottom;
}
.term-prompt-comment {
  color: var(--muted);
  font-weight: 500;
}

/* La salida del comando: lo que hay debajo de la línea de comandos. */
.term-output {
  margin-top: clamp(18px, 2.4vw, 28px);
}

/* ---------- Escribir al llegar ----------
   type-on-view.js marca cada sección: "waiting" mientras no se ha visto y "typed" al llegar.
   El comando se escribe letra a letra: su ancho pasa de 0 a tantas letras como tenga (1ch = una letra
   en letra monoespaciada), a saltos, sin suavizar. Después la salida se "imprime" de arriba abajo.
   Sin JavaScript o con movimiento reducido no hay atributo y todo se ve desde el principio. */
[data-typed='waiting'] .term-prompt-command {
  width: 0;
}
[data-typed='waiting'] .term-output {
  opacity: 0;
}
[data-typed='typed'] .term-prompt-command:not(.is-typed) {
  animation: type-command calc(var(--command-length) * 60ms) steps(var(--command-length), end) backwards;
}
[data-typed='typed'] .term-output {
  animation: print-output 0.55s steps(9, end) 0.65s backwards;
}
@keyframes type-command {
  from {
    width: 0;
  }
  to {
    width: calc(var(--command-length) * 1ch);
  }
}
@keyframes print-output {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* ---------- Enlaces y botones de texto ---------- */
.term-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.term-link:hover {
  background: var(--signal);
  text-decoration: none;
}
.term-button {
  display: inline-flex;
  align-items: center;
  gap: 1ch;
  padding: 9px 16px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--label);
  font: 600 14px/1.2 var(--font-mono);
  text-decoration: none;
  cursor: pointer;
}
.term-button:hover {
  background: var(--signal);
  color: var(--ink);
}
.term-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Los iconos de píxeles miden lo mismo que una letra. */
.pixel-icon {
  width: 0.8em;
  height: 0.8em;
  flex: none;
}

/* ---------- Ficha con puntos de relleno ----------
   "rol ........ Desarrollador full stack", como un listado de terminal. Los puntos son un borde
   punteado que rellena el hueco entre el nombre y el valor. */
.term-facts {
  display: grid;
  gap: 6px;
  max-width: 820px;
}
.term-facts > div {
  display: grid;
  grid-template-columns: 15ch minmax(0, 1fr);
  gap: 1ch;
}
.term-facts dt {
  display: flex;
  gap: 1ch;
  color: var(--muted);
}
.term-facts dt::after {
  content: '';
  flex: 1;
  min-width: 2ch;
  margin-bottom: 0.45em;
  border-bottom: 2px dotted rgb(11 11 11 / 35%);
}

/* Etiquetas de tecnologías: cada una en su cajita, como [Astro] [React]. */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  list-style: none;
}
.tag-list li {
  padding: 1px 8px;
  border: 1px solid var(--ink);
  font-size: 13px;
}

/* Cursor de bloque que parpadea. Lo usan la cabecera y la barra de arriba. */
@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}
/* ---------- Cabecera (./adri.sh) ----------
   El nombre en ASCII a lo grande, la frase, la batería, la línea de comandos con su cursor y la
   lista de comandos. Ocupa la primera pantalla. HTML en src/components/home/Hero.astro. */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100svh - var(--header-height) - var(--status-height));
  padding-block: clamp(28px, 5vw, 64px);
  border-top: 0;
}

/* El dibujo del nombre. line-height 1 junta las filas para que los bloques se toquen.
   El tamaño de letra sale del ancho de la pantalla: el dibujo mide 27 letras y tiene que caber. */
.ascii-name {
  display: inline-block;
  margin: 0;
  font: 400 min(5.3vw, 46px) / 1 var(--font-mono);
  letter-spacing: 0;
  white-space: pre;
  user-select: none;
}
.ascii-shadow {
  color: var(--muted);
}
.hero-title {
  line-height: 1;
}

.hero-tagline {
  margin-top: clamp(16px, 2.4vw, 26px);
  font-size: clamp(17px, 1.8vw, 22px);
  font-weight: 600;
}

/* ---------- Batería en ASCII ----------
   Una pastilla negra con las casillas en verde: [█████░░░] 62% recargando ideas.
   La última casilla llena parpadea, como cuando el móvil está cargando. */
.battery {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1ch;
  margin-top: 10px;
  font-size: 15px;
}
.battery-bar {
  padding: 0 0.6ch;
  background: var(--ink);
  color: var(--paper);
  white-space: pre;
}
.battery-full,
.battery-charging {
  color: var(--signal);
}
.battery-empty {
  color: rgb(233 233 230 / 45%);
}
.battery-percent {
  font-weight: 700;
}
.battery-text {
  color: var(--muted);
}
@media (prefers-reduced-motion: no-preference) {
  .battery-charging {
    animation: caret-blink 1.4s steps(1) infinite;
  }
}

/* ---------- Línea de comandos ----------
   El campo de texto no se ve como un campo: es la propia línea de la terminal. Mientras está vacío y
   sin foco, sale el cursor de bloque parpadeando. Al entrar a escribir, el cursor es el del navegador. */
.command-line {
  display: flex;
  align-items: baseline;
  gap: 1ch;
  max-width: 720px;
  margin-top: clamp(22px, 3vw, 34px);
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 600;
}
.command-line-prompt {
  flex: none;
  color: var(--muted);
  font-weight: 500;
}
.command-line-field {
  position: relative;
  flex: 1;
  min-width: 0;
}
.command-line-input {
  width: 100%;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px dashed transparent;
  background: none;
  color: var(--ink);
  font: inherit;
  caret-color: var(--ink);
  caret-shape: block;
}
.command-line-input:focus {
  outline: none;
  border-bottom-color: var(--ink);
}
.command-line-cursor {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.62em;
  height: 1.15em;
  background: var(--ink);
  translate: 0 -50%;
  pointer-events: none;
}
/* El cursor de adorno se va cuando hay foco o cuando ya hay algo escrito. */
.command-line-field:focus-within .command-line-cursor,
.command-line-field:has(.command-line-input:not(:placeholder-shown)) .command-line-cursor {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .command-line-cursor {
    animation: caret-blink 1.1s steps(1) infinite;
  }
}
/* Lo que contesta la línea de comandos (comando no encontrado, ayuda...). */
.command-line-output {
  min-height: 1.6em;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}
/* Sin JavaScript la línea no puede hacer nada, así que no se enseña. */
html:not(.js) .command-line,
html:not(.js) .command-line-output {
  display: none;
}

/* ---------- Lista de comandos ----------
   Como el menú de ayuda de un programa: el comando a la izquierda y lo que es a la derecha.
   La línea elegida (ratón o teclado) se invierte: barra negra, comando en verde. */
.help {
  margin-top: 8px;
}
.help-title {
  color: var(--muted);
  font-size: 14px;
}
.help-list {
  display: grid;
  max-width: 560px;
  column-gap: 4ch;
  margin-top: 6px;
  padding: 0;
  list-style: none;
}
.help-link {
  display: grid;
  grid-template-columns: 17ch minmax(0, 1fr);
  gap: 1ch;
  padding: 5px 1ch;
  margin-inline: -1ch;
  text-decoration: none;
}
.help-command {
  font-weight: 700;
}
.help-label {
  color: var(--muted);
}
.help-link:is(:hover, :focus-visible) {
  outline: none;
  background: var(--ink);
  color: var(--label);
}
.help-link:is(:hover, :focus-visible) .help-command {
  color: var(--signal);
}
.help-link:is(:hover, :focus-visible) .help-label {
  color: var(--paper);
}

/* En pantallas anchas la lista va en dos columnas, para que la cabecera quepa en la primera pantalla. */
@media (min-width: 960px) {
  .help-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 880px;
  }
}
/* ---------- Quién soy (whoami) ----------
   El nombre de usuario, mis frases una por línea y la ficha con puntos de relleno.
   HTML en src/components/home/About.astro. */

.whoami-user {
  font-weight: 700;
}
.whoami-lines {
  display: grid;
  gap: 4px;
  max-width: 72ch;
  margin-block: 14px 26px;
  padding: 0;
  font-size: clamp(16px, 1.5vw, 19px);
  list-style: none;
}
/* Cada frase empieza con un ">" gris, como una línea de salida. */
.whoami-lines li {
  display: grid;
  grid-template-columns: 2ch minmax(0, 1fr);
}
.whoami-lines li::before {
  content: '>';
  color: var(--muted);
}
/* ---------- Trayectoria (history) ----------
   Como el historial de la terminal: número, años, trabajo o estudio, y qué y dónde.
   HTML en src/components/home/Resume.astro. */

.history-list {
  display: grid;
  gap: 2px;
  padding: 0;
  list-style: none;
}
.history-line {
  display: grid;
  grid-template-columns: 3ch 22ch 8ch minmax(0, 1fr);
  gap: 2ch;
  padding: 6px 0;
  border-bottom: 1px dotted rgb(11 11 11 / 22%);
}
.history-number {
  color: var(--muted);
  text-align: right;
}
.history-kind,
.history-where,
.history-note {
  color: var(--muted);
}
/* La línea de ahora (la última) lleva el número en verde: es el comando más reciente. */
.history-line:last-child .history-number {
  background: var(--signal);
  color: var(--ink);
  text-align: center;
}
/* ---------- Proyectos (ls proyectos/) ----------
   Una línea por proyecto, como "ls -l", y a la derecha una vista previa de la imagen.
   HTML en src/components/home/ProjectList.astro; la vista previa la cambia project-preview.js. */

.projects-output {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  align-items: start;
  gap: clamp(24px, 4vw, 48px);
}
.projects-total,
.projects-hint {
  color: var(--muted);
  font-size: 14px;
}
.projects-hint {
  margin-top: 12px;
}
.projects-list {
  margin-top: 4px;
  padding: 0;
  list-style: none;
}
/* La línea entera es el enlace. Columnas: permisos, tipo, carpeta, qué es y la flecha.
   El dueño (adri) solo cabe en pantallas muy anchas. */
.project-line {
  display: grid;
  grid-template-columns: 10ch 11ch 18ch minmax(0, 1fr) 2ch;
  align-items: baseline;
  gap: 1.5ch;
  padding: 7px 1ch;
  margin-inline: -1ch;
  text-decoration: none;
}
.project-perms,
.project-owner,
.project-kind {
  color: var(--muted);
}
.project-owner {
  display: none;
}
@media (min-width: 1500px) {
  .project-line {
    grid-template-columns: 10ch 4ch 11ch 18ch minmax(0, 1fr) 2ch;
  }
  .project-owner {
    display: inline;
  }
}
.project-name {
  font-weight: 700;
}
.project-status {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
/* En escritorio solo se ve la flecha; la orden "cat ..." ya sale en la vista previa. */
.project-open {
  display: inline-flex;
  align-items: center;
  justify-content: end;
  gap: 1ch;
  font-size: 0;
  opacity: 0;
}
.project-open .pixel-icon {
  width: 11px;
  height: 11px;
}
/* La línea elegida se invierte, como el cursor de selección de una terminal. */
.project-line:is(:hover, :focus-visible) {
  outline: none;
  background: var(--ink);
  color: var(--label);
}
.project-line:is(:hover, :focus-visible) :is(.project-perms, .project-owner, .project-kind, .project-status) {
  color: var(--paper);
}
.project-line:is(:hover, :focus-visible) .project-name {
  color: var(--signal);
}
.project-line:is(:hover, :focus-visible) .project-open {
  color: var(--signal);
  opacity: 1;
}

/* ---------- Vista previa ----------
   Una ventana con barra de título negra. La imagen va en blanco y negro para no salirse de los colores
   de la web. Al cambiar de proyecto, la imagen entra a barridos de arriba abajo, como una pantalla vieja. */
.project-preview {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  border: 1.5px solid var(--ink);
  background: var(--label);
}
.project-preview-bar {
  display: flex;
  justify-content: space-between;
  gap: 1ch;
  padding: 5px 1ch;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
}
.project-preview-bar span:first-child {
  color: var(--signal);
}
.project-preview-frame {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.project-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
}
@media (prefers-reduced-motion: no-preference) {
  .project-preview[data-changed] img {
    animation: print-output 0.4s steps(8, end);
  }
}
/* ---------- Método (man adri) ----------
   Como una página de manual de Unix: cabecera "ADRI(1)", apartados en mayúsculas y el texto metido
   hacia dentro. HTML en src/components/home/WorkingStyle.astro. */

.man-page {
  max-width: 900px;
}
.man-edge {
  display: flex;
  justify-content: space-between;
  gap: 2ch;
  color: var(--muted);
  font-size: 13px;
}
.man-edge:last-child {
  margin-top: 36px;
}
.man-heading {
  margin-top: 26px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* En un manual el texto va metido unos espacios hacia dentro respecto a los apartados. */
.man-body,
.man-options,
.man-examples,
.man-see-also {
  margin-top: 8px;
  padding-left: clamp(2ch, 4vw, 7ch);
}
.man-body {
  max-width: 72ch;
}
.man-options {
  display: grid;
  gap: 14px;
}
.man-options dt {
  font-weight: 700;
}
.man-options dd {
  max-width: 68ch;
  margin-left: 4ch;
}
.man-examples {
  display: grid;
  gap: 18px;
  list-style: none;
}
.man-example-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1ch;
}
.man-example-project {
  color: var(--muted);
}
.man-examples .man-body {
  margin-top: 2px;
  padding-left: 0;
}
.man-examples .term-link {
  margin-top: 4px;
}
.man-see-also {
  display: flex;
  flex-wrap: wrap;
  gap: 1ch 3ch;
  list-style: none;
}
/* ---------- Stack (cat stack.txt) ----------
   Un archivo de texto con dos bloques: # código (tabla de tres columnas) y # diseño (palabras
   seguidas). HTML en src/components/home/Stack.astro. */

.stack-heading {
  color: var(--muted);
  font-weight: 500;
}
.stack-heading + * {
  margin-top: 8px;
}
.stack-heading:not(:first-child) {
  margin-top: 28px;
}
.stack-table {
  display: grid;
  max-width: 900px;
  padding: 0;
  list-style: none;
}
.stack-row {
  display: grid;
  grid-template-columns: 26ch minmax(0, 1fr) 14ch;
  gap: 2ch;
  padding: 6px 0;
  border-bottom: 1px dotted rgb(11 11 11 / 22%);
}
.stack-area {
  color: var(--muted);
}
.stack-level {
  text-align: right;
}
.stack-words {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 3ch;
  max-width: 900px;
  padding: 0;
  list-style: none;
}
/* ---------- Contacto (mail adri) ----------
   La última sección va a oscuras, como una terminal de verdad, para que la tarjeta holográfica brille.
   Primero la tarjeta (se inclina hacia el ratón y se puede quemar) y después la ventana del correo.
   HTML en src/components/home/Contact.astro; el fuego lo pinta ascii-fire.js. */

/* La sección negra ocupa todo el ancho; su contenido mantiene el ancho de las demás. */
.mail {
  max-width: none;
  padding-inline: max(var(--gutter), calc((100% - var(--page-width)) / 2 + var(--gutter)));
  border-top: 0;
  background: var(--ink);
  color: var(--paper);
}
.mail .term-prompt-user,
.mail .term-prompt-comment {
  color: rgb(233 233 230 / 62%);
}
.mail .term-prompt-path {
  color: var(--paper);
}
.mail :focus-visible {
  outline-color: var(--signal);
}

/* El escenario: la tarjeta (o la ventana del correo, cuando la tarjeta ya ha ardido), centrada. */
.mail-stage {
  display: grid;
  justify-items: center;
  perspective: 1400px;
}

/* ---------- Tarjeta holográfica ----------
   Colores del holograma: una banda de tonos que se repite. Es el único sitio de la web con más
   colores que el verde: es una lámina, como la de un carnet o una entrada. */
.holo-card {
  --pointer-x: 0;
  --pointer-y: 0;
  --holo: repeating-linear-gradient(115deg, #b6ff3c 0%, #5cf2ff 12%, #b28dff 24%, #ff7ad9 36%, #fff36b 48%, #b6ff3c 60%);
  position: relative;
  width: 100%;
  max-width: 460px;
  color: var(--ink);
  /* La tarjeta entera se inclina un poco hacia el ratón (--pointer-x / --pointer-y, de -1 a 1). */
  transform: rotateX(calc(var(--pointer-y) * -6deg)) rotateY(calc(var(--pointer-x) * 8deg));
  transition: transform 0.3s ease-out;
}
.holo-card[hidden] {
  display: none;
}
/* El canto: una lámina detrás de la tarjeta, desplazada y pintada con la banda de colores. */
.holo-edge {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: var(--holo);
  background-size: 300% 300%;
  background-position: calc(50% + var(--pointer-x) * 40%) calc(50% + var(--pointer-y) * 40%);
  translate: calc(12px + var(--pointer-x) * 4px) calc(12px + var(--pointer-y) * 4px);
  transition: translate 0.3s ease-out;
}
.holo-paper {
  position: relative;
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--label);
  overflow: hidden;
}
/* El brillo que cruza la tarjeta: la misma banda, muy suave, mezclada con el blanco del papel. */
.holo-paper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--holo);
  background-size: 300% 300%;
  background-position: calc(50% + var(--pointer-x) * 60%) calc(50% + var(--pointer-y) * 60%);
  mix-blend-mode: multiply;
  opacity: 0.28;
  pointer-events: none;
}
.holo-top {
  display: flex;
  justify-content: space-between;
  gap: 2ch;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
/* Sello redondo holográfico con el símbolo de la terminal (>_) dentro. */
.holo-seal {
  justify-self: start;
  display: grid;
  width: 116px;
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 50%;
  background: var(--holo);
  background-size: 300% 300%;
  background-position: calc(50% + var(--pointer-x) * -70%) calc(50% + var(--pointer-y) * -70%);
}
.holo-seal-face {
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: var(--signal);
  font-size: 34px;
  font-weight: 800;
}
.holo-title {
  padding-top: 14px;
  border-top: 2px dashed var(--ink);
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 800;
  line-height: 1;
}
.holo-text {
  font-size: 14px;
}
.holo-hint {
  display: flex;
  align-items: center;
  gap: 1ch;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.holo-links {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}
.holo-links .term-button {
  justify-content: center;
}
.term-button.is-outline {
  background: transparent;
  color: var(--ink);
}
.term-button.is-outline:hover {
  background: var(--signal);
}
/* Sin JavaScript no hay fuego ni botón que lo prenda. */
html:not(.js) .holo-hint,
html:not(.js) .holo-open {
  display: none;
}

/* Sin ratón (móvil) el holograma se mueve solo, despacio. Con ratón manda el ratón. */
@media (prefers-reduced-motion: no-preference) and (hover: none) {
  .holo-edge,
  .holo-paper::after,
  .holo-seal {
    animation: holo-drift 9s ease-in-out infinite alternate;
  }
}
@keyframes holo-drift {
  from {
    background-position: 0% 20%;
  }
  to {
    background-position: 100% 80%;
  }
}

/* ---------- Mechero y fuego ----------
   Encima de la tarjeta, el cursor es un mechero de píxeles; mientras quema, con la llama encendida. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .js .holo-card {
    cursor:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' shape-rendering='crispEdges'%3E%3Cpath fill='%230b0b0b' d='M9 11h14v20H9z'/%3E%3Cpath fill='%23fafaf8' d='M11 13h10v4H11z'/%3E%3Cpath fill='%23b6ff3c' d='M11 19h10v10H11z'/%3E%3Cpath fill='%230b0b0b' d='M17 7h6v4h-6z'/%3E%3Cpath fill='%23fafaf8' d='M19 8h2v2h-2z'/%3E%3C/svg%3E")
        13 8,
      pointer;
    user-select: none;
  }
  .js .holo-card.is-burning {
    cursor:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' shape-rendering='crispEdges'%3E%3Cpath fill='%230b0b0b' d='M11 0h4v2h2v3h1v5h-9V5h1V2h1z'/%3E%3Cpath fill='%23b6ff3c' d='M12 2h2v2h2v5h-5V5h1z'/%3E%3Cpath fill='%23fafaf8' d='M13 6h2v3h-2z'/%3E%3Cpath fill='%230b0b0b' d='M9 11h14v20H9z'/%3E%3Cpath fill='%23fafaf8' d='M11 13h10v4H11z'/%3E%3Cpath fill='%23b6ff3c' d='M11 19h10v10H11z'/%3E%3Cpath fill='%230b0b0b' d='M17 7h6v4h-6z'/%3E%3Cpath fill='%23fafaf8' d='M19 8h2v2h-2z'/%3E%3C/svg%3E")
        13 1,
      pointer;
  }
  .holo-card a,
  .holo-card button {
    cursor: pointer;
  }
}
/* El fuego: un lienzo encima de la tarjeta, más grande que ella para que las llamas puedan salirse
   por arriba y por los lados. Lo que pinta lo decide ascii-fire.js. No recibe clics. */
.burn-fire {
  position: absolute;
  top: -260px;
  left: -60px;
  z-index: 3;
  width: calc(100% + 120px);
  height: calc(100% + 290px);
  pointer-events: none;
}

/* ---------- Ventana del correo ----------
   Una ventana de terminal clara con barra de título negra. Al aparecer se "imprime" de arriba abajo. */
.mail-window {
  width: 100%;
  max-width: 760px;
  border: 1.5px solid var(--paper);
  background: var(--label);
  color: var(--ink);
}
.mail-window[hidden] {
  display: none;
}
.mail-window.is-printing {
  animation: print-output 0.6s steps(10, end);
}
.mail-window-bar {
  display: flex;
  justify-content: space-between;
  gap: 2ch;
  padding: 6px 1.5ch;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1.5px solid var(--paper);
  font-size: 12px;
}
.mail-window-bar span:first-child {
  color: var(--signal);
}
.mail-window :focus-visible {
  outline-color: var(--ink);
}
/* Sin JavaScript la tarjeta y el correo se ven uno debajo del otro. */
html:not(.js) .mail-window {
  margin-top: 40px;
}

.mail-form {
  display: grid;
  gap: 4px;
  padding: clamp(16px, 3vw, 28px);
}
.mail-field {
  display: grid;
  grid-template-columns: 14ch minmax(0, 1fr);
  align-items: baseline;
  gap: 1ch;
}
.mail-key {
  color: var(--muted);
}
.mail-field.is-fixed .mail-value {
  font-weight: 700;
}
/* Los campos son la línea punteada donde se escribe. Con foco, se ilumina la línea entera. */
.mail-input {
  width: 100%;
  padding: 6px 1ch;
  border: 0;
  border-bottom: 1.5px dashed rgb(11 11 11 / 45%);
  background: none;
  color: var(--ink);
  font: inherit;
  caret-color: var(--ink);
}
.mail-input::placeholder {
  color: rgb(95 95 90 / 70%);
}
.mail-input:focus {
  outline: none;
  border-bottom-style: solid;
  border-bottom-color: var(--ink);
  background: rgb(182 255 60 / 22%);
}
.mail-field.is-message {
  align-items: start;
  margin-top: 8px;
}
.mail-field.is-message .mail-key {
  padding-top: 6px;
}
textarea.mail-input {
  border: 1.5px dashed rgb(11 11 11 / 45%);
  resize: vertical;
}
textarea.mail-input:focus {
  border-style: solid;
}
.mail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1ch 2ch;
  margin-top: 14px;
  padding-left: calc(14ch + 1ch);
}
.mail-status {
  color: var(--muted);
  font-size: 14px;
}

/* Debajo: reiniciar la tarjeta (solo cuando ya se ha quemado algo) y volver arriba. */
.mail-also {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1ch 4ch;
  margin-top: 40px;
}
.mail-reset {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.mail-reset[hidden] {
  display: none;
}
.mail .term-link:hover {
  color: var(--ink);
}
/* ---------- Ficha de proyecto (cat <proyecto>.md) ----------
   Como un archivo Markdown abierto en la terminal: "# Título", "> tipo de proyecto", la ficha con
   puntos de relleno, la imagen, el índice a un lado y los apartados con "## ".
   HTML en src/components/project-cases/ProjectCaseTemplate.astro y CaseSection.astro. */

.case {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
  max-width: var(--page-width);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) var(--gutter) clamp(56px, 8vw, 96px);
}
/* Los signos de Markdown (#, ##, >) en gris: se ven, pero no mandan. */
.md-mark {
  color: var(--muted);
  font-weight: 500;
}

.case-header {
  display: grid;
  justify-items: start;
  gap: 14px;
}
.case-header-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgb(11 11 11 / 30%);
  font-size: 14px;
}
.back-link-label {
  color: var(--muted);
}
.back-link:hover .back-link-label {
  color: var(--ink);
}
.case-file {
  color: var(--muted);
}
.case-title {
  margin-top: 10px;
  font-size: clamp(34px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.05;
}
.case-status {
  color: var(--muted);
  text-transform: uppercase;
}
.case-intro {
  max-width: 68ch;
  font-size: clamp(16px, 1.5vw, 18px);
}
.case-facts {
  width: 100%;
  margin-block: 6px;
}

/* La imagen, en una ventana con borde de tinta. */
.case-image {
  border: 1.5px solid var(--ink);
  background: var(--label);
}
.case-image img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
}
.case-image.is-cover img {
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

/* Índice a la izquierda (se queda quieto al bajar) y apartados a la derecha. */
.case-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 5vw, 64px);
}
.case-index {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  display: grid;
  gap: 8px;
  font-size: 14px;
}
.case-index-title {
  font-weight: 700;
}
.case-index ol {
  display: grid;
  gap: 2px;
  padding: 0;
  list-style: none;
}
.case-index a {
  display: block;
  padding: 4px 1ch;
  margin-inline: -1ch;
  text-decoration: none;
}
.case-index a::before {
  content: '- ';
  color: var(--muted);
}
.case-index a:is(:hover, :focus-visible) {
  outline: none;
  background: var(--ink);
  color: var(--label);
}

.case-content {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  min-width: 0;
}
.case-section {
  display: grid;
  gap: 16px;
  scroll-margin-top: calc(var(--header-height) + 20px);
}
.case-section-label {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 800;
}
.case-section-body {
  display: grid;
  gap: 14px;
  max-width: 72ch;
}
.case-section-body h3 {
  font-size: 18px;
}
.case-section-body h4 {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
}
.case-section-body h4::before {
  content: '### ';
}
.case-section-body ul,
.case-section-body ol {
  display: grid;
  gap: 8px;
  padding-left: 3ch;
}
.case-section-body code {
  padding: 0 4px;
  background: var(--key-fill);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}
.case-context {
  padding-left: 2ch;
  border-left: 3px solid var(--signal);
  color: var(--muted);
  font-size: 14px;
}

/* Esquema de partes: cajas numeradas en fila (01, 02...). */
.architecture-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}
.architecture-flow > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--ink);
  background: var(--label);
  font-weight: 700;
}
.architecture-flow span {
  color: var(--muted);
  font-weight: 500;
}
.architecture-flow b {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* Código: un trozo de terminal negra dentro de la página. */
.case-code,
.case-request-path {
  padding: 16px 2ch;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  overflow-x: auto;
}
.case-section-body .case-code code {
  padding: 0;
  background: none;
}
.case-request-path {
  padding-left: 5ch;
}
.case-request-path code {
  background: rgb(233 233 230 / 14%);
}

.project-evidence {
  display: grid;
  gap: 8px;
}
.project-evidence img {
  border: 1px solid var(--ink);
}
.project-evidence figcaption,
.case-source {
  color: var(--muted);
  font-size: 13px;
}
.case-source span {
  color: var(--ink);
  font-weight: 700;
}
.case-source-details {
  padding: 10px 2ch;
  border: 1px dashed rgb(11 11 11 / 40%);
  font-size: 14px;
}
.case-source-details summary {
  font-weight: 700;
  cursor: pointer;
}
.case-source-details p {
  margin-top: 8px;
}
.case-proof-list {
  display: grid;
  gap: 10px;
}
.case-proof-list dt {
  font-weight: 700;
}

/* Salida de la ficha: el siguiente proyecto, como la próxima orden. */
.next-project {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding-top: 32px;
  border-top: 1px dashed rgb(11 11 11 / 30%);
}
.next-project-link {
  display: grid;
  gap: 4px;
  padding: 10px 1ch;
  margin-inline: -1ch;
  text-decoration: none;
}
.next-project-kicker {
  color: var(--muted);
  font-size: 13px;
}
.next-project-title {
  display: inline-flex;
  align-items: center;
  gap: 1ch;
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 800;
}
.next-project-link:is(:hover, :focus-visible) {
  outline: none;
  background: var(--ink);
  color: var(--label);
}
.next-project-link:is(:hover, :focus-visible) .next-project-title {
  color: var(--signal);
}

@media (max-width: 959px) {
  .case-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .case-index {
    position: static;
  }
}
/* ---------- Barra de estado ----------
   Tira negra fija abajo, como la de Vim o tmux: modo, lo que suena, rama, cuánto has bajado y la hora.
   HTML en src/components/layout/StatusBar.astro; los datos que cambian los escribe status-bar.js. */

.status-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 60;
  display: flex;
  align-items: stretch;
  height: var(--status-height);
  background: var(--ink);
  color: var(--paper);
  font: 500 12px/1 var(--font-mono);
  white-space: nowrap;
}
.status-bar > * {
  display: flex;
  align-items: center;
  padding: 0 1.2ch;
}
/* El modo va en un bloque verde. En modo INSERTAR (escribiendo) pasa a papel, como en Vim. */
.status-mode {
  background: var(--signal);
  color: var(--ink);
  font-weight: 800;
}
.status-bar[data-mode='insert'] .status-mode {
  background: var(--paper);
}
.status-track {
  gap: 1ch;
  min-width: 0;
  overflow: hidden;
}
.status-note {
  color: var(--signal);
}
.status-key {
  color: rgb(233 233 230 / 60%);
}
.status-track-title {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Teclas de proyecto: anterior, salir a la lista y siguiente. */
.status-keys {
  gap: 2px;
  padding: 0 0.6ch;
}
.status-key-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 22px;
  color: var(--paper);
}
.status-key-button .pixel-icon {
  width: 11px;
  height: 11px;
}
.status-key-button:is(:hover, :focus-visible) {
  outline: none;
  background: var(--signal);
  color: var(--ink);
}
/* Barras de sonido hechas con letras: el contenido de ::after cambia a saltos. */
.status-meter {
  color: var(--signal);
  letter-spacing: 1px;
}
.status-meter::after {
  content: '▁▃▅▂▇▄';
}
@media (prefers-reduced-motion: no-preference) {
  .status-meter::after {
    animation: status-meter 1.2s steps(1) infinite;
  }
}
@keyframes status-meter {
  0% {
    content: '▁▃▅▂▇▄';
  }
  25% {
    content: '▃▅▂▇▄▁';
  }
  50% {
    content: '▅▂▇▄▁▃';
  }
  75% {
    content: '▂▇▄▁▃▅';
  }
}
/* A partir de aquí todo va a la derecha, separado por rayas finas. */
.status-meter {
  margin-left: auto;
}
.status-branch,
.status-scroll,
.status-clock {
  border-left: 1px solid rgb(233 233 230 / 25%);
}
.status-scroll {
  justify-content: end;
  min-width: 9ch;
}
.status-clock {
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
}
/* ---------- Pie ----------
   La última línea de la sesión: "exit" y "[proceso terminado]", y debajo mi firma con los enlaces. */

.site-footer {
  display: grid;
  gap: 10px;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 36px var(--gutter) 40px;
  border-top: 1px dashed rgb(11 11 11 / 30%);
  font-size: 13px;
}
.footer-exit {
  display: flex;
  flex-wrap: wrap;
  gap: 2ch;
  color: var(--muted);
}
.footer-done {
  color: var(--ink);
  font-weight: 700;
}
.footer-line {
  display: flex;
  flex-wrap: wrap;
  gap: 1ch 3ch;
}

/* ---------- Glitch ----------
   Dos copias del texto (::before en verde y ::after en tinta) aparecen a trozos y desplazadas un
   instante, cada pocos segundos y sin parar mientras el ratón está encima. Las copias salen de
   data-text; el contenido generado con CSS no se lee como texto repetido en los lectores habituales. */
.glitch {
  position: relative;
  display: inline-block;
  text-decoration: none;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.glitch::before {
  color: var(--signal);
}
@media (prefers-reduced-motion: no-preference) {
  .glitch::before {
    animation: glitch-now-and-then 6s steps(1) infinite;
  }
  .glitch::after {
    animation: glitch-now-and-then 6s steps(1) infinite reverse;
  }
  .glitch:hover::before,
  .glitch:focus-visible::before {
    animation: glitch-burst 0.45s steps(1) infinite;
  }
  .glitch:hover::after,
  .glitch:focus-visible::after {
    animation: glitch-burst 0.45s steps(1) infinite reverse;
  }
}
@keyframes glitch-now-and-then {
  0%,
  90%,
  100% {
    opacity: 0;
  }
  91% {
    opacity: 1;
    clip-path: inset(8% 0 58% 0);
    translate: -4px 0;
  }
  94% {
    opacity: 1;
    clip-path: inset(62% 0 6% 0);
    translate: 5px 0;
  }
  97% {
    opacity: 1;
    clip-path: inset(34% 0 38% 0);
    translate: -2px 1px;
  }
}
@keyframes glitch-burst {
  0% {
    opacity: 1;
    clip-path: inset(8% 0 58% 0);
    translate: -4px 0;
  }
  25% {
    opacity: 1;
    clip-path: inset(62% 0 6% 0);
    translate: 5px 0;
  }
  50% {
    opacity: 1;
    clip-path: inset(34% 0 38% 0);
    translate: -3px 1px;
  }
  75% {
    opacity: 1;
    clip-path: inset(80% 0 0 0);
    translate: 3px -1px;
  }
}
/* ---------- Pantalla de carga ----------
   Lo que se ve en producción antes del lanzamiento (LoadingScreen.astro): la terminal instalando
   el porfolio, con una barra ASCII que se llena y vuelve a empezar. */

.loading {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 100svh;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: var(--gutter);
}
.loading-title {
  font-size: clamp(22px, 4vw, 40px);
}
.loading-bar {
  font-size: 18px;
}
.loading-bar::before {
  content: '[';
}
.loading-bar::after {
  content: ']';
}
.loading-fill::after {
  content: '░░░░░░░░░░░░░░░░░░░░';
}
@media (prefers-reduced-motion: no-preference) {
  .loading-fill::after {
    animation: loading-fill 4s steps(1) infinite;
  }
}
@keyframes loading-fill {
  0% {
    content: '░░░░░░░░░░░░░░░░░░░░';
  }
  20% {
    content: '████░░░░░░░░░░░░░░░░';
  }
  40% {
    content: '████████░░░░░░░░░░░░';
  }
  60% {
    content: '████████████░░░░░░░░';
  }
  80% {
    content: '████████████████░░░░';
  }
  95% {
    content: '████████████████████';
  }
}
.loading-links {
  display: flex;
  gap: 3ch;
}
/* ---------- Animaciones dormidas ----------
   Las animaciones que no paran nunca se quedan quietas mientras su sección está lejos de la pantalla.
   El atributo data-asleep lo pone y lo quita sleep-offscreen.js. Solo están aquí las de reloj. */
[data-asleep] .battery-charging,
[data-asleep] .command-line-cursor {
  animation: none;
}
[data-asleep] .holo-edge,
[data-asleep] .holo-paper::after,
[data-asleep] .holo-seal {
  animation: none;
}
/* ---------- Movimiento reducido ----------
   Quien pide menos movimiento en su sistema ve la web quieta: sin scroll suave, sin cursores que
   parpadean y sin efectos de escribir. Cada animación ya se pone solo con
   "prefers-reduced-motion: no-preference"; esto es la red de seguridad por si se escapa alguna. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* ---------- Móvil y pantallas estrechas ----------
   Va el último para que gane a lo anterior. Las tablas de terminal (history, ls, stack) no caben en
   columnas en un teléfono, así que cada línea se parte en dos o tres renglones. */

@media (max-width: 959px) {
  /* ls proyectos/: sin vista previa (la imagen ya está en la ficha). */
  .projects-output {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-preview {
    display: none;
  }
  .project-line {
    grid-template-columns: 11ch minmax(0, 1fr);
    row-gap: 2px;
    padding-block: 10px;
    border-bottom: 1px dotted rgb(11 11 11 / 22%);
  }
  .project-perms,
  .project-owner {
    display: none;
  }
  .project-status {
    grid-column: 1 / -1;
    white-space: normal;
  }
  /* En el móvil sí se ve la orden que abre la ficha, porque no hay vista previa. */
  .project-open {
    grid-column: 1 / -1;
    justify-content: start;
    color: var(--muted);
    font-size: 13px;
    opacity: 1;
  }

  .stack-row {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 0;
  }
  .stack-area {
    grid-row: 2;
    grid-column: 1 / -1;
  }
}

@media (max-width: 719px) {
  body {
    font-size: 14px;
  }
  .history-line {
    grid-template-columns: 3ch minmax(0, 1fr) auto;
    row-gap: 2px;
    column-gap: 1.5ch;
  }
  .history-what {
    grid-column: 2 / -1;
  }

  .term-facts > div,
  .mail-field {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .term-facts dt::after {
    display: none;
  }
  .mail-actions {
    padding-left: 0;
  }
  .help-link {
    grid-template-columns: 15ch minmax(0, 1fr);
    padding-block: 8px;
  }

  /* Barra de estado: solo modo, lo que suena (cortado si no cabe), las teclas y la hora. */
  .status-branch,
  .status-meter,
  .status-scroll {
    display: none;
  }
  .status-track {
    flex: 1;
  }
  .status-key {
    display: none;
  }
}
