/* ============================================================
   LANYARD.CSS — credencial 3D colgante (lanyard + credential)
   Solo estilos del componente. La física vive en lanyard.js.
   ============================================================ */

/* ------------------------------------------------------------
   CONTENEDOR / GEOMETRÍA
   #lanyard cubre el hero__visual; el SVG del cordón se dibuja
   detrás de la tarjeta y la tarjeta se mueve con transform.
   ------------------------------------------------------------ */
#heroVisual {
  /* variables compartidas CSS <-> JS */
  --card-w: 300px;
  --card-h: 470px;
  --card-scale: 1;
  --rest-top: 96px;         /* centra la tarjeta en el alto del hero */
  --anchor-y: -220px;       /* anclaje fuera de pantalla, arriba */
  --band-w: 24px;           /* ancho real del cordón (azul liso) */
  --band-blue-1: #1d4ed8;   /* azul en sombra */
  --band-blue-2: #2f6bf0;   /* azul franco */
  --band-blue-3: #60a5fa;   /* azul con luz */
  --lanyard-blue: #7dd3fc;
  --lanyard-blue-strong: #3b82f6;
  --paper-0: #f6f4ec;
  --paper-1: #f2f0e8;
  --paper-2: #e7e3d7;
  --ink: #111418;
  --ink-soft: rgba(17, 20, 24, .62);
  position: relative;
}

.lanyard {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.lanyard__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

/* ------------------------------------------------------------
   TARJETA — #credential maneja pérdulo (translate + rotate)
   .credential__card maneja el tilt 3D
   ------------------------------------------------------------ */
.credential {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--card-w);
  height: var(--card-h);
  margin-left: calc(var(--card-w) * -0.5);
  transform-origin: 50% 0;
  transform:
    translate3d(var(--tx, 0px), var(--ty, var(--rest-top)), 0)
    rotate(var(--rot, -6deg))
    scale(var(--card-scale, 1));
  transform-style: preserve-3d;
  perspective: 1500px;
  will-change: transform;
  z-index: 2;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.credential.is-dragging { cursor: grabbing; }
.credential:focus-visible {
  outline: none;
}
.credential.is-keyboard:focus-visible .credential__card {
  box-shadow:
    inset 0 0 0 2px rgba(125, 211, 252, .85),
    inset 0 0 0 1px rgba(17, 20, 24, .3),
    0 34px 60px -20px rgba(2, 6, 16, .85),
    0 12px 26px rgba(2, 6, 16, .45);
}

/* ------------------------------------------------------------
   CARA IMPRESA
   ------------------------------------------------------------ */
.credential__card {
  position: absolute;
  inset: 0;
  border-radius: 15px;
  overflow: hidden;
  isolation: isolate;
  transform:
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg));
  transform-style: preserve-3d;
  will-change: transform;
  background:
    radial-gradient(120% 74% at 18% -4%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 62%),
    radial-gradient(90% 60% at 108% 88%, rgba(37, 99, 235, .12), transparent 64%),
    linear-gradient(163deg, var(--paper-0) 0%, var(--paper-1) 44%, var(--paper-2) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 2px 0 0 rgba(125, 211, 252, .34),
    inset 2px 0 0 rgba(17, 20, 24, .16),
    0 34px 62px -22px rgba(2, 6, 16, .9),
    0 12px 26px rgba(2, 6, 16, .45),
    0 2px 5px rgba(2, 6, 16, .4);
}

/* grano de papel */
.credential__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  pointer-events: none;
  opacity: .42;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 150px 150px;
}

