/* Case history polish: content and layout stay unchanged. */
.page-detail .caseHero {
  position: relative;
}
.page-detail .caseHero:after {
  content: '';
  position: absolute;
  right: -120px;
  top: 8%;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(210, 184, 122, 0.09), transparent 68%);
  pointer-events: none;
}
.page-detail .caseHeroGrid {
  position: relative;
  z-index: 1;
}
.page-detail .caseVisual {
  transition: transform 0.5s var(--wow-ease);
  transform-style: preserve-3d;
}
.page-detail .visualPanel {
  box-shadow: 0 36px 90px rgba(4, 24, 47, 0.12);
  transition:
    box-shadow 0.45s,
    transform 0.45s var(--wow-ease);
}
.page-detail .visualPanel:hover {
  box-shadow: 0 46px 110px rgba(4, 24, 47, 0.17);
}
.page-detail .challengeCard,
.page-detail .feature,
.page-detail .benefit,
.page-detail .relatedCard {
  transition:
    transform 0.4s var(--wow-ease),
    box-shadow 0.4s,
    border-color 0.4s;
}
.page-detail .challengeCard:hover,
.page-detail .feature:hover,
.page-detail .benefit:hover,
.page-detail .relatedCard:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 62px rgba(8, 41, 78, 0.09);
}
.page-detail .archNode {
  transition:
    transform 0.3s var(--wow-ease),
    border-color 0.3s,
    box-shadow 0.3s;
}
.page-detail .archNode:hover {
  transform: translateY(-4px);
  border-color: rgba(166, 142, 93, 0.35);
  box-shadow: 0 18px 40px rgba(4, 24, 47, 0.12);
}
.page-detail .caseCta {
  position: relative;
  overflow: hidden;
}
.page-detail .caseCta:after {
  content: '';
  position: absolute;
  right: -100px;
  top: -150px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 0 0 62px rgba(255, 255, 255, 0.018),
    0 0 0 124px rgba(255, 255, 255, 0.012);
  pointer-events: none;
}
@media (max-width: 720px) {
  .page-detail .caseVisual {
    transform: none !important;
  }
}

/* =========================================================
   Layout fixes
   ========================================================= */

/* Related cards: "Apri il case study" is a text link, not the round
   .go icon of the portfolio grid (that rule squeezed it into 30x30). */
.relatedCard .go {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: none;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  white-space: nowrap;
  transition: color 0.25s;
}
.relatedCard:hover .go {
  color: var(--gold);
}

/* Project names made of one very long word (e.g. TheCryptoAcademy). */
.caseHero.longName h1 {
  font-size: clamp(48px, 6.1vw, 92px);
}
.caseHero.longName .visualName {
  font-size: 32px;
}
.phoneHero b {
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .caseHero.longName h1 {
    font-size: clamp(36px, 11.5vw, 60px);
  }
  .phoneHero b {
    font-size: 13px;
  }
}
@media (max-width: 420px) {
  .visualName {
    font-size: 30px;
  }
  .caseHero.longName .visualName {
    font-size: 26px;
  }
}

/* Hero: same space under the menu as the home page (58px, 54px on phones). */
.page-detail .caseHero {
  padding-top: 144px;
}
@media (max-width: 760px) {
  .page-detail .caseHero {
    padding-top: 126px;
  }
}

/* Hero: the project mockup instead of the generic panel */
.page-detail .caseVisual.caseShot {
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  min-height: 0;
}
.page-detail .caseShot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
  box-shadow: 0 40px 90px rgba(8, 41, 78, 0.22);
}

/* "Il software": web app and app screens */
.caseGallery .shotGrid {
  display: grid;
  gap: 22px;
  margin-top: 46px;
}
.caseGallery .shotGrid.g-both {
  grid-template-columns: 2fr 1fr;
}
.caseGallery .shotGrid.g-mobile {
  grid-template-columns: 1fr 1fr;
  max-width: 860px;
}
.caseGallery figure {
  margin: 0;
}
.caseGallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(8, 41, 78, 0.16);
}
.caseGallery figcaption {
  margin-top: 12px;
  font: 700 10px/1.4 ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8996a6;
}
@media (max-width: 760px) {
  .caseGallery .shotGrid.g-both,
  .caseGallery .shotGrid.g-mobile {
    grid-template-columns: 1fr;
  }
  .caseGallery .shotApp {
    max-width: 420px;
  }
}
/* galleries with several real web screens: first full width, then pairs, the last one next to the phone */
.caseGallery .shotGrid.multi {
  grid-template-columns: repeat(6, 1fr);
}
.caseGallery .shotGrid.multi .full {
  grid-column: span 6;
}
.caseGallery .shotGrid.multi .half {
  grid-column: span 3;
}
.caseGallery .shotGrid.multi .wide {
  grid-column: span 4;
}
.caseGallery .shotGrid.multi .shotApp {
  grid-column: span 2;
}
@media (max-width: 760px) {
  .caseGallery .shotGrid.multi {
    grid-template-columns: 1fr;
  }
  .caseGallery .shotGrid.multi .full,
  .caseGallery .shotGrid.multi .half,
  .caseGallery .shotGrid.multi .wide,
  .caseGallery .shotGrid.multi .shotApp {
    grid-column: 1 / -1;
  }
}
/* two real phone screens under the web ones: side by side, phone sized */
.caseGallery .shotGrid.multi .shotApp.pair {
  grid-column: span 3;
  justify-self: center;
  width: 100%;
  max-width: 400px;
}
