/* Intro de marca na página Entrar: a animação do canvas «FELABS — Logo» (artboard «Intro de jogo»).
   Palco fixo de 1280×720, escalado pelo /intro.js para caber no painel. Corre uma vez (~10 s) e fica
   no logótipo final. Só no ecrã largo; no telemóvel o painel fica como antes. Corre sempre completa,
   também com movimento reduzido (decisão do Feliciano; o tema.css deixa-a de fora com [data-intro]).
   Sem JavaScript, as letras aparecem no fim pela própria animação. */

.intro { display: none; position: relative; flex: 1 1 0; min-height: 0; pointer-events: none; user-select: none; }
@media (min-width: 900px) {
  .intro { display: block; }
  .entrada-marca--intro { background: #000; }
}

.intro-palco {
  position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; margin: -360px 0 0 -640px;
  transform: scale(var(--escala, .5)); transform-origin: 50% 50%; color: #fff;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}
.intro-animada { position: absolute; inset: 0; perspective: 1500px; perspective-origin: 640px 360px; }

.intro-cam { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 640px 360px; animation: intro-cam 10s linear 0s both; }
@keyframes intro-cam {
  0% { transform: translateZ(380px) rotateX(46deg) rotateZ(-12deg) translateX(-183px); animation-timing-function: cubic-bezier(.45,0,.55,1); }
  36% { transform: translateZ(470px) rotateX(42deg) rotateZ(-8deg) translateX(-183px); animation-timing-function: cubic-bezier(.45,0,.55,1); }
  60% { transform: translateZ(320px) rotateX(64deg) rotateZ(0deg) translateX(10px) translateY(-188px); animation-timing-function: cubic-bezier(.45,0,.55,1); }
  82% { transform: translateZ(350px) rotateX(62deg) rotateZ(0deg) translateX(-20px) translateY(-188px); animation-timing-function: cubic-bezier(.45,0,.55,1); }
  100% { transform: none; }
}
.intro-dof { position: absolute; left: -700px; top: -700px; width: 2680px; height: 2120px; animation: intro-dof 10s cubic-bezier(.45,0,.55,1) 0s both; }
@keyframes intro-dof { 0%, 36% { filter: blur(2px); } 60%, 82% { filter: blur(1.5px); } 100% { filter: blur(0); } }
.intro-grelha {
  position: absolute; inset: 0;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 40px 40px;
  animation: intro-grelha-entra 1.5s ease 0s both, intro-grelha-sai 1s ease 9.4s forwards;
}
.intro-eixo-x { position: absolute; left: -700px; width: 2680px; top: 360px; height: 1px; background: #fff; transform-origin: center; animation: intro-desenhar-x 1.6s cubic-bezier(.45,0,.55,1) .1s both, intro-atenuar 1.4s ease 1.8s forwards, intro-apagar-eixo 1s ease 9.4s forwards; }
.intro-eixo-y { position: absolute; left: 121px; top: -400px; width: 1px; height: 1043px; background: #fff; transform-origin: center; animation: intro-desenhar-y 1.6s cubic-bezier(.45,0,.55,1) .3s both, intro-atenuar 1.4s ease 2s forwards, intro-apagar-eixo 1s ease 9.4s forwards; }

.intro-etiqueta { position: absolute; white-space: nowrap; letter-spacing: 2px; animation: intro-aparecer .8s ease .5s both, intro-sair 1s ease 9.4s forwards; }
.intro-estado { left: 696px; top: 498px; font-size: 11px; color: #d0d0d0; }
.intro-codigo { left: 335px; top: 200px; font-size: 10px; color: #8a8a8a; }
.intro-cursor { animation: intro-piscar 1.1s steps(1) 9; }
.intro-caixa { position: absolute; left: 335px; top: 240px; overflow: visible; }
.intro-caixa rect { fill: none; stroke: #8a8a8a; stroke-width: 1; stroke-dasharray: 1; animation: intro-tracar 1s cubic-bezier(.45,0,.55,1) 6.2s both, intro-sair .6s ease 8.8s forwards; }
.intro-regua {
  position: absolute; left: 335px; top: 528px; width: 611px; height: 40px; border-top: 1px solid #fff;
  background:
    repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 50px) 0 0 / 100% 16px no-repeat,
    repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 10px) 0 0 / 100% 7px no-repeat;
  animation: intro-regua-entra .8s cubic-bezier(.45,0,.55,1) 5.8s both, intro-sair .8s ease 9.2s forwards;
}
.intro-numeros { position: absolute; left: 0; top: 18px; display: flex; font-size: 9px; color: #9a9a9a; }
.intro-numeros span { width: 50px; padding-left: 4px; }
.intro-sonda { position: absolute; left: 0; top: -22px; width: 1px; height: 64px; background: #fff; box-shadow: 0 0 10px 1px rgb(255 255 255 / .7); animation: intro-sonda 1.6s cubic-bezier(.45,0,.55,1) 6.6s both; }
.intro-sonda-valor { position: absolute; left: 6px; top: -4px; font-size: 10px; letter-spacing: 1px; white-space: nowrap; }

.intro-centro { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transform-style: preserve-3d; }
.intro-lockup { display: flex; align-items: center; gap: 36px; transform-style: preserve-3d; }
.intro-nome { position: relative; width: 330px; font-family: var(--titulo), sans-serif; font-weight: 800; font-size: 150px; line-height: .9; letter-spacing: -.045em; white-space: nowrap; text-transform: none; transform-style: preserve-3d; }
.intro-linha { display: block; }
.intro-camadas { position: absolute; inset: 0; transform-style: preserve-3d; }
.intro-camada { position: absolute; left: 0; top: 0; }
.intro-nome-extrusao { animation: intro-extrudir .9s cubic-bezier(.3,0,.2,1) 9.3s both; }
.intro-frente { position: relative; transform: translateZ(1px); }
.intro-registo { position: absolute; left: 322px; top: 18px; font-family: var(--corpo), sans-serif; font-weight: 500; font-size: 30px; letter-spacing: 0; line-height: 1; transform: translateZ(1px); animation: intro-suave .7s ease 9.9s both; }

/* As letras: sem JavaScript aparecem no fim; com ele, o /intro.js descodifica-as. */
.intro-animada .intro-l { animation: intro-aparecer 0s linear 9.4s both; }
.intro--js .intro-animada .intro-l { animation: none; opacity: 1; }
.intro--js .intro-animada .intro-l.escondida { opacity: 0; }
.intro--js .intro-frente .intro-l.baralhada { opacity: .4; }
.intro--js .intro-frente .intro-l.fixa { animation: intro-fixar .7s ease-out both; }

.intro-simbolo { position: relative; width: 243px; height: 243px; transform-style: preserve-3d; }
.intro-simbolo-extrusao { animation: intro-extrudir 1.2s cubic-bezier(.3,0,.2,1) 5.6s both; }
.intro-simbolo svg { position: absolute; left: 0; top: 0; }
.intro-planta { overflow: visible; animation: intro-sair .6s ease 5s forwards; }
.intro-planta path { fill: none; stroke: #fff; stroke-dasharray: 1; vector-effect: non-scaling-stroke; }
.intro-planta-fora { stroke-width: 1.2; animation: intro-tracar 2.2s cubic-bezier(.45,0,.55,1) .3s both; }
.intro-planta-dentro { stroke-width: 1; animation: intro-tracar 1.2s cubic-bezier(.45,0,.55,1) 2.3s both; }
.intro-planta .intro-cotas { fill: #8a8a8a; stroke: #8a8a8a; stroke-width: .8; font-family: inherit; font-size: 6px; animation: intro-aparecer .8s ease 1.5s both; }
.intro-cotas path { fill: none; stroke: #8a8a8a; stroke-dasharray: none; animation: none; }
.intro-cotas text { stroke: none; }
.intro-caneta { position: absolute; left: 0; top: 0; border-radius: 50%; background: #fff; opacity: 0; offset-rotate: 0deg; transform: translateZ(3px); }
.intro-caneta-fora { width: 8px; height: 8px; box-shadow: 0 0 14px 4px rgb(255 255 255 / .7); offset-path: path("M53.5 0 H243 V189.5 L189.5 243 H0 V53.5 Z"); animation: intro-caneta 2.2s cubic-bezier(.45,0,.55,1) .3s both; }
.intro-caneta-dentro { width: 7px; height: 7px; box-shadow: 0 0 12px 3px rgb(255 255 255 / .7); offset-path: path("M80.2 63.2 H243 V111.8 H128.8 V138.5 H177.4 A21.9 21.9 0 0 1 177.4 182.3 H128.8 V243 H80.2 Z"); animation: intro-caneta 1.2s cubic-bezier(.45,0,.55,1) 2.3s both; }
.intro-simbolo .intro-preencher { fill: #fff; transform: translateZ(1px); animation: intro-revelar 1.4s cubic-bezier(.45,0,.55,1) 3.6s both; }
.intro-simbolo .intro-marca-corte { transform: translateZ(1.2px); animation: intro-aparecer .4s ease 4.6s both, intro-sair .3s ease 5.6s forwards; }
.intro-marca-corte path { fill: none; stroke: #000; stroke-width: 1.6; stroke-dasharray: 5 4; animation: intro-formigas .8s linear 0s 8; }
.intro-simbolo .intro-corte { fill: #000; transform: translateZ(1.5px); animation: intro-revelar .7s cubic-bezier(.45,0,.55,1) 5s both; }
.intro-scan { position: absolute; left: -70px; width: 383px; top: 0; height: 2px; background: #fff; box-shadow: 0 0 16px 3px rgb(255 255 255 / .55); transform: translateZ(2px); animation: intro-varrer 1.4s cubic-bezier(.45,0,.55,1) 3.6s both; }
.intro-laser { position: absolute; left: 72px; width: 171px; top: 0; height: 2px; background: #fff; box-shadow: 0 0 12px 2px rgb(255 255 255 / .8); opacity: 0; animation: intro-varrer .7s cubic-bezier(.45,0,.55,1) 5s both; }

/* Profundidade da extrusão: uma camada a cada 2 px, do cinzento claro ao escuro. */
.intro-camada:nth-child(1) { color: #c8c8c8; transform: translateZ(-2px); }
.intro-camada:nth-child(2) { color: #b7b7b7; transform: translateZ(-4px); }
.intro-camada:nth-child(3) { color: #a6a6a6; transform: translateZ(-6px); }
.intro-camada:nth-child(4) { color: #959595; transform: translateZ(-8px); }
.intro-camada:nth-child(5) { color: #848484; transform: translateZ(-10px); }
.intro-camada:nth-child(6) { color: #737373; transform: translateZ(-12px); }
.intro-camada:nth-child(7) { color: #626262; transform: translateZ(-14px); }
.intro-camada:nth-child(8) { color: #515151; transform: translateZ(-16px); }
.intro-camada:nth-child(9) { color: #404040; transform: translateZ(-18px); }
.intro-camada:nth-child(10) { color: #303030; transform: translateZ(-20px); }
.intro-simbolo-extrusao > svg:nth-child(1) { fill: #d8d8d8; transform: translateZ(-2px); }
.intro-simbolo-extrusao > svg:nth-child(2) { fill: #cfcfcf; transform: translateZ(-4px); }
.intro-simbolo-extrusao > svg:nth-child(3) { fill: #c6c6c6; transform: translateZ(-6px); }
.intro-simbolo-extrusao > svg:nth-child(4) { fill: #bdbdbd; transform: translateZ(-8px); }
.intro-simbolo-extrusao > svg:nth-child(5) { fill: #b4b4b4; transform: translateZ(-10px); }
.intro-simbolo-extrusao > svg:nth-child(6) { fill: #ababab; transform: translateZ(-12px); }
.intro-simbolo-extrusao > svg:nth-child(7) { fill: #a2a2a2; transform: translateZ(-14px); }
.intro-simbolo-extrusao > svg:nth-child(8) { fill: #9a9a9a; transform: translateZ(-16px); }
.intro-simbolo-extrusao > svg:nth-child(9) { fill: #919191; transform: translateZ(-18px); }
.intro-simbolo-extrusao > svg:nth-child(10) { fill: #888888; transform: translateZ(-20px); }
.intro-simbolo-extrusao > svg:nth-child(11) { fill: #7f7f7f; transform: translateZ(-22px); }
.intro-simbolo-extrusao > svg:nth-child(12) { fill: #767676; transform: translateZ(-24px); }
.intro-simbolo-extrusao > svg:nth-child(13) { fill: #6d6d6d; transform: translateZ(-26px); }
.intro-simbolo-extrusao > svg:nth-child(14) { fill: #656565; transform: translateZ(-28px); }
.intro-simbolo-extrusao > svg:nth-child(15) { fill: #5c5c5c; transform: translateZ(-30px); }
.intro-simbolo-extrusao > svg:nth-child(16) { fill: #535353; transform: translateZ(-32px); }
.intro-simbolo-extrusao > svg:nth-child(17) { fill: #4a4a4a; transform: translateZ(-34px); }
.intro-simbolo-extrusao > svg:nth-child(18) { fill: #414141; transform: translateZ(-36px); }
.intro-simbolo-extrusao > svg:nth-child(19) { fill: #383838; transform: translateZ(-38px); }
.intro-simbolo-extrusao > svg:nth-child(20) { fill: #303030; transform: translateZ(-40px); }

@keyframes intro-grelha-entra { from { opacity: 0; } to { opacity: .08; } }
@keyframes intro-grelha-sai { from { opacity: .08; } to { opacity: 0; } }
@keyframes intro-desenhar-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes intro-desenhar-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes intro-atenuar { from { opacity: 1; } to { opacity: .18; } }
@keyframes intro-apagar-eixo { from { opacity: .18; } to { opacity: 0; } }
@keyframes intro-suave { from { opacity: 0; transform: translateY(6px) translateZ(1px); } to { opacity: 1; transform: translateZ(1px); } }
@keyframes intro-aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes intro-sair { from { opacity: 1; } to { opacity: 0; } }
@keyframes intro-tracar { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes intro-revelar { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes intro-regua-entra { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes intro-sonda { from { transform: translateX(0); } to { transform: translateX(609px); } }
@keyframes intro-varrer { 0% { transform: translateY(0) translateZ(2px); opacity: 0; } 10%, 90% { opacity: 1; } 100% { transform: translateY(243px) translateZ(2px); opacity: 0; } }
@keyframes intro-caneta { 0% { offset-distance: 0%; opacity: 0; } 6%, 94% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
@keyframes intro-formigas { to { stroke-dashoffset: -18; } }
@keyframes intro-extrudir { 0% { transform: scale3d(1, 1, .01); visibility: hidden; } 1% { visibility: visible; } 100% { transform: scale3d(1, 1, 1); visibility: visible; } }
@keyframes intro-fixar { from { text-shadow: 0 0 28px rgb(255 255 255 / .8); } to { text-shadow: none; } }
@keyframes intro-piscar { 0% { opacity: 1; } 50% { opacity: 0; } }

/* Ecrãs seguintes no mesmo separador: a intro salta para o fim (logótipo estável), sem repetir a animação. */
.intro-vista .intro, .intro-vista .intro *, .intro-vista .intro *::before, .intro-vista .intro *::after { animation-delay: -60s !important; animation-iteration-count: 1 !important; }
