/* =====================================================================
   CV · cv.css — estilos propios de la home (index.html)
   Depende de base.css (tokens y componentes compartidos).
   ===================================================================== */

/* ---------- HERO: escritorio con el canvas como fondo de pantalla ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: min(calc(100svh - var(--header-h)), 900px);
  padding-block: clamp(48px, 8vh, 96px) clamp(56px, 9vh, 104px);
  overflow: hidden;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 82% 78% at 50% 52%, #000 28%, transparent 92%);
  mask-image: radial-gradient(ellipse 82% 78% at 50% 52%, #000 28%, transparent 92%);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(330px, .78fr);
  gap: clamp(32px, 4.5vw, 64px);
  align-items: center;
}
.hero__copy { min-width: 0; }

/* Entrada escalonada (solo CSS: si falla el JS, todo queda visible) */
@keyframes rise { from { opacity: 0; translate: 0 16px; } }
.hero__copy > *, .hero .avatar {
  animation: rise .7s var(--intro-ease) both;
  animation-delay: calc(var(--i, 0) * 80ms + 60ms);
}

.hero__id .hero__photo { display: none; }   /* la foto vive en «Quién soy»; aquí solo la usa la impresión */
.hero__id { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.hero__photo {
  --step: 6px;
  flex: none;
  width: 104px;
  height: 104px;
  padding: 3px;
  background: var(--red);
  clip-path: polygon(
    calc(var(--step) * 2) 0, calc(100% - var(--step) * 2) 0, calc(100% - var(--step) * 2) var(--step),
    calc(100% - var(--step)) var(--step), calc(100% - var(--step)) calc(var(--step) * 2), 100% calc(var(--step) * 2),
    100% calc(100% - var(--step) * 2), calc(100% - var(--step)) calc(100% - var(--step) * 2),
    calc(100% - var(--step)) calc(100% - var(--step)), calc(100% - var(--step) * 2) calc(100% - var(--step)),
    calc(100% - var(--step) * 2) 100%, calc(var(--step) * 2) 100%, calc(var(--step) * 2) calc(100% - var(--step)),
    var(--step) calc(100% - var(--step)), var(--step) calc(100% - var(--step) * 2), 0 calc(100% - var(--step) * 2),
    0 calc(var(--step) * 2), var(--step) calc(var(--step) * 2), var(--step) var(--step), calc(var(--step) * 2) var(--step));
}
.hero__photo img {
  --step: 4.5px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-3);
  clip-path: inherit;
}
.hero__name {
  font: 600 clamp(17px, 1.5vw, 20px)/1.25 var(--font-display);
  letter-spacing: -.01em;
  color: var(--fg);
}
.hero__role {
  margin-top: 6px;
  font: 700 12px/1.4 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red-ink);
}
.hero__role .nw { white-space: nowrap; }
/* en móvil, un rol por línea y sin separador colgando */
@media (max-width: 560px) {
  .hero__role .nw { display: block; }
  .hero__role .sep { display: none; }
}
/* el texto pequeño del hero lleva un halo del color del fondo: los nodos
   rojos del canvas que pasan por detrás no le bajan el contraste */
