/* ==========================================================================
   CARRUSEL DE TRABAJOS (compartido: home y /portfolio/) · core/carrusel.js
   Anillo 3D de tarjetas holográficas + pantalla navegable (monitor o teléfono
   con la web del cliente en un iframe). Lo cargan con <link> solo las páginas
   que lo usan; la sección lleva [data-carrusel] y la clase .trab.
   Por defecto (sin JS o con "reducir movimiento"): tarjetas en rejilla,
   estáticas, con todo su texto. Con JS: .trab.is-ring. Si la sección tiene
   un panel [data-trab-info], el JS lleva ahí la ficha (.tcard__case) de cada
   tarjeta y enseña la de la tarjeta del frente con un fundido.
   Solo se anima transform, opacity y clip-path (filter: blur solo en modo completo).
   MEMORIA Y GPU (iPhone, móviles medios): las capturas de las tarjetas son recortes de
   2,5 pantallas (560x1400 móvil, 1120x1600 escritorio, <= 7 MB decodificadas), sin
   backdrop-filter, will-change solo mientras algo se mueve, y las tarjetas de detrás se
   apagan con opacidad y un velo del color del fondo (no con blur). Modo ligero (.is-lite,
   lo decide el JS: táctil, poca memoria o pocos núcleos, ahorro de datos o < 40 fps):
   capas holográficas estáticas (se pintan una vez dentro de la tarjeta), sin inclinación
   ni balanceo, desplazamiento de la captura más lento.
   El espaciado de la sección (padding) y su cabecera son de cada página.
   ========================================================================== */
