@font-face { font-family: 'Bodoni Moda'; src: url('../fontes/bodoni-moda-normal-400_700.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Bodoni Moda'; src: url('../fontes/bodoni-moda-italic-400_700.woff2') format('woff2'); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fontes/ibm-plex-mono-normal-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fontes/ibm-plex-mono-normal-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

@property --c { syntax: '<color>'; inherits: true; initial-value: #fff; }

:root {
  --papel: #f1ece2;
  --papel-2: rgba(241, 236, 226, .66);
  --fundo: #0a0908;
  --af: #7dff9a;
  --serif: 'Bodoni Moda', 'Didot', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --margem: clamp(16px, 3.4vw, 56px);
  --vao: clamp(4px, .55vw, 8px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--fundo); scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--papel); font-family: var(--serif); -webkit-font-smoothing: antialiased; overflow-x: clip; }
body.visor-aberto { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--af); outline-offset: 2px; }
.pula { position: absolute; left: 12px; top: -60px; z-index: 40; background: var(--papel); color: var(--fundo); padding: 10px 14px; font: 500 13px var(--mono); }
.pula:focus { top: 12px; }

/* A barra de cima: volta para o estúdio e liga o som */
#barra {
  position: absolute; z-index: 20; inset: 0 0 auto; display: flex; justify-content: space-between; align-items: center;
  padding: 8px var(--margem);
}
.volta, #som {
  min-height: 44px; display: inline-flex; align-items: center; gap: 9px;
  font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: #fff; text-shadow: 0 1px 10px #000;
}
.volta:hover, #som:hover { color: var(--af); }
.som-barras { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.som-barras i { width: 2px; height: 3px; background: currentColor; }
#som[aria-pressed="true"] .som-barras i { animation: barra 1s ease-in-out infinite alternate; }
#som[aria-pressed="true"] .som-barras i:nth-child(2) { animation-delay: -.45s; animation-duration: .8s; }
#som[aria-pressed="true"] .som-barras i:nth-child(3) { animation-delay: -.2s; animation-duration: 1.2s; }
#som[aria-pressed="true"] .som-barras i:nth-child(4) { animation-delay: -.7s; animation-duration: .9s; }
#som[aria-pressed="true"] .som-texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@keyframes barra { from { height: 3px; } to { height: 14px; } }

/* A capa: as fotos se revezam devagar, com o título por cima */
#capa { position: relative; height: 100svh; min-height: 520px; overflow: hidden; display: flex; align-items: flex-end; background: #050505; }
.slides, .slide { position: absolute; inset: 0; }
.slide { width: 100%; height: 100%; object-fit: cover; object-position: var(--pc); opacity: 0; transition: opacity 1.8s ease; transform: scale(1.06); will-change: opacity; }
.slide.ativo { opacity: 1; animation: respira 9s ease-out both; }
@keyframes respira { from { transform: scale(1.06); } to { transform: scale(1); } }
#capa::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(5, 5, 5, .86) 0, rgba(5, 5, 5, .28) 38%, rgba(5, 5, 5, 0) 62%), linear-gradient(to bottom, rgba(5, 5, 5, .42), rgba(5, 5, 5, 0) 18%); pointer-events: none; }
.capa-texto { position: relative; z-index: 2; padding: 0 var(--margem) clamp(72px, 11svh, 120px); max-width: 1100px; }
h1 { margin: 0; font-weight: 400; }
.h1-grande { display: block; font-size: clamp(64px, 15.5vw, 238px); line-height: .88; letter-spacing: -.035em; }
.h1-sub { display: block; margin-top: clamp(10px, 1.4vw, 18px); font: 500 clamp(11px, 1vw, 13px)/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--papel); }
.capa-texto p { margin: clamp(14px, 1.8vw, 22px) 0 0; font-size: clamp(18px, 1.7vw, 25px); line-height: 1.35; max-width: 34em; color: var(--papel); }
.desce { position: absolute; z-index: 2; left: 50%; bottom: 12px; width: 44px; height: 44px; margin-left: -22px; display: grid; place-items: center; }
.desce i { width: 1px; height: 28px; background: var(--papel); transform-origin: top; animation: desce 2.2s ease-in-out infinite; }
@keyframes desce { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
html.js .h1-grande { animation: sobe 1.2s cubic-bezier(.16, 1, .3, 1) both; }
html.js .h1-sub, html.js .capa-texto p { animation: sobe 1.2s .18s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes sobe { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* O índice fica preso no topo enquanto a pessoa desce */
#indice {
  position: sticky; top: 0; z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: clamp(8px, 1.4vw, 18px);
  padding: 0 var(--margem); background: rgba(10, 9, 8, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(241, 236, 226, .12);
}
.volta-2 { flex: none; display: grid; place-items: center; width: 34px; min-height: 52px; margin-left: -10px; font-size: 18px; text-decoration: none; color: var(--papel-2); transition: color .2s; }
.volta-2:hover { color: var(--af); }
#indice ul { display: flex; gap: clamp(14px, 1.9vw, 30px); overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
#indice ul::-webkit-scrollbar { display: none; }
#indice li a { display: inline-flex; align-items: center; min-height: 52px; white-space: nowrap; font-size: clamp(15px, 1.15vw, 17px); text-decoration: none; color: var(--papel-2); transition: color .25s; position: relative; }
#indice li a sup { font: 400 10px var(--mono); margin-left: 3px; transform: translateY(-3px); }
#indice li a:hover { color: var(--papel); }
#indice li a.aqui { color: var(--papel); font-style: italic; }
#indice li a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 9px; height: 1px; background: var(--af); transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.16, 1, .3, 1); }
#indice li a.aqui::after { transform: scaleX(1); }
.modos { flex: none; display: flex; gap: 14px; }
.modos button { min-height: 52px; font: 500 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--papel-2); }
.modos button[aria-pressed="true"] { color: var(--papel); text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--af); }
.modos button:hover { color: var(--papel); }

/* Cada capítulo */
.capitulo { padding: clamp(64px, 10vw, 150px) var(--margem) 0; }
.cap-topo { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(14px, 2vw, 30px); align-items: baseline; margin-bottom: clamp(26px, 3.6vw, 56px); max-width: 1180px; }
.cap-num { font: 500 12px var(--mono); letter-spacing: .1em; color: var(--af); }
.cap-topo h2 { margin: 0; font-weight: 400; font-size: clamp(40px, 7vw, 108px); line-height: .98; letter-spacing: -.025em; }
.cap-topo p { grid-column: 2; margin: clamp(14px, 1.6vw, 22px) 0 0; font-size: clamp(18px, 1.55vw, 23px); line-height: 1.42; max-width: 38em; color: var(--papel-2); }
.cap-link { grid-column: 2; justify-self: start; display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; font-style: italic; font-size: clamp(17px, 1.3vw, 19px); text-decoration: underline; text-underline-offset: 5px; text-decoration-color: rgba(241, 236, 226, .35); transition: text-decoration-color .25s, color .25s; }
.cap-link:hover { color: var(--af); text-decoration-color: var(--af); }

/* O mosaico: cada linha se ajusta à largura sem cortar nenhuma foto */
.mosaico { --alt: clamp(150px, 19vw, 300px); display: flex; flex-wrap: wrap; gap: var(--vao); margin-bottom: var(--vao); }
.mosaico.grande { --alt: clamp(220px, 28vw, 520px); }
.mosaico::after { content: ''; flex: 240 1 0; }
.mosaico.grande::after { display: none; }
.foto { position: relative; margin: 0; flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--alt)); aspect-ratio: var(--r); min-width: 0; background: var(--cor, #1a1816); overflow: hidden; }
.foto a { position: absolute; inset: 0; display: block; cursor: zoom-in; }
.foto img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s cubic-bezier(.16, 1, .3, 1), filter .45s; }
.foto figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; pointer-events: none;
  font: 400 11px/1.4 var(--mono); letter-spacing: .03em; color: #fff; background: linear-gradient(to top, rgba(0, 0, 0, .68), rgba(0, 0, 0, 0));
  opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .45s cubic-bezier(.16, 1, .3, 1);
}
/* Os cantos do visor, os mesmos do menu do estúdio: fecham na foto e ficam verdes quando o foco trava */
.af { position: absolute; inset: 12px; pointer-events: none; opacity: 0; --c: #fff; --t: clamp(14px, 1.5vw, 24px); transform: scale(1.06); transition: opacity .25s, transform .5s cubic-bezier(.16, 1, .3, 1); background:
  linear-gradient(var(--c), var(--c)) 0 0 / var(--t) 1px, linear-gradient(var(--c), var(--c)) 0 0 / 1px var(--t),
  linear-gradient(var(--c), var(--c)) 100% 0 / var(--t) 1px, linear-gradient(var(--c), var(--c)) 100% 0 / 1px var(--t),
  linear-gradient(var(--c), var(--c)) 0 100% / var(--t) 1px, linear-gradient(var(--c), var(--c)) 0 100% / 1px var(--t),
  linear-gradient(var(--c), var(--c)) 100% 100% / var(--t) 1px, linear-gradient(var(--c), var(--c)) 100% 100% / 1px var(--t);
  background-repeat: no-repeat; }