.hero__name, .hero__role, .hero__status, .hero__pitch { text-shadow: 0 0 3px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg); }
.hero__title {
  font-size: clamp(40px, 4.9vw, 72px);
  line-height: .98;
  letter-spacing: -.03em;
  margin-bottom: 26px;
  max-width: 13em;
}
.hero__pitch {
  font-size: clamp(17px, 1.35vw, 19px);
  line-height: 1.62;
  color: var(--fg-2);
  max-width: 58ch;
}
.hero__pitch b { color: var(--fg); font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__status {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 26px;
  max-width: 62ch;
  font: 400 13px/1.6 var(--font-mono);
  color: var(--fg-2);   /* no muted: sobre los nodos rojos del canvas no llegaba a 4.5:1 */
}
.hero__status .led { transform: translateY(-1px); }
.hero__status b { color: var(--fg); font-weight: 700; }

/* Avatar: dibujo de Marco en el lugar de la antigua terminal */
.avatar { align-self: center; justify-self: center; margin: 0; min-width: 0; width: 100%; max-width: 520px; }
.avatar { position: relative; aspect-ratio: 971 / 994; }
.avatar img { display: block; width: 100%; height: auto; }
/* con JS el dibujo vectorial (por capas) y el lienzo de partículas van encima del <img>, que solo cubre sin JS o si algo falla */
.avatar__art, .avatar__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar__art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.avatar__art, .avatar__canvas { transform-origin: 50% 84%; will-change: transform; }
/* el vector nítido aparece despacio sobre los cuadritos y estos se apagan después; al deshacerse, el cambio es rápido */
.avatar__art { transition: opacity .55s ease; }
.avatar__canvas { opacity: 0; pointer-events: none; transition: opacity .3s ease .5s; }
.avatar.is-particles .avatar__canvas { opacity: 1; transition: opacity .12s ease; }
.avatar.is-particles .avatar__art { opacity: 0; transition: opacity .12s ease; }
.avatar.is-live img { visibility: hidden; }
html.js .avatar:not(.is-live):not(.is-static) img { opacity: 0; animation: avatar-failsafe 0s linear 2.5s forwards; }
@keyframes avatar-failsafe { to { opacity: 1; } }
/* Botón "Pausar animaciones" del hero (esquina inferior derecha) */
.hero__motion {
  position: absolute;
  right: max(var(--gutter), calc((100% - var(--maxw)) / 2));
  bottom: 14px;
  z-index: 2;
}
@media (max-width: 960px) {
  .hero { min-height: 0; }
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__title { max-width: none; font-size: clamp(40px, 7.2vw, 72px); }
  .avatar { max-width: 420px; }
}
@media (max-width: 560px) {
  .hero { padding-bottom: 76px; }
  .hero__id { gap: 14px; margin-bottom: 22px; }
  .hero__photo { width: 76px; height: 76px; --step: 5px; padding: 2px; }
  .hero__photo img { --step: 4px; }
  .hero__title { font-size: clamp(36px, 10.6vw, 46px); margin-bottom: 18px; }
  .hero__cta { gap: 10px; margin-top: 26px; }
  .hero__cta .btn { flex: 1 1 auto; }
  .hero__cta .btn--primary { flex-basis: 100%; }
  .avatar { max-width: 320px; }
}

/* ---------- PROYECTOS ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.filters__group { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 44px;
  padding: 0 18px;
  background: var(--bg-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--bevel), 2px 3px 0 var(--shade);
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.filter:hover { color: var(--fg); border-color: var(--red); }
.filter__cursor {
  display: inline-block;
  width: 0;
  overflow: hidden;
  font-size: 12px;
  transition: width var(--dur-fast) var(--ease-step), margin var(--dur-fast) var(--ease-step);
}
.filter[aria-pressed="true"] {
  background: var(--red);
  border-color: var(--red);
  color: var(--on-red);
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .35), inset -1px -1px 0 rgba(255, 255, 255, .3);
  transform: translate(1px, 1px);
}
.filter[aria-pressed="true"] .filter__cursor { width: 1em; margin-right: 6px; }
.filters__count { font: 700 12px/1 var(--font-mono); letter-spacing: .14em; color: var(--muted); }
.filters__count span:first-child { color: var(--fg); }

.pgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.pgrid__empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  font: 400 14px var(--font-mono);
  color: var(--muted);
  text-align: center;
}
.pcard { transition: transform .18s steps(3, end), box-shadow var(--dur) ease; }
@media (hover: hover) {
  .pcard:hover { transform: translateY(-5px); box-shadow: var(--bevel), 4px 9px 0 rgba(255, 32, 32, .28); }
  /* extiende el área de hover bajo la tarjeta levantada (evita el parpadeo en el borde) */
  .pcard:hover::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; }
}
.pcard:hover .logo, .pcard:focus-within .logo { filter: none; opacity: 1; }
.pcard:hover .chip, .pcard:focus-within .chip { border-color: var(--line-strong); color: var(--fg); }
.pcard:hover .chip > .pi, .pcard:focus-within .chip > .pi { color: var(--red-ink); }
.chip > .pi { color: var(--muted); transition: color var(--dur) ease; }
@media (hover: hover) {
  .pcard:hover .pcard__view { border-color: var(--red); }
  .pcard:hover .pcard__view .btn__arrow { color: var(--red-ink); }
}

.pcard__cover {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.pcard__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg);
}
/* Portada generada por código (mientras no hay captura real) */
.cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 58% 70% at 50% 58%, rgba(255, 32, 32, .13), transparent 72%),
    linear-gradient(rgba(255, 32, 32, .09) 1px, transparent 1px) 0 0 / 7cqw 7cqw,
    linear-gradient(90deg, rgba(255, 32, 32, .09) 1px, transparent 1px) 0 0 / 7cqw 7cqw,
    var(--bg);
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(rgba(var(--ink-rgb), .025) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.cover::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -30%;
  height: 30%;
  background: linear-gradient(transparent, rgba(255, 32, 32, .08), transparent);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pcard:hover .cover::before { opacity: 1; animation: sweep 1.8s steps(7, end) infinite; }
}
@keyframes sweep { to { transform: translateY(470%); } }