.trab { position: relative; overflow-x: clip; }
.trab__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.trab__ring { list-style: none; margin: clamp(40px, 5vw, 72px) auto 0; padding: 0 var(--gutter); max-width: var(--wrap);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(16px, 2vw, 28px); }
.tcard { --tc-r: 26px; position: relative; display: grid; min-width: 0; }
.tcard__in {
  position: relative; display: flex; flex-direction: column; border-radius: var(--tc-r); padding: 12px 12px 24px; isolation: isolate; overflow: hidden;
  background: linear-gradient(165deg, oklch(23% 0.066 259 / 0.95), oklch(14.5% 0.05 264 / 0.97));
  box-shadow: 0 0 0 1px oklch(72% 0.07 245 / 0.16) inset, 0 1px 0 oklch(95% 0.04 225 / 0.12) inset, 0 50px 90px -50px var(--sh), 0 0 120px -60px var(--glow);
  transform-origin: 50% 50%;
}
.tcard__view { position: relative; display: block; border-radius: 16px; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.tcard__view:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.tcard__screen { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; container-type: size;
  background: var(--paper-3); box-shadow: 0 0 0 1px oklch(75% 0.07 240 / 0.14); }
.tcard__screen::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 1px oklch(85% 0.06 230 / 0.12) inset; background: linear-gradient(to bottom, transparent 72%, oklch(14% 0.05 264 / 0.35)); }
.tcard__screen picture { display: contents; }
.tcard__img { display: block; width: 100%; height: auto; max-width: none; -webkit-user-drag: none; user-select: none; }
.tcard__body { position: relative; z-index: 4; padding: 22px 10px 0; display: flex; flex-direction: column; flex: 1; }
.tcard__title { font-size: clamp(1.2rem, 0.9vw + 0.75rem, 1.6rem); font-weight: 380; font-stretch: 115%; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
.tcard__body > p:not(.tcard__k) { margin: 12px 0 18px; color: var(--ink-2); font-size: 0.98rem; line-height: 1.5; text-wrap: pretty; }
.tcard__body .link-arrow { margin-top: auto; align-self: flex-start; }
.tcard__hint { display: none; }

/* capas holográficas (encima de la captura, debajo del texto) */
.tcard__fx { position: absolute; inset: 0; z-index: 3; border-radius: inherit; overflow: hidden; pointer-events: none; }
.tcard__fx i { position: absolute; display: block; pointer-events: none; }
.tcard__iri { inset: -10% -50%; opacity: var(--iri-op, 0.95); mix-blend-mode: screen;
  background:
    linear-gradient(112deg, transparent 32%, oklch(76% 0.13 238 / 0.2) 40%, oklch(88% 0.09 212 / 0.26) 45%, oklch(70% 0.16 254 / 0.18) 50%, oklch(85% 0.11 200 / 0.24) 55%, transparent 63%),
    linear-gradient(112deg, transparent 8%, oklch(68% 0.15 250 / 0.12) 16%, oklch(84% 0.1 215 / 0.14) 22%, transparent 30%); }
.tcard__foil { inset: 0; opacity: 0.035; mix-blend-mode: overlay;
  background: repeating-linear-gradient(62deg, oklch(95% 0.05 220) 0 1px, transparent 1px 4px); }
.tcard__spec { left: 0; top: 0; width: 120%; aspect-ratio: 1; margin: -60% 0 0 -60%; mix-blend-mode: screen;
  background: radial-gradient(closest-side, oklch(97% 0.03 225 / 0.2), oklch(88% 0.07 225 / 0.06) 45%, transparent 72%); }
.tcard__rim { inset: 0; border-radius: inherit; padding: 1.25px; overflow: hidden;
  background: oklch(78% 0.07 238 / 0.14);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.tcard__rim b { position: absolute; left: 50%; top: 50%; width: 160%; aspect-ratio: 1; margin: -80% 0 0 -80%;
  background: conic-gradient(from 0deg, transparent 0 8%, oklch(94% 0.06 215 / 0.95) 14%, transparent 22% 54%, oklch(80% 0.12 222 / 0.85) 62%, transparent 70%); }

/* ---------- modo carrusel ---------- */
.trab.is-ring .trab__stage { position: relative; margin-top: clamp(28px, 4vw, 56px); padding-block: 12px 8px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.trab.is-ring .trab__stage.is-drag { cursor: grabbing; }
.trab.is-ring .trab__stage a, .trab.is-ring .trab__stage img { -webkit-user-drag: none; }
.trab.is-ring .trab__ring { --cw: clamp(320px, 38vw, 540px); margin: 0 auto; padding: 0; max-width: none; display: grid; grid-template: 1fr / 1fr; justify-items: center; gap: 0;
  perspective: 1600px; perspective-origin: 50% 46%; }
.trab.is-ring .tcard { grid-area: 1 / 1; width: var(--cw); backface-visibility: hidden; }
/* will-change solo mientras gira el anillo; las capas holográficas solo en la del frente y en modo completo */
.trab.is-moving .tcard { will-change: transform, opacity; }
.trab.is-fx .tcard.is-front .tcard__iri, .trab.is-fx .tcard.is-front .tcard__spec, .trab.is-fx .tcard.is-front .tcard__rim b,
.trab.is-fx .tcard.is-front .tcard__in { will-change: transform; }
/* velo de las tarjetas de detrás (sustituye al desenfoque): color del fondo, sube con la profundidad */
.trab.is-ring .tcard__in::after { content: ""; position: absolute; inset: 0; z-index: 6; border-radius: inherit; pointer-events: none;
  background: var(--paper); opacity: 0; transition: opacity 520ms var(--ease); }
.trab.is-ring .tcard[data-lvl="1"] .tcard__in::after { opacity: 0.4; }
.trab.is-ring .tcard[data-lvl="2"] .tcard__in::after { opacity: 0.58; }
.trab.is-lite .tcard__spec { opacity: 0.7; }
/* modo ligero: sin las sombras grandes difuminadas (agrandan cada capa 3D ~2,4 veces y son lo más caro de
   componer al girar); en su lugar un halo fijo bajo el anillo, pintado una vez en la página */
.trab.is-lite .trab__stage::before { content: ""; position: absolute; left: 12%; right: 12%; top: 18%; bottom: -2%; pointer-events: none;
  background: radial-gradient(closest-side, var(--glow), transparent); opacity: 0.55; }
.trab.is-lite .trab__ring { position: relative; }
.trab.is-ring.is-lite .tcard__in { box-shadow: 0 0 0 1px oklch(72% 0.07 245 / 0.16) inset, 0 1px 0 oklch(95% 0.04 225 / 0.12) inset; }
.trab.is-ring.is-lite .tcard.is-front .tcard__in { box-shadow: 0 0 0 1px oklch(80% 0.08 235 / 0.3) inset, 0 1px 0 oklch(95% 0.04 225 / 0.18) inset; }
html[data-theme="dia"] .trab.is-ring.is-lite .tcard__in { box-shadow: 0 0 0 1px oklch(40% 0.08 252 / 0.14) inset, 0 1px 0 oklch(100% 0 0 / 0.9) inset; }
html[data-theme="dia"] .trab.is-ring.is-lite .tcard.is-front .tcard__in { box-shadow: 0 0 0 1px oklch(48% 0.12 252 / 0.26) inset, 0 1px 0 oklch(100% 0 0 / 0.9) inset; }
/* modo ligero: sin desenfoque, el velo apaga un poco más */
.trab.is-lite .tcard[data-lvl="1"] .tcard__in::after { opacity: 0.58; }
.trab.is-lite .tcard[data-lvl="2"] .tcard__in::after { opacity: 0.66; }
.trab.is-ring .tcard:not(.is-front) .tcard__in { cursor: pointer; }
.trab.is-fx .tcard__in { transition: box-shadow 600ms var(--ease); }
.trab.is-ring .tcard.is-front .tcard__in { box-shadow: 0 0 0 1px oklch(80% 0.08 235 / 0.24) inset, 0 1px 0 oklch(95% 0.04 225 / 0.18) inset, 0 60px 110px -50px var(--sh), 0 0 140px -40px var(--glow); }
.trab.is-ring .tcard.is-open { visibility: hidden; }
.trab.is-live .tcard.is-front .tcard__img { animation: tcard-scroll 22s cubic-bezier(0.45, 0, 0.55, 1) 1.4s infinite alternate; }
.trab.is-lite.is-live .tcard.is-front .tcard__img { animation-duration: 40s; }
.trab.is-live .tcard.is-front .tcard__view:hover .tcard__img { animation-play-state: paused; }
@keyframes tcard-scroll { 0%, 6% { transform: translate3d(0, 0, 0); } 94%, 100% { transform: translate3d(0, calc(-100% + 100cqh), 0); } }

.trab.is-ring .tcard__hint { position: absolute; right: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 14px 9px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 540; letter-spacing: 0.01em; color: var(--ink);
  background: oklch(17% 0.055 262 / 0.93); box-shadow: 0 0 0 1px oklch(85% 0.07 228 / 0.32) inset, 0 12px 28px -12px var(--sh), 0 0 26px -8px var(--glow);
  opacity: 0; transform: translate(0, 8px); transition: opacity 400ms var(--ease), transform 500ms var(--ease); }
.trab.is-ring .tcard.is-front .tcard__hint { opacity: 1; transform: none; transition-delay: 200ms; }
.trab.is-ring .tcard.is-front .tcard__view:hover .tcard__hint { transform: translate3d(0, -2px, 0); box-shadow: 0 0 0 1px oklch(90% 0.07 225 / 0.6) inset, 0 16px 32px -12px var(--sh), 0 0 34px -6px var(--glow); }
.tcard__hint i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px 1px var(--cyan); }
.tcard__hint i::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--cyan); opacity: 0; animation: tcard-ping 2.4s var(--ease) infinite; }
@keyframes tcard-ping { 0% { transform: scale(0.4); opacity: 0.9; } 70%, 100% { transform: scale(1.6); opacity: 0; } }
.tcard__hint-c { display: none; }
@media (hover: none), (pointer: coarse) { .tcard__hint-f { display: none; } .tcard__hint-c { display: inline; } }

