/*
 * Acréscimos do site à ilha 3D publicada (24/09/2026). O scripts/build-3d.mjs copia este
 * arquivo para public/3d/site.css. A pasta 3D/ (a versão aprovada) não é alterada.
 */

/* Header da ilha com as medidas da nav do site (24/09, pedido do Lucca: indo e voltando pelo
   Pixalate, o header não pode mudar de tamanho). Os valores são os do app/globals.css:
   --fs-ui, o padding da .nav ul, o gap entre os itens e a distância do topo. A diferença é que
   aqui os itens são botões com fundo no hover, então o gap do site vira padding de cada um */
:root {
  --site-fs-ui: clamp(1rem, 1.60vw, 23px);
  --site-pad-y: calc(clamp(10px, 1.03vw, 15px) + 1px);
  --site-gap-half: clamp(14px, 3.35vw, 48.5px);
  --site-pad-x: clamp(24px, 4.1vw, 59px);
}
.topbar { top: clamp(18px, 3.84vw, 55px); }
.topbar nav {
  gap: 0;
  padding: 0 5px 0 calc(var(--site-pad-x) - var(--site-gap-half));
}
.topbar nav > button {
  padding: var(--site-pad-y) var(--site-gap-half);
  font-size: var(--site-fs-ui);
  line-height: 0.968;
}
.topbar nav #work-button span { font-size: .45em; }

/* do centro (abertura) para a direita (explorando) em movimento, e não num salto (24/09). Na 3D/
   a nav troca de position: absolute para item do flex, o que não anima; aqui ela fica sempre
   absoluta e só left/transform mudam. A barra guarda a altura da nav para a assinatura continuar
   centrada com ela */
.topbar { min-height: calc(var(--site-fs-ui) * .968 + 2 * var(--site-pad-y)); }
.topbar nav,
body:not(.exploring) .topbar nav {
  position: absolute;
  top: 0;
  left: 100%;
  transform: translateX(-100%);
  white-space: nowrap;
  transition: left .9s cubic-bezier(.65, 0, .35, 1), transform .9s cubic-bezier(.65, 0, .35, 1);
}
body:not(.exploring) .topbar nav { left: 50%; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) {
  .topbar nav, body:not(.exploring) .topbar nav { transition: none; }
}

/* Botão de volta ao portfólio: último item da pílula, uma cápsula laranja 5px por dentro */
#site-home {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  margin: 5px 0 5px clamp(4px, .7vw, 10px);
  padding: calc(var(--site-pad-y) - 5px) clamp(14px, 1.6vw, 24px);
  border-radius: 200px;
  background: #d36135;
  color: #f7f7ef;
  font-size: var(--site-fs-ui);
  font-weight: 400;
  line-height: 0.968;
  white-space: nowrap;
  text-decoration: none;
  transition: background .2s;
}
#site-home:hover { background: #b9502a; }
#site-home svg { width: .62em; height: .62em; fill: currentColor; flex: none; }

/* o site desce a nav para 24px do topo abaixo de 900px */
@media (max-width: 900px) {
  .topbar { top: 24px; }
}

/* celular: como o Pixalate no site, o Portfolio fica só com o ícone */
@media (max-width: 600px) {
  .topbar nav > button { padding-inline: 10px; }
  .topbar nav { left: 50%; transform: translateX(-50%); }
  /* círculo da altura interna da pílula; sem texto, a altura não vem mais da linha */
  #site-home {
    --d: calc(var(--site-fs-ui) * .968 + 2 * var(--site-pad-y) - 10px);
    width: var(--d);
    height: var(--d);
    padding: 0;
    justify-content: center;
    font-size: 0;
  }
  #site-home svg { width: 13px; height: 13px; }
}

/* ============================================================
   Leitor de cases em tela cheia (scripts/3d-immersive.js, 24/09): a folha do case sobre o mundo
   desfocado. A diagramação é a do reader-motion.css da 3D/; aqui só o tamanho da folha e,
   no celular, as letras (as de lá eram para uma página reduzida dentro da cena 3D)
   ============================================================ */
#exhibition-ui { display: none !important; }
#immersive {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(29, 29, 27, 0);
  backdrop-filter: blur(0) saturate(100%);
  -webkit-backdrop-filter: blur(0) saturate(100%);
  transition: background 1s ease, backdrop-filter 1s ease, -webkit-backdrop-filter 1s ease;
}
/* o mundo desfoca junto com a entrada da folha */
#immersive.on {
  background: rgba(29, 29, 27, .38);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}
