.case-page {
  background: var(--off);
}

.case-page main {
  overflow: hidden;
}

.case-hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  color: #fff;
  background: var(--sage-deep);
}

.case-hero > img {
  width: 100%;
  height: 100svh;
  min-height: 720px;
  object-fit: cover;
  object-position: center;
  animation: heroImageIn 1.5s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.case-hero-media {
  display: block;
  width: 100%;
  height: 100svh;
}

.case-hero-media img {
  width: 100%;
  height: 100%;
  min-height: 720px;
  object-fit: cover;
  object-position: center;
  animation: heroImageIn 1.5s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.case-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(18, 25, 21, 0.76), rgba(18, 25, 21, 0.38) 38%, transparent 70%),
    linear-gradient(0deg, rgba(13, 18, 16, 0.72), transparent 38%);
}

.case-hero-content {
  position: absolute;
  z-index: 2;
  left: var(--page-pad);
  bottom: clamp(150px, 19vh, 220px);
  width: min(940px, 64vw);
  animation: heroCopyIn 1s 180ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.case-hero-content h1 {
  margin: 0.16em 0;
  font-size: clamp(72px, 8.4vw, 150px);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.075em;
}

.case-hero-content > p:not(.eyebrow) {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.8);
}

.case-meta {
  position: absolute;
  z-index: 3;
  right: var(--page-pad);
  bottom: 0;
  left: var(--page-pad);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.case-meta span {
  min-height: 92px;
  padding: 22px 26px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-meta b {
  display: block;
  margin-bottom: 7px;
  color: var(--copper);
  font-weight: 600;
}

.case-intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0;
  padding: clamp(110px, 13vw, 210px) var(--page-pad);
  background: var(--off);
}

.case-intro .eyebrow {
  grid-column: 1 / 4;
  padding-top: 14px;
}

.case-intro h2 {
  grid-column: 4 / 10;
  margin: 0;
  font-size: clamp(58px, 7vw, 110px);
}

.case-intro > div {
  grid-column: 10 / 13;
  align-self: end;
  padding-left: clamp(24px, 3vw, 50px);
  border-left: 1px solid var(--line);
  color: var(--muted);
}

.story-section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  min-height: 720px;
  background: #fff;
}

.story-copy {
  grid-column: 1 / 6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(64px, 7vw, 118px) var(--page-pad);
}

.story-copy h2 {
  margin: 0.32em 0;
  font-size: clamp(48px, 5.6vw, 90px);
}

.story-copy p:not(.eyebrow) {
  max-width: 560px;
  color: var(--muted);
}

.story-media {
  grid-column: 6 / 13;
  margin: 0;
  overflow: hidden;
  background: #ece9e1;
}

.story-media img {
  width: 100%;
  height: 100%;
  min-height: 720px;
  object-fit: cover;
  transition: transform 850ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.story-media:hover img {
  transform: scale(1.018);
}

.story-media figcaption,
.story-gallery figcaption {
  padding: 13px 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.story-section.reverse .story-copy {
  grid-column: 8 / 13;
  grid-row: 1;
}

.story-section.reverse .story-media {
  grid-column: 1 / 8;
  grid-row: 1;
}

.story-section.sage {
  color: #fff;
  background: var(--sage-deep);
}

.story-section.sage .story-copy p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.65);
}

.story-section.technical .story-media {
  padding: clamp(28px, 4vw, 64px);
  background: #ebe8df;
}

.story-section.technical .story-media img {
  min-height: 620px;
  object-fit: contain;
  background: #fff;
}

.story-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(18px, 2.3vw, 38px);
  padding: clamp(110px, 12vw, 190px) var(--page-pad);
  background: var(--off);
}

.story-gallery .gallery-heading {
  grid-column: 1 / 8;
  padding-bottom: clamp(50px, 7vw, 100px);
}

.story-gallery .gallery-heading h2 {
  font-size: clamp(56px, 7vw, 108px);
}

.story-gallery figure {
  margin: 0 0 clamp(54px, 7vw, 110px);
}

.story-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.story-gallery .wide {
  grid-column: 1 / 9;
}

.story-gallery .side {
  grid-column: 9 / 13;
  margin-top: 12vw;
}

.story-gallery .center {
  grid-column: 3 / 11;
}

.story-gallery .half-left {
  grid-column: 1 / 7;
}

.story-gallery .half-right {
  grid-column: 7 / 13;
  margin-top: 8vw;
}

.story-gallery .drawing img {
  object-fit: contain;
  padding: clamp(18px, 3vw, 42px);
  background: #fff;
}

.case-stage {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  padding: clamp(100px, 11vw, 170px) var(--page-pad);
  color: #fff;
  background: var(--sage-deep);
}

.case-stage .eyebrow {
  grid-column: 1 / 4;
}

.case-stage h2 {
  grid-column: 4 / 10;
  margin: 0;
}

.case-stage p:last-child {
  grid-column: 10 / 13;
  align-self: end;
  color: rgba(255, 255, 255, 0.65);
}

.case-cta {
  position: relative;
  overflow: hidden;
  padding: clamp(120px, 14vw, 220px) var(--page-pad);
  text-align: center;
  background: var(--sage-soft);
}

.case-cta h2 {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto 44px;
}

.case-cta .button {
  position: relative;
  z-index: 1;
  background: var(--sage-deep);
}

.case-cta > img {
  position: absolute;
  right: -5%;
  bottom: -52%;
  width: min(42vw, 600px);
  opacity: 0.22;
  pointer-events: none;
}

.case-page footer {
  background: #fff;
}