.cover__browser {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 70%;
  aspect-ratio: 16 / 9.4;
  margin-top: -4cqw;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--bevel), 1.4cqw 1.8cqw 0 #000;
}
.cover__chrome {
  display: flex;
  align-items: center;
  gap: 1cqw;
  height: max(18px, 6cqw);
  padding: 0 2cqw;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 2px 0 var(--red);
}
.cover__chrome i { width: max(6px, 1.6cqw); height: max(6px, 1.6cqw); background: var(--bg-4); box-shadow: var(--bevel); flex: none; }
.cover__chrome span {
  margin-left: 1.6cqw;
  padding: 0 1.6cqw;
  font: 400 12px/1.5 var(--font-mono);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cover__screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.6cqw;
  padding: 0 6cqw;
}
.cover__mono {
  font: 700 15cqw/0.9 var(--font-display);
  letter-spacing: -.04em;
  color: var(--fg);
}
.cover__mono b { color: var(--red-ink); font-weight: 700; }
.cover__lines { display: grid; gap: 1.4cqw; }
.cover__lines i { display: block; height: max(4px, 1.3cqw); background: var(--line-strong); width: 70%; }
.cover__lines i:nth-child(2) { width: 52%; background: var(--line); }
.cover__lines i:nth-child(3) { width: 61%; background: var(--line); }
.cover__lines i:nth-child(4) { width: 34%; background: var(--red); opacity: .8; }
.cover__screen--dash { flex-direction: row; align-items: flex-end; justify-content: space-between; padding: 6cqw; }
.cover__bars { display: flex; align-items: flex-end; gap: 1.6cqw; height: 60%; width: 42%; }
.cover__bars i { flex: 1; height: var(--h); background: var(--line-strong); box-shadow: inset 0 2px 0 var(--fg-2); }
.cover__bars i:nth-child(4) { background: var(--red); box-shadow: none; }

/* teléfono con esquinas escalonadas (técnica clip-path, sin radios) */
.cover__phone {
  --s: max(4px, 1.3cqw);
  position: relative;
  z-index: 1;
  height: 82%;
  aspect-ratio: 9 / 18.5;
  padding: max(3px, .8cqw);
  background: var(--fg-2);
  clip-path: polygon(calc(var(--s) * 2) 0, calc(100% - var(--s) * 2) 0, calc(100% - var(--s) * 2) var(--s), calc(100% - var(--s)) var(--s), calc(100% - var(--s)) calc(var(--s) * 2), 100% calc(var(--s) * 2), 100% calc(100% - var(--s) * 2), calc(100% - var(--s)) calc(100% - var(--s) * 2), calc(100% - var(--s)) calc(100% - var(--s)), calc(100% - var(--s) * 2) calc(100% - var(--s)), calc(100% - var(--s) * 2) 100%, calc(var(--s) * 2) 100%, calc(var(--s) * 2) calc(100% - var(--s)), var(--s) calc(100% - var(--s)), var(--s) calc(100% - var(--s) * 2), 0 calc(100% - var(--s) * 2), 0 calc(var(--s) * 2), var(--s) calc(var(--s) * 2), var(--s) var(--s), calc(var(--s) * 2) var(--s));
  filter: drop-shadow(0 0 0 #000);
}
.cover__phone-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.4cqw;
  height: 100%;
  padding: 0 2.4cqw;
  background: var(--bg-2);
  background-image: linear-gradient(var(--red), var(--red));
  background-size: 100% max(2px, .5cqw);
  background-repeat: no-repeat;
  clip-path: inherit;
}
/* fila de altura definida: así el % de alto de los teléfonos se resuelve
   contra la portada (con un solo teléfono se trataba como auto y desbordaba) */
.cover--mobile { grid-template-rows: 100%; }
.cover--mobile .cover__phone { height: 74%; translate: 0 -7%; }
.cover--mobile .cover__mono { font-size: 9cqw; }
.cover--mobile .cover__lines i { height: max(3px, .9cqw); }
.cover__pill { display: flex; gap: 0; width: 60%; }
.cover__pill i { flex: 1; height: max(8px, 2.4cqw); background: var(--red); }
.cover__pill i + i { background: var(--fg-2); }
.cover__map { display: block; height: 30%; border: 1px solid var(--line-strong); background:
  linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 2.4cqw 2.4cqw,
  linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 2.4cqw 2.4cqw; position: relative; }
