/* Portal da raiz 7loshi.com.br — uma tela, sem rolagem. A moldura é renascentista; a obra é moderna.
   Pintura em tela cheia + três etiquetas de museu (sólidas, sem véu atrás do texto) + movimento só com transform/opacity. */
:root {
  --azul: #2f6bff; --campo: #2456e6; --laranja: #ff5a1f; --tinta: #1d150d; --papel: #f4ecdc; --creme: #fbf6ea; --ouro: #e6c27a;
  --serifa: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sem: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --margem: clamp(16px, 4vw, 56px);
  /* Pintura: proporção do arquivo e ponto de fuga (foco do enquadramento). */
  --r: .6667; --fx: .5; --fy: 0;
  /* Holograma (v6, Leonardo da Vinci): tudo em % da pintura (docs/portal-pinturas/telas.json), por orientacao.
     --lx: eixo do Leonardo; --cap: altura maxima do corpo (cabeca a pes) como fracao da altura da pintura.
     --bx/--by/--bw/--bh: caixa do feixe de particulas (da tela do tablet ao topo da nevoa); --fb/--ft: meia-largura na base e no topo, fracao da caixa.
     --rx/--ry/--rw/--ra: brilho elipitico sobre a tela do tablet (centro, largura, razao largura/altura). */
  --lx: .48; --cap: .56;
  --bx: 36%; --by: 8%; --bw: 24%; --bh: 67%; --fb: .3; --ft: .44;
  --rx: 48%; --ry: 75.5%; --rw: 40%; --ra: 5.5;
  --selo-tinta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M10 .5H38A9.5 9.5 0 0 0 47.5 10V38A9.5 9.5 0 0 0 38 47.5H10A9.5 9.5 0 0 0 .5 38V10A9.5 9.5 0 0 0 10 .5Z' fill='%231d150d' stroke='%230d0906'/%3E%3Cpath d='M12.63 3.5H35.37A12.5 12.5 0 0 0 44.5 12.63V35.37A12.5 12.5 0 0 0 35.37 44.5H12.63A12.5 12.5 0 0 0 3.5 35.37V12.63A12.5 12.5 0 0 0 12.63 3.5Z' fill='none' stroke='%23fbf6ea' stroke-opacity='.6' stroke-width='.9'/%3E%3C/svg%3E");
}
@media (orientation: landscape) { :root { --r: 1.5; --fx: 0; --fy: .75; --lx: .495; --cap: .54; --bx: 40%; --by: 14%; --bw: 19%; --bh: 59%; --fb: .3; --ft: .44; --rx: 49.5%; --ry: 73%; --rw: 18%; --ra: 4.5; } }
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; height: 100%; }
body.portal { margin: 0; height: 100svh; overflow: hidden; background: var(--tinta); color: var(--creme); font: 500 1rem/1.4 var(--sem); -webkit-text-size-adjust: 100%; }

/* ---- Pintura ---- */
.cena { position: fixed; inset: 0; overflow: hidden; container-type: size; background: var(--tinta); }
.par { position: absolute; inset: 0; will-change: transform; }
/* Caixa da pintura: cobre a cena como object-fit: cover, com 8% de sobra para o avanço e a paralaxe; brilhos usam % desta caixa. */
.obra { --l: calc(max(100cqw, 100cqh * var(--r)) * 1.08); --a: calc(var(--l) / var(--r));
  position: absolute; width: var(--l); height: var(--a);
  left: calc((100cqw - var(--l)) * var(--fx)); top: var(--topo, calc((100cqh - var(--a)) * var(--fy)));
  transform-origin: var(--orig, calc(var(--fx) * 100%) calc(var(--fy) * 100%)); will-change: transform;
  animation: avanco 26s ease-in-out infinite alternate; }
.obra picture, .obra img { display: block; width: 100%; height: 100%; }
.obra img { object-fit: cover; }
/* Paisagem: a cabeca do Leonardo (17% da pintura) fica fixa a ~4% do topo, sem passar do limite que ainda cobre a base; escala a partir da cabeca, entao o avanco so a mantem no lugar. */
@media (orientation: landscape) { .obra { --topo: clamp(100cqh - var(--a) + 10px, 4cqh - .17 * var(--a), -10px); --orig: 50% 17%; } }
@keyframes avanco { to { transform: scale(1.06); } }