/* marco impreso + remaches de esquina */
.credential__card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 7;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(17, 20, 24, .26),
    inset 0 0 0 6px rgba(255, 255, 255, .22),
    inset 0 0 0 7px rgba(17, 20, 24, .18),
    inset 0 0 34px rgba(17, 20, 24, .06);
  background-image:
    radial-gradient(circle at 10px 10px, #4a525d 0 1.5px, rgba(17, 20, 24, .28) 2.4px, transparent 2.9px),
    radial-gradient(circle at calc(100% - 10px) 10px, #4a525d 0 1.5px, rgba(17, 20, 24, .28) 2.4px, transparent 2.9px),
    radial-gradient(circle at 10px calc(100% - 10px), #4a525d 0 1.5px, rgba(17, 20, 24, .28) 2.4px, transparent 2.9px),
    radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), #4a525d 0 1.5px, rgba(17, 20, 24, .28) 2.4px, transparent 2.9px);
}

/* --- cabecera impresa --------------------------------------- */
.credential__head {
  position: absolute;
  top: 9px;
  left: 15px;
  right: 15px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 6.4px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.credential__tag {
  padding: 2px 5px 2.4px;
  border-radius: 2px;
  background: #101822;
  color: #f3f1e9;
  font-weight: 600;
  letter-spacing: .1em;
  box-shadow: 0 1px 2px rgba(17, 20, 24, .25);
}
.credential__loc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.credential__loc::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--lanyard-blue-strong);
  box-shadow: 0 0 4px rgba(59, 130, 246, .8);
}

/* --- DEVELOPER (tipografía condensada ultra bold) ----------- */
.credential__word {
  position: absolute;
  top: 21px;
  left: 11px;
  z-index: 1;
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 57px;
  line-height: .8;
  letter-spacing: -.042em;
  color: var(--ink);
  white-space: nowrap;
  transform: scaleX(.84);
  transform-origin: left top;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

/* --- ventana de foto (vertical 4:5, como foto impresa) ------ */
.credential__photo {
  position: absolute;
  top: 66px;
  left: 30px;
  right: 68px;
  z-index: 2;
  height: 252px;
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 30% 18%, #243a5e 0%, transparent 62%),
    linear-gradient(158deg, #12213a 0%, #0a1526 64%, #060d19 100%);
  box-shadow:
    inset 0 0 0 1px rgba(17, 20, 24, .32),
    inset 0 1px 0 rgba(255, 255, 255, .24),
    inset 0 -18px 26px rgba(3, 8, 18, .5),
    0 1px 2px rgba(17, 20, 24, .18);
}
.credential__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 16%;
  filter: saturate(.78) contrast(1.07) sepia(.07) brightness(1.02);
  -webkit-user-drag: none;
  user-select: none;
}
/* fallback si el retrato aún no existe */
.credential__photo.is-empty img { visibility: hidden; }
.credential__photo.is-empty::before {
  content: "JP";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 74px;
  letter-spacing: -.06em;
  color: rgba(214, 228, 250, .16);
  z-index: 0;
}
.credential__photo.is-empty::after {
  content: "RETRATO · 640 × 800";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: .22em;
  color: rgba(200, 218, 245, .4);
}
/* scanline / duotone de impresión */
.credential__scan {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(6, 14, 28, .16) 0px,
      rgba(6, 14, 28, .16) 1px,
      rgba(255, 255, 255, .02) 1px,
      rgba(255, 255, 255, .02) 3px
    ),
    linear-gradient(160deg, rgba(26, 52, 96, .20) 0%, rgba(255, 255, 255, .03) 46%, rgba(8, 20, 40, .24) 100%);
  mix-blend-mode: multiply;
}
.credential__scan::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 50% 32%, transparent 42%, rgba(5, 12, 24, .34) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, .10), transparent 20%);
}