.cover__map i { position: absolute; left: 55%; top: 40%; width: max(6px, 1.6cqw); height: max(6px, 1.6cqw); background: var(--red); box-shadow: 0 0 10px var(--red-glow); }
.cover--duo { grid-template-columns: auto auto; justify-content: center; gap: 5cqw; }
.cover--duo .cover__phone { height: 74%; }
.cover--duo .cover__phone--back { height: 64%; opacity: .7; translate: 0 2%; }
.cover--duo .cover__phone--back:has(.has-shot) { opacity: .92; }
.cover__tag {
  position: absolute;
  z-index: 3;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(var(--bg-rgb), .86);
  border: 1px solid var(--line);
  font: 400 12px/1.3 var(--font-mono);
  color: var(--muted);
}
.cover__tag .pi { width: 14px; height: 14px; }
/* etiqueta "Captura real" sobre una portada con evidencia */
.cover__tag--real { color: var(--fg-2); letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.cover__tag--real .led { width: 6px; height: 6px; }
/* captura vertical dentro del teléfono dibujado */
.cover__phone-screen.has-shot { padding: 0; gap: 0; background-image: none; }
.cover__shot { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.pcard__body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 20px 22px 18px; }
.pcard__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.pcard__title { font-size: clamp(24px, 2.1vw, 28px); letter-spacing: -.02em; }
.pcard__sub {
  margin-top: -6px;
  font: 700 12px/1.45 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.pcard__desc { color: var(--fg-2); font-size: 16px; line-height: 1.6; }
.pcard__tags { margin-top: auto; padding-top: 4px; }
.pcard__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 2px dotted var(--line);
}

@media (max-width: 700px) {
  .pgrid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .filters { margin-bottom: 22px; }
}
@media (max-width: 420px) {
  .filter { padding: 0 13px; }
  .pcard__body { padding: 18px 16px 16px; }
}

/* ---------- STACK: objetos ---------- */
.objs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}
.obj {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--bevel), var(--shadow-hard);
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.obj:hover, .obj:focus-within, .obj.is-lit { border-color: rgba(255, 32, 32, .55); box-shadow: var(--bevel), var(--shadow-hard-red); }
.obj__head { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 16px; align-items: center; }
.obj__art {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  filter: drop-shadow(3px 4px 0 var(--shade));
}
/* etiqueta "pegada" al objeto, en hueso */
.obj__label {
  position: relative;
  padding: 10px 12px 11px;
  background:
    linear-gradient(var(--red), var(--red)) 0 0 / 100% 3px no-repeat,
    repeating-linear-gradient(transparent 0 21px, rgba(10, 10, 10, .07) 21px 22px) 0 3px,
    var(--fg);
  color: var(--bg);
  border-radius: var(--radius);
  box-shadow: 2px 3px 0 var(--shade);
}
.obj__num { font: 700 12px/1 var(--font-mono); letter-spacing: .12em; color: var(--bg-4); }
.obj__title { margin-top: 5px; font-size: 19px; line-height: 1.12; letter-spacing: -.01em; color: var(--bg); }
.obj__note { margin-top: 4px; font: 400 13px/1.4 var(--font-body); color: var(--bg-4); }
/* tema claro: la etiqueta pasa de negra a roja con texto blanco. Se usa #e01c1c y no #ff2020 porque el blanco sobre
   #ff2020 da 3,4:1 (no llega a AA en el texto pequeño) y sobre #e01c1c da 4,9:1 */
