/* ==========================================================
   Mesa: capa de objetos, pista, botón de ordenar y cada objeto
   ========================================================== */

.desk {
  --obj-shadow: 0 2px 4px rgba(22, 32, 46, .12), 0 8px 18px rgba(22, 32, 46, .14);
  --obj-shadow-lift: 0 10px 18px rgba(22, 32, 46, .16), 0 26px 50px rgba(22, 32, 46, .26);
  --paper: #FFFFFF;
  --paper-ink: #16202E;
}
:root[data-theme="dark"] .desk {
  --obj-shadow: 0 2px 4px rgba(0, 0, 0, .35), 0 8px 18px rgba(0, 0, 0, .35);
  --obj-shadow-lift: 0 10px 18px rgba(0, 0, 0, .4), 0 26px 50px rgba(0, 0, 0, .55);
  --paper: #F2F4F7;
}

.desk__objects {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ---------- Objeto genérico ---------- */
.desk-obj {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper-ink);
  text-align: left;
  pointer-events: auto;
  touch-action: none;           /* el arrastre táctil no hace scroll */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
  will-change: transform;
}
.desk-obj__art {
  display: block;
  border-radius: inherit;
  box-shadow: var(--obj-shadow);
  transition: box-shadow .25s var(--ease-out);
}
.desk-obj.is-dragging { cursor: grabbing; }
.desk-obj.is-dragging .desk-obj__art { box-shadow: var(--obj-shadow-lift); }
.desk-obj:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 6px;
}
.desk-obj img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.desk-obj i, .desk-obj b { display: block; }

/* Ocultos hasta que JS los coloca (evita el salto inicial) */
.desk:not(.is-ready) .desk__objects { visibility: hidden; }