.trab__ctrl { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: clamp(22px, 2.6vw, 36px); }
.trab__ctrl[hidden] { display: none; }
.trab__arrow { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; color: var(--ink); font: inherit;
  background: linear-gradient(160deg, oklch(32% 0.075 256 / 0.6), oklch(22% 0.06 260 / 0.55)); box-shadow: 0 0 0 1px var(--edge-strong) inset, 0 14px 30px -16px var(--sh);
  transition: background-color 300ms var(--ease), box-shadow 300ms var(--ease), transform 160ms var(--ease-press); }
.trab__arrow .ico { width: 1.25em; height: 1.25em; transform: rotate(180deg); transition: transform 400ms var(--ease); }
.trab__arrow--next .ico { transform: none; }
.trab__arrow:hover { background: oklch(36% 0.09 255 / 0.7); box-shadow: 0 0 0 1px oklch(88% 0.07 230 / 0.6) inset, 0 0 30px -6px var(--glow); }
.trab__arrow:hover .ico { transform: rotate(180deg) translateX(3px); }
.trab__arrow--next:hover .ico { transform: translateX(3px); }
.trab__arrow:active { transform: scale(0.94); }
.trab__arrow:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.trab__count { min-width: 6.5ch; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.95rem; letter-spacing: 0.08em; }
.trab__count b { color: var(--ink); font-weight: 520; }
.trab__count span:not([data-trab-total]) { margin-inline: 6px; opacity: 0.6; }