@media (hover: hover) {
  .mosaico:hover .foto:not(:hover) img { filter: brightness(.5) saturate(.8); }
  .foto:hover img { transform: scale(1.025); }
  .foto:hover figcaption { opacity: 1; transform: none; }
  .foto:hover .af { opacity: 1; transform: none; --c: var(--af); transition: opacity .25s, transform .5s cubic-bezier(.16, 1, .3, 1), --c 0s .4s; filter: drop-shadow(0 0 4px rgba(125, 255, 154, .55)); }
}
.foto a:focus-visible { outline-offset: -4px; }
.foto a:focus-visible .af { opacity: 1; transform: none; }
.foto a:focus-visible ~ figcaption { opacity: 1; transform: none; }

/* A foto entra como um obturador abrindo */
html.js .foto:not(.vista) a { clip-path: inset(0 0 100% 0); }
html.js .foto a { transition: clip-path 1s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--atraso, 0s); }

/* Folha de contato: todas as fotos pequenas, como um negativo revelado */
html.folha .mosaico, html.folha .mosaico.grande { --alt: clamp(64px, 8.4vw, 124px); display: contents; }
html.folha .foto figcaption, html.folha .af { display: none; }
html.folha .capitulo { display: flex; flex-wrap: wrap; gap: 3px; padding-top: clamp(36px, 4.5vw, 64px); }
html.folha .capitulo::after { content: ''; flex: 100000 1 0; }
html.folha .cap-topo { flex-basis: 100%; margin-bottom: 11px; }
html.folha .cap-topo h2 { font-size: clamp(24px, 2.6vw, 38px); }
html.folha .cap-topo p, html.folha .cap-link { display: none; }