@media screen {
  :root[data-theme="light"] .obj__label {
    background:
      linear-gradient(#8a0b0b, #8a0b0b) 0 0 / 100% 3px no-repeat,
      repeating-linear-gradient(transparent 0 21px, rgba(10, 10, 10, .1) 21px 22px) 0 3px,
      #e01c1c;
    color: #fff;
  }
  :root[data-theme="light"] .obj__num,
  :root[data-theme="light"] .obj__title,
  :root[data-theme="light"] .obj__note { color: #fff; }
}
/* Columnas de fichas según el ancho del propio objeto (no de la ventana):
   2 por defecto y 3 cuando cada ficha conserva ≥ 144 px. Así ninguna
   etiqueta ("DigitalOcean", "Antigravity", "Engineering") se parte. */
.obj { container-type: inline-size; }
.obj__tray { flex: 1; align-content: start; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 490px) { .obj__tray { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.obj__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font: 400 12px/1.2 var(--font-mono);
  letter-spacing: .12em;
  color: var(--muted);
}
.tile > .osi { color: var(--muted); }
.tile:hover > .osi, .tiles:focus-visible .tile > .osi { color: var(--red-ink); }
.osi { display: flex; flex-direction: column; justify-content: center; gap: 1px; width: 22px; height: 22px; flex: none; transition: color var(--dur) ease; }
.osi i { display: block; height: 2px; background: currentColor; }
.osi i:nth-child(odd) { width: 100%; }
.osi i:nth-child(even) { width: 76%; }

/* --- objeto 01: disquete --- */
.floppy {
  position: relative;
  width: 66px;
  height: 66px;
  background: var(--bg-4);
  box-shadow: var(--bevel);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}
.floppy__shutter {
  position: absolute;
  top: 0; left: 14px;
  width: 36px; height: 24px;
  background: var(--muted);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .3), inset 2px 0 0 rgba(255, 255, 255, .3);
}
.floppy__shutter::before { content: ""; position: absolute; top: 4px; right: 6px; width: 9px; height: 15px; background: var(--bg); }
.floppy__label {
  position: absolute;
  left: 7px; right: 7px; bottom: 5px;
  height: 30px;
  background:
    linear-gradient(var(--red), var(--red)) 0 0 / 100% 4px no-repeat,
    repeating-linear-gradient(transparent 0 6px, rgba(10, 10, 10, .15) 6px 7px) 0 6px,
    var(--fg);
}
.floppy::after { content: ""; position: absolute; left: 3px; bottom: 3px; width: 4px; height: 4px; background: var(--bg); }

/* --- objeto 02: casete --- */
.cassette {
  position: relative;
  width: 74px;
  height: 50px;
  background:
    radial-gradient(circle, var(--bg) 0 1.5px, transparent 2px) 3px 3px / 68px 44px no-repeat,
    radial-gradient(circle, var(--bg) 0 1.5px, transparent 2px) 3px 3px / 4px 4px no-repeat,
    var(--bg-4);
  border-radius: var(--radius);
  box-shadow: var(--bevel);
}
.cassette::before {
  content: "";
  position: absolute;
  top: 5px; left: 7px; right: 7px;
  height: 30px;
  background: linear-gradient(var(--red), var(--red)) 0 0 / 100% 3px no-repeat, var(--fg);
}
.cassette::after {
  content: "";
  position: absolute;
  bottom: 0; left: 17px; right: 17px;
  height: 9px;
  background: var(--bg-3);
  box-shadow: var(--bevel);
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}
.cassette__window {
  position: absolute;
  z-index: 1;
  top: 14px; left: 15px; right: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px;
  background: var(--bg);
  border: 1px solid var(--bg-4);
}
.cassette__window b {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: conic-gradient(var(--fg-2) 0 12%, transparent 12% 33%, var(--fg-2) 33% 45%, transparent 45% 66%, var(--fg-2) 66% 78%, transparent 78%);
  box-shadow: 0 0 0 1.5px var(--fg-2);
}
@media (prefers-reduced-motion: no-preference) {
  .obj--cassette:hover .cassette__window b, .obj--cassette:focus-within .cassette__window b { animation: spin 1.3s linear infinite; }
  .obj--cassette:hover .cassette__window b + b, .obj--cassette:focus-within .cassette__window b + b { animation-direction: reverse; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- objeto 03: disco duro --- */
.hdd {
  position: relative;
  width: 60px;
  height: 74px;
  background:
    radial-gradient(circle, var(--bg) 0 1.5px, transparent 2px) 3px 3px / 54px 68px no-repeat,
    var(--bg-4);
  border-radius: var(--radius);
  box-shadow: var(--bevel);
}
.hdd__platter {
  position: absolute;
  top: 7px; left: 6px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--fg-2) 0 4px, var(--bg-4) 4px 6px, transparent 6px),
    repeating-radial-gradient(circle, var(--bg-3) 0 2px, var(--bg-2) 2px 3.5px);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 0 2px var(--bg-3);
}
.hdd__arm {
  position: absolute;
  right: 8px; bottom: 8px;
  width: 4px; height: 36px;
  background: var(--fg-2);
  transform-origin: 50% 100%;
  transform: rotate(-34deg);
  transition: transform .5s var(--ease-step);
}
.hdd__arm::before { content: ""; position: absolute; top: -2px; left: -1px; width: 6px; height: 7px; background: var(--red); }
.hdd__arm::after { content: ""; position: absolute; bottom: -3px; left: -3px; width: 10px; height: 10px; background: var(--muted); }
.obj--hdd:hover .hdd__arm, .obj--hdd:focus-within .hdd__arm { transform: rotate(-12deg); }

/* --- objeto 04: chip --- */
.chipart {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  background: var(--bg-4);
  box-shadow: var(--bevel);
}
.chipart::before, .chipart::after {
  content: "";
  position: absolute;
  z-index: -1;
}
.chipart::before {
  left: 6px; right: 6px; top: -8px; bottom: -8px;
  background:
    repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 7px) top / 100% 8px no-repeat,
    repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 7px) bottom / 100% 8px no-repeat;
}
.chipart::after {
  top: 6px; bottom: 6px; left: -8px; right: -8px;
  background:
    repeating-linear-gradient(var(--muted) 0 3px, transparent 3px 7px) left / 8px 100% no-repeat,
    repeating-linear-gradient(var(--muted) 0 3px, transparent 3px 7px) right / 8px 100% no-repeat;
}
.chipart__die {
  position: relative;
  padding: 7px 6px 6px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  font: 700 14px/1 var(--font-mono);
  font-style: normal;
  color: var(--red-ink);
  letter-spacing: .04em;
}
.chipart__die::before { content: ""; position: absolute; left: -9px; top: -9px; width: 4px; height: 4px; border-radius: 50%; background: var(--fg-2); }
.obj--chip:hover .chipart__die, .obj--chip:focus-within .chipart__die { text-shadow: 0 0 8px var(--red-glow); border-color: var(--red); }

/* --- objeto 05: rack de servidor --- */
.rack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 72px;
  padding: 5px 7px;
  background: var(--bg-3);
  border-left: 5px solid var(--bg-4);
  border-right: 5px solid var(--bg-4);
  box-shadow: var(--bevel);
}
.rack i {
  position: relative;
  display: block;
  height: 16px;
  background:
    repeating-linear-gradient(90deg, var(--bg-2) 0 2px, transparent 2px 5px) 5px 50% / 30px 8px no-repeat,
    var(--bg-4);
  box-shadow: var(--bevel);
}
.rack .led { position: absolute; right: 5px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; box-shadow: 0 0 6px var(--red-glow); }
.rack .led--off { box-shadow: inset 0 0 0 1px var(--line-strong); }

