/* =========================================================================
   Ulises Rodriguez — Portfolio · v3 (página principal)
   Se carga después de style.css. Dos temas en <html data-theme>:
     (sin atributo / "dark") → oscuro de siempre (default)
     "light"                 → claro, fondo sepia
   ========================================================================= */

/* ---------- temas ---------- */
html[data-theme="light"]{
  --bg:#f1e8d6; --bg-alt:#e9dec8; --surface:#f7f0e2; --surface-hi:#fbf6ec;
  --border:#d6c7a9; --border-soft:#e2d6bd;
  --text:#2a2219; --text-dim:#5a4f40; --text-faint:#8c7f6b;
  --red:#c8393c; --red-bright:#d23f41; --red-dim:#e7b9ad; --red-glow:rgba(200,57,60,.22);
  --amber:#c27a24; --amber-bright:#d18a32; --amber-glow:rgba(194,122,36,.22);
  --on-accent:#fff;
  color-scheme:light;
}
:root{ --on-accent:#fff; }
.nav{ background:color-mix(in srgb, var(--bg) 86%, transparent); }

/* botón de tema (íconos) */
.theme-switch{ display:flex; border:1px solid var(--border); }
.theme-switch button{
  width:32px; height:30px; display:flex; align-items:center; justify-content:center;
  background:transparent; border:0; color:var(--text-faint); padding:0; transition:color .2s, background .2s;
}
.theme-switch button + button{ border-left:1px solid var(--border); }
.theme-switch button svg{ width:15px; height:15px; }
.theme-switch button:hover{ color:var(--text); }
.theme-switch button.on{ background:var(--text); color:var(--bg); }
@media (max-width:720px){ .theme-switch button{ width:28px; } .nav-actions{ gap:8px; } }

/* ---------- todo recto ---------- */
body.home *, body.home *::before, body.home *::after{ border-radius:0 !important; }
body.home .dot-live, body.home .nav-current.on::before, body.home .pcard-media::before,
body.home .round{ border-radius:50% !important; }

/* ---------- títulos con presencia + texto justificado ---------- */
body.home .section-title{
  font-size:clamp(2.4rem,5.2vw,3.8rem); font-weight:700; line-height:1.02; letter-spacing:-.035em; margin-bottom:8px;
}
body.home .section-title::after{ height:4px; }
body.home .section-title.in::after{ width:96px; }
body.home .eyebrow{ font-size:.74rem; }
.just, body.home .hero-desc, body.home .perfil-text p, body.home .section-lede,
body.home .event-card p, body.home .xp-body li, body.home .tl-txt p{
  text-align:justify; hyphens:auto; -webkit-hyphens:auto;
}
body.home .section-lede{ margin-top:18px; max-width:720px; }

/* ---------- inicio: partículas con conexiones ---------- */
.hero-net{ position:absolute; inset:0; z-index:1; pointer-events:none; width:100%; height:100%; }
.hero-particles{ display:none; }

/* foto / logo que alternan con efecto de tele de tubo */
.gswap{ position:relative; border:1px solid var(--border); background:var(--surface); padding:20px; }
.gswap::before,.gswap::after{ content:""; position:absolute; width:14px; height:14px; border:2px solid var(--red); z-index:3; }
.gswap::before{ top:-1px; left:-1px; border-right:0; border-bottom:0; }
.gswap::after{ bottom:-1px; right:-1px; border-left:0; border-top:0; }
.gswap-stage{ position:relative; aspect-ratio:1/1; overflow:hidden; background:var(--bg-alt); }
.gswap-stage img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:0; }
.gswap-stage img.on{ opacity:1; }
.gswap-stage .gl{ display:none; }