/* O fim da página */
#fim { padding: clamp(90px, 13vw, 190px) var(--margem) clamp(30px, 4vw, 50px); text-align: center; }
.fim-frase { margin: 0 auto; font-size: clamp(27px, 4.7vw, 72px); line-height: 1.1; letter-spacing: -.015em; max-width: 19em; }
.fim-frase em { font-style: italic; }
.fim-botao {
  display: inline-flex; align-items: center; justify-content: center; min-height: 54px; margin-top: clamp(28px, 3.6vw, 46px); padding: 0 30px;
  font: 500 13px var(--mono); letter-spacing: .07em; text-transform: uppercase; text-decoration: none; color: var(--fundo); background: var(--papel); transition: background .25s;
}
.fim-botao:hover { background: var(--af); }
.fim-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px clamp(18px, 2.6vw, 38px); margin-top: clamp(48px, 7vw, 96px); }
.fim-links a { display: inline-flex; align-items: center; min-height: 44px; font-style: italic; font-size: 17px; text-decoration: none; color: var(--papel-2); }
.fim-links a:hover { color: var(--papel); }

/* O visor: a foto em tela cheia */
#visor { position: fixed; inset: 0; z-index: 30; display: grid; color: #fff; }
#visor[hidden] { display: none; }
.v-fundo { position: absolute; inset: 0; background: #050505; }
.v-fundo::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, var(--tinta, #222), #050505 72%); opacity: .55; transition: background .6s; }
.v-palco { position: absolute; inset: clamp(8px, 3.4svh, 40px) clamp(8px, 5vw, 92px) clamp(68px, 9svh, 88px); display: grid; place-items: center; overflow: hidden; }
#v-foto { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: opacity .28s, transform .55s cubic-bezier(.16, 1, .3, 1); cursor: zoom-in; touch-action: pan-y; }
#v-foto.lupa { cursor: zoom-out; transition: opacity .28s; }
#v-foto.troca { opacity: 0; }
.v-btn { position: absolute; z-index: 2; width: 52px; height: 52px; display: grid; place-items: center; font-size: 24px; color: #fff; transition: color .2s, transform .35s cubic-bezier(.16, 1, .3, 1); }
.v-btn:hover { color: var(--af); }
.v-fecha { top: 6px; right: 8px; font-size: 32px; font-family: var(--mono); }
.v-ant { left: 4px; top: 50%; margin-top: -40px; }
.v-prox { right: 4px; top: 50%; margin-top: -40px; }
.v-ant:hover { transform: translateX(-3px); }
.v-prox:hover { transform: translateX(3px); }
.v-info { position: absolute; left: var(--margem); right: var(--margem); bottom: 0; min-height: clamp(62px, 9svh, 84px); display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); font: 400 12px/1.45 var(--mono); padding-bottom: env(safe-area-inset-bottom); }
.v-cap { flex: none; color: var(--af); letter-spacing: .06em; text-transform: uppercase; font-size: 11px; font-weight: 500; }
.v-leg { flex: 1; min-width: 0; color: #fff; font: italic 400 clamp(15px, 1.2vw, 18px)/1.3 var(--serif); }
.v-cont { flex: none; color: rgba(255, 255, 255, .7); }

/* Na tela em pé a foto para antes do texto, para o título nunca passar por cima de um rosto */
@media (max-aspect-ratio: 1/1) {
  .slides { bottom: 22%; }
  .slide { object-position: var(--pm); }
  #capa::after { background: linear-gradient(to top, #050505 22%, rgba(5, 5, 5, 0) 44%), linear-gradient(to bottom, rgba(5, 5, 5, .42), rgba(5, 5, 5, 0) 14%); }
}
@media (max-width: 760px) {
  #indice { padding-right: 0; gap: 0; }
  #indice ul { padding-right: var(--margem); }
  .modos { display: none; }
  .mosaico { --alt: 28vw; }
  .mosaico.grande { --alt: 62vw; }
  .foto figcaption, .af { display: none; }
  .cap-topo { grid-template-columns: minmax(0, 1fr); }
  .cap-num { margin-bottom: 8px; }
  .cap-topo p, .cap-link { grid-column: 1; }
  .v-palco { inset: 52px 0 78px; }
  .v-ant, .v-prox { display: none; }
  .v-info { flex-wrap: wrap; gap: 2px 10px; align-content: center; min-height: 78px; }
  .v-leg { flex-basis: 100%; order: 3; }
  .v-cap { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