/* --- objeto 06: switch de red --- */
.switch {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px 4px;
  width: 74px;
  padding: 9px 7px 7px;
  background:
    linear-gradient(var(--red), var(--red)) 7px 3px / 14px 2px no-repeat,
    var(--bg-4);
  box-shadow: var(--bevel);
}
.switch i {
  position: relative;
  display: block;
  height: 13px;
  background: var(--bg);
  clip-path: polygon(0 28%, 22% 28%, 22% 0, 78% 0, 78% 28%, 100% 28%, 100% 100%, 0 100%);
}
.switch i.on::after { content: ""; position: absolute; left: 2px; bottom: 2px; width: 3px; height: 3px; background: var(--red); }
.switch i:not(.on)::after { content: ""; position: absolute; left: 2px; bottom: 2px; width: 3px; height: 3px; background: var(--bg-4); }

/* --- objeto 07: placa de circuito --- */
.pcb {
  position: relative;
  width: 74px;
  height: 56px;
  background:
    radial-gradient(circle, var(--bg) 0 2px, transparent 2.5px) 4px 4px / 66px 48px no-repeat,
    var(--bg-4);
  box-shadow: var(--bevel);
}
.pcb i { position: absolute; display: block; height: 2px; background: var(--muted); }
.pcb i:nth-child(1) { left: 8px; top: 14px; width: 26px; }
.pcb i:nth-child(2) { left: 8px; top: 28px; width: 18px; }
.pcb i:nth-child(3) { right: 8px; top: 40px; width: 30px; background: var(--red); }
.pcb i::after { content: ""; position: absolute; right: -3px; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--fg-2); }
.pcb b { position: absolute; right: 10px; top: 9px; width: 22px; height: 22px; background: var(--bg-3); box-shadow: 0 0 0 1px var(--line-strong); }
.obj--pcb:hover .pcb i:nth-child(3), .obj--pcb:focus-within .pcb i:nth-child(3) { box-shadow: 0 0 6px var(--red-glow); }
/* el séptimo grupo ocupa toda la fila: cabeza a la izquierda, fichas a la derecha */
.obj--pcb { grid-column: 1 / -1; }
@media (min-width: 701px) {
  .obj--pcb { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 26px; }
  .obj--pcb > .obj__head { flex: 0 1 320px; }
  .obj--pcb > .obj__tray { flex: 1 1 280px; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }
  .obj--pcb > .obj__foot { flex: 1 0 100%; }
}

@media (max-width: 1100px) { .objs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .objs { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .obj__head { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; }
  .obj__art { width: 64px; height: 64px; transform: scale(.82); }
}

/* ---------- EXPERIENCIA: línea de tiempo ---------- */
.timeline { position: relative; display: grid; gap: 22px; list-style: none; }
.timeline::before {
  content: "";
  position: absolute;
  left: 11px; top: 14px; bottom: 26px;
  width: 2px;
  background: linear-gradient(var(--red), var(--line-strong) 26%, var(--line-strong));
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  padding-left: 46px;
  align-items: start;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 22px; top: 25px;
  width: 22px;
  border-top: 2px dotted var(--line-strong);
}
.tl-node {
  position: absolute;
  left: 3px; top: 17px;
  width: 18px; height: 18px;
  background: var(--bg);
  border: 2px solid var(--red);
  box-shadow: 2px 2px 0 var(--shade);
}
.tl-item--main .tl-node { background: var(--red); box-shadow: 0 0 12px var(--red-glow), 2px 2px 0 var(--shade); }
.tl-stamp {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--bevel), 3px 4px 0 var(--shade);
}
.tl-stamp__big { font: 700 30px/1 var(--font-mono); letter-spacing: .02em; color: var(--red-ink); text-decoration: none; }
abbr.tl-stamp__big { cursor: help; }
.tl-stamp__sub { font: 400 12px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tl-card { padding: 18px 22px 20px; }
.tl-card { box-shadow: inset 0 2px 0 var(--win-strip), var(--bevel), var(--shadow-hard); }
.tl-card__ctrls { position: absolute; top: 10px; right: 10px; }
.tl-card__file { font: 700 12px/1.2 var(--font-mono); letter-spacing: .14em; color: var(--muted); padding-right: 64px; }
.tl-card__title { margin-top: 8px; font-size: clamp(20px, 2vw, 25px); line-height: 1.15; }
.tl-card__meta { margin-top: 6px; font: 700 13px/1.4 var(--font-mono); color: var(--fg); letter-spacing: .02em; }
.tl-item:not(.tl-item--main) .tl-card__meta { color: var(--fg-2); }
.tl-card__desc { margin-top: 10px; color: var(--fg-2); max-width: 70ch; }
.ai__note { margin-top: 22px; padding-left: 46px; font-family: var(--font-mono); font-size: 12px; }

/* cursos y diplomados, debajo de la línea de tiempo */
.certs { margin-top: 34px; padding-left: 46px; }
.certs__title { font: 700 13px/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red-ink); }
.certs__list { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; list-style: none; }
.certs__item { padding: 14px 18px 16px; box-shadow: inset 0 2px 0 var(--win-strip), var(--bevel), var(--shadow-hard); }
.certs__name { font: 700 17px/1.25 var(--font-display); color: var(--fg); }
.certs__meta { margin-top: 6px; font: 400 13px/1.4 var(--font-mono); color: var(--fg-2); }
/* miniatura de la constancia: se ve entera y abre el visor; la etiqueta va
   en una franja debajo para no tapar la imagen (D-1184, D-1219) */
