/* case study page (refs/flavio-projeto): full-bleed hero, film, 2-column gallery, more projects */
body.case { background: #111112; }
.case .hd { animation: none !important; }
.case-hero { position: relative; z-index: 60; height: 85svh; min-height: 620px; overflow: hidden; background: #111112; color: #fff; font-family: var(--inter); }
.case-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.case-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 10, 11, .72), rgba(10, 10, 11, .15) 55%, rgba(10, 10, 11, .35)); }
.case-info { position: absolute; left: var(--mx); right: var(--mx); bottom: 78px; z-index: 2; display: grid; grid-template-columns: 1fr auto; align-items: end; }
.case-meta { grid-column: 1; margin: 0 0 4px; display: flex; gap: 60px; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.case-meta span + span { color: rgba(255, 255, 255, .7); font-size: 12px; align-self: center; }
.case-title { grid-column: 1; margin: 0 0 24px; font-size: 84px; font-weight: 500; line-height: 1; letter-spacing: -0.05em; }
.case-author { grid-column: 1; display: flex; align-items: center; gap: 12px; }
.case-author img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.case-author p { margin: 0; font-size: 12px; line-height: 1.35; color: rgba(255, 255, 255, .7); }
.case-author b { color: #fff; font-weight: 500; }
.case-back { grid-column: 2; grid-row: 3; color: #fff; text-decoration: none; font-size: 13px; font-weight: 500; }
.arrow-back b, .case-back-small b { display: inline-block; transition: transform .25s var(--ease-spring); font-weight: 500; }
.arrow-back:hover b, .case-back-small:hover b { transform: translateX(-4px); }

.case-body { padding: 96px var(--mx) 40px; }
.case-intro { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 72px; }
.case-label { grid-column: 1; margin: 6px 0 0; font-size: 13px; font-weight: 500; }
.case-text { grid-column: 2 / 4; margin: 0; font-size: 28px; line-height: 1.25; letter-spacing: -0.035em; color: #2b2b2c; max-width: 26em; }
.case-film { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #ddd; margin-bottom: 24px; }
.case-film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.case-film .corners i { border-color: rgba(255, 255, 255, .9); }
.case-film .corners i:nth-child(1) { top: 20px; left: 20px; } .case-film .corners i:nth-child(2) { top: 20px; right: 20px; }
.case-film .corners i:nth-child(3) { bottom: 20px; left: 20px; } .case-film .corners i:nth-child(4) { bottom: 20px; right: 20px; }
.case-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.case-gallery img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: #ddd; }

.case-more { padding: 110px var(--mx) 140px; text-align: center; }
.case-back-small { display: inline-block; font-size: 12px; font-weight: 500; color: #555; text-decoration: none; margin-bottom: 16px; }
.case-more-title { margin: 0 0 60px; font-size: 80px; font-weight: 500; line-height: 1; letter-spacing: -0.05em; }
.case-next { position: relative; display: block; aspect-ratio: 1368 / 700; border-radius: 16px; overflow: hidden; color: #fff; text-decoration: none; cursor: none; }
.case-next img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-spring); }
.case-next:hover img { transform: scale(1.03); }
.case-next::after { content: ""; position: absolute; inset: 0; background: rgba(10, 10, 11, .25); }
.case-next .corners i { z-index: 1; border-color: rgba(255, 255, 255, .9); }
.case-next .corners i:nth-child(1) { top: 20px; left: 20px; } .case-next .corners i:nth-child(2) { top: 20px; right: 20px; }
.case-next .corners i:nth-child(3) { bottom: 20px; left: 20px; } .case-next .corners i:nth-child(4) { bottom: 20px; right: 20px; }
.case-next-text { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 1; font-size: 52px; font-weight: 500; letter-spacing: -0.05em; line-height: 1; }
.case-next-text small { display: block; font-size: 16px; letter-spacing: -0.02em; margin-bottom: 10px; font-weight: 500; }

@media (max-width: 800px) {
  .case-title { font-size: 40px; }
  .case-info { grid-template-columns: 1fr; gap: 18px; }
  .case-back { grid-column: 1; grid-row: auto; }
  .case-intro { grid-template-columns: 1fr; gap: 12px; }
  .case-text { grid-column: 1; font-size: 21px; }
  .case-gallery { gap: 12px; }
  .case-more-title { font-size: 40px; }
  .case-next { aspect-ratio: 4 / 5; }
  .case-next-text { font-size: 32px; }
}

/* folder photos: shown whole, so the camera and lens card under each still is never cropped */
.case-gallery.is-photos { align-items: start; }
.case-gallery.is-photos img { aspect-ratio: auto; height: auto; object-fit: contain; background: none; }

/* film: the loop plays until "Watch the film" swaps in the YouTube player */
.case-play {
  position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 12px; padding: 14px 22px 14px 16px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: #111112; font: 600 15px var(--inter); letter-spacing: -0.02em; cursor: pointer;
  transition: transform .3s var(--ease-spring), background .2s;
}
.case-play:hover { transform: translate(-50%, -50%) scale(1.05); background: #fff; }
.case-play-dot { width: 26px; height: 26px; border-radius: 50%; background: #111112; position: relative; }
.case-play-dot::after { content: ""; position: absolute; left: 10px; top: 7px; border: 6px solid transparent; border-left: 9px solid #fff; border-right: 0; }
.case-film iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; }

/* page transition (refs/flavio-enter, refs/flavio-exit, refs/flavio-rec = screen recording at 25 fps):
   the current page lifts 20% and fades out (600 ms, cubic-bezier(.87, .07, .43, .84), the reference keyframes) over the
   destination, which waits underneath behind a dark veil; the veil clears and the destination settles in (slight zoom out,
   title rises) during the last ~300 ms. Going back home, the light portfolio section waits underneath instead. */
.vt-curtain { position: fixed; inset: 0; z-index: 1; background: #f1f1f1; pointer-events: none; overflow: hidden; }
.vt-curtain .case-hero { position: absolute; left: 0; right: 0; top: 0; }
.vt-curtain::after { content: ""; position: absolute; inset: 0; z-index: 100; background: rgba(17, 17, 18, .9); }
.vt-curtain.home { background: #111112; }
.vt-curtain.home::after { display: none; }
html.vt-lift .vt-curtain::after { animation: vtVeil .3s .34s ease-out forwards; }
html.vt-lift .vt-curtain .case-hero-img { animation: vtZoom .7s cubic-bezier(.16, 1, .3, 1) both; }
html.vt-lift .vt-curtain .case-info { animation: vtRise .38s .3s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes vtVeil { to { opacity: 0; } }
@keyframes vtZoom { from { transform: scale(1.06); } }
@keyframes vtRise { from { transform: translateY(14px); } }
html.vt-lift body > :not(.vt-curtain):not(.plus):not(.menu) { position: relative; z-index: 2; animation: vtLift .6s cubic-bezier(.87, .07, .43, .84) forwards; }
@keyframes vtLift { to { transform: translateY(-20vh); opacity: 0; } }
html.vt-lift .plus { opacity: 0; }
/* arriving home from a case: the portfolio settles up into place */
html.vt-fadein main { animation: vtSettle .5s cubic-bezier(.16, 1, .3, 1) both; }
html.vt-fadein body::after { content: ""; position: fixed; inset: 0; z-index: 300; background: #111112; pointer-events: none; animation: vtVeil .32s ease-out forwards; }
@keyframes vtSettle { from { transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) { html.vt-lift body > *, html.vt-lift .vt-curtain *, html.vt-lift .vt-curtain::after, html.vt-fadein main, html.vt-fadein body::after { animation: none !important; } }

/* case content from ESTUDO.md: manifesto + ficha, film(s), two paragraphs, spec cards, credits */
.case-head { display: grid; grid-template-columns: repeat(4, 1fr); align-items: start; margin-bottom: 72px; }
.case-manifesto { grid-column: 1 / 3; margin: 0; font-size: 44px; font-weight: 500; line-height: 1.05; letter-spacing: -0.045em; color: #111112; max-width: 14em; }
.case-ficha { grid-column: 3 / 5; padding-top: 8px; }
.case-ficha p { margin: 0 0 6px; font-size: 16px; line-height: 1.4; color: #555; letter-spacing: -0.01em; }
.case-ficha p:first-child { color: #111112; font-weight: 500; }
.case-films { display: grid; gap: 24px; margin-bottom: 96px; }
.case-films.is-two { grid-template-columns: 1fr 1fr; }
.case-film { margin: 0; }
.case-film-box { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #ddd; }
.case-film.is-vertical .case-film-box { aspect-ratio: 9 / 16; max-height: 82vh; margin: 0 auto; }
.case-film-box video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.case-film-box .corners i { border-color: rgba(255, 255, 255, .9); }
.case-film-box .corners i:nth-child(1) { top: 20px; left: 20px; } .case-film-box .corners i:nth-child(2) { top: 20px; right: 20px; }
.case-film-box .corners i:nth-child(3) { bottom: 20px; left: 20px; } .case-film-box .corners i:nth-child(4) { bottom: 20px; right: 20px; }
.case-film figcaption { display: flex; justify-content: space-between; margin-top: 12px; font-size: 14px; font-weight: 500; letter-spacing: -0.02em; }
.case-film figcaption span { color: #999; font-variant-numeric: tabular-nums; }
.case-text { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 24px; margin-bottom: 96px; }
.case-text p { margin: 0; font-size: 20px; line-height: 1.45; color: #444; letter-spacing: -0.02em; }
.case-text p:first-child { grid-column: 1 / 3; max-width: 30em; } .case-text p:nth-child(2) { grid-column: 3 / 5; max-width: 30em; }
.case-credits { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 96px; padding-top: 18px; border-top: 2px solid #111112; }
.case-credits .case-label { grid-column: 1; }
.case-credits p:last-child { grid-column: 2 / 4; margin: 0; font-size: 16px; line-height: 1.6; color: #444; }
@media (max-width: 900px) {
  .case-head, .case-text, .case-credits { grid-template-columns: 1fr; gap: 16px; }
  .case-manifesto, .case-ficha, .case-text p:first-child, .case-text p:nth-child(2), .case-credits p:last-child { grid-column: 1; }
  .case-manifesto { font-size: 30px; }
  .case-films.is-two { grid-template-columns: 1fr; }
}

/* gallery rows (build-cases): g-l2 two landscapes, g-l1/g-l3 leftovers, g-p3 three portraits, g-p2/g-p1 leftovers.
   Every photo is sized so a whole row fits on one screen. */
.case-gallery.is-photos { grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: stretch; max-width: 1500px; margin-left: auto; margin-right: auto; }
.case-gallery.is-photos img { height: auto; object-fit: cover; background: #ddd; }
.case-gallery.is-photos .g-l2 { grid-column: span 3; aspect-ratio: 3 / 2; }
.case-gallery.is-photos .g-l3 { grid-column: span 2; aspect-ratio: 3 / 2; }
.case-gallery.is-photos .g-l1 { grid-column: 2 / span 4; aspect-ratio: 3 / 2; }
.case-gallery.is-photos .g-p3 { grid-column: span 2; aspect-ratio: 4 / 5; }
.case-gallery.is-photos .g-p2 { grid-column: span 2; aspect-ratio: 4 / 5; }
.case-gallery.is-photos .g-p2:nth-child(1 of .g-p2) { grid-column: 2 / span 2; }
.case-gallery.is-photos .g-p1 { grid-column: 3 / span 2; aspect-ratio: 4 / 5; }
.case-gallery.is-photos .is-spec { aspect-ratio: 16 / 9; object-fit: contain; background: none; }
@media (max-width: 700px) {
  .case-gallery.is-photos { grid-template-columns: 1fr 1fr; }
  .case-gallery.is-photos img { grid-column: span 2 !important; }
  .case-gallery.is-photos [class*="g-p"] { grid-column: span 1 !important; }
}
