/* =========================================================================
   cv.juanmonigo.com — hoja de estilos unica

   Sin framework, sin build step, sin fuentes remotas. Todo el sistema visual
   sale de las variables de :root, asi que cambiar la identidad del sitio es
   editar un punado de valores en un solo lugar.

   Indice
     1. Tokens y tema
     2. Reset y tipografia
     3. Layout
     4. Header y navegacion
     5. Hero
     6. Terminal
     7. Componentes (cards, timeline, chips, meters)
     8. Proyectos
     9. Diagrama de infraestructura
    10. Codigo y pestanas
    11. Formularios
    12. Paleta de comandos
    13. Footer y paginas de mensaje
    14. Animaciones y responsive
   ========================================================================= */

/* ---------- 1. Tokens y tema -------------------------------------------- */
:root {
  color-scheme: dark;

  --bg: #0a0e13;
  --bg-alt: #0c1219;
  --surface: #111823;
  --surface-2: #16202c;
  --surface-3: #1b2735;
  --border: #1e2b3a;
  --border-strong: #2c3d51;

  --text: #e6edf3;
  --text-dim: #93a4b6;
  --text-mute: #64798f;

  --accent: #5eead4;
  --accent-strong: #2dd4bf;
  --accent-soft: rgba(94, 234, 212, 0.12);
  --accent-line: rgba(94, 234, 212, 0.32);
  --indigo: #a5b4fc;

  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.8);

  --radius: 12px;
  --radius-lg: 18px;
  --radius-sm: 8px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Menlo,
    Consolas, "Liberation Mono", monospace;

  --wrap: 1180px;
  --wrap-narrow: 760px;
  --header-h: 68px;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f9fb;
  --bg-alt: #edf2f7;
  --surface: #ffffff;
  --surface-2: #f4f8fb;
  --surface-3: #e9f0f6;
  --border: #dbe4ec;
  --border-strong: #bccadb;

  --text: #0e1a24;
  --text-dim: #4a5c6e;
  --text-mute: #6c8194;

  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --accent-line: rgba(13, 148, 136, 0.3);
  --indigo: #4f46e5;

  --ok: #16a34a;
  --warn: #b45309;
  --err: #dc2626;

  --shadow-sm: 0 1px 2px rgba(15, 30, 45, 0.06);
  --shadow: 0 8px 24px -14px rgba(15, 30, 45, 0.28);
  --shadow-lg: 0 24px 60px -28px rgba(15, 30, 45, 0.34);
}

/* ---------- 2. Reset y tipografia --------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  /* El header es sticky: sin esto, los anclajes dejan el titulo tapado. */
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.08rem; }

p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.16s ease;
}

a:hover { color: var(--accent); }

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

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; }

ul, ol { list-style: none; padding: 0; }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--accent);
  color: #04211d;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus { top: 0; color: #04211d; }

.muted { color: var(--text-dim); }
.small { font-size: 0.86rem; }
.dot { opacity: 0.45; margin: 0 0.4em; }

