/* Portfolio en terminal: una ventana de terminal de verdad (letra mono, cursor de bloque, un color de acento). */
:root {
  --bg: #0a0a0c;
  --win: #0d0d10;
  --bar: #18181c;
  --line: #26262c;
  --ink: #d8d8dc;
  --dim: #7c7c86;
  --faint: #55555e;
  --acc: #3ff3ff;
  --acc-soft: rgba(63, 243, 255, .12);
  --ok: #3dff8a;
  --err: #ff6b6b;
  --warn: #ffcf5a;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.55 var(--mono);
  display: grid; place-items: center; padding: 24px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acc); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px dashed var(--acc); outline-offset: 2px; }
::selection { background: var(--acc); color: var(--bg); }

/* ---- la ventana ---- */
.ventana {
  width: min(1000px, 100%); height: min(860px, calc(100vh - 48px)); height: min(860px, calc(100dvh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--win); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .02);
}
.barra {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 12px;
  background: var(--bar); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--dim);
}
.luces { display: flex; gap: 8px; }
.luces i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.luces i:nth-child(2) { background: #febc2e; }
.luces i:nth-child(3) { background: #28c840; }
.titulo { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none; }
.logros {
  margin-left: auto; flex: none; min-height: 44px; padding: 0 6px; font-size: 13px; color: var(--dim); white-space: nowrap;
}
.logros:hover { color: var(--acc); }
.idiomas { display: flex; flex: none; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.idiomas button { min-width: 44px; min-height: 44px; padding: 0 8px; font-size: 13px; color: var(--dim); }
.idiomas button[aria-pressed="true"] { background: var(--acc-soft); color: var(--acc); }
.escribime {
  flex: none; min-height: 44px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 700;
  color: var(--bg); background: var(--acc);
}
.escribime:hover { filter: brightness(1.15); }
.destacado { margin-top: 6px; max-width: 62ch; }
.destacado a { color: var(--ink); text-decoration-color: var(--acc); text-underline-offset: 3px; }

/* ---- la sesión ---- */
.pantalla { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px 18px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.salida p, .salida pre, .salida h1, .salida h2 { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.salida h1, .salida h2 { font: inherit; }
.salida h2 { color: var(--acc); margin-top: 8px; }
.salida .eco { margin-top: 12px; color: var(--ink); }
.salida > .eco:first-child { margin-top: 0; }
.ps1 { color: var(--acc); white-space: nowrap; }
.ps1 .err { color: var(--err); }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.ok { color: var(--ok); }
.err { color: var(--err); }
.warn { color: var(--warn); }
.acc { color: var(--acc); }
.b { font-weight: 700; }

/* neofetch */
.neo { display: flex; flex-wrap: wrap; gap: 4px 28px; align-items: flex-start; margin-top: 6px; }
.neo-logo { color: var(--acc); line-height: 1; font-size: 14px; margin-top: 4px; }
.neo-info b { color: var(--acc); font-weight: 700; }
.neo-colores { display: flex; gap: 0; margin-top: 6px; }
.neo-colores i { width: 22px; height: 14px; }

/* archivos que se pueden tocar */
.f { padding: 6px 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.f.dir { color: var(--acc); font-weight: 700; }
.f.ex { color: var(--ok); font-weight: 700; }
.f.lnk { color: #c9a8ff; }
.f:hover { text-decoration-color: currentColor; }
.ls { display: flex; flex-wrap: wrap; gap: 2px 22px; }
.ls .f { min-height: 44px; display: inline-flex; align-items: center; }
.lsl { display: grid; grid-template-columns: auto auto auto 1fr; gap: 0 14px; }
.lsl .f { justify-self: start; }

/* habilidades.txt */
.hab { display: grid; grid-template-columns: 38ch 12ch auto; gap: 0 14px; align-items: center; margin-bottom: 4px; }
.hab .barra-lv { color: var(--acc); letter-spacing: -1px; }
.probar { color: var(--ok); text-decoration: underline; text-underline-offset: 3px; margin-left: 8px; white-space: nowrap; }

/* líneas que se pueden tocar dentro de una salida (▶ probalo, [s/n]) */
.acciones { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 6px; }
.acciones a, .acciones button { display: inline-flex; align-items: center; min-height: 44px; color: var(--acc); text-decoration: underline; text-underline-offset: 3px; }

/* cv: etiqueta y lista alineadas (en el celular, una debajo de la otra) */
.cvhab { display: grid; grid-template-columns: 16ch 1fr; gap: 0 8px; }

/* bot */
.bot b { color: var(--acc); font-weight: 700; }

/* ---- la línea donde se escribe ---- */
.activa { display: flex; align-items: center; gap: 0 10px; margin-top: 12px; }
.activa input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0; font: inherit; color: var(--ink);
  background: none; border: 0; outline: none; caret-color: var(--acc); caret-shape: block;
}
.activa.esperando .ps1 { color: var(--warn); }

/* ---- atajos de abajo ---- */
.atajos {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bar); scrollbar-width: none;
}
.atajos::-webkit-scrollbar { display: none; }
.atajos button {
  flex: none; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; color: var(--ink); background: var(--win);
}
.atajos button:hover { border-color: var(--acc); color: var(--acc); }

/* ---- aviso de logro ---- */
.logro-aviso {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10;
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; border: 1px solid var(--acc); border-radius: 8px;
  background: var(--bar); color: var(--ink); font-size: 14px; box-shadow: 0 0 24px var(--acc-soft);
  animation: aviso .35s ease-out;
}
@keyframes aviso { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---- celular: pantalla completa ---- */
@media (max-width: 700px) {
  body { padding: 0; place-items: stretch; font-size: 13px; }
  .ventana { width: 100%; height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
  .titulo, .luces { display: none; }
  .barra { gap: 8px; padding: 0 10px; }
  .logros { margin-left: 0; padding: 0 2px; }
  .idiomas { margin-left: auto; }
  .pantalla { padding: 12px 14px 14px; }
  .neo-logo { font-size: 12px; }
  .hab { grid-template-columns: 1fr auto; }
  .hab .barra-lv { grid-column: 1 / -1; grid-row: 2; }
  .cvhab { grid-template-columns: 1fr; margin-bottom: 4px; }
}
/* iPhone agranda la página al tocar un campo con letra de menos de 16 px y no vuelve: la línea de comandos usa 16 px */
@media (max-width: 700px) and (pointer: coarse) { .activa input { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .logro-aviso { animation: none; } }