@media (max-width: 900px) {
  .case-hero > img {
    min-height: 700px;
    object-position: 65% center;
  }

  .case-hero-content {
    left: 20px;
    bottom: 142px;
    width: calc(100% - 40px);
  }

  .case-hero-content h1 {
    font-size: clamp(48px, 12.7vw, 72px);
  }

  .case-meta {
    right: 20px;
    left: 20px;
  }

  .case-meta span {
    min-height: 76px;
    padding: 14px 10px;
    font-size: 8px;
  }

  .case-intro {
    display: block;
    padding: 100px 20px;
  }

  .case-intro h2,
  .case-intro > div {
    margin-top: 44px;
  }

  .case-intro > div {
    padding-left: 0;
    border-left: 0;
  }

  .story-section,
  .story-section.reverse {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }

  .story-section.reverse .story-copy,
  .story-section.reverse .story-media {
    grid-column: auto;
    grid-row: auto;
  }

  .story-copy {
    order: 2;
    padding: 86px 20px;
  }

  .story-media {
    order: 1;
  }

  .story-media img,
  .story-section.technical .story-media img {
    min-height: 58vh;
  }

  .story-section.technical .story-media {
    padding: 20px;
  }

  .story-gallery {
    display: block;
    padding: 100px 20px;
  }

  .story-gallery .side,
  .story-gallery .half-right {
    margin-top: 0;
  }

  .story-gallery img {
    min-height: 52vh;
  }

  .case-stage {
    display: block;
    padding: 100px 20px;
  }

  .case-stage h2,
  .case-stage p:last-child {
    margin-top: 42px;
  }

  .case-cta {
    padding: 120px 20px;
  }

  .case-cta > img {
    right: -35%;
    width: 100vw;
  }
}

@media (max-width: 560px) {
  .case-meta span:nth-child(2) {
    display: none;
  }

  .case-meta {
    grid-template-columns: 1fr 1fr;
  }

  .story-gallery img {
    min-height: 44vh;
  }
}

/* Pranchas limpas e narrativa móvel */
.case-page,
.case-intro,
.story-gallery,
.story-section,
.story-section.technical .story-media,
.story-gallery .drawing img {
  background: #fff;
}

.story-section.technical .story-media {
  padding: clamp(22px, 3vw, 48px);
}

.story-media figcaption,
.story-gallery figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  letter-spacing: 0.09em;
}

.story-media figcaption::before,
.story-gallery figcaption::before {
  content: "";
  flex: 0 0 26px;
  width: 26px;
  height: 1px;
  background: var(--copper);
}

.story-gallery figure,
.story-media {
  overflow: visible;
}

.story-gallery figure img,
.story-media img {
  overflow: hidden;
}

@media (max-width: 900px) {
  .case-hero {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    padding-top: calc(max(10px, env(safe-area-inset-top)) + 72px);
    background: var(--sage-deep);
  }

  .case-hero-content {
    position: relative;
    z-index: 3;
    order: 1;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: auto;
    padding: 26px 20px 34px;
  }

  .case-hero-content h1 {
    font-size: clamp(50px, 14vw, 76px);
    line-height: 0.86;
  }

  .case-hero > img {
    position: relative;
    z-index: 1;
    order: 2;
    flex: 1 1 auto;
    width: 100%;
    height: 54svh;
    min-height: 390px;
    object-fit: cover;
    object-position: 70% center;
    border-radius: 54px 54px 0 0;
    transform: none;
  }

  .case-hero::after {
    top: auto;
    bottom: 0;
    height: 56svh;
    background: linear-gradient(0deg, rgba(15, 25, 20, 0.78), transparent 46%);
  }

  .case-meta {
    z-index: 4;
  }

  .story-media,
  .story-section.technical .story-media {
    padding: 0 20px;
    background: #fff;
  }

  .story-media img,
  .story-section.technical .story-media img {
    width: 100%;
    min-height: 0;
    max-height: 72svh;
    object-fit: contain;
    background: #fff;
  }

  .story-gallery img {
    min-height: 0;
    max-height: 72svh;
    object-fit: contain;
    background: #fff;
  }
}

@media (max-width: 560px) {
  .case-hero > img {
    min-height: 350px;
    object-position: 72% center;
  }
}

/* Projeto editorial: imagens sem molduras artificiais. */
.case-page .story-gallery figure img,
.case-page .story-media,
.case-page .story-media img,
.case-page .story-gallery figure:nth-of-type(even) img {
  border-radius: 0;
}

@media (max-width: 900px) {
  .case-hero {
    color: var(--ink);
    background: transparent;
  }

  .case-hero-content {
    color: var(--ink);
    background: transparent;
  }

  .case-hero-content .eyebrow,
  .case-hero-content > p:not(.eyebrow) {
    color: var(--warm-gray);
  }

  .case-hero > img {
    border-radius: 0;
  }
}

@media (max-width: 900px) {
  .case-hero {
    position: relative;
    display: block;
    min-height: 100svh;
    padding: 0;
    color: #fff;
    background: var(--ink);
  }

  .case-hero-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
  }

  .case-hero-media img {
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    transform: none;
  }

  .case-hero-content {
    position: absolute;
    z-index: 3;
    top: auto;
    right: 20px;
    bottom: clamp(150px, 20svh, 190px);
    left: 20px;
    width: auto;
    padding: 0;
    color: #fff;
    background: transparent;
  }

  .case-hero-content .eyebrow,
  .case-hero-content > p:not(.eyebrow) {
    color: rgba(255, 255, 255, 0.82);
  }

  .case-hero::after {
    inset: 0;
    width: 100%;
    height: 100%;
    background:
      linear-gradient(180deg, rgba(10, 15, 13, 0.5) 0%, transparent 42%, rgba(10, 15, 13, 0.82) 100%),
      linear-gradient(90deg, rgba(10, 15, 13, 0.28), transparent 78%);
  }

  .case-meta {
    z-index: 4;
  }
}