/* ---------- 3. Layout ---------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 36px);
}

.wrap-narrow { max-width: var(--wrap-narrow); }

.section { padding-block: clamp(56px, 9vw, 104px); }
.section-alt { background: var(--bg-alt); }

.section-head { margin-bottom: clamp(28px, 4vw, 44px); max-width: 62ch; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-lead {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 1.03rem;
  max-width: 62ch;
}

.sub-head {
  margin: 44px 0 20px;
  font-size: 1.2rem;
  color: var(--text-dim);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.side-title {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 14px;
}

/* ---------- 4. Header y navegacion --------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.site-header.is-stuck {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

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

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent-soft), transparent 70%);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.92rem;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 0.96rem; font-weight: 620; }
.brand-text small {
  font-size: 0.74rem;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-nav { display: flex; gap: 4px; }

.site-nav a {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-dim);
  position: relative;
}

.site-nav a:hover { color: var(--text); background: var(--surface-2); }

.site-nav a.is-active { color: var(--accent); }

.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.header-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  height: 36px;
  min-width: 36px;
  padding-inline: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.82rem;
  font-family: var(--mono);
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--surface-2);
}

.icon-btn svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kbd-hint {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-mute);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

/* Cada tema muestra el icono del tema al que va a cambiar. */
.icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* ---------- 5. Hero ------------------------------------------------------ */
.hero {
  position: relative;
  padding-block: clamp(52px, 10vw, 108px) clamp(64px, 10vw, 116px);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

/* Malla de fondo: dos gradientes repetidos, sin imagenes ni requests. */
.hero-grid {
  position: absolute;
  inset: -40% 0 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.4;
  mask-image: radial-gradient(ellipse 75% 55% at 50% 42%, #000 20%, transparent 78%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 13px 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-family: var(--mono);
  margin-bottom: 22px;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-role {
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--accent);
  letter-spacing: 0.01em;
  margin-top: 14px;
}

.hero-tagline {
  margin-top: 18px;
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  color: var(--text-dim);
  max-width: 54ch;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 26px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.hero-meta li { display: inline-flex; align-items: center; gap: 8px; }

.hero-meta svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--text-mute);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 550;
  transition: transform 0.14s ease, border-color 0.16s ease, background 0.16s ease,
    box-shadow 0.16s ease;
}

.btn svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover {
  color: var(--text);
  border-color: var(--accent-line);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #04211d;
  font-weight: 620;
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #04211d;
  box-shadow: 0 10px 28px -12px var(--accent);
}

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }

.hero-social { display: flex; gap: 18px; margin-top: 26px; font-size: 0.88rem; }
.hero-social a { display: inline-flex; align-items: center; gap: 7px; color: var(--text-mute); }
.hero-social svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-card {
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, var(--surface), var(--bg));
  box-shadow: var(--shadow);
}

.hero-avatar { display: flex; justify-content: center; margin-bottom: 22px; }

.hero-avatar img {
  width: 132px; height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-line);
}

.avatar-initials {
  width: 132px; height: 132px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 2.6rem;
  font-weight: 700;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-block: 18px;
  border-block: 1px solid var(--border);
}

.hero-stats div { text-align: center; }

.hero-stats dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  font-family: var(--mono);
}

.hero-stats dd {
  font-size: 1.6rem;
  font-weight: 650;
  color: var(--accent);
  font-family: var(--mono);
  margin-top: 2px;
}

.hero-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.hero-tech li {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-family: var(--mono);
  color: var(--text-dim);
}

.scroll-cue {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.scroll-cue svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: bob 2.2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(4px); opacity: 1; }
}

/* ---------- 6. Terminal --------------------------------------------------- */
.section-terminal { padding-top: clamp(48px, 7vw, 76px); }

.terminal {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.terminal-bar .dots { display: flex; gap: 7px; }

.terminal-bar .dots i {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--border-strong);
}

.terminal-bar .dots i:first-child { background: #ff5f57; }
.terminal-bar .dots i:nth-child(2) { background: #febc2e; }
.terminal-bar .dots i:nth-child(3) { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-clear {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-mute);
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid transparent;
}

.terminal-clear:hover { color: var(--accent); border-color: var(--border); }

.terminal-body {
  height: clamp(320px, 46vh, 440px);
  overflow-y: auto;
  overflow-x: auto;
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.6;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.terminal-body::-webkit-scrollbar { width: 9px; height: 9px; }
.terminal-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

.terminal-body .line { white-space: pre; min-height: 1.3em; }

.terminal-body .line.wrapped { white-space: pre-wrap; }

.tone-dim    { color: var(--text-mute); }
.tone-accent { color: var(--accent); }
.tone-ok     { color: var(--ok); }
.tone-warn   { color: var(--warn); }
.tone-err    { color: var(--err); }
.tone-head   {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.echo-line { color: var(--text-dim); margin-top: 10px; }
.echo-line .echo-prompt { color: var(--accent); }

.terminal-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.prompt { font-family: var(--mono); font-size: 0.84rem; white-space: nowrap; }
.prompt-user { color: var(--accent); }
.prompt-sep, .prompt-path { color: var(--text-mute); }
.prompt-host { color: var(--indigo); }

.terminal-input input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--text);
  caret-color: var(--accent);
}

.terminal-input input::placeholder { color: var(--text-mute); opacity: 0.7; }

.terminal-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.terminal-suggestions button {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.78rem;
  transition: all 0.16s ease;
}

.terminal-suggestions button:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* ---------- 7. Componentes ------------------------------------------------ */
.card {
  padding: clamp(20px, 2.6vw, 28px);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.card-sub { color: var(--text-dim); font-size: 0.93rem; margin-top: 4px; }
.card-sub strong { color: var(--text); font-weight: 600; }

.card-period {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-mute);
  text-align: right;
  white-space: nowrap;
}

.card-period .small { display: block; opacity: 0.75; }

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(240px, 0.9fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.profile-summary p { font-size: clamp(1.02rem, 1.6vw, 1.16rem); color: var(--text-dim); }

.profile-summary::before {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin-bottom: 22px;
}

.lang-list { display: grid; gap: 18px; }
.lang-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.lang-name { font-weight: 560; }

.lang-list .dots { display: flex; gap: 5px; }

.lang-list .dots i {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}

.lang-list .dots i.on { background: var(--accent); border-color: var(--accent); }

/* Timeline */
.timeline { position: relative; display: grid; gap: 24px; padding-left: 32px; }

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(var(--accent-line), var(--border) 55%, transparent);
}

.timeline-item { position: relative; }

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 22px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg);
}

