/* ---------- Taller 3D (entrada «/») ----------
   La escena (Three.js, js/workshop/) ocupa todo el espacio bajo la cabecera. Encima solo hay HTML cuando hace
   falta: la tarjeta del objeto señalado, la pantalla de carga y la versión sencilla. Comparte tokens, cabecera,
   botones y paneles con css/styles.css. */


.workshop {
  position: relative; overflow: hidden;
  height: calc(100svh - 64px); min-height: 440px;
  background: #c9c6c0;
}
.ws-stage, .ws-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ws-canvas { touch-action: none; opacity: 0; transition: opacity .5s ease-out; outline: none; }
.workshop.is-ready .ws-canvas { opacity: 1; }

/* Salida hacia una práctica: fundido al fondo de la mesa técnica. */
.workshop::after { content: ""; position: absolute; inset: 0; z-index: 8; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .45s ease-in; }
.workshop.is-leaving::after { opacity: 1; }

/* Puntos de interés para teclado y lectores de pantalla: invisibles; con el foco se señala el objeto en la escena
   (halo y tarjeta), que hace de indicador de foco. */
.ws-points { position: absolute; left: 0; top: 0; margin: 0; padding: 0; list-style: none; }
.ws-points button {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* Tarjeta contextual: solo al señalar o seleccionar. */
.ws-card {
  position: absolute; left: 0; top: 0; z-index: 5; width: max-content; max-width: min(300px, calc(100% - 24px));
  display: grid; grid-template-columns: 32px 1fr; gap: 3px 12px; padding: 11px 15px; border-radius: 13px;
  border: 1px solid #a9dcf5; color: #eef8ff;
  background: linear-gradient(135deg, rgb(13 40 62 / 96%), rgb(7 26 43 / 91%));
  box-shadow: 0 0 0 3px rgb(54 169 240 / 12%), 0 0 21px rgb(47 164 240 / 38%), inset 0 1px 13px rgb(120 205 255 / 12%), 0 9px 24px rgb(0 15 30 / 24%);
  backdrop-filter: blur(12px); opacity: 0; translate: 0 4px; transition: opacity .16s ease-out, translate .16s ease-out;
  pointer-events: auto;
}
.ws-card::after { content: ""; position: absolute; left: var(--anchor-x, 50%); top: 100%; height: 17px; width: 1px; background: linear-gradient(#8ad6ff, #49baff); pointer-events: none; }
.ws-card::before { content: ""; position: absolute; left: var(--anchor-x, 50%); top: calc(100% + 14px); width: 8px; height: 8px; translate: -50% 0; border-radius: 50%; background: #effcff; border: 1px solid #6cccff; box-shadow: 0 0 0 4px rgb(66 175 255 / 17%), 0 0 12px #56c3ff; pointer-events: none; }
.ws-card[hidden] { display: none; }
.ws-card.is-visible { opacity: 1; translate: 0 0; }
.ws-card__icon { grid-column: 1; grid-row: 1 / span 5; align-self: center; width: 30px; height: 38px; color: #c4eaff; filter: drop-shadow(0 0 5px rgb(83 186 255 / 35%)); }
.ws-card > :not(.ws-card__icon) { grid-column: 2; }
.ws-card__title { font-size: 15px; line-height: 1.3; font-weight: 700; color: #f5fbff; }
.ws-card__text { font-size: 12px; line-height: 1.4; color: #c8dceb; max-width: 215px; }
.ws-card__soon, .ws-card__status { font-size: 12px; color: #a9c4d7; }
.ws-card__action.btn { justify-self: start; margin-top: 5px; padding: 4px 0; min-height: 28px; border: 0; border-radius: 0; background: transparent; color: #87d8ff; font-size: 13px; text-decoration: none; box-shadow: none; }
.ws-card__action.btn:hover { color: #fff; background: transparent; }
.ws-card__action:focus-visible { outline: 2px solid #8bdcff; outline-offset: 4px; }
.ws-card[data-kind="soon"] { border-color: #7c9db4; box-shadow: 0 4px 18px rgb(0 15 30 / 28%), inset 0 1px 10px rgb(120 205 255 / 8%); }
.ws-card [hidden] { display: none; }

/* Carga: el icono, una frase y un indicador discreto. */
.ws-loader {
  position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center; gap: 10px;
  background: #e4e9ed; color: var(--muted); font-size: 14.5px; transition: opacity .45s ease-out;
}
.ws-loader[hidden] { display: none; }
.workshop.is-ready .ws-loader { opacity: 0; pointer-events: none; }
.ws-loader__bar { position: relative; width: 120px; height: 3px; border-radius: 3px; background: rgb(var(--navy-rgb) / 12%); overflow: hidden; }
.ws-loader__bar::after { content: ""; position: absolute; inset: 0; background: var(--blue); transform-origin: left; transform: scaleX(var(--load, .08)); transition: transform .25s; }

/* Versión sencilla (sin WebGL o si el 3D no arranca). */
.ws-fallback {
  position: absolute; inset: 0; z-index: 7; display: grid; place-content: center; justify-items: center; gap: 8px;
  padding: 24px; text-align: center; background: linear-gradient(180deg, #e9edf0, #d6dde3); color: var(--ink);
}
.ws-fallback[hidden] { display: none; }
.ws-fallback__title { font-size: 19px; font-weight: 700; color: var(--navy); }
.ws-fallback__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.ws-fallback .btn { text-decoration: none; }
.ws-noscript { position: absolute; left: 24px; bottom: 24px; z-index: 9; padding: 10px 14px; border-radius: 10px; background: var(--surface); }

.practices--about { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; }
.practices--about[open] { display: flex; flex-direction: column; }   /* la cabecera fija; el texto se desplaza */
.practices__text { overflow-y: auto; padding: 4px 20px 20px; font-size: 15px; line-height: 1.55; }
.practices__text p { margin: 12px 0 0; }
.practices__text h3 { margin: 22px 0 0; font-size: 15.5px; color: var(--navy); }
.practices__text ul, .practices__text ol { margin: 8px 0 0; padding-left: 22px; }
.practices__text li + li { margin-top: 5px; }
.practices__text strong { color: var(--navy); }
.practices__text .practice-link { margin-top: 14px; }
.practices__text .practices__legal { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.practices__text .practices__legal a { color: var(--muted); }

.hub .tool .icon { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  .ws-canvas, .ws-card, .ws-loader, .workshop::after { transition: none; }
}
@media (max-width: 700px) {
  .workshop { height: calc(100svh - 64px); min-height: 380px; }
  .hub .topbar { padding: 8px 12px; }
  .ws-card { max-width: calc(100% - 24px); }
}

/* La marca conserva el blanco en todos los estados del enlace. */
.hub .brand__name a:any-link, .hub .brand__home:any-link{color:var(--on-dark,#fff);text-decoration:none}

.practices__text nav a,.practices__text strong a{color:var(--blue);text-underline-offset:2px}
