/* Foto del hero (me.js): tarjeta que se voltea, cara delantera pixelada con líneas de escaneo y cara trasera con la serpiente */
/* El lienzo de la foto es más grande que la foto: --m es el margen donde se amontonan los píxeles (64 de 608 px) */
.t-me { position: relative; --m: 10.53%; width: min(84vw, 360px); aspect-ratio: 1; margin-top: 32px; perspective: 1400px; rotate: 4deg; transition: rotate 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.t-me:hover, .t-me.is-flipped { rotate: 1.5deg; }
.t-me__card { position: relative; height: 100%; transform-style: preserve-3d; transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.t-me.is-flipped .t-me__card { transform: rotateY(180deg); }
.t-me__front, .t-me__back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.t-me__back { inset: var(--m); overflow: hidden; border: 1px solid var(--line); border-radius: 2px; background: var(--bg-2); transform: rotateY(180deg); display: flex; flex-direction: column; }

.t-me__front { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.t-me__front:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.t-me__front::after { content: ""; position: absolute; inset: var(--m); pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.t-me__pix { display: block; width: 100%; height: 100%; image-rendering: pixelated; }

.t-me__hud { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.t-me__hud b { color: var(--accent); font-weight: 400; }
.t-me__hud span { margin-right: auto; }
.t-me__hud button { padding: 4px 10px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--fg); font: inherit; letter-spacing: 0.12em; cursor: pointer; }
.t-me__hud button:hover { border-color: var(--accent); color: var(--accent); }
.t-me__stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.t-me__game { display: block; width: 100%; height: 100%; object-fit: contain; touch-action: none; outline: none; }
.t-me__game:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.t-me__msg { position: absolute; inset: auto 12px 12px; padding: 8px 10px; border-radius: 2px; background: rgba(10, 13, 16, 0.85); font-size: 11px; line-height: 1.5; text-align: center; color: var(--fg); pointer-events: none; }

@media (min-width: 900px) {
  .t-hero { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 30vw, 450px); column-gap: clamp(32px, 5vw, 72px); align-items: start; }
  .t-hero > * { grid-column: 1; }
  .t-hero > .t-me { grid-column: 2; grid-row: 1 / span 6; width: 100%; margin-top: 0; align-self: center; }
}
.enter .t-hero > :nth-child(7) { animation-delay: 1.3s; }
@media (prefers-reduced-motion: reduce) { .t-me, .t-me__card { transition: none; } }

/* Aviso al voltear, fuera de la foto: como el texto de un videojuego al abrir un cofre */
.t-me__toast { position: absolute; left: 50%; bottom: calc(100% - var(--m) + 10px); z-index: 2; translate: -50% 0; width: max-content; max-width: 110%; margin: 0;
  font-size: clamp(12px, 1.3vw, 15px); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #fbbf24;
  text-shadow: 2px 2px 0 #3b2a05, 0 0 14px rgba(251, 191, 36, 0.55); opacity: 0; pointer-events: none; }
.t-me__toast::before, .t-me__toast::after { content: "✦"; display: inline-block; margin: 0 0.6em; color: var(--accent); text-shadow: 0 0 10px rgba(94, 234, 212, 0.7); }
.t-me.is-flipped .t-me__toast { animation: t-chest 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.4) 0.35s both; }
.t-me.is-flipped .t-me__toast::before, .t-me.is-flipped .t-me__toast::after { animation: t-spark 0.5s steps(2) 0.9s 3; }
@keyframes t-chest { from { opacity: 0; transform: translateY(24px) scale(0.4); } 60% { opacity: 1; transform: translateY(-6px) scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes t-spark { 50% { opacity: 0.2; transform: scale(0.6) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) { .t-me.is-flipped .t-me__toast { animation: none; opacity: 1; } .t-me.is-flipped .t-me__toast::before, .t-me.is-flipped .t-me__toast::after { animation: none; } }