.timeline-item.is-current .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.bullets { display: grid; gap: 9px; }

.bullets li {
  position: relative;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.75;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }

.chips li {
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.chips li.chip-more { color: var(--accent); border-color: var(--accent-line); }

/* Formacion */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.edu-card { display: flex; flex-direction: column; gap: 8px; }

.edu-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.edu-card.is-wip .edu-badge { color: var(--accent); border-color: var(--accent-line); }

.pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-out infinite;
}

.edu-card .card-period { text-align: left; }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.skill-card h3 {
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.skill-list { display: grid; gap: 16px; }

.skill-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 7px;
}

.skill-name { font-size: 0.93rem; font-weight: 540; }

.skill-name .star { color: var(--accent); font-size: 0.78rem; margin-left: 4px; }

.skill-level {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-mute);
}

.meter {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill[data-band="working"] .meter-fill { opacity: 0.6; }
.skill[data-band="solid"] .meter-fill { opacity: 0.78; }

.skill-note { margin-top: 6px; }

/* ---------- 8. Proyectos --------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }

.filter {
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.85rem;
  transition: all 0.16s ease;
}

.filter:hover { color: var(--text); border-color: var(--border-strong); }

.filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #04211d;
  font-weight: 600;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.project-card { display: flex; flex-direction: column; scroll-margin-top: 100px; }

.project-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.project-card[hidden] { display: none; }

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.status .status-dot { width: 6px; height: 6px; animation: none; box-shadow: none; }
.status-live { color: var(--ok); }
.status-live .status-dot { animation: pulse 2.4s ease-out infinite; }
.status-wip { color: var(--warn); }

.project-card h3 { font-size: 1.14rem; margin-bottom: 10px; }
.project-card h3 a:hover { color: var(--accent); }

.project-summary { color: var(--text-dim); font-size: 0.94rem; flex: 1; }

.project-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 560;
}

.link-arrow svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.link-arrow:hover svg { transform: translateX(3px); }

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 0.9rem;
}

/* Detalle de proyecto */
.project-detail { padding-top: 44px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-mute);
  font-size: 0.88rem;
  margin-bottom: 30px;
}

.back-link svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-detail-head { margin-bottom: 36px; }
.project-detail-head .eyebrow { text-transform: none; letter-spacing: 0.04em; }

.project-lead {
  margin-top: 16px;
  font-size: 1.12rem;
  color: var(--text-dim);
}

.prose { display: grid; gap: 18px; }
.prose p { color: var(--text-dim); font-size: 1.02rem; }

.highlight-box {
  margin-top: 36px;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

.highlight-box h2,
.project-stack h2,
.related h2 {
  font-size: 0.82rem;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 16px;
}

.project-stack { margin-top: 36px; }
.project-stack .chips { margin-top: 0; }
.related { margin-top: 52px; }

/* ---------- 9. Diagrama de infraestructura --------------------------------- */
.infra-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 44px);
  align-items: start;
}