/* ---------- antes de que arranque el JS: ya con forma de carrusel (sin salto de maquetación) ----------
   Solo con JS y sin "reducir movimiento" (el JS se apaga en ese caso y quedan las tarjetas estáticas). */
@media (prefers-reduced-motion: no-preference) {
  html.js .trab:not(.is-ring) .trab__stage { margin-top: clamp(28px, 4vw, 56px); padding-block: 12px 8px; }
  html.js .trab:not(.is-ring) .trab__ring { --cw: clamp(320px, 38vw, 540px); margin: 0 auto; padding: 0; max-width: none; grid-template: 1fr / 1fr; justify-items: center; gap: 0; }
  html.js .trab:not(.is-ring) .tcard { grid-area: 1 / 1; width: var(--cw); }
  html.js .trab:not(.is-ring) .tcard ~ .tcard { visibility: hidden; }
  html.js .trab:not(.is-ring) .tcard__case { display: none; }
  html.js .trab__ctrl[hidden] { display: flex; visibility: hidden; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 759px) {
  html.js .trab:not(.is-ring) .trab__ring { --cw: min(74vw, 340px); }
}

/* ---------- ficha de cada trabajo (portfolio): antetítulo y bloque de detalle ---------- */
.tcard__k { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sky); font-weight: 560; margin-bottom: 8px; }
.tcard__case { display: grid; gap: 16px; justify-items: start; margin-top: 16px; }
.trab.is-ring .tcard__body { padding-bottom: 2px; }

/* panel bajo el carrusel con la ficha de la tarjeta del frente: todas apiladas en la misma celda
   (alto estable, sin saltos al girar) y fundido entre ellas */
.trab__info { display: none; }
.trab.is-ring .trab__info { display: grid; grid-template: 1fr / 1fr; max-width: var(--wrap); margin: clamp(28px, 3.4vw, 48px) auto 0; padding: 0 var(--gutter); }
.trab.is-ring .trab__info > .tcard__case { grid-area: 1 / 1; margin: 0; align-self: start; opacity: 0; visibility: hidden; transform: translate3d(0, 10px, 0);
  transition: opacity 320ms var(--ease), transform 420ms var(--ease), visibility 0s linear 420ms; }
