:root {
  color-scheme: light dark;
  --fondo: #f6f4ee;
  --superficie: #fffdf8;
  --texto: #1d211f;
  --texto-suave: #575e59;
  --linea: #d9d5c9;
  --acento: #b5451b;
  --acento-texto: #ffffff;
  --estado-desarrollo: #8a5a00;
  --estado-beta: #1f5f99;
  --estado-disponible: #1c7145;
  --editor-fondo: #18201c;
  --editor-barra: #222c27;
  --editor-texto: #e8ece8;
  --editor-clave: #8fd3b6;
  --editor-valor: #f2b98f;
  --editor-comentario: #8f9d96;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #141715;
    --superficie: #1b1f1c;
    --texto: #eceee9;
    --texto-suave: #a4aba5;
    --linea: #303632;
    --acento: #f0824f;
    --acento-texto: #1a0f09;
    --estado-desarrollo: #e0b252;
    --estado-beta: #7db8ea;
    --estado-disponible: #6fcf9c;
    --editor-fondo: #0f1311;
    --editor-barra: #1b211e;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: inherit; }

:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; border-radius: 2px; }

.contenedor { width: min(100% - 2rem, 68rem); margin-inline: auto; }

.saltar {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: .5rem 1rem;
  background: var(--texto);
  color: var(--fondo);
}
.saltar:focus { top: 1rem; }

.barra {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .5rem 1.5rem;
  padding-block: 1.5rem;
}
.marca { font-weight: 600; text-decoration: none; }
.marca-signo { margin-right: .25rem; color: var(--acento); font-family: var(--mono); font-weight: 500; }
.barra nav { display: flex; gap: 1.25rem; font-size: .9375rem; }
.barra nav a { color: var(--texto-suave); text-decoration: none; }
.barra nav a:hover { color: var(--texto); text-decoration: underline; text-underline-offset: 4px; }

.portada {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 3rem;
  align-items: center;
  padding-block: 3.5rem 5rem;
}

.etiqueta {
  margin: 0 0 .75rem;
  color: var(--acento);
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 500;
}

h1 {
  margin: 0;
  font-size: clamp(2.75rem, 6.5vw, 4.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.03em;
}

.entrada { max-width: 32rem; margin: 1.5rem 0 2rem; color: var(--texto-suave); font-size: 1.25rem; line-height: 1.5; }

.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin: 0; }

.boton {
  display: inline-block;
  padding: .7rem 1.2rem;
  border-radius: 4px;
  background: var(--acento);
  color: var(--acento-texto);
  font-weight: 500;
  text-decoration: none;
  transition: opacity .15s ease;
}
.boton:hover { opacity: .88; }

.enlace { font-weight: 500; text-underline-offset: 4px; }
.enlace:hover { color: var(--acento); }

/* Ventana de editor de código */
.editor {
  overflow: hidden;
  border-radius: 10px;
  background: var(--editor-fondo);
  color: var(--editor-texto);
  font-family: var(--mono);
  font-size: .875rem;
  line-height: 1.7;
  box-shadow: 0 18px 40px rgb(24 32 28 / .22);
}
.editor-barra {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .65rem 1rem;
  background: var(--editor-barra);
}
.editor-puntos { display: flex; gap: .4rem; }
.editor-puntos i { width: .65rem; height: .65rem; border-radius: 50%; background: #55625b; }
.editor-puntos i:first-child { background: #f0824f; }
.editor-archivo { color: var(--editor-comentario); font-size: .8125rem; }

.codigo { margin: 0; padding: 1.1rem 1.25rem 1.25rem 0; list-style: none; counter-reset: linea; }
.codigo li {
  position: relative;
  padding-left: 3.25rem;
  counter-increment: linea;
}
.codigo li::before {
  content: counter(linea);
  position: absolute;
  left: 0;
  width: 2.25rem;
  color: #5f6c65;
  text-align: right;
}
.codigo b { color: var(--editor-clave); font-weight: 400; }
.codigo em { color: var(--editor-valor); font-style: normal; }
.codigo .comentario { color: var(--editor-comentario); }

.cursor {
  display: inline-block;
  width: .55em;
  height: 1.1em;
  margin-left: .2em;
  background: var(--editor-texto);
  vertical-align: text-bottom;
  animation: parpadeo 1.1s steps(2, start) infinite;
}
@keyframes parpadeo { to { visibility: hidden; } }

/* Secciones */
.seccion { padding-block: 4rem; border-top: 1px solid var(--linea); }

h2 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.25rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
h3 { margin: 0 0 .75rem; font-size: 1.125rem; font-weight: 600; }
.seccion-intro { margin: .5rem 0 2rem; color: var(--texto-suave); }

.proyectos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.proyecto {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--linea);
  border-radius: 8px;
  background: var(--superficie);
}
.proyecto-cabecera { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.proyecto h3 { margin: 0; font-size: 1.25rem; }
.proyecto p { margin: .75rem 0 1.25rem; color: var(--texto-suave); }

.estado { font-family: var(--mono); font-size: .75rem; font-weight: 500; white-space: nowrap; }
.estado::before { content: "●"; margin-right: .35em; font-size: .7em; vertical-align: .1em; }
.estado-desarrollo { color: var(--estado-desarrollo); }
.estado-beta { color: var(--estado-beta); }
.estado-disponible { color: var(--estado-disponible); }

.stack-titulo { margin-top: auto; color: var(--texto-suave); font-size: .8125rem; }
.stack { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin: .15rem 0 0; padding: 0; list-style: none; font-family: var(--mono); font-size: .8125rem; }
.proyecto-enlace { margin-top: 1rem; font-weight: 500; text-underline-offset: 4px; }
.proyecto-enlace:hover { color: var(--acento); }

.columnas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem; margin-top: 2rem; }
.columnas p { margin: 0; color: var(--texto-suave); }

.habilidades { margin: 0; }
.habilidades div { padding-block: .75rem; border-top: 1px solid var(--linea); }
.habilidades div:first-child { border-top: 0; padding-top: 0; }
.habilidades dt { font-weight: 600; font-size: .9375rem; }
.habilidades dd { margin: .15rem 0 0; color: var(--texto-suave); }

/* Contacto */
.contactos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contactos a {
  display: block;
  height: 100%;
  padding: .9rem 1.1rem;
  border: 1px solid var(--linea);
  border-radius: 8px;
  background: var(--superficie);
  font-family: var(--mono);
  font-size: .875rem;
  overflow-wrap: anywhere;
  text-decoration: none;
  transition: border-color .15s ease;
}
.contactos a:hover { border-color: var(--acento); }
.contactos span {
  display: block;
  margin-bottom: .1rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}

.pie { padding-block: 2rem 3rem; border-top: 1px solid var(--linea); color: var(--texto-suave); font-size: .875rem; }
.pie p { margin: 0; }

@media (max-width: 820px) {
  .portada { grid-template-columns: 1fr; gap: 2.5rem; padding-block: 2rem 3rem; }
  .editor { font-size: .8125rem; }
  .columnas { grid-template-columns: 1fr; gap: 2rem; }
  .seccion { padding-block: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .boton, .contactos a { transition: none; }
}