/* Holograma: Leonardo da Vinci. Camada .leo (img + varredura + disco) em % da pintura, entao acompanha avanco e paralaxe.
   O tamanho e a posicao saem das duas medidas que a pagina conhece: onde a cabeca fica (--cab) e onde as portas comecam (--cbase, medido pelo JS;
   sem JS, estimativa). Se couber, o corpo tem a altura da nevoa (pes pousados no tablet); se nao, encolhe para ficar inteiro, nunca atras das portas.
   A imagem tem a cabeca a 3,1% e os pes (disco) a 96,9% da altura: corpo = 93,8%. */
.leo { --cab: var(--ctop, 112px); --cb0: calc(100cqh - 300px);
  --corpo: max(120px, min(var(--cap) * var(--a), (var(--cbase, var(--cb0)) - var(--cab)) / 1.07)); --H: calc(var(--corpo) / .938);
  position: absolute; height: var(--H); aspect-ratio: 640 / 1262; left: calc(var(--lx) * var(--l) - var(--H) * .2535); top: calc(var(--cab) - var(--topo, 0px) - .031 * var(--H));
  pointer-events: none; mix-blend-mode: screen; transform-origin: 50% 96%; will-change: transform;
  animation: entra 1.6s ease-out both, flutua 6s ease-in-out infinite alternate; }