.trab.is-ring .trab__info > .tcard__case.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity 520ms var(--ease) 140ms, transform 640ms var(--ease) 140ms, visibility 0s; }

@media (max-width: 900px) {
  .trab__ring { grid-template-columns: minmax(0, 1fr); max-width: 560px; gap: 22px; }
}
@media (max-width: 759px) {
  .tcard__screen { aspect-ratio: 1 / 1.04; }
  .trab.is-ring .trab__ring { --cw: min(74vw, 340px); perspective: 1000px; }
  .tcard__in { padding: 10px 10px 20px; }
  .tcard__body { padding: 18px 8px 0; }
  .tcard__body > p:not(.tcard__k) { font-size: 0.94rem; margin: 10px 0 14px; }
  .trab.is-ring .tcard__hint { right: 10px; bottom: 10px; font-size: 0.8125rem; padding: 8px 12px 8px 10px; }
}

/* ---------- pantalla conceptual (dialog creado por page.js) ---------- */
html.trab-lock { overflow: hidden; }
.tscr { position: fixed; inset: 0; z-index: 920; display: grid; place-items: center; }
.tscr[hidden] { display: none; }
.tscr__bg { position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(55% 50% at 50% 46%, oklch(34% 0.11 252 / 0.45), transparent 72%), oklch(8.5% 0.04 266 / 0.9); }
.tscr__wrap { position: relative; display: grid; justify-items: center; gap: 22px; }
.tscr__dev { --dr: 24px; position: relative; display: flex; flex-direction: column; border-radius: var(--dr); padding: 10px;
  width: min(1240px, 92vw, calc((100svh - 150px) * 1.6)); aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, oklch(30% 0.075 255 / 0.62), oklch(15% 0.05 264 / 0.72));
  box-shadow: 0 0 0 1px oklch(82% 0.08 230 / 0.2) inset, 0 70px 140px -60px oklch(3% 0.04 264), 0 0 160px -50px oklch(64% 0.17 255 / 0.55);
  will-change: transform, clip-path; }
/* filo de luz: línea fina que recorre el canto superior */
.tscr__dev::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(100deg, transparent 8%, oklch(95% 0.06 215 / 0.9) 34%, oklch(80% 0.12 230 / 0.35) 52%, transparent 70%) top / 100% 50% no-repeat,
              linear-gradient(170deg, oklch(85% 0.08 225 / 0.35), transparent 30%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.tscr__floor { position: absolute; left: 10%; right: 10%; bottom: 40px; height: 80px; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, oklch(70% 0.14 235 / 0.34), oklch(70% 0.14 235 / 0.12) 55%, transparent); }
.tscr__bar { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 2px 10px; flex: none; }
.tscr__url { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px;
  font-size: 0.875rem; color: var(--ink-2); background: oklch(10% 0.04 266 / 0.55); box-shadow: 0 0 0 1px oklch(72% 0.06 245 / 0.14) inset; }
.tscr__url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tscr__url svg { flex: none; width: 13px; height: 13px; color: var(--sky); }
.tscr__btn, .tscr__close { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; border-radius: 999px; border: 0; cursor: pointer;
  font: inherit; font-size: 0.875rem; font-weight: 540; color: var(--ink); text-decoration: none;
  background: oklch(30% 0.07 258 / 0.5); box-shadow: 0 0 0 1px var(--edge-strong) inset; transition: background-color 250ms var(--ease), box-shadow 250ms var(--ease); }