.certs__shot {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 14px;
  padding: 0;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: zoom-in;
  overflow: hidden;
  text-align: left;
}
.certs__frame { display: grid; place-items: center; height: 160px; padding: 10px; }
.certs__frame img { display: block; max-width: 100%; max-height: 140px; width: auto; height: auto; object-fit: contain; box-shadow: 0 0 0 1px var(--line), 3px 4px 0 var(--shade); }
.certs__zoom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-4);
  border-top: 1px solid var(--line-strong);
  font: 700 11px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg);
}
.certs__zoom .pi { width: 14px; height: 14px; }
.certs__shot:hover, .certs__shot:focus-visible { border-color: var(--red); }
.certs__shot:hover .certs__zoom, .certs__shot:focus-visible .certs__zoom { color: var(--red-ink); border-top-color: var(--red); }

/* visor de constancias (<dialog>): la imagen nunca se recorta y la ventana se
   ajusta a ella; el botón de la imagen alterna entre ajustada y tamaño real */
html.has-modal { overflow: hidden; }
.cert-lb { width: min(96vw, 1180px); max-width: 96vw; max-height: 96svh; margin: auto; padding: 0; border: 0; background: transparent; color: var(--fg); overflow: visible; }
.cert-lb::backdrop { background: radial-gradient(ellipse at center, rgba(40, 6, 6, .55), rgba(0, 0, 0, .9) 70%), rgba(0, 0, 0, .82); }
.cert-lb__win { display: flex; flex-direction: column; max-height: 96svh; }
.cert-lb__win > * { flex-shrink: 0; }
.cert-lb__bar { gap: 12px; }
.cert-lb__title {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}
.cert-lb__close {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -4px -4px -4px auto;
  background: var(--bg-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--bevel);
  color: var(--fg);
}
.cert-lb__close .pi { width: 20px; height: 20px; }
.cert-lb__close:hover { border-color: var(--red); color: var(--red-ink); }
.cert-lb__media.cert-lb__media {
  flex-shrink: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 14px;
  background: var(--bg-3);
  overflow: auto;
  overscroll-behavior: contain;
}
.cert-lb__zoom { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.cert-lb__zoom:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.cert-lb__zoom img {
  display: block;
  max-width: 100%;
  max-height: min(calc(96svh - 170px), 840px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 0 0 1px var(--line-strong), 6px 8px 0 var(--shade);
}
.cert-lb__zoom { max-width: 100%; }
.cert-lb__media.is-zoomed { height: min(calc(96svh - 120px), 900px); align-items: flex-start; justify-content: flex-start; }
.cert-lb__media.is-zoomed .cert-lb__zoom { max-width: none; cursor: zoom-out; }
.cert-lb__media.is-zoomed img { max-width: none; max-height: none; }
.cert-lb__hint { padding: 8px 14px 10px; font: 400 12px/1.4 var(--font-mono); color: var(--muted); }
@media (max-width: 760px) {
  .tl-item { grid-template-columns: minmax(0, 1fr); gap: 10px; padding-left: 40px; }
  .tl-stamp { flex-direction: row; align-items: baseline; flex-wrap: wrap; justify-self: start; gap: 4px 12px; padding: 9px 12px; }
  .tl-stamp__big { font-size: 24px; }
  .tl-item::before { width: 16px; }
  .ai__note, .certs { padding-left: 40px; }
}

/* ---------- SOBRE MÍ: SOBRE_MI.TXT ---------- */
.about-win__icon { width: 16px; height: 16px; color: var(--red-ink); }
.about-win__body { display: grid; grid-template-columns: minmax(250px, .78fr) minmax(0, 1.7fr) auto; }
.about-win__side { display: flex; align-items: flex-start; justify-content: center; padding: 30px clamp(22px, 3vw, 40px) 32px 0; background: var(--bg); }
.about-photo { width: clamp(200px, 19vw, 260px); height: clamp(200px, 19vw, 260px); --step: 10px; padding: 4px; }
.about-photo img { --step: 7px; }
.props { padding: 22px 24px 24px; border-right: 1px solid var(--line); background: var(--bg-2); }
.props__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font: 700 12px/1.2 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.props__title .pi { width: 16px; height: 16px; color: var(--red-ink); }
.props__list > div { padding: 11px 0 12px; border-bottom: 1px dotted var(--line-strong); }
.props__list > div:last-child { border-bottom: 0; }
.props__list dt { font: 700 12px/1.3 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.props__list dd { margin-top: 4px; font-size: 15px; line-height: 1.5; color: var(--fg); }
.about-win__text {
  padding: 26px clamp(20px, 3vw, 36px) 32px;
  background:
    linear-gradient(rgba(var(--ink-rgb), .045) 1px, transparent 1px) 0 25px / 100% 30px,
    var(--bg);
}
.about-win__bio { font-size: 17px; line-height: 30px; color: var(--fg-2); max-width: 66ch; }
.about-win__quote {
  margin-top: 30px;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--red);
  font: 600 clamp(21px, 2.2vw, 28px)/1.32 var(--font-display);
  letter-spacing: -.01em;
  color: var(--fg);
  max-width: 34em;
}
.caret {
  display: inline-block;
  width: .48em;
  height: .95em;
  margin-left: 8px;
  vertical-align: -.1em;
  background: var(--red);
  animation: caret-blink 1.1s var(--ease-step) infinite;
}
[data-anim]:not(.is-onscreen) .caret { animation-play-state: paused; }
@media (max-width: 1100px) {
  .about-win__body { grid-template-columns: minmax(250px, .78fr) minmax(0, 1.7fr); }
  .about-win__side { grid-column: 1 / -1; padding: 8px 20px 30px; border-top: 1px dotted var(--line-strong); }
  .about-photo { margin-top: 22px; }
}
@media (max-width: 820px) {
  .about-win__body { grid-template-columns: minmax(0, 1fr); }
  .props { border-right: 0; border-bottom: 1px solid var(--line); }
  .props__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .props__list > div:nth-last-child(2) { border-bottom: 0; }
}
@media (max-width: 520px) {
  .props__list { grid-template-columns: minmax(0, 1fr); }
  .props__list > div:nth-last-child(2) { border-bottom: 1px dotted var(--line-strong); }
  .win__menu { gap: 14px; }
  .win__status-right { display: none; }
}

/* ---------- CONTACTO: 3 ventanas ---------- */
.contact { overflow: hidden; }
.contact__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 90% at 50% 0%, rgba(255, 32, 32, .07), transparent 70%);
  pointer-events: none;
}
.contact .wrap { position: relative; }
.cgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.ccard__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1;
  padding: 30px 22px 22px;
  text-align: center;
}
.ccard__icon {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  background:
    radial-gradient(circle at 1px 1px, rgba(var(--ink-rgb), .08) 1px, transparent 1.5px) 0 0 / 6px 6px,
    var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--bevel-pressed);
  color: var(--fg);
}
.ccard__icon .pi { width: 72px; height: 72px; transition: color var(--dur) ease; }
.ccard:hover .ccard__icon .pi, .ccard:focus-within .ccard__icon .pi { color: var(--red-ink); }
.ccard__info { display: grid; gap: 6px; min-width: 0; }
.ccard__handle { font: 700 13px/1.45 var(--font-mono); color: var(--fg); overflow-wrap: anywhere; }
/* en 3 columnas, cada dirección reserva 2 líneas: subtítulos y reglas alineados */
@media (min-width: 961px) { .ccard__handle { min-height: calc(2 * 1.45em); } }
.ccard__tag { font-size: 15px; color: var(--muted); }
.ccard__actions {
  width: 100%;
  margin-top: auto;
  padding-top: 18px;
  border-top: 2px dotted var(--line-strong);
}
.ccard__copy { justify-self: center; margin-top: 4px; }
.ccard__copy.is-done { border-color: var(--red); }
.ccard__copy.is-done .pi { color: var(--red-ink); }
@media (hover: hover) {
  .ccard:hover .ccard__btn { --btn-bg: var(--red); --btn-fg: var(--on-red); --btn-bd: var(--red); }
  .ccard:hover .ccard__btn .btn__arrow { color: var(--on-red); }
}
.ccard__btn:focus-visible { --btn-bg: var(--red); --btn-fg: var(--on-red); --btn-bd: var(--red); outline-color: var(--fg); }
@media (max-width: 960px) {
  .cgrid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ccard__body { flex-direction: row; flex-wrap: wrap; align-items: center; text-align: left; padding: 20px; gap: 14px 18px; }
  .ccard__icon { width: 72px; height: 72px; }
  .ccard__icon .pi { width: 48px; height: 48px; }
  .ccard__info { flex: 1 1 220px; }
  .ccard__actions { flex: 1 1 100%; padding-top: 14px; }
}
@media (min-width: 640px) and (max-width: 960px) {
  .ccard__actions { flex: 0 0 auto; width: auto; margin-top: 0; padding-top: 0; border-top: 0; }
  .ccard__btn { width: auto; }
}
@media (max-width: 960px) { .ccard__copy { justify-self: start; } }