.diagram-hint { margin-bottom: 12px; }

.diagram-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px;
  scrollbar-width: thin;
}

.diagram { width: 100%; min-width: 620px; height: auto; }

/* El contenedor LXC: es un nodo clickeable, pero se dibuja como un recinto
   punteado y no como una tarjeta, para que se lea "esto contiene a aquello". */
.diagram .node-host rect {
  fill: color-mix(in srgb, var(--accent) 4%, transparent);
  stroke: var(--border-strong);
  stroke-width: 1;
  stroke-dasharray: 5 4;
}

.diagram .node-host.is-active rect {
  fill: color-mix(in srgb, var(--accent) 8%, transparent);
  stroke: var(--accent);
  stroke-width: 1.6;
}

.diagram .host-label {
  fill: var(--text-mute);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.diagram .edges path {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.6;
}

.diagram .edges .edge-dashed { stroke-dasharray: 5 4; stroke: var(--indigo); opacity: 0.7; }
.diagram .arrow-head { fill: var(--border-strong); }

.diagram .edge-label {
  fill: var(--text-mute);
  font-family: var(--mono);
  font-size: 10.5px;
  text-anchor: middle;
}

.diagram .node { cursor: pointer; }

.diagram .node rect {
  fill: var(--surface-2);
  stroke: var(--border-strong);
  stroke-width: 1.4;
  transition: stroke 0.18s ease, fill 0.18s ease;
}

.diagram .node:hover rect,
.diagram .node:focus-visible rect { stroke: var(--accent); }

.diagram .node.is-active rect {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 2;
}

.diagram .node-accent rect { fill: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }
.diagram .node-probe rect { stroke-dasharray: 4 3; }

.diagram .node-title {
  fill: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-anchor: middle;
}

.diagram .node-meta {
  fill: var(--text-mute);
  font-family: var(--mono);
  font-size: 10.5px;
  text-anchor: middle;
}

.diagram .node:focus { outline: none; }
.diagram .node:focus-visible rect { stroke-width: 2.4; }

.diagram-detail {
  margin-top: 16px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  min-height: 150px;
}

.diagram-detail h3 { font-family: var(--mono); font-size: 1rem; color: var(--accent); }

.detail-meta {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-mute);
  margin: 4px 0 12px;
}

.diagram-detail p:last-child { color: var(--text-dim); font-size: 0.94rem; }

/* ---------- 10. Codigo y pestanas ------------------------------------------ */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab {
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-mute);
  transition: all 0.16s ease;
}

.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.tab-panel > .muted { margin-bottom: 14px; }

.code-block { position: relative; }

.code-block pre {
  margin: 0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.62;
  color: var(--text-dim);
  scrollbar-width: thin;
}

.code-block code { font-family: inherit; }

.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 0.72rem;
  opacity: 0;
  transition: opacity 0.16s ease, color 0.16s ease;
}

.code-block:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.copy-btn.is-done { color: var(--ok); border-color: var(--ok); opacity: 1; }

/* ---------- 11. Formularios ------------------------------------------------ */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.85fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.contact-form { display: grid; gap: 18px; }

.field-row { display: grid; gap: 7px; }