.tscr__btn { padding: 0 14px; }
.tscr__btn svg, .tscr__close svg { width: 15px; height: 15px; }
.tscr__close { width: 34px; padding: 0; }
.tscr__btn:hover, .tscr__close:hover { background: oklch(38% 0.09 255 / 0.6); box-shadow: 0 0 0 1px oklch(88% 0.07 230 / 0.6) inset, 0 0 24px -6px var(--glow); }
.tscr__btn:focus-visible, .tscr__close:focus-visible, .tscr__fall:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tscr__view { position: relative; flex: 1; min-height: 0; border-radius: 14px; overflow: hidden; background: oklch(97% 0.008 250); isolation: isolate; }
.tscr__ghost { position: absolute; left: 0; top: 0; width: 100%; height: auto; max-width: none; z-index: 1; will-change: transform; transition: opacity 400ms var(--ease); }
.tscr__view iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2; opacity: 0; transition: opacity 450ms var(--ease); background: oklch(98% 0.005 250); }
.tscr__view.is-loaded iframe { opacity: 1; }
.tscr__view.is-loaded .tscr__ghost, .tscr__view.is-fall .tscr__ghost { opacity: 0; }
.tscr__fall { position: absolute; inset: 0; z-index: 2; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; opacity: 0; transition: opacity 400ms var(--ease); }
.tscr__view.is-fall .tscr__fall { opacity: 1; }
.tscr__fall img { display: block; width: 100%; height: auto; max-width: none; }
.tscr__fall img:not([src]) { visibility: hidden; }
.tscr__cta { position: absolute; left: 50%; bottom: 22px; z-index: 4; translate: -50% 0; white-space: nowrap; }
.tscr__cta[hidden] { display: none; }
.tscr__load { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 16px; pointer-events: none;
  background: linear-gradient(170deg, oklch(16% 0.05 262 / 0.86), oklch(11% 0.045 265 / 0.9));
  color: var(--ink); font-size: 0.95rem; transition: opacity 450ms var(--ease); }
.tscr__view.is-loaded .tscr__load, .tscr__view.is-fall .tscr__load, .tscr.is-closing .tscr__load { opacity: 0; }
.tscr__load i { position: relative; width: 160px; height: 3px; border-radius: 3px; overflow: hidden; background: oklch(45% 0.07 255 / 0.5); }
.tscr__load i::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 12px var(--electric); animation: tscr-load 1.2s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
@keyframes tscr-load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.tscr__cap { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 0.95rem; color: var(--muted); text-align: center; opacity: 0; }
.tscr__cap b { color: var(--ink); font-weight: 520; }
.tscr__island { display: none; }

/* móvil: pantalla de teléfono */
.tscr--phone .tscr__wrap { gap: 0; }
.tscr--phone .tscr__dev { --dr: 46px; padding: 8px; aspect-ratio: auto; width: min(92vw, 400px, calc((100svh - 28px) * 0.47)); height: min(calc(100svh - 28px), calc(min(92vw, 400px) / 0.47)); }
.tscr--phone .tscr__view { border-radius: 39px; order: 2; }
.tscr--phone .tscr__bar { order: 1; position: absolute; left: 8px; right: 8px; top: 8px; z-index: 5; height: auto; padding: 44px 12px 10px; border-radius: 39px 39px 0 0;
  background: linear-gradient(to bottom, oklch(12% 0.045 264 / 0.97), oklch(12% 0.045 264 / 0.93)); }
.tscr--phone .tscr__view { margin-top: 0; padding-top: 0; }
.tscr--phone .tscr__view > iframe, .tscr--phone .tscr__view > .tscr__fall { top: 88px; bottom: auto; height: calc(100% - 88px); }
.tscr--phone .tscr__ghost { top: 88px; }
.tscr--phone .tscr__btn span { display: none; }
.tscr--phone .tscr__btn { width: 34px; padding: 0; }
.tscr--phone .tscr__island { display: block; position: absolute; top: 18px; left: 50%; z-index: 6; width: 96px; height: 26px; margin-left: -48px; border-radius: 999px;
  background: oklch(6% 0.03 266); box-shadow: 0 0 0 1px oklch(70% 0.06 245 / 0.12), inset 0 0 6px oklch(60% 0.1 250 / 0.25); }
