/* Home only. Default layout is the plain version: seven readable chapters in normal flow, each over its photo.
   The class "filme" (set by home.js when the film is running) turns the text panels into fixed overlays
   and shows the stage built by cena.js. */

.pg-home .barra { background: linear-gradient(#050505f2 0%, #050505b0 55%, #05050500 100%); border-bottom: 0; height: 5.5rem; }
.pg-home .barra__nav, .pg-home .barra__acoes { height: 4.25rem; }

h1, .cap h2 { font-size: clamp(3rem, 8.2vw, 7rem); line-height: .98; max-width: 15ch; text-shadow: 0 2px 28px #000a; }
.cap h2 { font-size: clamp(2.7rem, 6.6vw, 5.6rem); max-width: 14ch; }

/* ---------- chapters (plain version by default) ---------- */
.cap { position: relative; min-height: 100svh; background: #0a0a0a var(--foto) center / cover no-repeat; }
.cap__painel {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end; gap: .15rem;
  padding: 8rem var(--margem) clamp(2.2rem, 7vh, 4.5rem);
}
.cap__painel::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to right, rgb(5 5 5 / var(--esq, .5)) 0%, rgb(5 5 5 / 0) 64%),
    linear-gradient(to top, rgb(5 5 5 / var(--baixo, .6)) 0%, rgb(5 5 5 / 0) 52%);
}
.cap__painel { z-index: 0; }
.cap__painel > * { max-width: 36rem; }
.cap--tunel { --esq: .2; --baixo: .55; }
.cap--palco { --esq: .6; --baixo: .65; }
.cap--categorias { --esq: .6; --baixo: .6; }
.cap--caminho { --esq: .45; --baixo: .7; }
.cap--dia { --esq: .78; --baixo: .6; }
.cap--taca { --esq: .5; --baixo: .55; }
.cap--fim { --esq: .7; --baixo: .75; }

.linha { margin: 0; font-size: 1.15rem; text-shadow: 0 1px 12px #000c; }
.linha--conta { font-family: var(--titulo); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ouro); margin-top: .5rem; font-size: 1rem; }
.linha--conta:empty { display: none; }
.texto { margin: 0 0 .8rem; text-shadow: 0 1px 12px #000c; }
.texto--menor { font-size: .95rem; color: #dedede; }
.role, .dica { font-family: var(--titulo); font-weight: 600; font-size: .9rem; letter-spacing: .18em; text-transform: uppercase; color: #d0d0d0; margin: 1.6rem 0 0; }
.dica { margin: 0; display: none; }

.fichas { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .3rem; }
.ficha {
  min-height: 2.75rem; padding: .4rem 1rem; cursor: pointer;
  font-family: var(--titulo); font-weight: 800; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--tinta); background: #050505a6; border: 2px solid #ffffff77; border-radius: 3px;
}
.ficha:hover { border-color: #fff; }
.ficha[aria-pressed='true'] { background: #fff; border-color: #fff; color: #000; }
.cartao { margin: .8rem 0 0; min-height: 3.1em; text-shadow: 0 1px 12px #000c; }

.cap .programa { max-width: 22rem; margin-bottom: 1rem; }
.cap .programa li { text-shadow: 0 1px 10px #000c; }

.gravar label { margin-top: .2rem; }
.simulacao { font-size: .85rem; color: #dedede; margin: .5rem 0 0; }
#placa2d { display: block; width: 100%; max-width: 26rem; height: auto; margin: 0 0 1rem; border-radius: 4px; }
.etapas-img { display: block; width: 100%; max-width: 26rem; height: auto; margin: 0 0 1rem; border-radius: 4px; }
.arrasto { display: none; }

/* ---------- film: stage ---------- */
#palco, .trilho { display: none; }
.filme #palco { display: block; position: fixed; inset: 0 0 auto 0; height: 100lvh; z-index: 0; overflow: hidden; background: var(--noite); }
.cena { position: absolute; inset: 0; overflow: hidden; visibility: hidden; will-change: opacity; }
.clarao { position: absolute; inset: -20%; z-index: 2; pointer-events: none; visibility: hidden; will-change: transform, opacity; background: radial-gradient(closest-side at 52% 50%, #fff3d2 0%, #ffe1a3cc 22%, #ffc97a66 46%, #ffc97a00 72%); }
.cena__quadro { position: absolute; will-change: transform; }
.cena__quadro > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.cena--parcial .cena__quadro { -webkit-mask-image: linear-gradient(to bottom, #0000 0%, #000 7%, #000 84%, #0000 100%); mask-image: linear-gradient(to bottom, #0000 0%, #000 7%, #000 84%, #0000 100%); }
.cena--5.cena--parcial .cena__quadro { -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 82%, #0000 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 82%, #0000 100%); }

/* chapter 3: rows of shirts, the far rows smaller */
.camisas { position: absolute; left: 45%; right: 4%; top: 22%; bottom: 5%; display: grid; grid-template-rows: repeat(4, 1fr); justify-items: center; align-items: center; }
.fila {
  position: relative; display: flex; align-items: center; gap: 2.5%;
  width: calc(60% + var(--r) * 13%); padding: 0; margin: 0; background: none; border: 0; cursor: pointer; color: inherit; font: inherit;
  opacity: var(--e, 0); transform: translateY(calc((1 - var(--e, 0)) * 18%));
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), filter .45s, opacity .2s;
}
.fila.on { transform: translateY(-9%) scale(1.14); z-index: 5; }
.fila.dim { filter: brightness(.58) saturate(.8); }
.camisa { position: relative; flex: 1; aspect-ratio: 475 / 520; display: grid; place-items: center; }
.camisa img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.camisa b { position: relative; top: 2%; font-family: var(--titulo); font-weight: 800; font-size: clamp(.9rem, 2.4vw, 2.6rem); line-height: 1; color: #fff; }
.camisa::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: -7%; height: 12%; background: radial-gradient(closest-side, #000b, #0000); z-index: -1; }
.fila__nome {
  position: absolute; right: 100%; margin-right: .9rem; top: 50%; translate: 0 -50%; white-space: nowrap;
  font-family: var(--titulo); font-weight: 800; font-size: 1.05rem; letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 1px 8px #000;
  padding: .15rem .5rem; border: 2px solid #ffffff88; border-radius: 3px; background: #05050588;
}
.fila.on .fila__nome { background: #fff; color: #000; border-color: #fff; text-shadow: none; }

/* chapter 4: the chalk bracket on the board */
.chave { position: absolute; left: 43.5%; top: 13.5%; width: 50%; height: 66%; overflow: visible; }
.chave text { font-family: var(--titulo); font-weight: 800; font-size: 26px; letter-spacing: 1.5px; text-transform: uppercase; text-anchor: middle; dominant-baseline: middle; fill: #f3efe2; }
.chave .chave__sub { font-weight: 600; font-size: 19px; letter-spacing: 2.5px; fill: #f3efe2cc; }
.chave .chave__titulo { font-weight: 600; font-size: 17px; letter-spacing: 4px; fill: #f3efe2b0; }
.chave .chave__nota { font-weight: 600; font-size: 17px; letter-spacing: 4px; fill: #e2bd70; opacity: 0; }
.chave__tracos path { fill: none; stroke: #f3efe2; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .9; }
.chave__caixa { opacity: 0; }
.chave__caixa rect { fill: #f3efe20f; stroke: #f3efe2; stroke-width: 2.5; }
.chave__caixa--ouro rect { stroke: #e2bd70; }
.chave__caixa--prata rect { stroke: #b9c8cb; }

/* chapter 5: dusk */
.crepusculo { position: absolute; inset: 0; background: linear-gradient(#05081a, #0d0903); opacity: 0; pointer-events: none; }

/* chapter 6: trophy */
.taca-foto { transition: opacity .6s; }
.taca3d { position: absolute; opacity: 0; transition: opacity .6s; pointer-events: none; }
.taca3d canvas { display: block; width: 100%; height: 100%; }
.taca-sombra { position: absolute; left: 60%; top: 86.2%; width: 24%; height: 6.4%; background: radial-gradient(closest-side, #000c 0%, #0008 45%, #0000 100%); opacity: 0; transition: opacity .6s; }
.tem3d .taca-foto { opacity: 0; }
.tem3d .taca3d, .tem3d .taca-sombra { opacity: 1; }
.placa-nome {
  position: absolute; margin: 0; display: grid; place-items: center; text-align: center;
  font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: clamp(.5rem, 1.05vw, 1.1rem); line-height: 1.1; color: #35250a; text-shadow: .5px .5px 0 #fff3cd99;
  padding: 0 .3em;
}
.tem3d .placa-nome { display: none; }

/* ---------- film: text panels ---------- */
.filme .cap { min-height: 0; height: calc(var(--len) * 100svh); background: none; }
/* The sections only give the page its length; clicks must reach the stage behind them. */
.filme .cap { pointer-events: none; }
.filme .cap__painel {
  position: fixed; inset: 0; z-index: 10; min-height: 0; height: 100svh;
  padding-top: 7rem; padding-right: 3.2rem;
  opacity: 0; visibility: hidden; pointer-events: none;
}
.filme .cap__painel { will-change: opacity; }
.filme .cap__painel > * { pointer-events: auto; max-width: min(36rem, 44vw); transform: translate3d(0, var(--dy, 0), 0); }
.veu { position: fixed; inset: 0; z-index: 12; background: var(--noite); opacity: 0; pointer-events: none; transition: opacity .55s ease-out; }
.veu.on { opacity: 1; transition: none; }
.filme .cap__painel--fases { display: grid; align-content: end; justify-content: start; }
.fase { display: flex; flex-direction: column; gap: .15rem; margin-top: 2.5rem; }
.fase:first-child { margin-top: 0; }
.filme .fase { grid-area: 1 / 1; align-self: end; margin: 0; }
.filme #placa2d, .filme .so-leve { display: none; }
.filme .dica { display: block; }
.filme .fase.gravar .rotulo { display: none; }
.filme .gravar { background: #050505d9; padding: 1.1rem 1.2rem 1.3rem; border-radius: 6px; width: 26rem; }
.filme .gravar .acoes { margin-top: .9rem; }
.filme .arrasto { pointer-events: auto; position: fixed; z-index: 11; left: 50%; right: 3.5rem; top: 14%; height: 74%; cursor: grab; touch-action: pan-y; }
.filme .arrasto:active { cursor: grabbing; }
.filme .trilho {
  display: flex; flex-direction: column; gap: .55rem;
  position: fixed; right: clamp(.5rem, 1.6vw, 1.4rem); top: 50%; transform: translateY(-50%); z-index: 25;
}
.trilho button { width: 1.5rem; height: 1.5rem; padding: 0; background: none; border: 0; cursor: pointer; display: grid; place-items: center; }
.trilho button::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; border: 2px solid #ffffffb0; box-shadow: 0 0 6px #0008; transition: transform .2s, background .2s; }
.trilho button[aria-current='true']::before { background: #fff; border-color: #fff; transform: scale(1.5); }

/* ---------- upright phones: the picture on top, the text below ---------- */
@media (max-aspect-ratio: 4/5) {
  .pg-home .barra { height: 4.6rem; }
  .filme .cap__painel { padding-right: 2.6rem; padding-bottom: 1.6rem; }
  .filme .cap__painel > * { max-width: none; }
  .filme .cap__painel::before { background: linear-gradient(to top, #050505 0%, #050505eb 30%, #050505a8 46%, #05050500 64%); }
  .filme .cap--tunel .cap__painel::before, .filme .cap--fim .cap__painel::before { background: linear-gradient(to top, #050505f2 0%, #050505b0 38%, #05050500 66%); }
  .filme h1 { font-size: clamp(2.7rem, 13vw, 3.6rem); }
  .filme .cap h2 { font-size: clamp(2.2rem, 10.5vw, 3rem); }
  .filme .cap--categorias .texto, .filme .cap--caminho #cat-caminho { display: none; }
  .filme .cartao { font-size: .97rem; min-height: 4.3em; }
  .filme .gravar { width: auto; padding: .9rem 1rem 1rem; }
  .camisas { left: 17%; right: 9%; top: 10.5%; bottom: 53%; }
  .fila { width: calc(70% + var(--r) * 10%); }
  .fila.on { transform: translateY(-5%) scale(1.06); }
  .filme .fichas { gap: .4rem; flex-wrap: nowrap; }
  .filme .ficha { padding: .4rem .6rem; font-size: 1.05rem; white-space: nowrap; }
  .fila__nome { font-size: .8rem; margin-right: .3rem; padding: .05rem .3rem; letter-spacing: .06em; }
  .camisa b { font-size: clamp(.7rem, 4.4vw, 1.5rem); }
  .placa-nome { font-size: clamp(.45rem, 2.1vw, .8rem); }
  .filme .arrasto { left: 0; right: 2.6rem; top: 12%; height: 46%; }
}
@media (max-width: 720px) and (min-aspect-ratio: 4/5) {
  .filme .cap__painel > * { max-width: min(30rem, 62vw); }
}