/* ---------- Polaroid ---------- */
.obj-polaroid .desk-obj__art {
  width: 150px;
  padding: 10px 10px 0;
  background: var(--paper);
  border-radius: 3px;
}
.obj-polaroid__photo {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 2px;
  background: linear-gradient(150deg, #F7D9C4, #CFE3DA);
}
.obj-polaroid__caption {
  display: block;
  padding: 9px 2px 12px;
  font: 600 .8125rem/1.2 var(--f-body);
  text-align: center;
}
[data-id="inc-london"] .obj-polaroid__photo {
  background: linear-gradient(160deg, #1D2A3B, #3A4C63);
  --mini-ink: rgba(255, 255, 255, .75);
  --mini-soft: rgba(255, 255, 255, .25);
}

/* Mini web dibujada (miniatura provisional) */
.mini-web {
  --mini-ink: rgba(22, 32, 46, .7);
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 12px;
}
.mini-web__bar { height: 6px; width: 40%; border-radius: 3px; background: var(--mini-ink); opacity: .5; }
.mini-web__h { height: 12px; width: 80%; margin-top: 10px; border-radius: 3px; background: var(--mini-ink); }
.mini-web__p { height: 5px; width: 90%; border-radius: 3px; background: var(--mini-ink); opacity: .35; }
.mini-web__p--short { width: 60%; }
.mini-web__block { flex: 1; margin-top: 6px; border-radius: 4px; background: var(--c-accent); opacity: .85; }
[data-id="inc-london"] .mini-web__block { background: var(--mini-soft); }

/* ---------- Móvil con mini tienda ---------- */
.obj-phone .desk-obj__art {
  width: 112px;
  height: 214px;
  padding: 7px;
  border-radius: 22px;
  background: #16202E;
}
.obj-phone__screen {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: 100%;
  padding: 10px 8px;
  border-radius: 16px;
  background: #FFFFFF;
}
.obj-phone__top {
  display: flex;
  align-items: center;
  gap: 5px;
  font: 700 .5625rem/1.1 var(--f-display);
  letter-spacing: -.01em;
}
.obj-phone__top i { width: 10px; height: 10px; flex: none; border-radius: 3px; background: var(--c-accent); }
.obj-phone__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 1;
}
.obj-phone__item { display: flex; flex-direction: column; gap: 3px; }
.obj-phone__item i { flex: 1; border-radius: 5px; background: #E7EDF3; }
.obj-phone__item:nth-child(1) i { background: #F6E0B3; }
.obj-phone__item:nth-child(4) i { background: #D9E6D2; }
.obj-phone__item b { height: 4px; width: 70%; border-radius: 2px; background: #16202E; opacity: .5; }
.obj-phone__cta { height: 16px; border-radius: 999px; background: var(--c-accent); }

/* ---------- Post-it ---------- */
.obj-postit .desk-obj__art {
  position: relative;
  width: 148px;
  height: 148px;
  padding: 26px 16px 16px;
  background: var(--c-postit);
  border-radius: 2px 2px 14px 2px;
}
.obj-postit__tape {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 62px;
  height: 22px;
  translate: -50% 0;
  rotate: -3deg;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.obj-postit__title {
  display: block;
  font: 700 1.05rem/1.15 var(--f-display);
  letter-spacing: -.02em;
}
.obj-postit__lines { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.obj-postit__lines i { height: 3px; border-radius: 2px; background: rgba(22, 32, 46, .28); }
.obj-postit__lines i:nth-child(2) { width: 80%; }
.obj-postit__lines i:nth-child(3) { width: 55%; }

/* ---------- Sello WCAG ---------- */
.obj-stamp .desk-obj__art {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  background: var(--paper);
}
.obj-stamp__svg { width: 100%; height: 100%; }
.obj-stamp__ring { fill: none; stroke: var(--c-accent); stroke-width: 3; }
.obj-stamp__ring--thin { stroke-width: 1.5; stroke-dasharray: 3 3; }
.obj-stamp__around {
  font: 600 9.5px var(--f-mono);
  letter-spacing: 1.6px;
  fill: #16202E;
}
.obj-stamp__aa { font: 800 20px var(--f-display); fill: var(--c-accent); }
.obj-stamp__wcag { font: 500 8.5px var(--f-mono); fill: #16202E; }

/* ---------- Billete de avión ---------- */
.obj-ticket .desk-obj__art {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 56px;
  width: 232px;
  height: 96px;
  border-radius: 10px;
  background: var(--paper);
  overflow: hidden;
}
.obj-ticket__main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 0 14px 0 16px;
  border-left: 6px solid var(--c-accent);
}
.obj-ticket__kicker { font: 500 .5625rem/1 var(--f-mono); letter-spacing: .14em; color: #4A5868; }
.obj-ticket__route { font: 700 1.3rem/1.15 var(--f-display); letter-spacing: -.02em; }
.obj-ticket__plane { color: var(--c-accent); font-size: .9em; }
.obj-ticket__name { font: 600 .75rem/1.2 var(--f-body); color: #4A5868; }
.obj-ticket__stub {
  display: grid;
  place-items: center;
  border-left: 2px dashed #C9D3DE;
}
.obj-ticket__barcode {
  width: 26px;
  height: 64px;
  background: repeating-linear-gradient(0deg, #16202E 0 2px, transparent 2px 4px, #16202E 4px 5px, transparent 5px 8px);
}

/* ---------- Tecla "hola" ---------- */
.obj-key .desk-obj__art {
  width: 86px;
  height: 86px;
  padding: 5px 5px 10px;
  border-radius: 16px;
  background: #CBD4DE;
}
.obj-key__cap {
  display: grid;
  place-items: center;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(180deg, #FFFFFF, #EEF2F6);
  font: 500 1rem/1 var(--f-mono);
}
.obj-key:active .obj-key__cap { translate: 0 2px; }

/* ---------- Pista y botón de ordenar ---------- */
.desk__hint,
.desk__reset {
  position: absolute;
  bottom: 18px;
  z-index: 1000;
  font-size: .75rem;
}
.desk__hint {
  left: 22px;
  color: var(--c-muted);
  pointer-events: none;
}
.desk__hint-touch { display: none; }
.desk__reset {
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--c-text) 25%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--c-surface) 80%, transparent);
  transition: background-color .2s, border-color .2s;
}
.desk__reset:hover { border-color: var(--c-text); background: var(--c-surface); }
.desk__reset .icon { width: 16px; height: 16px; }

/* Tamaño intermedio: titular más estrecho para dejar sitio a los objetos */
@media (max-width: 1100px) and (min-width: 821px) {
  .desk__headline { max-width: 460px; }
}

/* ---------- Móvil: sin arrastre, objetos apilados bajo el titular ---------- */
@media (max-width: 820px) {
  .desk {
    display: block;
    min-height: 0;
    padding: 40px 16px 24px;
  }
  .desk__objects {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 28px 22px;
    margin-top: 44px;
  }
  .desk-obj {
    position: relative;
    transform: rotate(var(--rot)) !important;
    touch-action: manipulation;
    cursor: pointer;
  }
  .desk__hint {
    position: static;
    margin-top: 28px;
    text-align: center;
  }
  .desk__hint-pointer { display: none; }
  .desk__hint-touch { display: inline; }
  .desk__reset { display: none; }
}

/* ---------- Hoja de CV ---------- */
.obj-cv .desk-obj__art {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 116px;
  height: 150px;
  padding: 12px 11px;
  border-radius: 3px;
  /* esquina doblada */
  background:
    linear-gradient(225deg, transparent 12px, var(--paper) 12px);
}
.obj-cv .desk-obj__art::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 17px;
  height: 17px;
  background: linear-gradient(225deg, transparent 50%, #D5DEE8 50%);
  border-bottom-left-radius: 3px;
}
.obj-cv__head { display: flex; align-items: center; gap: 7px; }
.obj-cv .obj-cv__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #16202E;
  font: 700 .5625rem/1 var(--f-display);
  font-style: normal;
}
.obj-cv__who { display: grid; line-height: 1.15; }
.obj-cv__who b { font: 700 .5625rem/1.2 var(--f-display); }
.obj-cv__who small { font: 500 .5rem/1.2 var(--f-body); color: #4A5868; }
.obj-cv__lines { display: grid; gap: 6px; }
.obj-cv__lines i { height: 4px; border-radius: 2px; background: rgba(22, 32, 46, .18); }
.obj-cv__lines i:nth-child(1) { width: 45%; background: rgba(22, 32, 46, .45); }
.obj-cv__lines i:nth-child(3) { width: 80%; }
.obj-cv__lines i:nth-child(4) { width: 45%; background: rgba(22, 32, 46, .45); }
.obj-cv__lines i:nth-child(5) { width: 70%; }
.obj-cv__pdf {
  align-self: flex-start;
  margin-top: auto;
  padding: 3px 7px;
  border-radius: 4px;
  background: #16202E;
  color: #FFFFFF;
  font: 600 .5625rem/1 var(--f-mono);
  letter-spacing: .06em;
}

/* ---------- Acreditación (experiencia) ---------- */
.obj-badge .desk-obj__art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 110px;
  height: 150px;
  padding-bottom: 11px;
  border-radius: 10px;
  background: var(--paper);
  overflow: visible;
}
.obj-badge__clip {
  position: absolute;
  top: -9px;
  width: 30px;
  height: 14px;
  border-radius: 4px;
  background: #8A97A8;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15);
}
.obj-badge__top {
  align-self: stretch;
  padding: 12px 0 8px;
  border-radius: 10px 10px 0 0;
  background: #2E9E6B;
  color: #FFFFFF;
  font: 700 .5625rem/1 var(--f-mono);
  letter-spacing: .12em;
  text-align: center;
}
.obj-badge__avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-top: 10px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: #16202E;
  color: #FFFFFF;
  font: 700 .875rem/1 var(--f-display);
  box-shadow: 0 0 0 2px #16202E;
}
.obj-badge__name { margin-top: 9px; font: 700 .625rem/1.2 var(--f-display); }
.obj-badge__role { font: 500 .5625rem/1.3 var(--f-body); color: #4A5868; }
.obj-badge__bar {
  width: 70%;
  height: 12px;
  margin-top: auto;
  background: repeating-linear-gradient(90deg, #16202E 0 2px, transparent 2px 4px, #16202E 4px 5px, transparent 5px 7px);
  opacity: .8;
}

/* Escritorio: el titular baja un poco para dejar la franja superior a los objetos */
@media (min-width: 821px) {
  .desk { padding: 150px 24px 80px; }
}

/* Móvil con captura real de la app */
.obj-phone__screen--img { padding: 0; overflow: hidden; }
.obj-phone__screen--img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* Foto en la acreditación */
.obj-badge__avatar { overflow: hidden; }
.obj-badge__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Post-it con foto sujeta con un clip */
.obj-postit__photo {
  position: absolute;
  top: -14px;
  right: -16px;
  width: 64px;
  height: 64px;
  padding: 4px;
  background: #FFFFFF;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(22, 32, 46, .25);
  rotate: 8deg;
}
.obj-postit__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}
/* Clip metálico dibujado con bordes */
.obj-postit__clip {
  position: absolute;
  top: -10px;
  left: 18px;
  width: 12px;
  height: 30px;
  border: 2px solid #8A97A8;
  border-radius: 6px;
  rotate: -6deg;
}
.obj-postit__clip::after {
  content: "";
  position: absolute;
  inset: 4px 2px;
  border: 2px solid #8A97A8;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}
.obj-postit__title { padding-right: 34px; }

/* ==========================================================
   Lámpara colgante: claro/oscuro
   ========================================================== */
.lamp {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 110px;
  padding: 0;
  border: 0;
  background: none;
  translate: -50% 0;
  transform-origin: 50% 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lamp__cable {
  width: 2px;
  height: 46px;
  background: #3A4656;
}
.lamp__head {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lamp__shade {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 38px;
  background: var(--c-accent);
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
  border-radius: 6px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .15);
}
.lamp__shade::before {
  /* casquillo */
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 22px;
  height: 8px;
  translate: -50% 0;
  background: #2A3442;
}
.lamp__bulb {
  width: 22px;
  height: 12px;
  margin-top: -3px;
  border-radius: 0 0 12px 12px;
  background: #FFF4C2;
  box-shadow: 0 0 16px 6px rgba(255, 225, 120, .75);
  transition: background .3s, box-shadow .3s;
}
/* Cadena para "tirar" */
.lamp__chain {
  position: absolute;
  top: 30px;
  right: -8px;
  width: 2px;
  height: 34px;
  background: repeating-linear-gradient(#8A97A8 0 3px, transparent 3px 5px);
  transition: height .15s;
}
.lamp__chain i {
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 9px;
  height: 9px;
  translate: -50% 0;
  border-radius: 50%;
  background: #8A97A8;
}
.lamp:hover .lamp__chain { height: 40px; }
/* Cono de luz (solo con la lámpara encendida = modo claro) */
.lamp__light {
  position: absolute;
  top: 96px;
  left: 50%;
  width: 360px;
  height: 230px;
  translate: -50% 0;
  background: radial-gradient(ellipse 50% 100% at 50% 0, rgba(255, 236, 170, .55), transparent 75%);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  pointer-events: none;
  transition: opacity .4s;
}
.lamp:focus-visible { outline: none; }
.lamp:focus-visible .lamp__shade { outline: 3px solid var(--c-focus); outline-offset: 4px; }

/* Apagada (modo oscuro) */
.lamp.is-off .lamp__bulb { background: #5A6474; box-shadow: none; }
.lamp.is-off .lamp__light { opacity: 0; }
.lamp.is-off .lamp__cable { background: #5A6474; }

/* Tirón: balanceo corto */
.lamp.is-pulled { animation: lamp-swing 1.1s var(--ease-out); }
.lamp.is-pulled .lamp__chain { animation: lamp-pull .35s ease-out; }
@keyframes lamp-swing {
  20% { rotate: 7deg; }
  45% { rotate: -5deg; }
  70% { rotate: 2.5deg; }
  85% { rotate: -1deg; }
}
@keyframes lamp-pull {
  40% { height: 50px; }
}

/* Foco de luz que sigue al cursor (modo oscuro, escritorio) */
.desk.has-spot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle 280px at var(--mx, 50%) var(--my, 120px), rgba(255, 225, 150, .10), rgba(3, 6, 12, .32) 72%);
  transition: opacity .5s;
}
:root[data-theme="dark"] .desk.has-spot::after { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .lamp.is-pulled, .lamp.is-pulled .lamp__chain { animation: none; }
}

/* Móvil: la mesa es estática; el cambio de tema queda en el menú */
@media (max-width: 820px) {
  .lamp { display: none; }
  .desk.has-spot::after { display: none; }
}
/* El titular queda por encima de la sombra para que siempre se lea bien */
:root[data-theme="dark"] .desk.has-spot .desk__headline { z-index: 6; }

/* ---------- Herramientas de la mesa (sonido + ordenar) ---------- */
.desk__tools {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  display: flex;
  gap: 8px;
}
.desk__tools .desk__reset { position: static; }
.desk__sound {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--c-text) 25%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--c-surface) 80%, transparent);
  color: var(--c-text);
  transition: background-color .2s, border-color .2s;
}
.desk__sound:hover { border-color: var(--c-text); background: var(--c-surface); }
.desk__sound[aria-pressed="true"] { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-ink-fixed); }
.desk__sound .icon { width: 18px; height: 18px; }
@media (max-width: 820px) {
  .desk__tools { display: none; }
}

/* ---------- Cursor: lápiz sobre la mesa, mano sobre los objetos ---------- */
@media (hover: hover) and (pointer: fine) {
  .desk:not(.is-static) { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cg transform='rotate(45 14 14)'%3E%3Crect x='11' y='2' width='6' height='18' rx='1' fill='%23FFE15C' stroke='%2316202E' stroke-width='1.5'/%3E%3Crect x='11' y='2' width='6' height='4' fill='%23FF8A9A' stroke='%2316202E' stroke-width='1.5'/%3E%3Cpath d='M11 20l3 6 3-6z' fill='%23F3D6B0' stroke='%2316202E' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M13.2 24.4l.8 1.6.8-1.6z' fill='%2316202E'/%3E%3C/g%3E%3C/svg%3E") 3 25, crosshair; }
  .desk:not(.is-static) .desk__headline { cursor: auto; }
  .desk:not(.is-static) .desk__headline a,
  .desk:not(.is-static) .desk__tools button,
  .desk:not(.is-static) .lamp { cursor: pointer; }
}