.tscr--phone .tscr__cap, .tscr--phone .tscr__floor { display: none; }
.tscr--phone .tscr__cta { bottom: 26px; }

@media (prefers-reduced-motion: reduce) {
  .tcard__hint i::after, .tscr__load i::after { animation: none; }
}

/* ==========================================================================
   MODO DÍA (html[data-theme="dia"]) · trabajos (carrusel y pantalla)
   Cristal blanco, iridiscencia en multiply (cian y azul pálidos), filo en
   azul marino al 20-45 %. Patrón: docs/MODO-DIA-PATRONES.md
   ========================================================================== */
html[data-theme="dia"] .tcard__in {
  background: linear-gradient(165deg, oklch(99% 0.006 240 / 0.97), oklch(95% 0.018 245 / 0.97));
  box-shadow: 0 0 0 1px oklch(40% 0.08 252 / 0.12) inset, 0 1px 0 oklch(100% 0 0 / 0.9) inset, 0 50px 90px -50px var(--sh), 0 0 110px -60px var(--glow); }
html[data-theme="dia"] .trab.is-ring .tcard.is-front .tcard__in {
  box-shadow: 0 0 0 1px oklch(48% 0.12 252 / 0.22) inset, 0 1px 0 oklch(100% 0 0 / 0.9) inset, 0 60px 110px -50px var(--sh), 0 0 130px -40px var(--glow-strong); }
html[data-theme="dia"] .tcard__screen { box-shadow: 0 0 0 1px oklch(40% 0.08 252 / 0.14); }
html[data-theme="dia"] .tcard__screen::after { box-shadow: 0 0 0 1px oklch(100% 0 0 / 0.5) inset; background: linear-gradient(to bottom, transparent 75%, oklch(40% 0.08 252 / 0.08)); }
html[data-theme="dia"] .tcard__iri { --iri-op: 0.9; mix-blend-mode: multiply;
  background:
    linear-gradient(112deg, transparent 32%, oklch(88% 0.07 238 / 0.55) 40%, oklch(93% 0.06 212 / 0.6) 45%, oklch(86% 0.08 254 / 0.5) 50%, oklch(92% 0.07 200 / 0.55) 55%, transparent 63%),
    linear-gradient(112deg, transparent 8%, oklch(88% 0.07 250 / 0.4) 16%, oklch(93% 0.06 215 / 0.4) 22%, transparent 30%); }