@media (orientation: landscape) { .leo { --cab: calc(var(--topo) + .17 * var(--a)); --cb0: calc(100cqh - 210px); } }
.leo .leonardo { display: block; width: 100%; height: 100%; object-fit: fill; background: #000; opacity: .96; animation: tremula 11s linear infinite; }
@keyframes entra { from { opacity: 0; } to { opacity: 1; } }
/* O gesto vem do video (leonardo.webm/mp4, 10 s em loop, fundo preto + screen = transparente); em codigo so resta uma flutuacao bem leve (+-.6% da altura). */
@keyframes flutua { from { translate: 0 .6%; } to { translate: 0 -.6%; } }
/* Tremeluz de holograma: duas quedas curtas e suaves a cada 11 s (cada uma ~130 ms), longe do limite de 3 por segundo. */
@keyframes tremula { 0%, 16%, 17.4%, 18.4%, 19.6%, 61%, 62.2%, 100% { opacity: .96; } 16.7% { opacity: .78; } 19% { opacity: .88; } 61.6% { opacity: .84; } }
/* Varredura: linhas finas (1px a cada 4px) recortadas no proprio contorno do Leonardo (luminancia da imagem); descem 40px (10 periodos) e recomecam sem salto; uma faixa suave cruza o corpo. */
.varre { position: absolute; inset: 0; overflow: hidden; -webkit-mask-image: url("/portal/img/leonardo-mascara.webp"); mask-image: url("/portal/img/leonardo-mascara.webp"); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
@supports not ((mask-image: url(x)) or (-webkit-mask-image: url(x))) { .varre { display: none; } }
/* Video: nenhum controle nativo (WebKit mostra o botao de play quando o autoplay e bloqueado). Sem autoplay, o JS marca .estatico e fica so o poster. */
.leo .leonardo::-webkit-media-controls, .leo .leonardo::-webkit-media-controls-panel, .leo .leonardo::-webkit-media-controls-start-playback-button, .leo .leonardo::-webkit-media-controls-overlay-play-button, .leo .leonardo::-webkit-media-controls-play-button { display: none !important; -webkit-appearance: none; appearance: none; opacity: 0; pointer-events: none; }
.leo.estatico { background: url("/portal/img/leonardo.webp") center / 100% 100% no-repeat; }
.leo.estatico .leonardo { visibility: hidden; }
.varre::before { content: ""; position: absolute; left: 0; right: 0; top: -40px; height: calc(100% + 40px);
  background: repeating-linear-gradient(to bottom, rgba(170, 230, 255, .7) 0 1px, transparent 1px 4px); animation: desce 4.2s linear infinite; }
.varre::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12%;
  background: linear-gradient(to bottom, rgba(150, 225, 255, 0), rgba(190, 240, 255, .75), rgba(150, 225, 255, 0)); animation: faixa 9s linear infinite; }
@keyframes desce { to { transform: translateY(40px); } }
@keyframes faixa { from { transform: translateY(-110%); } to { transform: translateY(830%); } }
/* Disco de luz nos pes: pulsa devagar. */
.disco { position: absolute; left: 50%; top: 96.9%; width: 80%; height: 7%; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(ellipse closest-side, rgba(140, 215, 255, .55) 0, rgba(60, 130, 255, .2) 60%, rgba(47, 107, 255, 0) 100%); animation: pulsa 3.4s ease-in-out infinite alternate; }
@keyframes pulsa { from { opacity: .35; scale: .94; } to { opacity: .95; scale: 1.05; } }
.feixe { position: absolute; left: var(--bx); top: var(--by); width: var(--bw); height: var(--bh); pointer-events: none; mix-blend-mode: screen; }

/* Luz do tablet: glow elipitico e frio (screen); so opacidade e escala animam. */
.brilho { --x: var(--rx); --y: var(--ry); --s: var(--rw);
  position: absolute; left: var(--x); top: var(--y); width: var(--s); aspect-ratio: var(--ra); translate: -50% -50%; border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(ellipse closest-side, rgba(150, 195, 255, .5) 0, rgba(60, 120, 255, .2) 40%, rgba(47, 107, 255, 0) 70%);
  animation: respira 4.6s ease-in-out var(--d, 0s) infinite alternate; }
@keyframes respira { from { opacity: .2; scale: .85; } to { opacity: .55; scale: 1.1; } }
.poeira { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---- Palco de texto: título no alto, portas embaixo, nada rola ---- */
main { position: relative; z-index: 1; height: 100svh; display: grid; align-content: space-between; justify-items: stretch; gap: 10px;
  grid-template-columns: 1fr; grid-template-areas: "cart" "portas" "zap";
  grid-template-rows: auto 1fr auto; padding: max(14px, env(safe-area-inset-top)) var(--margem) max(12px, env(safe-area-inset-bottom)); }
main > * { min-width: 0; }
.cartela { grid-area: cart; align-self: start; justify-self: start; max-width: 100%; display: grid; gap: .22rem;
  padding: 9px 16px 11px; border: 1px solid transparent; border-image: var(--selo-tinta) 16 fill / 16px; color: var(--creme); }
.marca { font: 800 .72rem/1 var(--sem); letter-spacing: .34em; text-transform: uppercase; color: var(--ouro); }
.cartela h1 { margin: 0; font: italic 400 clamp(1.55rem, 6.6vw, 3rem)/1 var(--serifa); letter-spacing: -.005em; text-wrap: balance; }
.cartela h1 em { color: var(--creme); }
/* Retrato: titulo em uma linha, para a cartela ficar baixa e liberar o Leonardo. */
@media (orientation: portrait) { .cartela h1 { font-size: clamp(1.15rem, 5.4vw, 1.6rem); } .cartela br { display: none; } .cartela p { font-size: .8rem; } }
.cartela p { margin: 0; font: 500 .84rem/1.3 var(--sem); color: rgba(251, 246, 234, .9); max-width: 26rem; }

/* Portas: placas de tinta e ouro, sólidas, sem véu atrás do texto; filete dourado duplo; no hover uma varredura de luz azul passa por trás do texto.
   Numeral romano em Instrument Serif, nome em serifa itálica, descrição em versalete espaçado. */
:root { --ouro-filete: #d6b06a; }
.portas { grid-area: portas; align-self: end; display: grid; gap: 9px; }
.porta { --in: inset 0 0 0 4px #1d150d, inset 0 0 0 5px rgba(230, 194, 122, .8); --sob: 0 7px 14px rgba(20, 10, 0, .5);
  position: relative; display: grid; grid-template-columns: 2.6rem 1fr; align-items: center; column-gap: .75rem; min-height: 68px; padding: 10px 18px 10px 14px;
  color: var(--creme); text-decoration: none; border: 1px solid var(--ouro-filete); border-radius: 2px; background: var(--tinta); overflow: hidden;
  box-shadow: var(--in), var(--sob);
  transition: translate .25s cubic-bezier(.2, 0, 0, 1), box-shadow .25s; }
.porta::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; translate: -110% 0;
  background: linear-gradient(100deg, transparent 32%, rgba(110, 180, 255, .26) 50%, transparent 68%); transition: translate .8s cubic-bezier(.2, 0, 0, 1); }
.num, .txt { position: relative; z-index: 1; }
.num { font: 400 2.3rem/1 var(--serifa); color: var(--ouro); text-align: center; }
.txt { display: grid; gap: 3px; }
.txt b { font: italic 400 1.5rem/1.05 var(--serifa); letter-spacing: 0; color: var(--creme); }
.txt small { font: 500 .7rem/1.25 var(--sem); letter-spacing: .15em; text-transform: uppercase; color: var(--ouro); }
/* Em breve: a própria descrição, com um losango; sem chip. */
.breve small::before { content: "\25C6\00a0" / ""; }

/* WhatsApp: pílula laranja com filete de tinta. */
.zap { grid-area: zap; justify-self: stretch; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .2em 1.2em .3em;
  border: 1px solid #8a2c08; border-radius: 2px; color: var(--tinta); text-decoration: none; font: italic 400 1.5rem/1 var(--serifa); background: var(--laranja);
  box-shadow: inset 0 0 0 3px var(--laranja), inset 0 0 0 4px rgba(29, 21, 13, .6), 0 5px 9px rgba(20, 10, 0, .4);
  transition: translate .25s cubic-bezier(.2, 0, 0, 1), box-shadow .25s; }

/* Foco visível: anel claro + halo escuro (lê sobre papel, tinta e pintura); mantém o bisel da moldura. */
.portal a:focus-visible { outline: 3px solid var(--creme); outline-offset: 3px; }
.porta:focus-visible { box-shadow: var(--in), 0 0 0 9px var(--tinta); }
.zap:focus-visible { box-shadow: inset 0 0 0 3px var(--laranja), inset 0 0 0 4px rgba(29, 21, 13, .6), 0 0 0 9px var(--tinta); }
.porta:active { translate: 0 1px; }
.zap:active { translate: 0 1px; }
@media (hover: hover) {
  .porta:hover { translate: 0 -3px; box-shadow: var(--in), 0 13px 22px rgba(20, 10, 0, .55); }
  .porta:hover:active { translate: 0 0; }
  .porta:hover::after { translate: 110% 0; }
  .zap:hover { translate: 0 -2px; box-shadow: inset 0 0 0 3px var(--laranja), inset 0 0 0 4px rgba(29, 21, 13, .6), 0 10px 14px rgba(20, 10, 0, .45); }
}

/* Telas baixas (360×740): comprime em vez de rolar. */
@media (max-height: 760px) and (max-width: 700px) {
  .cartela { padding: 10px 16px 12px; }
  .porta { min-height: 60px; padding-block: 5px; } .num { font-size: 1.9rem; } .txt b { font-size: 1.3rem; } .txt small { font-size: .64rem; }
  .zap { min-height: 44px; font-size: 1.35rem; }
}
/* O subtítulo só some em alturas realmente pequenas. */
@media (max-height: 640px) { .cartela p { display: none; } }
@media (max-height: 600px) and (max-width: 700px) { body.portal { overflow-y: auto; } main { height: auto; min-height: 100svh; } }

/* Desktop / paisagem: título no canto, portas em fileira embaixo, pílula do WhatsApp à direita na última linha. */
@media (min-width: 860px) and (orientation: landscape) {
  main { grid-template-columns: 1fr auto; grid-template-areas: "cart cart" "portas portas" ". zap"; gap: 16px; padding-block: clamp(20px, 4vh, 44px); padding-inline: max(var(--margem), calc((100vw - 1180px) / 2)); }
  .cartela { padding: 20px 30px 24px; gap: .5rem; }
  .cartela h1 { font-size: clamp(2.8rem, 4.4vw, 4.6rem); }
  .cartela p { font-size: 1.05rem; max-width: 30rem; }
  .portas { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 26px); }
  .porta { min-height: 104px; padding: 12px 22px 12px 16px; grid-template-columns: 3.2rem 1fr; column-gap: 1.1rem; }
  .num { font-size: 3rem; } .txt b { font-size: 1.75rem; } .txt small { font-size: .74rem; }
  .zap { justify-self: end; min-width: 18rem; }
}
@media (min-width: 860px) and (orientation: landscape) and (max-height: 760px) { .porta { min-height: 92px; } .num { font-size: 2.6rem; } .txt b { font-size: 1.55rem; } .cartela { padding: 14px 26px 16px; } .cartela h1 { font-size: clamp(2.2rem, 3.8vw, 3.6rem); } }

@media (prefers-reduced-motion: reduce) {
  .obra, .brilho, .leo, .leo .leonardo { animation: none; }
  .brilho { opacity: .4; }
  .porta, .zap, .porta::after { transition: none; }
  .poeira, .feixe, .varre, .disco { display: none; }
}
@media (forced-colors: active) {
  .cartela, .zap { border: 1px solid CanvasText; border-image: none; background: Canvas; color: CanvasText; }
  .porta { border: 1px solid CanvasText; background: Canvas; color: CanvasText; } .porta::before, .porta::after { display: none; } .num, .txt b, .txt small { color: CanvasText; }
}
