/* DataLab — Créditos da tela inicial (assets/js/creditos.js): cenas de cinema com a equipe.
   Por cima do datacenter (#dc), abaixo das linhas de CRT (.crt, z-index 20). */

.cred-on, .cred-on body { overflow: hidden; }
.cred-on .title, .cred-on .top, .cred-on main { visibility: hidden; }

.cred {
  --c: #3dffa2;
  --bar: 40px;
  position: fixed; inset: 0; z-index: 15;
  overflow: hidden;
  color: #e6ecf5;
  cursor: pointer;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 1;
  transition: opacity .25s steps(3, end);
}
.cred[hidden] { display: none; }
.cred.is-out { opacity: 0; }

/* the datacenter behind, dimmed (deeper in Abner's scene) */
.cred__dim {
  position: absolute; inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Cpath fill='%2305070d' d='M0 0h2v2H0zM2 2h2v2H2z'/%3E%3C/svg%3E"),
    rgba(5, 7, 13, .5);
  opacity: 0;
  transition: opacity .4s steps(4, end), background-color .6s steps(4, end);
}
.cred.is-in .cred__dim { opacity: 1; }
.cred.is-deep .cred__dim { background-color: rgba(5, 7, 13, .8); }
.cred.is-final .cred__dim { background-color: rgba(5, 7, 13, .66); }

.cred__stage { position: absolute; inset: 0; }
.cred__cv { position: absolute; left: 0; top: 0; image-rendering: crisp-edges; image-rendering: pixelated; }