/* ---------- tele de tubo: punto → línea hacia los costados → imagen ---------- */
.gswap-stage, .pics .stage{ isolation:isolate; }
.crt-wait, .crt-run, .crt-off{ background:#050506 !important; }
.crt-wait > *{ opacity:0 !important; }
.crt-run::after{
  content:""; position:absolute; left:0; right:0; top:50%; height:2px; margin-top:-1px; z-index:5; pointer-events:none;
  background:#fff; box-shadow:0 0 6px 1px #fff, 0 0 18px 4px rgba(255,235,220,.55), 0 0 40px 10px var(--red-glow);
  transform:scaleX(0); animation:crtLine .95s cubic-bezier(.2,.7,.2,1) forwards;
}
.crt-run .ph.on img, .crt-run .empty, .gswap-stage.crt-run img.on{
  transform-origin:50% 50%; animation:crtImg .95s cubic-bezier(.2,.7,.2,1) both;
}
.gswap-stage.crt-off img.on{ transform-origin:50% 50%; animation:crtOff .38s ease-in forwards; }
@keyframes crtLine{
  0%  { transform:scaleX(0); opacity:1; }
  12% { transform:scaleX(.03); opacity:1; }
  42% { transform:scaleX(1); opacity:1; }
  58% { transform:scaleX(1) scaleY(1); opacity:.9; }
  78% { transform:scaleX(1) scaleY(30); opacity:0; }
  100%{ transform:scaleX(1) scaleY(30); opacity:0; }
}
@keyframes crtImg{
  0%, 44% { opacity:0; transform:scale(1,.006); filter:brightness(6) saturate(0); }
  47%     { opacity:1; transform:scale(1,.02);  filter:brightness(5) saturate(0); }
  70%     { transform:scale(1,1.03); filter:brightness(1.9) contrast(1.15) saturate(.7); }
  84%     { transform:scale(1,.99);  filter:brightness(1.15); }
  100%    { opacity:1; transform:none; filter:none; }
}
@keyframes crtOff{
  0%  { transform:none; filter:none; opacity:1; }
  55% { transform:scale(1,.008); filter:brightness(6) saturate(0); opacity:1; }
  85% { transform:scale(.02,.008); filter:brightness(8) saturate(0); opacity:1; }
  100%{ transform:scale(0,0); opacity:0; }
}

/* ---------- texto tipeado como consola ---------- */
.tw-rest{ visibility:hidden; }
.tw-caret{
  display:inline-block; width:.5em; height:1.05em; margin:0 1px -.18em; background:var(--red);
  box-shadow:0 0 6px var(--red-glow); animation:twBlink .7s steps(1) infinite;
}
@keyframes twBlink{ 50%{ opacity:.25; } }
@media (prefers-reduced-motion: reduce){ .crt-wait > *{ opacity:1 !important; } }

/* señal chica */
.mini-scope{ display:flex; align-items:center; gap:12px; margin-top:12px; border:1px solid var(--border); background:var(--bg-alt); padding:6px 10px; }
.mini-scope span{ font-family:var(--font-mono); font-size:.58rem; letter-spacing:.1em; color:var(--text-faint); white-space:nowrap; }
.mini-scope b{ color:var(--red-bright); font-weight:500; display:inline-block; min-width:58px; }
.mini-scope canvas{ flex:1; height:28px; display:block; min-width:0; }
.chip-flip, .chip-scope{ display:none; }

/* ---------- proyectos ---------- */
.pcard-grid.four{ grid-template-columns:repeat(4,1fr); }
.pcard-grid.four .pcard h3{ font-size:1.38rem; }
.pcard-grid.four .pcard-media{ height:190px; }
.pcard-grid.four .pcard-media img{ width:118px; height:118px; }
.pcard .pix{ image-rendering:pixelated; }
@media (max-width:1100px){ .pcard-grid.four{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:640px){ .pcard-grid.four{ grid-template-columns:1fr; } }

/* carrusel de pósters académicos */
.acar{ display:grid; grid-template-columns:minmax(0,1fr) 300px; border:1px solid var(--border); background:var(--surface); }
.acar-view{ position:relative; overflow:hidden; aspect-ratio:3/1; border-right:1px solid var(--border); background:var(--bg-alt); }
.acar-track{ display:flex; height:100%; transition:transform .6s cubic-bezier(.65,0,.35,1); }
.acar-slide{ flex:0 0 100%; height:100%; display:block; position:relative; }
.acar-slide img{ width:100%; height:100%; object-fit:cover; display:block; }
.acar-btn{
  position:absolute; top:50%; transform:translateY(-50%); z-index:2; width:38px; height:38px;
  display:flex; align-items:center; justify-content:center; background:var(--bg); border:1px solid var(--border); color:var(--text);
  opacity:0; transition:opacity .2s, border-color .2s;
}
.acar-btn svg{ width:16px; height:16px; }
.acar-btn.prev{ left:12px; } .acar-btn.next{ right:12px; }
.acar:hover .acar-btn, .acar-btn:focus-visible{ opacity:1; }
.acar-btn:hover{ border-color:var(--red); }
.acar-prog{ position:absolute; left:0; bottom:0; height:4px; background:var(--red); width:0; z-index:2; transition:background .3s; }
.acar-list{ display:flex; flex-direction:column; }
.acar-item{
  flex:1; display:flex; flex-direction:column; justify-content:center; gap:2px; padding:10px 16px;
  border-bottom:1px solid var(--border-soft); position:relative; transition:background .2s;
}
.acar-item:last-child{ border-bottom:0; }
.acar-item small{ font-family:var(--font-mono); font-size:.6rem; letter-spacing:.08em; color:var(--text-faint); }
.acar-item b{ font-family:var(--font-display); font-size:.95rem; font-weight:600; line-height:1.2; }
.acar-item:hover{ background:var(--surface-hi); }
.acar-item.on{ background:var(--surface-hi); box-shadow:inset 3px 0 0 var(--ac, var(--red)); }
.acar-item.on small{ color:var(--ac, var(--red-bright)); }
.proj-all{ display:flex; justify-content:flex-end; margin-top:26px; }
@media (max-width:860px){
  .acar{ grid-template-columns:1fr; }
  .acar-view{ border-right:0; border-bottom:1px solid var(--border); }
  .acar-list{ flex-direction:row; overflow-x:auto; }
  .acar-item{ flex:0 0 auto; min-width:170px; border-bottom:0; border-right:1px solid var(--border-soft); }
  .acar-btn{ opacity:1; }
}

/* ---------- stack: capas + oblea ---------- */
.stack-wrap{ display:grid; grid-template-columns:minmax(0,1fr) 230px; gap:28px; align-items:stretch; margin-top:34px; }
.layers{ border:1px solid var(--border); margin-top:22px; }
.layer{ display:grid; grid-template-columns:84px 240px 1fr; border-bottom:1px solid var(--border); background:var(--surface); position:relative; transition:background .2s; }
.layer:last-child{ border-bottom:0; }
.layer:hover, .layer.hl{ background:var(--surface-hi); }
.l-code{ display:flex; flex-direction:column; justify-content:center; align-items:center; border-right:1px solid var(--border);
  font-family:var(--font-mono); font-size:.6rem; color:var(--text-faint); letter-spacing:.12em; transition:background .2s, color .2s; }
.l-code b{ font-family:var(--font-display); font-size:1.6rem; color:var(--text); line-height:1; }
.layer:hover .l-code, .layer.hl .l-code{ background:var(--red); color:var(--on-accent); }
.layer:hover .l-code b, .layer.hl .l-code b{ color:var(--on-accent); }
.layer.focus{ box-shadow:inset 4px 0 0 var(--red); }
.l-name{ padding:26px 22px 18px; border-right:1px solid var(--border-soft); }
.l-name h3{ font-family:var(--font-display); font-size:1.12rem; line-height:1.2; }
.l-name small{ display:block; font-family:var(--font-mono); font-size:.6rem; color:var(--text-faint); margin-top:6px; letter-spacing:.06em; }
.l-body{ padding:26px 22px 20px; display:flex; align-items:center; }
.l-body .tags{ gap:6px; }
.l-body .tag{ font-size:.74rem; padding:5px 10px; background:var(--bg-alt); }
.l-logos{ position:absolute; top:0; right:18px; transform:translateY(-50%); display:flex; gap:6px; z-index:2; }
.lg{ width:40px; height:40px; background:var(--surface); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; position:relative; transition:transform .2s, border-color .2s; }
.lg svg{ width:21px; height:21px; fill:var(--text); transition:fill .2s; }
.lg.sym svg{ fill:none; stroke:var(--text); stroke-width:1.6; }
.lg:hover{ transform:translateY(-3px); border-color:var(--red); }
.lg:hover svg{ fill:var(--c); }
.lg.sym:hover svg{ fill:none; stroke:var(--red-bright); }
.lg[data-t]:hover::after{ content:attr(data-t); position:absolute; bottom:calc(100% + 6px); left:50%; transform:translateX(-50%); white-space:nowrap;
  font-family:var(--font-mono); font-size:.6rem; background:var(--text); color:var(--bg); padding:3px 7px; z-index:5; }
.stack-axis{ display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:.6rem; color:var(--text-faint); letter-spacing:.12em; margin-top:10px; }
.wafer{ position:relative; margin:22px 0 0; }
.wafer svg{ position:absolute; inset:0; width:100%; height:100%; display:block; overflow:visible; }
.wafer .slab{ transition:transform .5s cubic-bezier(.2,.7,.2,1); }
.wafer:hover .slab{ transform:translateY(calc(var(--k) * -9px)); }
.wafer .slab.hl .top{ stroke:var(--red); stroke-width:1.6; }
.wafer-cap{ font-family:var(--font-mono); font-size:.6rem; color:var(--text-faint); letter-spacing:.12em; text-align:center; margin-top:10px; }
@media (max-width:900px){ .stack-wrap{ grid-template-columns:1fr; } .wafer{ display:none; } }
@media (max-width:760px){ .layer{ grid-template-columns:60px 1fr; } .l-body{ grid-column:1/-1; border-top:1px solid var(--border-soft); } .l-name{ border-right:0; } .l-logos{ right:10px; } }

/* ---------- recuadros de fotos (se adaptan a las que haya) ---------- */
.pics{ position:relative; }
.pics .stage{ position:relative; aspect-ratio:4/3; overflow:hidden; background:var(--bg-alt); border:1px solid var(--border); }
.pics .ph{ position:absolute; inset:0; opacity:0; transition:opacity 1s; }
.pics .ph.on{ opacity:1; }
.pics .ph img{ width:100%; height:100%; object-fit:cover; display:block; }
.pics .cnt{ position:absolute; left:8px; bottom:8px; z-index:2; font-family:var(--font-mono); font-size:.6rem; letter-spacing:.08em; background:var(--bg); color:var(--text-dim); border:1px solid var(--border); padding:3px 7px; }
.pics .bars{ position:absolute; right:8px; bottom:9px; z-index:2; display:flex; gap:3px; }
.pics .bars i{ width:14px; height:3px; background:color-mix(in srgb, var(--bg) 70%, transparent); }
.pics .bars i.on{ background:var(--red); }
.pics.one .cnt, .pics.one .bars{ display:none; }
/* sin fotos: queda un bloque de fecha tipo componente */
.pics .empty{ display:none; }
.pics.none .stage{ aspect-ratio:auto; min-height:150px; display:flex; align-items:center; justify-content:center; background:var(--surface);
  background-image:repeating-linear-gradient(135deg, var(--border-soft) 0 1px, transparent 1px 12px); }
.pics.none .empty{ display:flex; flex-direction:column; align-items:center; gap:4px; padding:22px; background:var(--surface); border:1px solid var(--border); }
.pics.none .empty b{ font-family:var(--font-display); font-size:1.9rem; line-height:1; letter-spacing:-.02em; }
.pics.none .empty small{ font-family:var(--font-mono); font-size:.6rem; letter-spacing:.12em; color:var(--text-faint); }
.pics.none .cnt, .pics.none .bars{ display:none; }

/* ---------- experiencia profesional ---------- */
.xp{ display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr); gap:48px; align-items:start; }
.xp-date{ display:inline-flex; align-items:center; gap:10px; font-family:var(--font-mono); font-size:.7rem; letter-spacing:.1em; color:var(--red-bright); border:1px solid var(--red); padding:4px 10px; margin-bottom:12px; }
.xp-date i{ width:7px; height:7px; background:var(--red); }
.xp-body h3{ font-family:var(--font-display); font-size:1.5rem; line-height:1.15; }
.xp-body .org{ display:block; font-family:var(--font-mono); font-size:.72rem; color:var(--text-faint); margin:6px 0 14px; }
.xp-body ul{ display:flex; flex-direction:column; gap:8px; margin-bottom:24px; }
.xp-body li{ color:var(--text-dim); font-size:.93rem; position:relative; padding-left:18px; }
.xp-body li::before{ content:""; position:absolute; left:0; top:.72em; width:8px; height:2px; background:var(--red); }
.xp-facts{ display:grid; grid-template-columns:1fr 1fr; border:1px solid var(--border); }
.xp-facts div{ padding:12px 14px; border-bottom:1px solid var(--border-soft); }
.xp-facts div:nth-child(odd){ border-right:1px solid var(--border-soft); }
.xp-facts div:nth-last-child(-n+2){ border-bottom:0; }
.xp-facts small{ display:block; font-family:var(--font-mono); font-size:.6rem; letter-spacing:.1em; color:var(--text-faint); }
.xp-facts span{ font-size:.88rem; }
.xp .pics .stage{ aspect-ratio:4/3; }
.xp .pics.none .stage{ aspect-ratio:4/3; }
@media (max-width:900px){ .xp{ grid-template-columns:1fr; gap:28px; } }

/* ---------- liderazgo: pista serpenteante ---------- */
.tlx{ position:relative; margin-top:16px; }
.tlx svg.route{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible; z-index:0; }
.route .trk{ fill:none; stroke:var(--border); stroke-width:6; stroke-linejoin:miter; }
.route .cu{ fill:none; stroke:var(--red); stroke-width:2.2; stroke-linejoin:miter; stroke-dasharray:10 14; animation:cuFlow 1.6s linear infinite; }
@keyframes cuFlow{ to{ stroke-dashoffset:-48; } }
.route .via{ fill:var(--bg); stroke:var(--red); stroke-width:2.2; }
.tl-node{ position:relative; display:grid; grid-template-columns:1fr 1fr; gap:124px; align-items:center; margin-bottom:72px; z-index:1; }
.tl-node:last-child{ margin-bottom:0; }
.tl-node.r .pics{ order:2; }
.tl-node .pad{ position:absolute; top:50%; width:14px; height:14px; background:var(--red); border:3px solid var(--bg); outline:1px solid var(--red); transform:translateY(-50%); z-index:3; right:-8px; }
.tl-node.r .pad{ left:-8px; right:auto; }
.tl-txt .xp-date{ margin-bottom:10px; }
.tl-txt h3{ font-family:var(--font-display); font-size:1.32rem; line-height:1.15; }
.tl-txt .org{ display:block; font-family:var(--font-mono); font-size:.7rem; color:var(--text-faint); margin:6px 0 12px; }
.tl-txt p{ color:var(--text-dim); font-size:.92rem; }
@media (prefers-reduced-motion:reduce){ .route .cu{ animation:none; } }
@media (max-width:860px){
  .tl-node{ grid-template-columns:1fr; gap:16px; padding-left:34px; margin-bottom:48px; }
  .tl-node.r .pics{ order:0; }
  .tl-node .pad, .tl-node.r .pad{ left:-41px; right:auto; }
}

/* ---------- formación: colores de cada institución ---------- */
.edu-card{ position:relative; padding-left:40px; }
.edu-flag{ position:absolute; left:0; top:0; bottom:0; width:12px; display:flex; flex-direction:column; }
.edu-flag i{ flex:1; }
.edu-card .lang-bar.wide i{ background:var(--inst, var(--red)); }

/* certificados: lista + visor al costado */
.certs-h{ display:flex; align-items:baseline; gap:14px; margin:56px 0 18px; }
.certs-h b{ font-family:var(--font-display); font-size:1.6rem; letter-spacing:-.02em; }
.certs-h span{ font-family:var(--font-mono); font-size:.64rem; color:var(--text-faint); letter-spacing:.1em; }
.certs{ display:grid; grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr); gap:22px; align-items:start; }
.cert-list{ display:flex; flex-direction:column; border:1px solid var(--border); }
.cert-item{
  display:grid; grid-template-columns:46px 1fr auto; gap:14px; align-items:center; padding:12px 16px;
  background:var(--surface); border:0; border-bottom:1px solid var(--border-soft); color:var(--text); text-align:left; font-family:inherit; cursor:pointer;
  transition:background .2s;
}
.cert-item:last-child{ border-bottom:0; }
.cert-item:hover{ background:var(--surface-hi); }
.cert-item.on{ background:var(--surface-hi); box-shadow:inset 3px 0 0 var(--red); }
.cert-iss{ width:46px; height:46px; background:#fff; border:1px solid var(--border); padding:5px; display:flex; align-items:center; justify-content:center; }
.cert-iss img, .cert-iss svg{ width:100%; height:100%; object-fit:contain; }
.cert-item small{ display:block; font-family:var(--font-mono); font-size:.6rem; letter-spacing:.08em; color:var(--red-bright); }
.cert-item b{ display:block; font-family:var(--font-display); font-size:.98rem; font-weight:600; line-height:1.25; margin:2px 0; }
.cert-item span.m{ font-family:var(--font-mono); font-size:.64rem; color:var(--text-faint); }
.cert-item > svg{ width:16px; height:16px; color:var(--text-faint); transition:transform .2s, color .2s; }
.cert-item.on > svg{ color:var(--red-bright); transform:translateX(3px); }
.cert-view{ position:sticky; top:92px; }
.cert-view .frame{ position:relative; border:1px solid var(--border); background:var(--surface); padding:12px; cursor:zoom-in; }
.cert-view .frame::before,.cert-view .frame::after{ content:""; position:absolute; width:14px; height:14px; border:2px solid var(--red); }
.cert-view .frame::before{ top:-1px; left:-1px; border-right:0; border-bottom:0; }
.cert-view .frame::after{ bottom:-1px; right:-1px; border-left:0; border-top:0; }
.cert-view img{ width:100%; aspect-ratio:1.414/1; object-fit:contain; background:#fff; display:block; transition:opacity .25s; }
.cert-view img.swap{ opacity:0; }
.cert-cap{ display:flex; justify-content:space-between; gap:12px; font-family:var(--font-mono); font-size:.64rem; color:var(--text-faint); letter-spacing:.06em; margin-top:10px; }
.cert-note{ font-family:var(--font-mono); font-size:.6rem; color:var(--text-faint); margin-top:6px; }
@media (max-width:900px){ .certs{ grid-template-columns:1fr; } .cert-view{ position:static; order:-1; } }

/* visor a pantalla completa (certificados) */
.zoom{ position:fixed; inset:0; z-index:600; background:rgba(8,9,11,.92); display:flex; align-items:center; justify-content:center; padding:40px; opacity:0; pointer-events:none; transition:opacity .2s; }
.zoom.open{ opacity:1; pointer-events:auto; cursor:zoom-out; }
.zoom img{ max-width:100%; max-height:100%; background:#fff; }

/* ---------- contacto: integrado con pistas de cobre ---------- */
.ct{ display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:56px; align-items:center; }
.ct-board{ position:relative; display:grid; grid-template-columns:200px 1fr; gap:110px; align-items:center; }
.ct-board svg.traces{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible; }
.traces .trk{ fill:none; stroke:var(--border); stroke-width:7; stroke-linejoin:miter; }
.traces .cu{ fill:none; stroke:var(--amber); stroke-width:2.4; stroke-linejoin:miter; opacity:.9; }
html:not([data-theme]) .traces .cu, html[data-theme="dark"] .traces .cu{ stroke:#b87333; }
.traces .pulse{ fill:none; stroke:var(--red-bright); stroke-width:2.4; stroke-dasharray:14 400; animation:pulse 2.6s linear infinite; }
@keyframes pulse{ from{ stroke-dashoffset:414; } to{ stroke-dashoffset:0; } }
.traces .via{ fill:var(--bg); stroke:var(--amber); stroke-width:2; }
.ic{ position:relative; justify-self:center; width:150px; padding:18px 0; background:#1a1b1f; border:2px solid #2f3238; color:#edeef0;
  display:flex; flex-direction:column; align-items:center; z-index:1; }
body.home .ic::before{ content:""; position:absolute; top:-2px; left:50%; transform:translateX(-50%); width:26px; height:13px; background:var(--bg); border:2px solid #2f3238; border-top:0; border-radius:0 0 26px 26px !important; }
body.home .ic-dot{ position:absolute; top:12px; left:12px; width:7px; height:7px; background:var(--red); border-radius:50% !important; }
.ic b{ font-family:var(--font-display); font-size:1rem; line-height:1.15; text-align:center; margin-top:46px; }
.ic small{ font-family:var(--font-mono); font-size:.58rem; letter-spacing:.12em; color:#8a8f96; margin:6px 0 46px; }
.ic-pins{ position:absolute; top:24px; bottom:24px; display:flex; flex-direction:column; justify-content:space-around; }
.ic-pins.l{ left:-14px; } .ic-pins.r{ right:-14px; }
.ic-pins i{ width:14px; height:6px; background:#9aa0a8; display:block; }
.ic-pins span{ position:absolute; font-family:var(--font-mono); font-size:.5rem; color:#8a8f96; letter-spacing:.06em; }
.ct-cards{ display:flex; flex-direction:column; gap:14px; position:relative; z-index:1; }
.ct-card{
  position:relative; display:grid; grid-template-columns:42px 1fr; gap:14px; align-items:center;
  padding:13px 16px; border:1px solid var(--border); background:var(--surface); transition:border-color .2s, transform .2s;
}
.ct-card:hover{ border-color:var(--red); transform:translateX(4px); }
.ct-card .ico{ width:42px; height:42px; display:flex; align-items:center; justify-content:center; background:var(--bg-alt); border:1px solid var(--border-soft); }
.ct-card .ico svg{ width:20px; height:20px; fill:var(--text); }
.ct-card .ico svg.st{ fill:none; stroke:var(--text); stroke-width:1.8; }
.ct-card:hover .ico svg{ fill:var(--c, var(--text)); }
.ct-card:hover .ico svg.st{ fill:none; stroke:var(--red-bright); }
.ct-card small{ display:block; font-family:var(--font-mono); font-size:.6rem; letter-spacing:.1em; color:var(--text-faint); }
.ct-card span.v{ font-size:.92rem; word-break:break-all; }
.ct-card .ct-pad{ position:absolute; left:-6px; top:50%; width:10px; height:10px; background:var(--amber); transform:translateY(-50%); }
html:not([data-theme]) .ct-card .ct-pad, html[data-theme="dark"] .ct-card .ct-pad{ background:#b87333; }
@media (max-width:1000px){ .ct{ grid-template-columns:1fr; gap:34px; } }
@media (max-width:600px){
  .ct-board{ grid-template-columns:1fr; gap:46px; }
  .ic{ width:100%; max-width:260px; flex-direction:row; justify-content:center; gap:12px; padding:14px 18px; }
  .ic b{ margin:0; } .ic small{ margin:0; }
  .ic-pins{ display:none; }
  .ct-card .ct-pad{ left:50%; top:-6px; transform:translateX(-50%); }
}

/* imágenes por idioma */
body.home img[lang="en"]{ display:none; }
html[data-lang="en"] body.home img[lang="en"]{ display:block; }
html[data-lang="en"] body.home img[lang="es"]{ display:none; }

/* ajustes v3.0.1 */
.pcard-grid.four .pcard-foot{ flex-direction:column; align-items:flex-start; gap:12px; }
.proj-all .btn svg{ width:14px; height:14px; }
@media (max-width:480px){
  .nav-inner{ padding:0 14px; }
  .nav-brand{ gap:8px; font-size:.9rem; }
  .nav-brand img{ width:30px; height:30px; }
  .nav-brand small{ display:none; }
  .nav-current.on{ display:flex; }
  .nav-actions{ gap:6px; }
  .theme-switch button{ width:26px; height:28px; }
  .theme-switch button svg{ width:13px; height:13px; }
  .lang-toggle{ padding:6px 7px; }
  .nav-toggle{ padding:4px; }
}
@media (max-width:360px){ .nav-brand > span{ display:none; } }

/* botón Jugar en la tarjeta (TrueRMS) */
.pcard-btns{ display:flex; gap:8px; flex-wrap:wrap; position:relative; z-index:2; }
.pcard-play{ background:var(--accent); border-color:var(--accent); color:#1a1206; font-weight:600; }
.pcard-play:hover{ background:var(--accent); filter:brightness(1.08); border-color:var(--accent); }
.crt-run .ph{ transition:none; }

/* ---------- variantes que usa el generador (contenido editable desde /edit) ---------- */
.pcard-grid.two{ grid-template-columns:repeat(2,1fr); }
@media (max-width:640px){ .pcard-grid.two{ grid-template-columns:1fr; } }
.stack-wrap.no-wafer{ grid-template-columns:1fr; }
.lg img{ width:21px; height:21px; object-fit:contain; display:block; }
.ct-card .ico img{ width:20px; height:20px; object-fit:contain; }
.xp + .xp{ margin-top:56px; padding-top:56px; border-top:1px dashed var(--border); }

/* ---------- otras animaciones de imagen (se eligen en /edit) ---------- */
.gswap-stage.fade-swap img{ transition:opacity .9s ease; }
.fx-fade .ph.on img, .fx-fade .empty, .gswap-stage.fx-fade img.on{ animation:fxFade .9s ease both; }
@keyframes fxFade{ from{ opacity:0; transform:scale(1.04); } to{ opacity:1; transform:none; } }
.fx-glitch .ph.on img, .fx-glitch .empty, .gswap-stage.fx-glitch img.on{ animation:gImg .42s steps(1) 1; }
@keyframes gImg{
  0%  { clip-path:inset(12% 0 64% 0); transform:translateX(-10px); }
  15% { clip-path:inset(58% 0 18% 0); transform:translateX(12px); filter:hue-rotate(40deg) saturate(2); }
  30% { clip-path:inset(30% 0 40% 0); transform:translateX(-6px); }
  45% { clip-path:inset(0 0 82% 0);   transform:translateX(8px); }
  60% { clip-path:inset(76% 0 4% 0);  transform:translateX(-12px); filter:invert(1); }
  75% { clip-path:inset(40% 0 44% 0); transform:translateX(5px); }
  100%{ clip-path:inset(0 0 0 0); transform:none; filter:none; }
}

/* ---------- más modos de aparición ---------- */
/* texto */
.tw-sc{ color:var(--red-bright); opacity:.85; }
.tw-w{ opacity:0; filter:blur(4px); transition:opacity .45s ease, filter .45s ease; }
.tw-w.on{ opacity:1; filter:none; }
/* imágenes */
.fx-scan .ph.on img, .fx-scan .empty, .gswap-stage.fx-scan img.on{ animation:fxScan .9s cubic-bezier(.3,.7,.3,1) both; }
@keyframes fxScan{
  0%  { clip-path:inset(0 0 100% 0); filter:brightness(2.4) saturate(0); }
  70% { clip-path:inset(0 0 0 0); filter:brightness(1.4) saturate(.6); }
  100%{ clip-path:inset(0 0 0 0); filter:none; }
}
.fx-scan::after{ content:""; position:absolute; left:0; right:0; top:0; height:3px; z-index:5; pointer-events:none;
  background:#fff; box-shadow:0 0 14px 4px var(--red-glow); animation:fxScanLine .65s cubic-bezier(.3,.7,.3,1) forwards; }
@keyframes fxScanLine{ from{ top:0; opacity:1; } 90%{ opacity:1; } to{ top:100%; opacity:0; } }
.fx-wipe .ph.on img, .fx-wipe .empty, .gswap-stage.fx-wipe img.on{ animation:fxWipe .85s cubic-bezier(.6,0,.2,1) both; }
@keyframes fxWipe{
  from{ clip-path:polygon(0 0, 0 0, -30% 100%, 0 100%); }
  to  { clip-path:polygon(0 0, 130% 0, 100% 100%, 0 100%); }
}
.fx-zoom .ph.on img, .fx-zoom .empty, .gswap-stage.fx-zoom img.on{ animation:fxZoom 1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fxZoom{ from{ opacity:0; transform:scale(1.25); filter:blur(10px); } to{ opacity:1; transform:none; filter:none; } }