/* --- sello holográfico sobre la foto ------------------------ */
.credential__photo .sello {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    conic-gradient(from 210deg, #bfe3ff, #5b8fd6 22%, #d7efff 38%, #2b5aa8 56%, #9dd0ff 72%, #ffffff 84%, #bfe3ff);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .55),
    0 0 0 2px rgba(17, 20, 24, .14),
    0 2px 4px rgba(2, 6, 16, .45),
    inset 0 0 6px rgba(4, 12, 26, .45);
  opacity: .9;
  mix-blend-mode: multiply;
}

/* --- texto vertical lateral -------------------------------- */
.credential__vertical {
  position: absolute;
  top: 80px;
  right: 13px;
  z-index: 3;
  height: 214px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 8.2px;
  letter-spacing: .26em;
  line-height: 1;
  text-transform: uppercase;
  color: rgba(17, 20, 24, .6);
}
.credential__vertical::before,
.credential__vertical::after {
  content: "";
  display: block;
  width: 1px;
  background: rgba(17, 20, 24, .28);
}
.credential__vertical::before { height: 12px; margin: 0 auto 8px; }
.credential__vertical::after { display: none; }

/* --- placa de nombre --------------------------------------- */
.credential__plate {
  position: absolute;
  top: 326px;
  left: 15px;
  right: 15px;
  z-index: 3;
  min-height: 48px;
  padding: 6px 9px 7px;
  border-radius: 3px;
  background:
    linear-gradient(180deg, #fdfcf7 0%, #f7f5ec 62%, #efecdf 100%);
  box-shadow:
    inset 0 0 0 1px rgba(17, 20, 24, .28),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 1px 0 rgba(255, 255, 255, .55),
    0 2px 5px rgba(17, 20, 24, .16);
}
.credential__plate strong {
  display: block;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 800;
  line-height: .98;
  letter-spacing: .015em;
  color: var(--ink);
  text-transform: uppercase;
}
.credential__plate span {
  display: block;
  margin-top: 3.5px;
  font-family: var(--font-mono);
  font-size: 5.9px;
  font-weight: 500;
  letter-spacing: .19em;
  text-transform: uppercase;
  color: rgba(17, 20, 24, .6);
}

/* --- pie: logo + url + bala de barras ---------------------- */
.credential__foot {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 34px;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
}
.credential__foot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 9px);
  height: 13px;
  opacity: .34;
  background-image: repeating-linear-gradient(
    90deg,
    var(--ink) 0 1px, transparent 1px 3px,
    var(--ink) 3px 5px, transparent 5px 6px,
    var(--ink) 6px 7px, transparent 7px 10px,
    var(--ink) 10px 12px, transparent 12px 13px,
    var(--ink) 13px 14px, transparent 14px 18px
  );
  mask-image: linear-gradient(90deg, #000 0 46%, rgba(0, 0, 0, .5) 72%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0 46%, rgba(0, 0, 0, .5) 72%, transparent 100%);
}
.credential__logo {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  line-height: .8;
  letter-spacing: -.06em;
  color: var(--ink);
}
.credential__logo span { color: var(--lanyard-blue-strong); }
.credential__url {
  font-family: var(--font-mono);
  font-size: 7.2px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(17, 20, 24, .68);
  padding-bottom: 1px;
}

/* --- tira de patrocinadores -------------------------------- */
.credential__sponsors {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 11px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(17, 20, 24, .18);
  font-family: var(--font-mono);
  font-size: 5.6px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(17, 20, 24, .44);
}
.credential__sponsors span { white-space: nowrap; }
.credential__sponsors span:nth-child(2) { color: rgba(17, 20, 24, .62); }
.credential__sponsors span:last-child { letter-spacing: .2em; }

/* ------------------------------------------------------------
   GANCHO MODERNO — <i> anilla giratoria · <b> cuerpo mate · <span> cuello
   Metal oscuro (gunmetal) minimalista, sin cromados.
   ------------------------------------------------------------ */
.credential__clip {
  position: absolute;
  left: 50%;
  top: -46px;
  z-index: 5;
  width: 64px;
  height: 56px;
  margin-left: -32px;
  pointer-events: none;
}
/* sombra ambiental del gancho (sin filtros: no añade overflow) */
.credential__clip::before {
  content: "";
  position: absolute;
  left: -9px;
  right: -9px;
  top: -6px;
  bottom: -10px;
  border-radius: 26px;
  background: radial-gradient(ellipse at 50% 42%, rgba(2, 4, 10, .55), rgba(2, 4, 10, 0) 70%);
  z-index: 0;
  pointer-events: none;
}
/* sombra proyectada sobre la tarjeta */
.credential__clip::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: 44px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(3, 6, 12, .62), rgba(3, 6, 12, 0) 72%);
  filter: blur(2.5px);
  z-index: -1;
  pointer-events: none;
}
/* anilla giratoria: la banda pasa por el hueco */
.credential__clip i {
  position: absolute;
  left: 50%;
  top: 0;
  width: 38px;
  height: 38px;
  margin-left: -19px;
  border-radius: 50%;
  background:
    conic-gradient(from 205deg,
      #5a6270 0%,
      #20242b 16%,
      #171a20 34%,
      #3b424d 50%,
      #14171c 66%,
      #4a525f 82%,
      #1b1f26 100%);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 11.8px, #000 12.7px);
  mask: radial-gradient(circle at 50% 50%, transparent 0 11.8px, #000 12.7px);
  z-index: 3;
}
/* filo azul fino dentro de la anilla */
.credential__clip i::before {
  content: "";
  position: absolute;
  inset: 4.4px;
  border-radius: 50%;
  border: 1.6px solid rgba(59, 130, 246, .8);
}
/* cuerpo del gancho: metal oscuro mate */
.credential__clip b {
  position: absolute;
  left: 50%;
  top: 31px;
  width: 30px;
  height: 17px;
  margin-left: -15px;
  border-radius: 5px 5px 7px 7px;
  background:
    linear-gradient(168deg,
      #565f6d 0%,
      #2c323b 30%,
      #1c2027 58%,
      #12151a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 0 0 1px rgba(255, 255, 255, .05),
    inset 0 -2px 4px rgba(0, 0, 0, .55),
    0 2px 4px rgba(2, 4, 10, .55);
  z-index: 2;
}
/* ranura de metal donde se engancha la banda */
.credential__clip b::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 3px;
  height: 1px;
  border-radius: 1px;
  background: rgba(255, 255, 255, .16);
}
/* detalle azul fino del gancho (conecta con la correa) */
.credential__clip b::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 16px;
  height: 2px;
  margin-left: -8px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(59, 130, 246, .2), #3b82f6 18%, #60a5fa 50%, #3b82f6 82%, rgba(59, 130, 246, .2));
  opacity: .95;
}
/* cuello que une el gancho con la tarjeta */
.credential__clip span {
  position: absolute;
  left: 50%;
  top: 43px;
  width: 18px;
  height: 6px;
  margin-left: -9px;
  border-radius: 3px;
  background: linear-gradient(180deg, #343a44 0%, #23272e 55%, #14171c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 -1px 0 rgba(0, 0, 0, .6),
    0 1px 2px rgba(2, 4, 10, .55);
  z-index: 1;
}

/* ------------------------------------------------------------
   PISTA / AYUDAS
   ------------------------------------------------------------ */
#heroVisual .hero__hint {
  z-index: 1; /* por debajo de la tarjeta: al arrastrar no se monta encima */
  transition: opacity .35s var(--ease);
}
#heroVisual:has(.is-dragging) .hero__hint { opacity: 0; }

/* la tarjeta no debe seleccionar texto ni arrastrar la imagen */
.credential,
.credential * {
  -webkit-user-drag: none;
}
.credential ::selection { background: transparent; }

/* ------------------------------------------------------------
   RESPONSIVE — escalamos con la variable --card-scale que usa
   el transform que maneja el JS (el JS sigue funcionando).
   En una columna el hero visual queda debajo del texto: el cordón
   se ancla al borde superior del área visual (con desvanecido) para
   no cruzar titular/párrafo, y la tarjeta se centra y reduce.
   ------------------------------------------------------------ */
@media (max-width: 1180px) {
  #heroVisual {
    --anchor-y: -220px;
    --rest-top: 120px;
  }
  /* el glow del hero (site.css) sangra ±12% y provocaba scroll
     horizontal al pasar a una columna: lo mantenemos dentro. */
  #heroVisual::before {
    left: 0;
    right: 0;
  }
}
@media (max-width: 980px) {
  #heroVisual {
    --card-scale: .72;
    --rest-top: 150px;
    --band-w: 22px;
    --anchor-y: -220px;
  }
}
@media (max-width: 520px) {
  #heroVisual {
    --card-scale: .62;
    --rest-top: 150px;
    --band-w: 20px;
    --anchor-y: -220px;
  }
  #heroVisual .hero__hint { font-size: .6rem; letter-spacing: .12em; }
}

/* ------------------------------------------------------------
   MOVIMIENTO REDUCIDO
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .credential,
  .credential__card,
  .credential__clip {
    transition: none !important;
  }
}
