/* Easter eggs (home-eggs.js, home-console.js): XP bar, !DEZZY toggle, character sheet, Snake. */

/* ---- XP bar: fixed at the very top, fills while scrolling ---- */
.home-xp {
  position: fixed;
  inset: 0 0 auto;
  z-index: 70;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}

.home-xp.is-visible { opacity: 1; }

.home-xp__bar {
  height: 100%;
  background: linear-gradient(90deg, #b69bff, #ff2e88 55%, #29e0ff);
  box-shadow: 0 0 10px #ff2e8899;
  transform: scaleX(0);
  transform-origin: left;
}

.home-xp__badge {
  position: absolute;
  top: 12px;
  right: 16px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid #ff2e8873;
  background: #060608e6;
  color: #f2f2f4;
  font: 700 11px/1.4 var(--home-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .25s ease, transform .25s ease;
}

.home-xp__badge [data-xp-level] { color: #ff2e88; }
.home-xp.is-leveling .home-xp__badge { opacity: 1; transform: none; }
.home-xp.is-max .home-xp__badge { border-color: #3ddc84; box-shadow: 0 0 24px #3ddc8466; }
.home-xp.is-max .home-xp__badge [data-xp-level] { color: #3ddc84; }

/* ---- !DEZZY; toggle (looks exactly like the heading) ---- */
.home .home-hero__name {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.home-hero__bang { display: inline-block; transition: opacity .2s ease, width .2s ease; }
.home-hero__name.is-true .home-hero__bang { width: 0; opacity: 0; overflow: hidden; }
.home-hero__name.is-true { text-shadow: 0 0 24px #3ddc8466, 0 0 50px #3ddc8433; }

/* ---- Character sheet: the portrait flips around ---- */
.home-about__flip {
  position: relative;
  aspect-ratio: 4 / 5;
  cursor: pointer;
  perspective: 1200px;
  user-select: none;
}

.home-about__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}

.home-about__face--back { transform: rotateY(180deg); }
.home-about__flip.is-flipped .home-about__portrait { transform: rotateY(-180deg); }
.home-about__flip.is-flipped .home-about__face--back { transform: rotateY(0); }

.home-about__sheet {
  --pcut: 18px;
  display: flex;
  flex-direction: column;
  padding: 22px 20px;
  clip-path: polygon(var(--pcut) 0, 100% 0, 100% calc(100% - var(--pcut)), calc(100% - var(--pcut)) 100%, 0 100%, 0 var(--pcut));
  background:
    repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 3px),
    linear-gradient(160deg, rgba(var(--accent-rgb), .22), #0b0a12 70%);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45);
  font: 12px/1.4 var(--home-mono);
}

.home-about__sheet-title { margin: 0 0 14px; color: var(--accent); font: 700 13px/1.3 var(--home-heading); letter-spacing: .08em; text-transform: uppercase; }
.home-about__sheet dl { display: grid; gap: 9px; margin: 0; }
.home-about__sheet-row { display: flex; justify-content: space-between; gap: 10px; }
.home-about__sheet-row dt { color: #96929f; }
.home-about__sheet-row dd { margin: 0; color: #f2f2f4; font-weight: 700; }
.home-about__sheet-row--bar { flex-wrap: wrap; }

.home-about__sheet-row--bar::after {
  content: '';
  flex: 1 0 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) var(--fill), #ffffff14 var(--fill));
}

.home-about__sheet-special { margin: auto 0 0; padding-top: 12px; color: #d6d2c8; line-height: 1.5; }
.home-about__sheet-special span { color: var(--home-pink); }
.home-about__sheet-back { margin: 10px 0 0; color: #6f6a78; font-size: 10px; }

/* "+1" / "2 more" popping up where the portrait was clicked */
.home-about__pop {
  position: absolute;
  z-index: 3;
  color: var(--home-pink);
  font: 800 16px/1 var(--home-heading);
  text-shadow: 0 0 10px #ff2e88;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: home-pop .8s ease-out forwards;
}

@keyframes home-pop {
  to { opacity: 0; transform: translate(-50%, -190%); }
}

/* ---- Snake in the console ---- */
.home-console__snake {
  display: block;
  max-width: 100%;
  margin: 6px 0 10px;
  border: 1px solid #ff2e8855;
  image-rendering: pixelated;
  touch-action: none;
}

@media (max-width: 760px) {
  .home-about__flip { width: min(100%, 240px); }
  .home-about__flip .home-about__portrait { width: 100%; }
  .home-xp__badge { top: 10px; right: 10px; }
  .home-about__sheet { padding: 14px 14px 12px; font-size: 10.5px; }
  .home-about__sheet-title { margin-bottom: 8px; font-size: 11.5px; }
  .home-about__sheet dl { gap: 4px; }
  .home-about__sheet-row--bar::after { height: 3px; }
  .home-about__sheet-special { padding-top: 8px; }
  .home-about__sheet-back { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home-about__face, .home-xp, .home-xp__badge { transition: none; }
  .home-about__pop { animation-duration: .01s; }
}
