/* =========================================================
   EFECTOS Y PIEZAS NUEVAS
   Secciones · transición de tele · tinta y píxeles · sonido ·
   máquinas expendedoras · rótulo LED · fotos pixeladas ·
   404 · placa Arduino · monitor serie ·
   cable USB · cargadores
   ========================================================= */

/* Lo que lleva el atributo hidden no se muestra nunca, aunque su clase le dé display */
[hidden] { display: none !important; }

/* ---------- Secciones en una sola página ---------- */
.js .view { display: none; }
.js[data-view="inicio"] #inicio,
.js[data-view="sobre-mi"] #sobre-mi,
.js[data-view="proyectos"] #proyectos,
.js[data-view="servicios"] #servicios,
.js[data-view="laboratorio"] #laboratorio,
.js[data-view="contacto"] #contacto,
.js[data-view="legal"] #legal,
.js[data-view="perdido"] #perdido { display: block; }
html:not(.js) #perdido { display: none; }
.view { min-height: 100vh; min-height: 100svh; }
.view h1:focus, #contenido:focus { outline: none; }

/* ---------- Transición de tele antigua (View Transitions) ---------- */
.nav { view-transition-name: site-nav; }
html.vt-crt::view-transition { background: #000; }
html.vt-crt::view-transition-old(root) { animation: crtOff .36s cubic-bezier(.7, 0, .84, 0) both; }
html.vt-crt::view-transition-new(root) { animation: crtOn .52s .32s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes crtOff {
  0% { transform: none; filter: none; opacity: 1; }
  50% { transform: scale(1, .008); filter: brightness(4) saturate(.2); opacity: 1; }
  80% { transform: scale(.03, .008); filter: brightness(6); opacity: 1; }
  100% { transform: scale(0, 0); opacity: 0; }
}
@keyframes crtOn {
  0% { transform: scale(0, .008); filter: brightness(6); opacity: 1; }
  35% { transform: scale(1, .008); filter: brightness(4); }
  70% { transform: scale(1, 1.015); filter: brightness(1.4) contrast(1.1); }
  100% { transform: none; filter: none; }
}

/* Misma idea para navegadores sin View Transitions */
.crt { position: fixed; inset: 0; z-index: 140; pointer-events: none; visibility: hidden; }
.crt__top, .crt__bottom { position: absolute; left: 0; right: 0; height: 50.5%; background: #000; transform: scaleY(0); }
.crt__top { top: 0; transform-origin: top; }
.crt__bottom { bottom: 0; transform-origin: bottom; }
.crt__line {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 3px;
  margin-top: -1.5px;
  background: #fff;
  box-shadow: 0 0 20px 6px var(--accent-2), 0 0 60px 12px var(--accent);
  transform: scaleX(0);
  opacity: 0;
}
.crt.is-off, .crt.is-on { visibility: visible; }
.crt.is-off .crt__top, .crt.is-off .crt__bottom { animation: crtClose .3s cubic-bezier(.7, 0, .84, 0) forwards; }
.crt.is-off .crt__line { animation: crtLineOff .4s forwards; }
.crt.is-on .crt__top, .crt.is-on .crt__bottom { animation: crtOpen .46s .1s cubic-bezier(.16, 1, .3, 1) both; }
.crt.is-on .crt__line { animation: crtLineOn .3s both; }
@keyframes crtClose { to { transform: scaleY(1); } }
@keyframes crtOpen { from { transform: scaleY(1); } to { transform: scaleY(0); } }
@keyframes crtLineOff { 0%, 60% { opacity: 0; transform: scaleX(1); } 70% { opacity: 1; transform: scaleX(1); } 100% { opacity: 1; transform: scaleX(0); } }
@keyframes crtLineOn { 0% { opacity: 1; transform: scaleX(0); } 60% { opacity: 1; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(1); } }

/* Barra fina de carga al cambiar de sección */
.route-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 160;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-3), var(--accent), var(--accent-2), #fff);
  box-shadow: 0 0 14px var(--accent-2);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  pointer-events: none;
}
.route-bar.is-loading { opacity: 1; animation: barLoad 1.2s cubic-bezier(.1, .7, .2, 1) forwards; }
.route-bar.is-done { animation: barDone .45s ease forwards; }
@keyframes barLoad { from { transform: scaleX(0); } to { transform: scaleX(.8); } }
@keyframes barDone { from { transform: scaleX(.8); opacity: 1; } 60% { transform: scaleX(1); opacity: 1; } to { transform: scaleX(1); opacity: 0; } }

/* ---------- Rojo que se derrama como tinta ---------- */
:root {
  --ink-x: 50vw;
  --ink-y: 50vh;
  --ink-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='%23000'%3E%3Ccircle cx='100' cy='100' r='74'/%3E%3Ccircle cx='100' cy='24' r='17'/%3E%3Ccircle cx='158' cy='46' r='21'/%3E%3Ccircle cx='180' cy='104' r='14'/%3E%3Ccircle cx='156' cy='160' r='23'/%3E%3Ccircle cx='98' cy='180' r='15'/%3E%3Ccircle cx='40' cy='158' r='20'/%3E%3Ccircle cx='20' cy='96' r='15'/%3E%3Ccircle cx='46' cy='38' r='22'/%3E%3Ccircle cx='132' cy='9' r='6'/%3E%3Ccircle cx='194' cy='70' r='5'/%3E%3Ccircle cx='190' cy='148' r='6'/%3E%3Ccircle cx='64' cy='194' r='5'/%3E%3Ccircle cx='7' cy='132' r='6'/%3E%3Ccircle cx='11' cy='54' r='4'/%3E%3C/g%3E%3C/svg%3E");
}
:root.no-accent-tr { transition: none !important; }
html.vt-ink::view-transition-old(root) { animation: none; }
html.vt-ink::view-transition-new(root) {
  animation: inkGrow 1s cubic-bezier(.3, .6, .2, 1) both;
  -webkit-mask-image: var(--ink-mask);
  mask-image: var(--ink-mask);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
@keyframes inkGrow {
  from {
    -webkit-mask-size: 0 0; mask-size: 0 0;
    -webkit-mask-position: var(--ink-x) var(--ink-y); mask-position: var(--ink-x) var(--ink-y);
  }
  to {
    -webkit-mask-size: 440vmax 440vmax; mask-size: 440vmax 440vmax;
    -webkit-mask-position: calc(var(--ink-x) - 220vmax) calc(var(--ink-y) - 220vmax);
    mask-position: calc(var(--ink-x) - 220vmax) calc(var(--ink-y) - 220vmax);
  }
}
.ink-layer {
  position: fixed;
  inset: 0;
  z-index: 135;
  pointer-events: none;
  background: radial-gradient(circle at var(--ink-x) var(--ink-y), #ff6a7c, #ff2d4a 30%, #b3001f);
  -webkit-mask-image: var(--ink-mask);
  mask-image: var(--ink-mask);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 0 0;
  mask-size: 0 0;
  opacity: 0;
}
.ink-layer.is-going { animation: inkLayer 1.15s cubic-bezier(.3, .6, .2, 1) both; }
@keyframes inkLayer {
  0% { opacity: 1; -webkit-mask-size: 0 0; mask-size: 0 0; -webkit-mask-position: var(--ink-x) var(--ink-y); mask-position: var(--ink-x) var(--ink-y); }
  40% { opacity: 1; -webkit-mask-size: 440vmax 440vmax; mask-size: 440vmax 440vmax; -webkit-mask-position: calc(var(--ink-x) - 220vmax) calc(var(--ink-y) - 220vmax); mask-position: calc(var(--ink-x) - 220vmax) calc(var(--ink-y) - 220vmax); }
  100% { opacity: 0; -webkit-mask-size: 440vmax 440vmax; mask-size: 440vmax 440vmax; -webkit-mask-position: calc(var(--ink-x) - 220vmax) calc(var(--ink-y) - 220vmax); mask-position: calc(var(--ink-x) - 220vmax) calc(var(--ink-y) - 220vmax); }
}

/* Reinicio en píxeles al volver al azul */
.fx-layer { position: fixed; inset: 0; z-index: 136; display: none; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; }
.fx-layer.is-on { display: block; }

/* ---------- Botón de sonido ---------- */
.snd {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px; height: 44px;
  margin-left: auto;
  border-radius: 13px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  transition: color .3s, border-color .3s, background .3s;
}
.snd[hidden] { display: none; }
.snd:hover { color: var(--text); border-color: var(--a-60); }
.snd svg { grid-area: 1 / 1; width: 20px; height: 20px; }
.snd__on, .snd[aria-pressed="true"] .snd__off { display: none; }
.snd[aria-pressed="true"] .snd__on { display: block; }
.snd[aria-pressed="true"] { color: var(--accent-2); border-color: var(--a-40); background: var(--a-08); }
.snd__bars { position: absolute; right: 6px; bottom: 6px; display: flex; align-items: flex-end; gap: 1.5px; height: 8px; opacity: 0; transition: opacity .3s; }
.snd__bars i { width: 2px; height: 100%; border-radius: 1px; background: var(--accent-2); transform-origin: bottom; animation: eq .7s ease-in-out infinite alternate; }
.snd__bars i:nth-child(2) { animation-delay: -.3s; }
.snd__bars i:nth-child(3) { animation-delay: -.55s; }
.snd[aria-pressed="true"] .snd__bars { opacity: 1; }
@keyframes eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.nav__toggle { margin-left: 10px; }
.snd[hidden] ~ .nav__toggle { margin-left: auto; }
@media (min-width: 1024px) { .snd { margin-left: 6px; } }

/* =========================================================
   MÁQUINA EXPENDEDORA (menú)
   ========================================================= */
.vm {
  position: relative;
  width: min(100%, 410px);
  margin-inline: auto;
  padding: 12px 12px 14px;
  border-radius: 24px 24px 18px 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .07), transparent 12%, transparent 88%, rgba(0, 0, 0, .25)),
    linear-gradient(170deg, #1b2a4b, #0c1428 55%, #070c18);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, .07),
    inset 0 -10px 0 rgba(0, 0, 0, .35),
    0 40px 80px -30px rgba(0, 0, 0, .9),
    0 0 60px -20px var(--a-60);
  font-family: var(--font-mono);
  user-select: none;
  -webkit-user-select: none;
}
.vm.is-thud { animation: vmThud .26s ease; }
@keyframes vmThud { 30% { transform: translateY(2px); } 60% { transform: translateY(-1px); } }
.vm__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.vm__brand { font-family: var(--font-display); font-size: 11px; letter-spacing: .3em; color: #cfe2ff; }
.vm__brand b { font-weight: 400; color: var(--accent-2); text-shadow: 0 0 10px var(--accent), 0 0 2px #fff; }
.vm__lamp { width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 10px #3ddc84; animation: blink 2.4s steps(2) infinite; }
.vm.is-busy .vm__lamp { background: #ffc233; box-shadow: 0 0 12px #ffc233; animation-duration: .4s; }
.vm__body { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 10px; }

.vm__glass {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 10px 6px 6px;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(140, 200, 255, .16), transparent 70%),
    linear-gradient(180deg, #060c1a, #0b1730);
  box-shadow: inset 0 0 0 2px rgba(160, 200, 255, .16), inset 0 0 40px rgba(0, 0, 0, .7);
}
.vm__glass::before {
  content: "";
  position: absolute;
  left: 8%; right: 8%; top: 0;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: #e9f4ff;
  box-shadow: 0 0 18px 4px rgba(170, 215, 255, .55);
}
.vm__shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .08) 38%, transparent 46%, transparent 60%, rgba(255, 255, 255, .05) 64%, transparent 70%);
  animation: vmShine 7s ease-in-out infinite;
}
@keyframes vmShine { 0%, 100% { transform: translateX(-30%); } 50% { transform: translateX(30%); } }
.vm__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding-bottom: 4px; border-bottom: 3px solid #1b2a47; box-shadow: 0 2px 0 rgba(255, 255, 255, .05); }
.vm__slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 112px;
  padding: 0 0 26px;
  border-radius: 8px;
  transition: background .25s;
  -webkit-tap-highlight-color: transparent;
}
.vm__slot:hover, .vm__slot:focus-visible { background: rgba(120, 180, 255, .08); }
.vm__slot:focus-visible { outline-offset: -2px; }
.vm__coil {
  position: absolute;
  left: 10%; right: 10%; bottom: 15px;
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(100deg, transparent 0 30%, #b9c9de 30% 45%, #6f8199 45% 55%, transparent 55%) 0 0 / 8px 100% repeat-x;
  opacity: .85;
}
.vm__slot.is-vending .vm__coil { animation: coil .22s linear infinite; }
@keyframes coil { to { background-position: 8px 0; } }
.vm__code {
  position: absolute;
  left: 50%; bottom: 0;
  padding: 1px 7px;
  border-radius: 4px;
  background: #02060f;
  box-shadow: inset 0 0 0 1px var(--a-40);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-shadow: 0 0 6px var(--accent);
  transform: translateX(-50%);
}

.vm__prod {
  --c1: #3aa0ff;
  --c2: #0b3b9a;
  position: relative;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .5));
  transition: transform .5s var(--ease), opacity .3s;
}
.vm__slot:hover .vm__prod { transform: translateY(-3px) rotate(-3deg); }
.vm__slot.is-vending .vm__prod { animation: prodPush .78s ease-in forwards; }
@keyframes prodPush { 70% { transform: translateY(2px) scale(1.06); } 100% { transform: translateY(4px) scale(1.1); } }
.vm__prod.is-gone { opacity: 0; transition: none; }
.vm__prod.is-restock { animation: restock .6s var(--ease) both; }
@keyframes restock { from { opacity: 0; transform: translateY(-30px) scale(.8); } }
.vm__plabel {
  font-family: var(--font-body);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
  white-space: nowrap;
  pointer-events: none;
}
.vm__prod--blue { --c1: #3aa0ff; --c2: #0b3b9a; }
.vm__prod--red { --c1: #ff4d64; --c2: #8f0b1f; }
.vm__prod--orange { --c1: #ff8a2b; --c2: #b33f00; }
.vm__prod--purple { --c1: #b46bff; --c2: #4b1590; }
.vm__prod--green { --c1: #4de8a8; --c2: #0d7a4f; }
.vm__prod--pink { --c1: #ff6bb5; --c2: #7a1fd0; }
.vm__prod--can { width: 30px; height: 56px; border-radius: 6px 6px 5px 5px; background: linear-gradient(90deg, var(--c2), var(--c1) 30%, #fff 42%, var(--c1) 55%, var(--c2)); }
.vm__prod--can::before {
  content: "";
  position: absolute;
  left: 3px; right: 3px; top: -3px;
  height: 5px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(90deg, #8b97a8, #e3e9f1, #8b97a8);
}
.vm__prod--can .vm__plabel, .vm__prod--bottle .vm__plabel, .vm__prod--box .vm__plabel { writing-mode: vertical-rl; transform: rotate(180deg); }
.vm__prod--chips {
  width: 46px; height: 60px;
  filter: none;
  background: radial-gradient(ellipse at 50% 62%, rgba(255, 255, 255, .35), transparent 42%), linear-gradient(160deg, var(--c1), var(--c2));
  clip-path: polygon(0 4%, 10% 0, 20% 4%, 30% 0, 40% 4%, 50% 0, 60% 4%, 70% 0, 80% 4%, 90% 0, 100% 4%, 96% 50%, 100% 96%, 90% 100%, 80% 96%, 70% 100%, 60% 96%, 50% 100%, 40% 96%, 30% 100%, 20% 96%, 10% 100%, 0 96%, 4% 50%);
}
.vm__prod--bar { width: 54px; height: 26px; border-radius: 4px; background: linear-gradient(90deg, #c9d3e0 0 6px, var(--c1) 6px calc(100% - 6px), #c9d3e0 calc(100% - 6px)); box-shadow: inset 0 -6px 0 var(--c2); }
.vm__prod--bottle {
  width: 24px; height: 62px;
  margin-top: 12px;
  border-radius: 9px 9px 6px 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .55) 35%, rgba(255, 255, 255, .15) 60%), linear-gradient(var(--c1), var(--c2));
}
.vm__prod--bottle::before {
  content: "";
  position: absolute;
  left: 50%; top: -12px;
  width: 10px; height: 12px;
  margin-left: -5px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(#fff 0 4px, rgba(255, 255, 255, .45) 4px);
}
.vm__prod--box { width: 34px; height: 50px; border-radius: 3px; background: linear-gradient(90deg, var(--c2), var(--c1) 40%, var(--c1) 70%, var(--c2)); }
.vm__prod--box::before { content: ""; position: absolute; right: 6px; top: -12px; width: 3px; height: 14px; border-radius: 2px; background: #fff; transform: rotate(12deg); }
.vm__falling { position: absolute; z-index: 6; margin: 0; pointer-events: none; transition: none; }

.vm__panel { display: flex; flex-direction: column; gap: 8px; padding: 8px 7px; border-radius: 12px; background: linear-gradient(180deg, #111c36, #0a1122); box-shadow: inset 0 0 0 1px var(--line-2); }
.vm__lcd {
  display: grid;
  place-items: center;
  min-height: 50px;
  padding: 6px 4px;
  border-radius: 6px;
  background: #020a14;
  box-shadow: inset 0 0 0 1px rgba(98, 208, 255, .25), inset 0 0 14px rgba(0, 0, 0, .8);
  color: var(--accent-2);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .06em;
  text-align: center;
  text-shadow: 0 0 6px var(--accent);
}
.vm__lcd.is-on span { animation: lcdBlink .9s steps(2) infinite; }
.vm__lcd.is-err { color: #ff6b81; text-shadow: 0 0 6px #ff2d4a; }
.vm__lcd.is-ok { color: #4de8a8; text-shadow: 0 0 6px #1fbf7a; }
@keyframes lcdBlink { 50% { opacity: .55; } }
.vm__keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.vm__key {
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(#2a3753, #161f33);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 2px 0 #04070e;
  color: #e1ebff;
  font-size: 12px;
  font-weight: 700;
  transition: transform .08s, box-shadow .08s, background .2s;
}
.vm__key:hover { background: linear-gradient(#34446a, #1c2742); }
.vm__key:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
.vm__key--clear { color: #ff8a98; }
.vm__coin { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 6px; border-radius: 8px; background: #070d1b; box-shadow: inset 0 0 0 1px var(--line); }
.vm__coin small { font-size: 7.5px; letter-spacing: .2em; color: var(--dim); }
.vm__coinslot { width: 6px; height: 22px; border-radius: 3px; background: #000; box-shadow: inset 0 0 0 1px #2d3a55, 0 0 8px var(--a-40); transition: box-shadow .3s; }
.vm.is-busy .vm__coinslot { box-shadow: inset 0 0 0 1px var(--accent-2), 0 0 14px var(--accent-2); }
.vm__tray {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 60px;
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(#02050c, #0a1222);
  box-shadow: inset 0 8px 16px rgba(0, 0, 0, .85), inset 0 0 0 2px rgba(160, 200, 255, .12);
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .24em;
  cursor: default;
}
.vm__tray:disabled { cursor: default; }
.vm__flap { position: absolute; left: 6%; right: 6%; top: 6px; height: 12px; border-radius: 0 0 8px 8px; background: linear-gradient(rgba(170, 210, 255, .2), rgba(170, 210, 255, .05)); }
.vm__traytxt { position: relative; z-index: 1; }
.vm__tray.is-ready {
  color: var(--accent-2);
  cursor: pointer;
  box-shadow: inset 0 8px 16px rgba(0, 0, 0, .85), inset 0 0 0 2px var(--accent-2), 0 0 24px -4px var(--accent);
  animation: trayPulse 1s ease-in-out infinite;
}
@keyframes trayPulse { 50% { box-shadow: inset 0 8px 16px rgba(0, 0, 0, .85), inset 0 0 0 2px var(--accent-2), 0 0 36px 0 var(--accent); } }

/* Menú del móvil a pantalla completa */
.vmenu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--nav-h) + 6px) 16px 24px;
  background:
    radial-gradient(ellipse at 50% 30%, var(--a-15), transparent 60%),
    color-mix(in srgb, var(--bg) 93%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility 0s .4s;
}
/* Al abrir, visible al instante (para poder enfocar el primer producto); al cerrar, tras el fundido */
.vmenu.is-open { opacity: 1; visibility: visible; transition: opacity .4s var(--ease), visibility 0s; }
.vmenu__inner { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(100%, 400px); margin: auto; }
.vmenu__hint { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: center; }
.vmenu__machine { width: 100%; opacity: 0; transform: translateY(40px) scale(.94); transition: transform .6s var(--ease), opacity .5s; }
.vmenu.is-open .vmenu__machine { opacity: 1; transform: none; }
.vmenu__cta { width: 100%; }
@media (min-width: 1024px) { .vmenu { display: none; } }
@media (max-height: 700px) {
  .vmenu .vm__slot { height: 96px; padding-bottom: 24px; }
  .vmenu .vm__tray { height: 48px; }
}

/* =========================================================
   RÓTULO LED
   ========================================================= */
.led {
  position: relative;
  z-index: 2;
  padding: 14px 0;
  border-block: 1px solid var(--line-2);
  background:
    radial-gradient(ellipse 60% 120% at 50% 50%, var(--a-08), transparent 70%),
    linear-gradient(180deg, #02040a, #050a15 50%, #02040a);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .9), 0 0 60px -20px var(--a-40);
}
.led__canvas { display: block; width: calc(100% - 64px); height: 99px; margin: 0 auto; cursor: crosshair; touch-action: pan-y; }
.led__screw { position: absolute; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #9aa8bd, #3a4458); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5); }
.led__screw::after { content: ""; position: absolute; left: 2px; right: 2px; top: 50%; height: 1.5px; margin-top: -.75px; background: #1b2232; transform: rotate(45deg); }
.led__screw--l { left: 14px; }
.led__screw--r { right: 14px; }
.led__tip {
  position: absolute;
  right: 40px; bottom: -11px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--dim);
  transition: opacity .5s;
  pointer-events: none;
}
.led.is-touched .led__tip { opacity: 0; }
@media (max-width: 600px) {
  .led__canvas { width: calc(100% - 36px); }
  .led__screw { width: 8px; height: 8px; margin-top: -4px; }
  .led__screw--l { left: 6px; }
  .led__screw--r { right: 6px; }
  .led__tip { right: 16px; }
}

/* =========================================================
   FOTOS QUE CARGAN PIXELADAS
   ========================================================= */
.pix { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.portrait__frame .pix { transform: scale(1.04); }
[data-pixel].is-pixel .pix { opacity: 1; }
.js [data-pixel] img { opacity: 0; animation: pixFailsafe .4s 5s forwards; }
.js [data-pixel].is-pixel img { opacity: 0; animation: none; }
.js [data-pixel].pix-fail img { opacity: 1; animation: none; }
@keyframes pixFailsafe { to { opacity: 1; } }
.pix-loader {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(3, 6, 13, .78);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.pix-loader i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--a-25); border-top-color: var(--accent-2); animation: spin .8s linear infinite; }
.js [data-pixel]:not(.is-pixel):not(.pix-fail) .pix-loader { opacity: 1; animation: pixLoaderOut .3s 5s forwards; }
.js [data-pixel].is-loading .pix-loader { opacity: 1; animation: none; }
@keyframes pixLoaderOut { to { opacity: 0; } }
.about__tip { margin: 12px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--dim); text-align: center; }

/* =========================================================
   404: PRODUCTO ATASCADO
   ========================================================= */
.stuck { display: grid; gap: 40px; align-items: center; min-height: 100vh; min-height: 100svh; padding-top: calc(var(--nav-h) + 30px); padding-bottom: 70px; }
@media (min-width: 900px) { .stuck { grid-template-columns: 1fr 1fr; gap: 56px; } }
.stuck__code { margin: 0; font-family: var(--font-display); font-size: clamp(70px, 14vw, 150px); line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--accent-2); text-shadow: 0 0 40px var(--a-40); animation: glitch404 3s steps(1) infinite; }
@keyframes glitch404 { 0%, 92%, 100% { transform: none; } 93% { transform: translate(3px, -2px) skewX(8deg); } 95% { transform: translate(-3px, 1px); } 97% { transform: translate(2px, 2px) skewX(-6deg); } }
.stuck__title { margin: 14px 0 10px; font-size: clamp(28px, 4.4vw, 46px); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.stuck__lead { max-width: 48ch; margin: 0; color: var(--muted); }
.stuck__meter { max-width: 320px; height: 6px; margin: 22px 0 0; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.stuck__meter span { display: block; height: 100%; background: linear-gradient(90deg, #ffc233, #ff6a00, #ff2d4a); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.stuck__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 22px; }
.stuck__plain { font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.stuck__plain:hover { color: var(--accent-2); }
.stuck__stage { position: relative; display: grid; place-items: center; padding: 20px 0 64px; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.stuck__machine {
  --wob: 0;
  position: relative;
  width: min(84vw, 320px);
  padding: 12px;
  border-radius: 22px 22px 14px 14px;
  background: linear-gradient(170deg, #1b2a4b, #0c1428 55%, #070c18);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .07), 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 60px -20px var(--a-60);
  transition: transform .5s cubic-bezier(.3, 1.6, .5, 1);
}
.stuck__machine.is-dragging { cursor: grabbing; transition: none; }
.stuck__head { padding: 2px 4px 10px; font-family: var(--font-display); font-size: 10px; letter-spacing: .3em; color: #9fb3d1; }
.stuck__head b { font-weight: 400; color: var(--accent-2); }
.stuck__body { display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 8px; }
.stuck__glass { position: relative; display: grid; gap: 8px; padding: 10px 8px; border-radius: 10px; background: linear-gradient(#060c1a, #0b1730); box-shadow: inset 0 0 0 2px rgba(160, 200, 255, .16), inset 0 0 30px rgba(0, 0, 0, .7); }
.stuck__shine { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .07) 42%, transparent 50%); pointer-events: none; }
.stuck__row { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; justify-items: center; height: 92px; padding-bottom: 16px; }
.stuck__coil { position: absolute; left: 4%; right: 4%; bottom: 4px; height: 9px; border-radius: 5px; background: linear-gradient(100deg, transparent 0 30%, #b9c9de 30% 45%, #6f8199 45% 55%, transparent 55%) 0 0 / 8px 100% repeat-x; opacity: .85; }
.stuck__item { width: 30px; height: 52px; border-radius: 6px; background: linear-gradient(90deg, rgba(0, 0, 0, .3), transparent 30%, rgba(255, 255, 255, .4) 42%, transparent 55%), var(--ic, #3aa0ff); }
.stuck__item--a { --ic: #3aa0ff; }
.stuck__item--b { --ic: #4de8a8; }
.stuck__item--c { --ic: #ff4d64; }
.stuck__item--d { --ic: #ffb02e; width: 46px; height: 28px; border-radius: 4px; }
.stuck__item--e { --ic: #b46bff; }
.stuck__slot { position: relative; width: 100%; height: 100%; }
.stuck__prod {
  position: absolute;
  left: 50%; bottom: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px; height: 58px;
  margin-left: -20px;
  background: radial-gradient(ellipse at 50% 60%, rgba(255, 255, 255, .35), transparent 45%), linear-gradient(160deg, #ff8a2b, #b33f00);
  clip-path: polygon(0 4%, 12% 0, 25% 4%, 37% 0, 50% 4%, 62% 0, 75% 4%, 87% 0, 100% 4%, 96% 50%, 100% 96%, 87% 100%, 75% 96%, 62% 100%, 50% 96%, 37% 100%, 25% 96%, 12% 100%, 0 96%, 4% 50%);
  transform-origin: 50% 0;
  animation: dangle calc(1.4s - var(--wob) * .9s) ease-in-out infinite;
}
.stuck__prod b { font-family: var(--font-body); font-size: 7.5px; font-weight: 800; letter-spacing: .06em; color: #fff; }
@keyframes dangle {
  0%, 100% { transform: translate(10px, 10px) rotate(calc(14deg + var(--wob) * 10deg)); }
  50% { transform: translate(12px, 12px) rotate(calc(22deg - var(--wob) * 18deg)); }
}
.stuck__machine.is-done .stuck__prod, .stuck__prod.is-down { animation: none; }
.stuck__panel { display: flex; flex-direction: column; gap: 8px; padding: 8px 6px; border-radius: 10px; background: linear-gradient(#111c36, #0a1122); box-shadow: inset 0 0 0 1px var(--line-2); }
.stuck__lcd { margin: 0; padding: 8px 4px; border-radius: 6px; background: #14020a; color: #ff6b81; font-family: var(--font-mono); font-size: 9px; font-weight: 700; line-height: 1.35; text-align: center; text-shadow: 0 0 6px #ff2d4a; animation: lcdBlink 1s steps(2) infinite; }
.stuck__machine.is-done .stuck__lcd { background: #021208; color: #4de8a8; text-shadow: 0 0 6px #1fbf7a; }
.stuck__keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.stuck__keys i { height: 18px; border-radius: 4px; background: linear-gradient(#2a3753, #161f33); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.stuck__tray { height: 56px; margin-top: 10px; border-radius: 10px; background: linear-gradient(#02050c, #0a1222); box-shadow: inset 0 8px 16px rgba(0, 0, 0, .85), inset 0 0 0 2px rgba(160, 200, 255, .12); transition: box-shadow .4s; }
.stuck__tray.is-lit { box-shadow: inset 0 8px 16px rgba(0, 0, 0, .85), inset 0 0 0 2px var(--accent-2), 0 0 30px -4px var(--accent); }
.stuck__out {
  position: absolute;
  left: 50%; bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 50%, var(--accent-3));
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 16px 40px -12px var(--accent);
  transform: translate(-50%, 20px) scale(.6);
  opacity: 0;
  visibility: hidden;
  transition: transform .5s cubic-bezier(.3, 1.6, .5, 1), opacity .3s, visibility .3s;
}
.stuck__out svg { width: 18px; height: 18px; }
.stuck__out.is-out { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }

/* =========================================================
   PLACA ARDUINO INTERACTIVA
   ========================================================= */
.circuit {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 26px;
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, var(--a-15), transparent 65%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    #040913;
  cursor: crosshair;
  touch-action: pan-y;
}
.circuit__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.c-board { fill: #071a2e; stroke: var(--a-60); stroke-width: 1.2; }
.c-usb { fill: #1a2740; stroke: rgba(255, 255, 255, .25); }
.c-holes circle { fill: #02060d; stroke: rgba(255, 255, 255, .18); }
.c-header rect { fill: #0b1426; stroke: var(--a-25); }
.c-traces path { fill: none; stroke: var(--a-25); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: stroke .4s; }
.c-traces path.is-on { stroke: var(--a-60); }
.c-flows path { fill: none; stroke: var(--accent-2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 6 14; opacity: 0; filter: drop-shadow(0 0 4px var(--accent-2)); transition: opacity .25s; }
.c-flows path.is-on { opacity: 1; animation: flow .45s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.c-chip { fill: #02060d; stroke: var(--a-60); stroke-width: 1.2; }
.c-chip-pins path { stroke: #9fb3d1; stroke-width: 2; }
.c-label { font-family: var(--font-mono); font-size: 13px; letter-spacing: 2px; fill: var(--accent-2); }
.c-sub { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 1px; fill: var(--dim); }
.c-leds circle { --led: #ff4d64; fill: color-mix(in srgb, var(--led) 16%, #05070c); stroke: var(--led); stroke-width: 1.6; transition: fill .2s, filter .2s; }
.c-leds circle[data-i="1"] { --led: #ffb02e; }
.c-leds circle[data-i="2"] { --led: #4de8a8; }
.c-leds circle[data-i="3"] { --led: #3aa0ff; }
.c-leds circle[data-i="4"] { --led: #b46bff; }
.c-leds circle[data-i="5"] { --led: #ff6bb5; }
.c-leds circle.is-visited { fill: color-mix(in srgb, var(--led) 45%, #05070c); }
.c-leds circle.is-on { fill: var(--led); filter: drop-shadow(0 0 5px var(--led)) drop-shadow(0 0 12px var(--led)); }
.c-main { fill: #0a1730; stroke: var(--accent-2); stroke-width: 2; transition: fill .3s; }
.circuit.is-complete .c-main { fill: #fff; filter: drop-shadow(0 0 8px var(--accent-2)) drop-shadow(0 0 22px var(--accent)); animation: mainPulse 1.2s ease-in-out infinite; }
@keyframes mainPulse { 50% { fill: var(--accent-2); } }
.circuit.is-complete .c-traces path { stroke: var(--a-60); }
.c-probe { fill: #fff; opacity: 0; filter: drop-shadow(0 0 6px var(--accent-2)); transition: opacity .2s; pointer-events: none; }
.circuit.is-probing .c-probe { opacity: .9; }
.cled {
  position: absolute;
  display: grid;
  place-items: end center;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  color: var(--dim);
  transition: color .3s;
  -webkit-tap-highlight-color: transparent;
}
.cled:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.cled.is-on, .cled[aria-pressed="true"] { color: var(--text); }
.cled--0 { left: 17.5%; top: 20%; }
.cled--1 { left: 50%; top: 15.667%; }
.cled--2 { left: 82.5%; top: 20%; }
.cled--3 { left: 85%; top: 77.333%; }
.cled--4 { left: 50%; top: 84.333%; }
.cled--5 { left: 17.5%; top: 77.333%; }
.circuit__count { position: absolute; left: 14px; top: 12px; margin: 0; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(3, 6, 13, .72); font-family: var(--font-mono); font-size: 11.5px; color: var(--accent-2); pointer-events: none; }
.circuit.is-complete .circuit__count { color: #4de8a8; border-color: rgba(77, 232, 168, .5); }
.circuit__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.circuit__help { max-width: 46ch; margin: 0; font-size: 13px; color: var(--dim); }
.circuit__msg { margin: 14px 0 0; padding: 16px 18px; border-radius: 16px; border: 1px solid rgba(77, 232, 168, .4); background: rgba(77, 232, 168, .08); font-size: 14.5px; color: var(--muted); animation: panelIn .6s var(--ease) both; }
.circuit__msg strong { color: #4de8a8; }

/* =========================================================
   MONITOR SERIE
   ========================================================= */
.serial { max-width: 920px; margin: 18px auto 0; border-radius: 18px; border: 1px solid var(--a-40); background: rgba(3, 7, 15, .94); box-shadow: 0 0 60px -30px var(--accent); overflow: hidden; animation: panelIn .5s var(--ease) both; }
.serial[hidden] { display: none; }
.serial__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12.5px; }
.serial__led { width: 9px; height: 9px; border-radius: 50%; background: #4de8a8; box-shadow: 0 0 10px #4de8a8; animation: blink .5s steps(2) infinite; }
.serial__meta { font-size: 11.5px; color: var(--dim); }
.serial__close { display: grid; place-items: center; width: 34px; height: 34px; margin-left: auto; border-radius: 9px; color: var(--muted); }
.serial__close:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.serial__close svg { width: 16px; height: 16px; }
.serial__grid { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .serial__grid { grid-template-columns: minmax(0, 1fr) 190px; } }
.serial__plotwrap { padding: 12px; border-bottom: 1px solid var(--line); }
@media (min-width: 700px) { .serial__plotwrap { border-bottom: 0; border-right: 1px solid var(--line); } }
.serial__plot { display: block; width: 100%; height: 190px; border-radius: 10px; background: #020610; touch-action: none; }
.serial__hint { margin: 8px 0 0; font-size: 12px; color: var(--dim); }
.serial__side { padding: 12px 14px; font-family: var(--font-mono); }
.serial__label { margin: 0; font-size: 11px; letter-spacing: .2em; color: var(--dim); }
.serial__value { margin: 2px 0 0; font-size: 40px; line-height: 1; color: var(--accent-2); text-shadow: 0 0 18px var(--accent); font-variant-numeric: tabular-nums; }
.serial__peak { margin: 6px 0 10px; font-size: 11.5px; color: var(--dim); }
.serial__peak span { color: #ffc861; }
.serial__log { max-height: 126px; margin: 0; padding: 0; list-style: none; font-size: 11px; line-height: 1.6; color: #8fd9a8; white-space: pre; overflow: hidden; }
.serial__log li:first-child { color: #fff; }
.chip-btn--serial { border-color: var(--a-40); color: var(--accent-2); }

/* =========================================================
   CABLE USB «ENCHUFA Y HABLAMOS»
   ========================================================= */
.plug-section { padding-bottom: 0; }
.plug {
  position: relative;
  isolation: isolate;
  height: clamp(340px, 42vw, 430px);
  border-radius: 30px;
  border: 1px solid var(--line-2);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 85% 75%, var(--a-15), transparent 55%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(180deg, #060b17, #03060d);
  transition: box-shadow .6s, border-color .6s;
  touch-action: pan-y;
}
.plug.is-on { border-color: var(--a-60); box-shadow: 0 0 80px -20px var(--accent), inset 0 0 80px -40px var(--accent-2); }
.plug__canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.plug__copy { position: absolute; left: 24px; right: 24px; top: 20px; z-index: 0; pointer-events: none; }
.plug__title { margin: 0; font-family: var(--font-display); font-size: clamp(18px, 3vw, 30px); font-weight: 400; letter-spacing: .06em; }
.plug__status { max-width: 40ch; margin: 8px 0 0; font-size: 14px; color: var(--muted); transition: color .4s; }
.plug.is-on .plug__status { color: #4de8a8; }
.plug__device {
  position: absolute;
  left: clamp(18px, 7%, 70px); top: 42%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 78px; height: 58px;
  border-radius: 12px;
  background: linear-gradient(160deg, #1d2d50, #0b1428);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 14px 30px -10px rgba(0, 0, 0, .9);
}
.plug__devled { position: absolute; right: 8px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 8px #3ddc84; animation: blink 1.6s steps(2) infinite; }
.plug__device b { font-family: var(--font-display); font-size: 11px; font-weight: 400; letter-spacing: .2em; color: var(--accent-2); }
.plug__device small { font-family: var(--font-mono); font-size: 8px; letter-spacing: .14em; color: var(--dim); }
.plug__socket {
  position: absolute;
  right: 0; bottom: 18%;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 96px;
  padding: 14px 0 14px 12px;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(160deg, #1b2a4b, #0a1226);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), -10px 14px 30px -12px rgba(0, 0, 0, .9);
}
.plug__port { width: 30px; height: 16px; border-radius: 4px; background: #000; box-shadow: inset 0 0 0 2px #3a4a6a, inset 0 0 0 5px #000, inset 0 0 0 6px #23314d; transition: box-shadow .3s; }
.plug.is-near .plug__port { box-shadow: inset 0 0 0 2px var(--accent-2), inset 0 0 0 5px #000, inset 0 0 0 6px var(--a-60), 0 0 20px var(--accent-2); }
.plug__sled { position: absolute; right: 14px; top: 16px; width: 9px; height: 9px; border-radius: 50%; background: #3a0a12; box-shadow: inset 0 0 0 1px #ff4d64; transition: background .3s, box-shadow .3s; }
.plug.is-on .plug__sled { background: #4de8a8; box-shadow: 0 0 10px #4de8a8, 0 0 20px #4de8a8; }
.plug__socket small { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .16em; color: var(--muted); }
.plug__head {
  position: absolute;
  left: 0; top: 0;
  z-index: 3;
  width: 28px; height: 42px;
  padding: 0;
  border-radius: 6px 6px 9px 9px;
  background: linear-gradient(90deg, #0e1524, #2a3a5a 45%, #121b2e);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 14px rgba(0, 0, 0, .6);
  cursor: grab;
  touch-action: none;
  will-change: transform;
}
.plug__head.is-grabbed { cursor: grabbing; }
.plug__metal { position: absolute; left: 5px; right: 5px; top: -12px; height: 14px; border-radius: 2px 2px 0 0; background: linear-gradient(90deg, #8d99ab, #f1f5fb 40%, #a6b1c1 60%, #6d788a); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.plug__metal::after { content: ""; position: absolute; left: 4px; right: 4px; top: 3px; height: 4px; border-radius: 1px; background: rgba(0, 0, 0, .35); }
.plug__grip { position: absolute; left: 7px; right: 7px; top: 12px; bottom: 10px; border-radius: 3px; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .12) 0 2px, transparent 2px 5px); }
.plug__head::after { content: ""; position: absolute; inset: -12px -10px -6px; border-radius: 14px; border: 2px solid var(--accent-2); opacity: 0; animation: plugHint 1.8s ease-out infinite; pointer-events: none; }
.plug.is-touched .plug__head::after, .plug.is-on .plug__head::after { animation: none; }
@keyframes plugHint { 0% { opacity: .9; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.35); } }
.plug__go {
  position: absolute;
  right: 16px; bottom: calc(18% + 80px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 50%, var(--accent-3));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 14px 30px -10px var(--accent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.8);
  transition: opacity .35s, visibility .35s, transform .5s cubic-bezier(.3, 1.6, .5, 1);
}
.plug.is-on .plug__go { opacity: 1; visibility: visible; transform: none; }
.plug__go svg { width: 18px; height: 18px; }

/* =========================================================
   CARGADORES
   ========================================================= */
/* Miniaturas de la galería: brillo de carga hasta que llega la foto */
.shot { background: linear-gradient(110deg, #1a120a 30%, #34220f 50%, #1a120a 70%) 0 0 / 300% 100%; animation: skeleton 1.4s linear infinite; }
.shot.is-loaded { background: #1a120a; animation: none; }
.js .shot img { opacity: 0; transition: opacity .5s, transform .7s var(--ease); }
.js .shot.is-loaded img { opacity: 1; }
.js .shot:not(.is-loaded) img { animation: pixFailsafe .3s 6s forwards; }
@keyframes skeleton { to { background-position: -150% 0; } }

/* Visor de fotos */
.lightbox figure { position: relative; }
.lb-spin { position: absolute; left: 50%; top: 42%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: #FF6A00; opacity: 0; transition: opacity .2s; animation: spin .8s linear infinite; pointer-events: none; }
.lightbox.is-loading .lb-spin { opacity: 1; }
.lightbox img { transition: opacity .25s; }
.lightbox.is-loading img { opacity: .35; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html.vt-crt::view-transition-old(root), html.vt-crt::view-transition-new(root),
  html.vt-ink::view-transition-new(root) { animation: none !important; }
  .stuck__prod { animation: none; transform: translate(10px, 10px) rotate(18deg); }
}
.vm__prod--chips { width: 52px; }
.vm__prod--chips .vm__plabel { font-size: 6.5px; letter-spacing: .02em; }

/* =========================================================
   AJUSTES PARA MÓVIL (revisión a 375 px)
   ========================================================= */
/* Menos hueco bajo la portada cuando no hay indicador de scroll */
@media (max-width: 1023px) { .hero { padding-bottom: 56px; } }

/* Botón de volver arriba más discreto en pantallas pequeñas */
@media (max-width: 600px) {
  .to-top { right: 12px; bottom: 12px; width: 44px; height: 44px; }
  .to-top__icon { width: 16px; height: 16px; }
}
/* Zona táctil más grande que el conector (más fácil de agarrar con el dedo) */
.plug__head::before { content: ""; position: absolute; inset: -16px -14px; border-radius: 16px; }
/* 404 en móvil: la máquina sube para verse antes */
@media (max-width: 899px) {
  .stuck { gap: 18px; padding-top: calc(var(--nav-h) + 12px); }
  .stuck__code { font-size: 64px; }
  .stuck__title { margin-top: 6px; }
  .stuck__meter, .stuck__actions { margin-top: 16px; }
}

/* =========================================================
   ACABADO PROFESIONAL
   ========================================================= */
/* Texto tenue con contraste suficiente (≥ 4,5:1 sobre el fondo) */
:root { --dim: #6e7f9f; }

/* Titulares repartidos en líneas equilibradas y párrafos sin palabras huérfanas */
h1, h2, h3, .page-lead, .section__intro { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }

/* Barra de scroll a juego con el tema */
html { scrollbar-color: #1d2b47 var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { border: 2px solid var(--bg); border-radius: 10px; background: #1d2b47; }
::-webkit-scrollbar-thumb:hover { background: var(--a-60); }

/* Pantallas táctiles: sin destello gris al tocar ni efectos de «hover» que se quedan pegados */
a, button, [role="tab"], summary { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .now-card:hover, .service:hover { translate: none; }
  .now-card:hover .now-card__img, .shot:hover img { transform: none; }
  .vm__slot:hover .vm__prod { transform: none; }
  .swatch:hover, .chip-btn:hover, .bbtn:hover, .footer__social:hover, .tones__btn:hover { transform: none; }
  .btn:hover .arrow, .ig-cta:hover .ig-cta__arrow, .now-card:hover .now-card__go svg { transform: none; }
  .phone:hover { transform: rotateY(-10deg) rotateX(4deg); }
  /* Respuesta inmediata al tocar */
  .btn:active, .bbtn:active, .chip-btn:active, .tones__btn:active, .swatch:active, .ig-cta:active { transform: scale(.97); }
  .now-card:active, .shot:active { scale: .98; }
}

/* Móviles con muesca o barra de inicio */
.nav { padding-top: env(safe-area-inset-top); }
.toast { bottom: calc(26px + env(safe-area-inset-bottom)); }
.vmenu { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.to-top { bottom: calc(18px + env(safe-area-inset-bottom)); right: calc(18px + env(safe-area-inset-right)); }
@media (max-width: 600px) {
  .to-top { bottom: calc(12px + env(safe-area-inset-bottom)); right: calc(12px + env(safe-area-inset-right)); }
}
@supports (padding: max(0px)) {
  .container { padding-inline: max(0px, env(safe-area-inset-left) - 16px) max(0px, env(safe-area-inset-right) - 16px); }
}

/* El rótulo LED reserva su alto desde el principio (sin saltos cuando arranca) */
.led__canvas { height: calc(clamp(7px, (100vw - 64px) / 72, 13px) * 11); }
.led__canvas { height: calc(clamp(7px, round(nearest, (100vw - 64px) / 72, 1px), 13px) * 11); }
@media (max-width: 600px) {
  .led__canvas { height: calc(clamp(7px, (100vw - 36px) / 72, 13px) * 11); }
}

/* Tonos de marca: botones que copian el código de color */
.tones li { display: block; padding: 0; border: 0; background: none; }
.tones__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .04);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.tones__btn:hover { border-color: var(--brand, var(--accent)); background: rgba(255, 255, 255, .07); transform: translateY(-1px); }
.tones__btn::after {
  content: "";
  width: 14px; height: 14px;
  background: currentColor;
  opacity: .45;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='2.5'/%3E%3Cpath d='M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='2.5'/%3E%3Cpath d='M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: opacity .25s;
}
.tones__btn:hover::after { opacity: .8; }
.tones__btn.is-copied { border-color: #3ddc84; }
.tones__btn.is-copied::after {
  opacity: 1;
  background: #3ddc84;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