#immersive[hidden] { display: none; }
.immersive-sheet {
  position: relative;
  width: min(1120px, calc(100vw - 176px));
  height: calc(100vh - 2 * clamp(24px, 5vh, 56px));
  height: var(--sheet-h);
}
#immersive .project-book {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
  outline: none;
}
.immersive-close {
  position: absolute;
  top: 0;
  left: calc(100% + 16px);
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f7f7ef;
  color: #1d1d1b;
  font-size: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: background .2s, transform .2s;
}
.immersive-close:hover { background: #fff; transform: rotate(90deg); }
.immersive-sheet { will-change: transform; }

@media (max-width: 700px) {
  .immersive-sheet { width: 100vw; height: 100vh; height: 100dvh; }
  #immersive .project-book { border-radius: 0; box-shadow: none; }
  .immersive-close { top: 10px; left: auto; right: 12px; width: 40px; height: 40px; font-size: 14px; background: #1d1d1b; color: #f7f7ef; z-index: 6; }
}

/* ============================================================
   Layout Dossiê do case (scripts/3d-case-layouts.js, 24/09; escolhido entre Revista, Exposição
   e Dossiê). --sheet-h é a altura da folha, para a coluna fixa e o quadro das artes
   ============================================================ */
#immersive { --sheet-h: calc(100dvh - 2 * clamp(24px, 5vh, 56px)); --line: rgba(29, 29, 27, .13); --muted: #716c61; }
#immersive .project-book.cl-root {
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  font-size: 16px;
  line-height: 1.5;
  color: #1d1d1b;
  background: #f7f7ef;
  scrollbar-width: thin;
  scrollbar-color: #c9c3b3 transparent;
}
#immersive .cl-root h2, #immersive .cl-root h3, #immersive .cl-root p { margin: 0; }
#immersive .cl-root h2 { font-weight: 700; }
#immersive .cl-root h3 { font-size: clamp(22px, 2.1vw, 28px); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.cl-root figure { margin: 0; }
.cl-frame { position: relative; overflow: hidden; border-radius: 4px; background: #ebe8dc; }
.cl-frame img, .cl-frame video { display: block; width: 100%; height: auto; }
.cl-video video { background: #1d1d1b; }
.cl-media figcaption { padding-top: 10px; font-size: 13px; color: var(--muted); }
.cl-kicker { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 13px; color: var(--muted); }
.cl-kicker span { color: #d36135; font-variant-numeric: tabular-nums; }
.cl-num { font-size: 13px; color: #d36135; font-variant-numeric: tabular-nums; }
.cl-link { align-self: flex-start; font-size: 15px; text-decoration: underline; text-underline-offset: 5px; }
.cl-link:hover { color: #d36135; }
.cl-play {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 15px;
  border-radius: 99px;
  background: #f7f7ef;
  color: #1d1d1b;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  transition: background .2s, transform .2s;
}
.cl-play:hover { background: #fff; transform: scale(1.04); }
.cl-play span { width: 0; height: 0; border-left: 10px solid currentColor; border-block: 6px solid transparent; }
.cl-play[hidden] { display: none; }
.cl-progress { position: sticky; left: 0; bottom: 0; z-index: 5; width: 100%; height: 3px; background: #e4e0d2; }
.cl-progress span { display: block; height: 100%; background: #d36135; transform-origin: left; transform: scaleX(0); }

/* próximo projeto: cartão escuro com a capa dele */
.cl-next { padding: clamp(64px, 9%, 112px) clamp(20px, 5%, 64px) clamp(24px, 5%, 56px); }
.cl-nextcard {
  display: grid;
  grid-template-columns: minmax(0, 38%) 1fr auto;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  width: 100%;
  min-height: 200px;
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #1d1d1b;
  color: #f7f7ef;
  text-align: left;
}
.cl-nextcard__art { align-self: stretch; background: #34342f center / cover no-repeat; transition: transform .7s cubic-bezier(.16, 1, .3, 1); }
.cl-nextcard:hover .cl-nextcard__art { transform: scale(1.06); }
.cl-nextcard__text small { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .6; }
.cl-nextcard__text strong { display: block; margin: 8px 0 6px; font-size: clamp(28px, 3.2vw, 46px); line-height: 1.02; letter-spacing: -.03em; }
.cl-nextcard__text em { font-style: normal; font-size: 14px; opacity: .7; }
.cl-nextcard__arrow { padding-right: clamp(20px, 3vw, 40px); font-size: 32px; transition: transform .3s; }
.cl-nextcard:hover .cl-nextcard__arrow { transform: translateX(8px); color: #de6f3f; }

/* arte de uma imagem só: quadro na parede e etiqueta de museu */
.cl-print { display: flex; flex-direction: column; min-height: 100%; }
.cl-print__wall { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 260px); align-items: end; gap: clamp(24px, 4vw, 56px); padding: clamp(28px, 5%, 64px); }
.cl-print__art { justify-self: center; }
.cl-print__art .cl-frame { width: fit-content; border-radius: 2px; background: none; box-shadow: 0 24px 60px rgba(29, 29, 27, .2), 0 2px 8px rgba(29, 29, 27, .12); }
.cl-print__art img, .cl-print__art video { width: auto; max-width: 100%; max-height: calc(var(--sheet-h) - 2 * clamp(28px, 5%, 64px)); }
.cl-label { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid #1d1d1b; }
#immersive .cl-label h2 { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.05; letter-spacing: -.03em; }
.cl-label p { font-size: 14px; line-height: 1.55; color: var(--muted); }
.cl-print .cl-next { padding-top: 24px; }

/* mosaico: a primeira mídia larga, as outras em duas colunas sem corte */
.cl-mosaic { display: grid; gap: clamp(12px, 1.6vw, 20px); }
.cl-wide .cl-frame img { width: auto; max-width: 100%; max-height: calc(var(--sheet-h) - 96px); margin: 0 auto; }
.cl-cols { columns: 2; column-gap: clamp(12px, 1.6vw, 20px); }
.cl-cols .cl-media { break-inside: avoid; margin-bottom: clamp(12px, 1.6vw, 20px); }

/* a coluna fixa e o conteúdo */
.cl-dossier { display: grid; grid-template-columns: minmax(260px, 32%) minmax(0, 1fr); align-items: start; }
.cl-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 18px; height: calc(var(--sheet-h) - 3px); padding: clamp(28px, 3.5vw, 48px); overflow-y: auto; border-right: 1px solid var(--line); box-sizing: border-box; }
#immersive .cl-side h2 { font-size: clamp(38px, 4vw, 60px); line-height: .96; letter-spacing: -.045em; }
.cl-index { display: flex; flex-direction: column; margin: 10px 0 0; padding: 14px 0 0; list-style: none; border-top: 1px solid var(--line); }
.cl-index button { display: flex; gap: 12px; width: 100%; padding: 8px 0; background: none; color: var(--muted); font-size: 15px; text-align: left; transition: color .2s, transform .3s; }
.cl-index button span { padding-top: 2px; font-size: 12px; color: #b5ae9b; font-variant-numeric: tabular-nums; }
.cl-index button:hover { color: #1d1d1b; }
.cl-index button.is-active { color: #1d1d1b; font-weight: 700; transform: translateX(6px); }
.cl-index button.is-active span { color: #d36135; }
.cl-nextmini { margin-top: auto; padding: 16px 0 0; border-top: 1px solid var(--line); background: none; font-size: 18px; font-weight: 700; text-align: left; }
.cl-nextmini small { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cl-nextmini:hover { color: #d36135; }
.cl-main { padding: clamp(28px, 3.5vw, 48px); }
.cl-dossier .cl-chapter { display: grid; gap: 16px; padding-top: clamp(48px, 6vw, 80px); }
.cl-dossier .cl-mosaic { margin-top: 12px; }
.cl-dossier .cl-next { padding: clamp(64px, 8vw, 104px) 0 0; }

@media (max-width: 700px) {
  #immersive { --sheet-h: 100dvh; }
  .cl-nextcard { grid-template-columns: 1fr auto; }
  .cl-nextcard__art { grid-column: 1 / -1; height: 150px; }
  .cl-nextcard__text { padding: 0 0 22px 22px; }
  .cl-nextcard__arrow { padding-bottom: 22px; }
  .cl-print__wall { grid-template-columns: 1fr; padding: 72px 20px 20px; }
  .cl-cols { columns: 1; }
  .cl-dossier { grid-template-columns: 1fr; }
  .cl-side { position: static; height: auto; padding: 72px 20px 8px; border-right: 0; overflow: visible; }
  .cl-index, .cl-nextmini { display: none; }
  .cl-main { padding: 20px; }
}

/* chegada pelo Pixalate: tinta até o /pixalate.js assumir (mesma regra do site) */
html.pixalate-in::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: #1D1D1B;
  animation: pixalate-safety 0s 10s forwards;
}
@keyframes pixalate-safety { to { visibility: hidden; } }