html[data-theme="dia"] .tcard__foil { opacity: 0.05; mix-blend-mode: multiply; background: repeating-linear-gradient(62deg, oklch(60% 0.1 245) 0 1px, transparent 1px 4px); }
html[data-theme="dia"] .tcard__spec { mix-blend-mode: normal; background: radial-gradient(closest-side, oklch(100% 0 0 / 0.42), oklch(100% 0 0 / 0.1) 45%, transparent 72%); }
html[data-theme="dia"] .trab.is-ring .tcard[data-lvl="1"] .tcard__in::after { opacity: 0.36; }
html[data-theme="dia"] .trab.is-ring .tcard[data-lvl="2"] .tcard__in::after { opacity: 0.5; }
html[data-theme="dia"] .trab.is-lite .tcard[data-lvl="1"] .tcard__in::after { opacity: 0.52; }
html[data-theme="dia"] .trab.is-lite .tcard[data-lvl="2"] .tcard__in::after { opacity: 0.6; }
html[data-theme="dia"] .tcard__rim { background: oklch(45% 0.1 252 / 0.14); }
html[data-theme="dia"] .tcard__rim b { background: conic-gradient(from 0deg, transparent 0 8%, oklch(55% 0.16 252 / 0.75) 14%, transparent 22% 54%, oklch(62% 0.12 225 / 0.7) 62%, transparent 70%); }
html[data-theme="dia"] .trab.is-ring .tcard__hint { color: var(--ink); background: oklch(99% 0.005 240 / 0.9); box-shadow: 0 0 0 1px var(--edge-strong) inset, 0 12px 26px -14px var(--sh); }
html[data-theme="dia"] .trab.is-ring .tcard.is-front .tcard__view:hover .tcard__hint { box-shadow: 0 0 0 1px oklch(45% 0.12 252 / 0.45) inset, 0 16px 30px -14px var(--glow); }
html[data-theme="dia"] .tcard__hint i { background: var(--sky); box-shadow: 0 0 8px 1px var(--glow); }
html[data-theme="dia"] .tcard__hint i::after { border-color: var(--sky); }
html[data-theme="dia"] .trab__arrow { background: linear-gradient(160deg, oklch(100% 0 0 / 0.78), oklch(96% 0.014 245 / 0.66)); box-shadow: 0 0 0 1px var(--edge-strong) inset, 0 12px 26px -16px var(--sh); }
html[data-theme="dia"] .trab__arrow:hover { background: oklch(100% 0 0 / 0.88); box-shadow: 0 0 0 1px oklch(45% 0.12 252 / 0.45) inset, 0 14px 30px -14px var(--glow); }
html[data-theme="dia"] .tscr__bg { background: radial-gradient(55% 50% at 50% 46%, oklch(84% 0.07 240 / 0.6), transparent 72%), oklch(91% 0.022 246 / 0.9); }
html[data-theme="dia"] .tscr__dev { background: linear-gradient(160deg, oklch(99% 0.006 240 / 0.8), oklch(92% 0.025 246 / 0.78));
  box-shadow: 0 0 0 1px oklch(40% 0.08 252 / 0.16) inset, 0 1px 0 oklch(100% 0 0) inset, 0 70px 140px -60px oklch(35% 0.09 258 / 0.55), 0 0 140px -50px var(--glow); }
html[data-theme="dia"] .tscr__dev::before { background: linear-gradient(100deg, transparent 8%, oklch(100% 0 0) 34%, oklch(70% 0.12 235 / 0.4) 52%, transparent 70%) top / 100% 50% no-repeat,
  linear-gradient(170deg, oklch(55% 0.14 252 / 0.3), transparent 30%); }
html[data-theme="dia"] .tscr__floor { background: radial-gradient(closest-side, oklch(55% 0.16 255 / 0.35), transparent); }
html[data-theme="dia"] .tscr__url { background: oklch(100% 0 0 / 0.7); box-shadow: 0 0 0 1px oklch(40% 0.08 252 / 0.14) inset; color: var(--ink-2); }
html[data-theme="dia"] .tscr__btn, html[data-theme="dia"] .tscr__close { background: oklch(100% 0 0 / 0.6); box-shadow: 0 0 0 1px var(--edge-strong) inset; }
html[data-theme="dia"] .tscr__btn:hover, html[data-theme="dia"] .tscr__close:hover { background: oklch(100% 0 0 / 0.92); box-shadow: 0 0 0 1px oklch(45% 0.12 252 / 0.45) inset, 0 0 22px -6px var(--glow); }
html[data-theme="dia"] .tscr__load { background: linear-gradient(170deg, oklch(97% 0.01 245 / 0.86), oklch(94% 0.016 246 / 0.9)); }
html[data-theme="dia"] .tscr__load i { background: oklch(60% 0.06 250 / 0.25); }
html[data-theme="dia"] .tscr__load i::after { background: linear-gradient(90deg, transparent, var(--sky), transparent); box-shadow: 0 0 10px var(--glow); }
html[data-theme="dia"] .tscr--phone .tscr__bar { background: linear-gradient(to bottom, oklch(98% 0.008 240 / 0.98), oklch(96% 0.012 245 / 0.95)); }
html[data-theme="dia"] .tscr--phone .tscr__island { background: oklch(22% 0.05 260); box-shadow: 0 0 0 1px oklch(100% 0 0 / 0.5); }
