/* Página interna dos cases (frame "Página interna", 1440px) */
.case-page {
  display: block;
  padding: 0;
  background: var(--surface);
}

/* ---------- Topo com corte diagonal ---------- */
/* Header fica fixo no topo durante o scroll */
.case-header {
  position: sticky;
  top: 0;
  z-index: 20;
  isolation: isolate;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 152px;
  padding: 40px var(--gutter) 0;
  background: var(--bg);
  overflow: hidden;
}
.case-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--surface);
  clip-path: polygon(560.5px 0, 100% 0, 100% 100%, 410.5px 100%);
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
  margin-top: 12px;
  font-family: var(--display);
  font-size: 62.65px;
  line-height: 0.62;
  white-space: nowrap;
}
.brand-word { display: block; }

.brand,
.case-header .actions { position: relative; z-index: 2; }

/* ---------- Cases como abas de arquivo, no formato diagonal do header ---------- */
.case-tabs { --tab-w: clamp(150px, calc((100vw - 780px) / 3), 220px); }
.case-tab {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(410.5px + var(--i) * (var(--tab-w) + 4px));
  z-index: 1;
  width: calc(var(--tab-w) + 150px);
  background: #050505;
  color: var(--muted);
  clip-path: polygon(150px 0, 100% 0, calc(100% - 150px) 100%, 0 100%);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
a.case-tab:hover,
a.case-tab:focus-visible { background: #141414; color: var(--fg); }
/* Aba do case atual: mesma cor do conteúdo, como o arquivo aberto */
.case-tab.is-current { background: var(--surface); color: var(--fg); }

.tab-label {
  position: absolute;
  top: 52px;
  left: 118px;
  max-width: calc(var(--tab-w) - 60px);
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
}
.tab-index { opacity: 0.5; margin-right: 4px; }
.tab-step {
  position: absolute;
  top: 100px;
  left: 70px;
  padding: 2px 10px;
  font-size: 12px;
}

@media (min-width: 1200px) {
  .case-header::before { display: none; }
}
.brand-photo {
  flex: none;
  width: 28.3px;
  height: 39.3px;
  overflow: hidden;
}
.brand-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.brand:hover .brand-photo img { transform: scale(1.12); }

/* ---------- Conteúdo ---------- */
.case {
  display: grid;
  grid-template-columns: 325px minmax(0, 1fr);
  column-gap: 21px;
  align-items: start;
  padding: 50px var(--gutter);
}

/* Coluna da esquerda acompanha a leitura */
.case-aside {
  position: sticky;
  top: calc(152px + 50px);
  height: 503px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.case-title {
  max-width: 298px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.1;
}
.case-meta {
  display: grid;
  grid-template-columns: 161px 137px;
  font-family: var(--mono-alt);
  font-size: 12px;
  line-height: 1.53;
  text-transform: uppercase;
}
.case-list { display: flex; flex-direction: column; gap: 8px; white-space: nowrap; }
.case-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.case-chips li { padding: 6px 16px; border: 1px solid var(--fg); white-space: nowrap; }

.case-main { display: flex; flex-direction: column; gap: 21px; }
.case-shot { background: var(--fg); overflow: hidden; }
.case-shot img { width: 100%; height: 100%; object-fit: cover; }
.case-shot-wide { aspect-ratio: 1014 / 503; }

.case-text {
  max-width: 906px;
  min-height: 261px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  text-transform: uppercase;
}
.case-text h2 { font-size: 18px; font-weight: 700; line-height: 1.53; }
.case-text p { max-width: 890px; font-size: 14px; line-height: 1.53; }

.case-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 8px;
}
.case-pair .case-shot { aspect-ratio: 491 / 470; }

.case-page .footer { padding: 40px var(--gutter); }

/* ---------- Próximo case ---------- */
.next-case-wrap { padding: 0 0 20px; }
.next-case {
  display: grid;
  grid-template-columns: 325px minmax(0, 1fr) auto;
  column-gap: 21px;
  align-items: center;
  padding: 44px var(--gutter);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.next-label { font-size: 12px; text-transform: uppercase; }
.next-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  line-height: 1.1;
  color: var(--dim);
  transition: color 0.4s var(--ease);
}
.next-arrow {
  font-size: 32px;
  line-height: 1;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.next-case:hover .next-title,
.next-case:focus-visible .next-title { color: var(--fg); }
.next-case:hover .next-arrow { transform: translateX(10px); }

/* ---------- Entrada: quase instantânea, só a imagem principal sobe ---------- */
.case-shot-wide { animation: shot-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
@keyframes shot-up {
  from { opacity: 0; transform: translateY(80px); }
}

/* Próximo case: no header a partir de 1200px, no fim da página abaixo disso */
@media (min-width: 1200px) {
  .next-case-wrap { display: none; }
}
@media (max-width: 1199px) {
  .case-tabs { display: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1023px) {
  .case { grid-template-columns: 1fr; row-gap: 40px; }
  .case-aside { position: static; height: auto; gap: 32px; }
  .case-text { min-height: 0; padding: 24px 0; }
  .next-case { grid-template-columns: minmax(0, 1fr) auto; row-gap: 12px; }
  .next-label { grid-column: 1 / -1; }
}

/* ---------- Celular ---------- */
@media (max-width: 767px) {
  .case-header { height: 112px; padding-top: 24px; }
  .case-header::before { clip-path: polygon(290px 0, 100% 0, 100% 100%, 200px 100%); }
  .brand { gap: 3px; margin-top: 10px; font-size: 34px; }
  .brand-photo { width: 15.4px; height: 21.3px; }
  .next-case { padding-block: 32px; }
  .next-title, .next-arrow { font-size: 24px; }
  .case-header .actions { flex-direction: column; align-items: flex-end; gap: 4px; }
  .case-header .actions .link-muted { padding-inline: 10px; }
  .case { padding-block: 32px; }
  .case-title { max-width: none; font-size: 28px; }
  .case-meta { grid-template-columns: 1fr 1fr; }
  .case-pair { grid-template-columns: 1fr; padding: 0; }
}