/* the white flash (impact) */
.cred__flash { position: absolute; inset: 0; background: #fff8e0; opacity: 0; pointer-events: none; }

/* cinema bars */
.cred__bar {
  position: absolute; left: 0; right: 0; height: 0;
  background: #05070d;
  transition: height .5s steps(5, end);
}
.cred__bar--top { top: 0; box-shadow: 0 2px #0e1422; }
.cred__bar--bot { bottom: 0; box-shadow: 0 -2px #0e1422; }
.cred.is-in .cred__bar { height: var(--bar); }
.cred.is-in.is-final .cred__bar--top { height: var(--bar-final, 12px); }
.cred.is-in.is-final .cred__bar--bot { height: var(--foot, 120px); }

/* ---------- one member alone: name, title, the sentence being typed ---------- */
.cred__solo {
  position: absolute; left: 50%; top: 0;
  width: min(720px, calc(100vw - 32px));
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  transition: opacity .3s steps(3, end);
}
.cred__solo.is-out { opacity: 0; }
.cred.is-final .cred__solo { display: none; }
.cred__solo p { margin: 0; }
.cred__name {
  font: 400 clamp(14px, 2.4vw, 26px)/1.25 'Press Start 2P', monospace;
  letter-spacing: .06em;
  color: var(--c);
  text-shadow: 0 2px #05070d, 2px 2px #05070d, -2px 0 #05070d, 2px 0 #05070d, 0 -2px #05070d, 0 4px rgba(5, 7, 13, .6), 0 0 14px color-mix(in srgb, var(--c) 45%, transparent);
  visibility: hidden;
}
.cred__role {
  margin-top: clamp(6px, 1.2vh, 12px) !important;
  font: 400 clamp(11px, 1.5vw, 16px)/1.3 'Silkscreen', monospace;
  letter-spacing: .14em; text-transform: uppercase;
  color: #ffb547;
  text-shadow: 2px 2px #05070d, -1px 0 #05070d, 1px 0 #05070d;
  visibility: hidden;
}
.cred__quote {
  max-width: 42ch;
  margin: clamp(8px, 1.8vh, 18px) auto 0 !important;
  font: 400 clamp(19px, 2.4vw, 30px)/1.15 'VT323', monospace;
  color: #d5ddeb;
  text-shadow: 2px 2px #05070d, -1px 0 #05070d, 1px 0 #05070d, 0 -1px #05070d;
  visibility: hidden;
}
.cred__name.on, .cred__role.on, .cred__quote.on { visibility: visible; }
.cred__name.on { animation: credIn .3s steps(3, end); }
.cred__role.on { animation: credIn .3s steps(3, end); }
@keyframes credIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cred__rest { visibility: hidden; }
.cred__cur {
  display: inline-block; width: .45em; height: .8em; margin-right: -.45em; vertical-align: -.05em;
  background: var(--c);
  animation: credBlink .8s steps(1, end) infinite;
}
.cred__quote.done .cred__cur { opacity: 0; animation: none; }
@keyframes credBlink { 50% { opacity: 0; } }
.cred__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Abner: the name in big golden letters, slammed in */
.cred.is-big .cred__name {
  font-size: clamp(22px, 5.4vw, 60px);
  letter-spacing: .04em;
  color: #ffd666;
  text-shadow:
    0 3px #b8791a, 0 6px #6b3f0a, 3px 6px #05070d, -3px 6px #05070d, 0 9px #05070d,
    -3px 0 #05070d, 3px 0 #05070d, 0 -3px #05070d,
    0 0 24px rgba(255, 214, 102, .55);
}
.cred.is-big .cred__name.on { animation: credSlam .36s steps(4, end); }
@keyframes credSlam { 0% { opacity: 0; transform: scale(2.2); } 60% { opacity: 1; transform: scale(.94); } 100% { transform: scale(1); } }
.cred.is-big .cred__role { color: #ffe9b0; font-size: clamp(12px, 1.9vw, 20px); }
.cred.is-big .cred__quote { color: #fff3d6; }

/* ---------- the whole team ---------- */
.cred__team { position: absolute; inset: 0; pointer-events: none; display: none; }
.cred.is-final .cred__team { display: block; }
.cred__tag {
  position: absolute; left: 0; top: 0;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
  visibility: hidden;
}
.cred__tag.on { visibility: visible; animation: credIn .3s steps(3, end); }
.cred__tag b {
  font: 400 clamp(8px, 1.15vw, 13px)/1.35 'Press Start 2P', monospace;
  color: var(--c);
  text-shadow: 0 2px #05070d, 2px 2px #05070d, -1px 0 #05070d, 1px 0 #05070d, 0 -1px #05070d;
}
.cred__tag > span {
  font: 400 clamp(10px, 1.2vw, 14px)/1.2 'Silkscreen', monospace;
  letter-spacing: .12em; text-transform: uppercase;
  color: #ffb547;
  text-shadow: 2px 2px #05070d;
}
.cred__tag--big b {
  font-size: clamp(11px, 1.8vw, 20px);
  color: #ffd666;
  text-shadow: 0 2px #8a5a12, 2px 3px #05070d, -2px 0 #05070d, 2px 0 #05070d, 0 -2px #05070d, 0 0 14px rgba(255, 214, 102, .5);
}
.cred__tag--big > span { color: #ffe9b0; }

/* the information, on the bottom bar */
.cred__info {
  position: absolute; left: 50%; bottom: 50%;
  transform: translate(-50%, 50%);
  display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.2vh, 12px);
  text-align: center;
  visibility: hidden;
}
.cred__info.on { visibility: visible; animation: credIn .4s steps(4, end); }
.cred__info p { margin: 0; }
.cred__ver { font: 400 clamp(8px, 1vw, 11px)/1.4 'Press Start 2P', monospace; color: #3dffa2; text-shadow: 0 2px #0f4a33; }
.cred__fonts { font: 400 clamp(10px, 1.1vw, 13px)/1.35 'Silkscreen', monospace; color: #808ba6; }
.cred__thanks { font: 400 clamp(9px, 1.1vw, 12px)/1.4 'Press Start 2P', monospace; color: #ffb547; text-shadow: 0 2px #6b3f0a; animation: credPulse 1.6s steps(2, end) infinite; }
@keyframes credPulse { 50% { opacity: .55; } }

/* ---------- controls ---------- */
.cred__skip {
  position: absolute; z-index: 2;
  top: max(8px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right));
  min-height: 32px; padding: 9px 12px 8px;
  font: 400 8px/1 'Press Start 2P', monospace;
  color: #c3ccd9; background: #05070d;
  border: 0; border-radius: 0;
  box-shadow: 0 -2px #46506b, 0 2px #46506b, -2px 0 #46506b, 2px 0 #46506b;
  cursor: pointer;
}
.cred__skip:hover, .cred__skip:focus-visible { color: #3dffa2; box-shadow: 0 -2px #3dffa2, 0 2px #3dffa2, -2px 0 #3dffa2, 2px 0 #3dffa2; outline: none; }
.cred__hint {
  position: absolute; z-index: 2; margin: 0;
  right: max(12px, env(safe-area-inset-right)); bottom: max(6px, calc((var(--bar) - 8px) / 2));
  font: 400 8px/1 'Press Start 2P', monospace; color: #808ba6;
  animation: credBlink 1.4s steps(1, end) infinite;
  pointer-events: none;
}
.cred.is-final .cred__hint { display: none; }
.cred__hint .t { display: none; }
.touch .cred__hint .k { display: none; }
.touch .cred__hint .t { display: inline; }

/* short screens (phone lying down) */
@media (max-height: 520px) {
  .cred__name { font-size: clamp(12px, 2vw, 18px); }
  .cred.is-big .cred__name { font-size: clamp(18px, 4vw, 34px); }
  .cred__quote { font-size: 19px; max-width: 46ch; }
  .cred__hint { display: none; }
}

/* scene indicator: four dots (top left), the current one blinking */
.cred__dots {
  position: absolute; z-index: 2; margin: 0;
  top: max(20px, calc(env(safe-area-inset-top) + 12px)); left: max(14px, env(safe-area-inset-left));
  display: flex; gap: 8px;
  pointer-events: none;
}
.cred__dots i { width: 8px; height: 8px; background: #2a3247; box-shadow: 0 2px #05070d; }
.cred__dots i.on { background: var(--c); }
.cred__dots i.cur { animation: credBlink 1s steps(1, end) infinite; }
.cred.is-final .cred__dots i { background: #3dffa2; animation: none; }

/* skipping does not count during the first second of a scene: the button says so */
.cred__skip.is-wait { opacity: .45; }

/* the transition between scenes: the texts glitch out (the canvas glitches in creditos.js) */
.cred.is-glitch .cred__solo { animation: credGlitch .4s steps(4, end); }
@keyframes credGlitch {
  0% { transform: translateX(-50%); text-shadow: none; }
  25% { transform: translateX(calc(-50% - 6px)); }
  50% { transform: translateX(calc(-50% + 5px)); filter: drop-shadow(3px 0 #ff3d7f) drop-shadow(-3px 0 #2de2c8); }
  75% { transform: translateX(calc(-50% - 3px)); }
  100% { transform: translateX(-50%); }
}

/* accents drawn in pixels over the plain letter (Press Start 2P draws Ã, É, Ê... wrong): creditos.js pixelAccents() */
.pxa { position: relative; }
.pxa::before, .pxa::after {
  content: ''; position: absolute; left: 0; top: var(--pxa-top, -.25em);
  width: 1em; height: .25em;
  -webkit-mask: var(--m) 0 0 / 100% 100% no-repeat; mask: var(--m) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}
.pxa::before { background: #05070d; transform: translateY(2px); }
.pxa::after { background: currentColor; }
.pxa--ced::before, .pxa--ced::after { top: auto; bottom: var(--pxa-bot, -.25em); }