.field-row label {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.field {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  resize: vertical;
}

.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field::placeholder { color: var(--text-mute); opacity: 0.65; }

/* Honeypot: invisible para humanos, presente para bots. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form-error { color: var(--err); font-size: 0.85rem; }

/* El parrafo esta siempre en el HTML para que `aria-describedby` tenga a que
   apuntar; vacio no tiene que ocupar ni el hueco del grid. */
.form-error:empty { display: none; }

/* La marca visible que promete el resumen ("está marcado abajo"). Sin esto el
   unico indicio era el texto rojo, que en un formulario de tres campos obliga
   a leerlos todos para saber cual falló. */
.field-row.has-error .field { border-color: var(--err); }
.field-row.has-error .field:focus {
  border-color: var(--err);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

.form-status { font-size: 0.9rem; min-height: 1.4em; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-error { color: var(--err); }

.contact-form .btn { justify-self: start; }
.contact-form .btn[disabled] { opacity: 0.6; cursor: progress; }

.contact-side { display: grid; gap: 18px; }

.contact-list { display: grid; gap: 12px; }

.contact-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.93rem;
  flex-wrap: wrap;
}

.contact-list .k {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  min-width: 70px;
}

.copy-inline {
  color: var(--text-mute);
  font-size: 0.9rem;
  padding: 0 4px;
}

.copy-inline:hover { color: var(--accent); }
.copy-inline.is-done { color: var(--ok); }

.contact-side .btn { justify-self: start; }

/* ---------- 12. Paleta de comandos ----------------------------------------- */
.palette {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  margin-top: 12vh;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.palette::backdrop {
  background: rgba(3, 7, 12, 0.62);
  backdrop-filter: blur(3px);
}

.palette-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.palette-search svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--text-mute);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.palette-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  font-size: 0.98rem;
}

.palette-search kbd {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-mute);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

.palette-results { max-height: 52vh; overflow-y: auto; padding: 8px; scrollbar-width: thin; }

.palette-group {
  padding: 10px 12px 6px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 0.93rem;
  color: var(--text-dim);
}

.palette-item:hover,
.palette-item.is-selected { background: var(--accent-soft); color: var(--accent); }

.palette-item[hidden] { display: none; }

.palette-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45%;
}

.palette-empty { padding: 26px; text-align: center; color: var(--text-mute); font-size: 0.9rem; }

/* ---------- 13. Footer y paginas de mensaje -------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 40px;
  background: var(--bg-alt);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: center;
  justify-content: space-between;
}

.footer-name { font-weight: 620; }

.footer-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.9rem; }
.footer-links a { color: var(--text-dim); }

.footer-built {
  width: 100%;
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--text-mute);
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.message-page { text-align: center; padding-block: clamp(48px, 12vh, 120px); }
.message-page h1 { font-size: clamp(1.4rem, 3.4vw, 2rem); margin-bottom: 24px; }
.message-page .btn { margin-top: 8px; }

.message-icon {
  width: 62px; height: 62px;
  margin: 0 auto 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.8rem;
  font-weight: 700;
}

.message-icon.is-ok { background: var(--accent-soft); color: var(--ok); }
.message-icon.is-error { background: rgba(248, 113, 113, 0.12); color: var(--err); }

.error-code {
  font-family: var(--mono);
  font-size: clamp(4rem, 16vw, 8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  opacity: 0.28;
  margin-bottom: 8px;
}

/* ---------- 14. Animaciones y responsive ----------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible { opacity: 1; transform: none; }

/* Sin JavaScript el contenido tiene que verse igual: la clase .js la pone
   app.js al arrancar, asi que sin el nada queda invisible. */
html:not(.js) .reveal { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card { max-width: 460px; }
  .profile-grid,
  .contact-grid,
  .infra-layout { grid-template-columns: 1fr; }
  .site-nav { display: none; }
}

@media (max-width: 620px) {
  :root { --header-h: 60px; }
  .brand-text small { display: none; }
  .kbd-hint { display: none; }
  .hero-stats dd { font-size: 1.3rem; }
  .card-head { flex-direction: column; }
  .card-period { text-align: left; }
  .terminal-body { font-size: 0.78rem; padding: 14px; }
  .scroll-cue { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Impresion: que Ctrl+P produzca un CV legible en papel, no una captura
   del sitio oscuro. */
@media print {
  :root {
    --bg: #fff; --bg-alt: #fff; --surface: #fff; --surface-2: #fff;
    --text: #000; --text-dim: #333; --text-mute: #555;
    --border: #ccc; --border-strong: #999; --accent: #0f766e;
  }
  .site-header, .site-footer, .scroll-cue, .section-terminal,
  .filters, .palette, .contact-form, .infra-files, .diagram-scroll,
  .hero-actions, .hero-social { display: none !important; }
  .section { padding-block: 18px; break-inside: avoid; }
  .card { break-inside: avoid; box-shadow: none; }
  a { text-decoration: none; }
}
