/* Estilos EXCLUSIVOS dos projetos. Menu, footer, botoes e identidade vem de style.css. */
.portfolio-page .nav [aria-current='page'] {
  color: var(--lime);
  opacity: 1;
}
.portfolio-page .portfolio-intro {
  padding: 190px 0 100px;
  min-height: min(74vh, 700px);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.portfolio-page .portfolio-intro h1 {
  max-width: 1000px;
  margin: 22px 0 26px;
  font-size: clamp(52px, 8vw, 104px);
}
.portfolio-page .portfolio-lead {
  max-width: 700px;
  color: #c7c7c7;
  font-size: 18px;
  line-height: 1.7;
  margin: 0;
}
.portfolio-page .portfolio-work {
  background: #0f0f0f;
  min-height: 55vh;
}
.portfolio-page .portfolio-work .section-head {
  margin-bottom: 46px;
}
.portfolio-page .portfolio-work .section-head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.portfolio-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(160deg, #1b1b1b, #151515);
  transition:
    opacity 0.75s ease,
    transform 0.75s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.portfolio-card.visible:hover {
  transform: translateY(-6px);
  border-color: rgba(195, 245, 0, 0.32);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.3);
}
.portfolio-cover {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #222;
  display: grid;
  place-items: center;
}
.portfolio-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.portfolio-card:hover .portfolio-cover img {
  transform: scale(1.04);
}
.portfolio-fallback {
  font:
    700 clamp(24px, 3vw, 40px) 'Space Grotesk',
    sans-serif;
  letter-spacing: -0.055em;
  color: var(--lime);
  opacity: 0.45;
}
.portfolio-card-body {
  padding: 27px;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}
.portfolio-category {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--lime);
}
.portfolio-card h3 {
  font:
    700 25px/1.16 'Space Grotesk',
    sans-serif;
  letter-spacing: -0.04em;
  margin: 0;
}
.portfolio-description {
  font-size: 13px;
  line-height: 1.7;
  color: #aaa;
  margin: 0 0 12px;
}
.portfolio-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  margin-top: auto;
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
  border-bottom: 1px solid rgba(195, 245, 0, 0.45);
  padding-bottom: 5px;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.portfolio-link:hover {
  color: #fff;
  border-color: #fff;
}
.portfolio-status {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}
.portfolio-status[hidden] {
  display: none;
}
.portfolio-page .footer-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
@media (max-width: 1000px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .portfolio-page .portfolio-intro {
    min-height: auto;
    padding: 146px 0 84px;
  }
  .portfolio-page .portfolio-intro h1 {
    font-size: clamp(45px, 10vw, 68px);
  }
  .portfolio-page .portfolio-lead {
    font-size: 16px;
  }
  .portfolio-page .portfolio-work .section-head {
    margin-bottom: 28px;
  }
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  .portfolio-card-body {
    padding: 23px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .portfolio-card,
  .portfolio-cover img,
  .portfolio-link {
    transition: none !important;
    animation: none !important;
  }
}

/* Advanced image previews — desktop hover and keyboard focus. */
.portfolio-card-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 100%;
  text-decoration: none;
  color: inherit;
}
.portfolio-card-main:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: -4px;
}
.portfolio-card-main .portfolio-cover {
  isolation: isolate;
}
.portfolio-card-main .portfolio-card-body {
  flex: 1;
}
.portfolio-hover-grid {
  position: absolute;
  inset: 0;
  padding: 8px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
  background: rgba(10, 10, 10, 0.93);
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
  transition:
    opacity 0.4s ease,
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.portfolio-hover-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  transform: none !important;
  transition: none !important;
}
.portfolio-hover-grid img:first-child:nth-last-child(2),
.portfolio-hover-grid img:nth-child(2):last-child {
  grid-row: span 2;
}
.portfolio-hover-grid img:only-child {
  grid-column: span 2;
  grid-row: span 2;
}
.portfolio-hover-label {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: 16px;
  opacity: 0;
  transform: translateY(6px);
  color: var(--lime);
  background: rgba(10, 10, 10, 0.92);
  padding: 8px 13px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 800;
  transition:
    opacity 0.3s,
    transform 0.3s;
}
.portfolio-image-count {
  position: absolute;
  left: 14px;
  bottom: 14px;
  font-size: 11px;
  font-weight: 800;
  z-index: 1;
  background: rgba(10, 10, 10, 0.82);
  border-radius: 99px;
  padding: 8px 12px;
}
@media (hover: hover) and (pointer: fine) {
  .portfolio-card-main:hover .portfolio-hover-grid,
  .portfolio-card-main:focus-visible .portfolio-hover-grid {
    opacity: 1;
    transform: scale(1);
  }
  .portfolio-card-main:hover .portfolio-hover-label,
  .portfolio-card-main:focus-visible .portfolio-hover-label {
    opacity: 1;
    transform: translateY(0);
  }
  .portfolio-card:hover .portfolio-cover > img {
    transform: scale(1.04);
  }
}
@media (hover: none), (pointer: coarse) {
  .portfolio-hover-grid {
    display: none !important;
  }
  .portfolio-hover-label {
    display: none !important;
  }
}

/* Detailed case-study layout */
/* Optional CMS artwork: no frame; keep the original full-width intro when absent. */
.project-detail-page #case-intro.has-case-brand {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
}
.project-detail-page .case-intro-copy {
  min-width: 0;
}
.project-detail-page #case-intro.has-case-brand h1 {
  font-size: clamp(38px, 4.4vw, 68px);
  overflow-wrap: anywhere;
}
.project-detail-page .case-brand-art {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(260px, 30vw, 420px);
  min-width: 0;
  border: 0;
  outline: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}
.project-detail-page .case-brand-art::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 10% 0;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(195, 245, 0, 0.25), transparent 70%);
  filter: blur(32px);
}
.project-detail-page .case-brand-image {
  display: block;
  width: var(--case-brand-size, 88%);
  height: var(--case-brand-size, 88%);
  object-fit: contain;
  border: 0;
  outline: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: case-brand-float 6.5s ease-in-out infinite;
}
@keyframes case-brand-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -16px, 0);
  }
}
@media (max-width: 900px) {
  .project-detail-page #case-intro.has-case-brand {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .project-detail-page #case-intro.has-case-brand h1 {
    font-size: clamp(30px, 6vw, 56px);
  }
  .project-detail-page .case-brand-art {
    width: min(100%, 360px);
    height: clamp(190px, 40vw, 280px);
    justify-self: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-detail-page .case-brand-image {
    animation: none;
  }
}
.project-detail-page .case-header {
  padding: 150px 0 60px;
  background:
    radial-gradient(circle at 78% 10%, rgba(195, 245, 0, 0.08), transparent 36%), var(--bg);
}
.project-detail-page .case-back {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 45px;
}
.project-detail-page .case-back:hover {
  color: var(--lime);
}
.project-detail-page .case-header h1 {
  font:
    700 clamp(46px, 7vw, 100px) / 1.02 'Space Grotesk',
    sans-serif;
  letter-spacing: -0.06em;
  max-width: 1100px;
  margin: 20px 0 18px;
}
.project-detail-page .case-lead {
  color: #c4c4c4;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.7;
  max-width: 800px;
}
.project-detail-page .case-gallery-section {
  padding: 35px 0 80px;
}
.project-detail-page .case-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.project-detail-page .case-gallery .case-image-button:first-child {
  grid-column: span 2;
  aspect-ratio: 16/9;
}
.project-detail-page .case-gallery .case-image-button:only-child {
  grid-column: span 2;
}
.project-detail-page .case-gallery-secondary .case-image-button:first-child {
  grid-column: span 2;
}
.project-detail-page .case-image-button {
  border: 1px solid var(--line);
  padding: 0;
  background: #202020;
  aspect-ratio: 4/3;
  border-radius: 18px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.project-detail-page .case-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.35s ease,
    filter 0.35s ease;
}
.project-detail-page .case-image-button:hover img {
  transform: scale(1.025);
}
.project-detail-page .case-image-button:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}
.project-detail-page .case-image-error {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}
.project-detail-page .case-photo-note {
  color: var(--muted);
  font-size: 12px;
  margin: 18px auto 0;
  width: 100%;
  text-align: center;
}
.project-detail-page .case-story-section,
.project-detail-page .case-custom-section {
  padding: 70px 0;
  background: var(--bg-2);
}
.project-detail-page .case-custom-section:nth-of-type(even) {
  background: var(--bg);
}
.project-detail-page .case-section-title {
  font:
    700 clamp(32px, 4.5vw, 65px) / 1.1 'Space Grotesk',
    sans-serif;
  letter-spacing: -0.05em;
  margin: 0 0 24px;
}
.project-detail-page .case-section-copy {
  max-width: 850px;
  color: #c7c7c7;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-line;
  margin-bottom: 34px;
}
.project-detail-page .case-story-section .agency-panel p {
  white-space: pre-line;
}
.project-detail-page [hidden] {
  display: none !important;
}
.case-lightbox {
  border: 1px solid #444;
  max-width: min(96vw, 1500px);
  max-height: 95vh;
  width: 96vw;
  height: 95vh;
  margin: auto;
  padding: 0;
  background: #101010;
  color: var(--text);
  border-radius: 14px;
  box-shadow: 0 20px 90px rgba(0, 0, 0, 0.7);
}
.case-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
}
.case-lightbox-inner {
  height: 100%;
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr) 55px;
  align-items: center;
  padding: 18px;
  gap: 10px;
}
.case-lightbox figure {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: hidden;
}
.case-lightbox figure img {
  max-height: calc(95vh - 100px);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.case-lightbox figure figcaption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.case-lightbox button {
  appearance: none;
  background: #222;
  border: 1px solid #555;
  border-radius: 99px;
  color: var(--text);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}
.case-lightbox button:hover,
.case-lightbox button:focus-visible {
  border-color: var(--lime);
  color: var(--lime);
}
.case-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
}
@media (max-width: 760px) {
  .project-detail-page .case-header {
    padding: 125px 0 40px;
  }
  .project-detail-page .case-header h1 {
    font-size: clamp(38px, 11vw, 60px);
  }
  .project-detail-page .case-gallery {
    gap: 10px;
    grid-template-columns: 1fr;
  }
  .project-detail-page .case-gallery .case-image-button,
  .project-detail-page .case-gallery .case-image-button:first-child {
    grid-column: auto;
    aspect-ratio: 4/3;
  }
  .project-detail-page .case-gallery .case-image-button:first-child {
    aspect-ratio: 5/4;
  }
  .project-detail-page .case-story-section,
  .project-detail-page .case-custom-section {
    padding: 45px 0;
  }
  .case-lightbox-inner {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 2px;
    padding: 8px;
  }
  .case-lightbox-close {
    top: 7px;
    right: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .portfolio-hover-grid,
  .portfolio-hover-label,
  .project-detail-page .case-image-button img {
    transition: none !important;
  }
}

/* Modal top layer: custom pointer remains visible above the gallery. */
@media (hover: hover) and (pointer: fine) {
  .case-lightbox .site-cursor {
    position: fixed;
    z-index: 2147483647;
    pointer-events: none;
  }
}

.case-likes {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.case-like-button {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(195, 245, 0, 0.38);
  border-radius: 999px;
  color: #f5f5f0;
  background: #202020;
  padding: 12px 18px;
  cursor: pointer;
  font:
    700 13px/1.4 Inter,
    sans-serif;
  transition:
    border-color 0.2s,
    color 0.2s,
    background 0.2s;
}
.case-like-button svg {
  width: 19px;
  height: 19px;
  color: var(--lime);
}
.case-like-button:hover:not(:disabled),
.case-like-button:focus-visible {
  border-color: var(--lime);
  color: var(--lime);
}
.case-like-button[aria-pressed='true'] {
  border-color: var(--lime);
  color: var(--lime);
}
.case-like-button[aria-pressed='true'] svg {
  fill: var(--lime);
}
.case-like-button:disabled {
  cursor: default;
}
.case-like-count {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--lime);
}
.case-like-status {
  font-size: 12px;
  color: #a4a4a4;
}

.portfolio-card-like-count {
  display: inline-flex;
  align-items: center;
  color: var(--lime);
  font-size: 12px;
  font-weight: 700;
  margin-top: 13px;
}
.portfolio-card-like-count[hidden] {
  display: none !important;
}

/* Themed in-page state for missing or temporarily unavailable case studies. */
.project-detail-page .case-error-shell {
  max-width: 750px;
  padding: 25px 0 70px;
}
.project-detail-page .case-error-symbol {
  width: 114px;
  height: 114px;
  border: 1px solid rgba(195, 245, 0, 0.2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 23px 0 20px;
  background: rgba(195, 245, 0, 0.025);
}
.project-detail-page .case-error-symbol img {
  width: 65%;
  height: auto;
}
.project-detail-page .case-error-shell h1 {
  font:
    700 clamp(33px, 4.5vw, 58px) / 1.13 'Space Grotesk',
    Inter,
    sans-serif;
  letter-spacing: -0.045em;
  margin: 10px 0 18px;
}
.project-detail-page .case-error-shell p {
  color: #bebebe;
  font-size: 16px;
  line-height: 1.7;
  max-width: 600px;
  margin: 0;
}
.project-detail-page .case-error-shell .agency-actions {
  margin-top: 29px;
}
.project-detail-page .case-error-shell .btn-primary {
  background: var(--lime);
  color: #131313;
}
@media (max-width: 600px) {
  .project-detail-page .case-error-shell {
    padding-bottom: 25px;
  }
}

/* Editorial case-study reading experience: prose, not a stack of cards. */
.project-detail-page .case-story-editorial {
  background: linear-gradient(180deg, #171717, #121212);
  padding: clamp(62px, 7vw, 110px) 0;
}
.project-detail-page .case-story-layout {
  display: grid;
  grid-template-columns: minmax(185px, 0.35fr) minmax(0, 1fr);
  gap: clamp(35px, 6vw, 108px);
  align-items: start;
}
.project-detail-page .case-story-aside {
  position: sticky;
  top: 116px;
  padding: 10px 0;
}
.project-detail-page .case-story-aside .section-kicker {
  font-size: 11px;
}
.project-detail-page .case-story-aside > p {
  font-size: 13px;
  line-height: 1.75;
  color: #aaa;
  max-width: 245px;
  margin: 20px 0;
}
.project-detail-page .case-chapter-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 25px 0 0;
}
.project-detail-page .case-chapter-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #353535;
  padding: 12px 2px;
  color: #a9a9a9;
  text-decoration: none;
  font-size: 13px;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.project-detail-page .case-chapter-nav a:hover,
.project-detail-page .case-chapter-nav a:focus-visible,
.project-detail-page .case-chapter-nav a.is-active {
  color: var(--lime);
  border-color: rgba(195, 245, 0, 0.45);
}
.project-detail-page .case-story-main {
  min-width: 0;
  max-width: 785px;
}
.project-detail-page .case-story-chapter {
  border-bottom: 1px solid #343434;
  padding: 0 0 clamp(42px, 5vw, 70px);
  margin: 0 0 clamp(43px, 5vw, 70px);
  scroll-margin-top: 125px;
}
.project-detail-page .case-story-chapter:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}
.project-detail-page .case-story-index {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--lime);
  display: block;
  margin: 0 0 17px;
}
.project-detail-page .case-story-chapter h2 {
  font:
    700 clamp(28px, 3.2vw, 44px) / 1.17 'Space Grotesk',
    Inter,
    sans-serif;
  letter-spacing: -0.05em;
  margin: 0 0 23px;
  color: #f6f6f2;
}
.project-detail-page .case-story-chapter p {
  font-size: clamp(15px, 1.45vw, 18px);
  line-height: 1.9;
  white-space: pre-line;
  color: #c7c7c7;
  margin: 0;
  max-width: 68ch;
  overflow-wrap: anywhere;
}
.project-detail-page .case-custom-section {
  background: #111;
  padding: clamp(45px, 5vw, 70px) 0;
  border-top: 1px solid #252525;
}
.project-detail-page .case-custom-section .container {
  max-width: 1100px;
}
.project-detail-page .case-custom-section .case-section-title {
  font-size: clamp(27px, 3.3vw, 44px);
  max-width: 850px;
}
.project-detail-page .case-custom-section .case-section-copy {
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.9;
  max-width: 68ch;
}
.project-detail-page .case-header h1 {
  font-size: clamp(38px, 5vw, 72px);
  line-height: 1.09;
  max-width: 970px;
}
.project-detail-page .case-gallery-section {
  padding: 22px 0 clamp(50px, 7vw, 85px);
}
.project-detail-page #case-story-section[hidden],
.project-detail-page .case-story-section[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  .project-detail-page .case-story-layout {
    grid-template-columns: 1fr;
    gap: 29px;
  }
  .project-detail-page .case-story-aside {
    position: static;
    border-bottom: 1px solid #333;
    padding: 0 0 20px;
  }
  .project-detail-page .case-story-aside > p {
    max-width: 100%;
    margin: 13px 0;
  }
  .project-detail-page .case-chapter-nav {
    display: flex;
    flex-flow: row wrap;
    gap: 8px;
    margin: 15px 0 0;
  }
  .project-detail-page .case-chapter-nav a {
    padding: 9px 0;
    border-bottom: 1px solid #444;
    margin-right: 20px;
  }
  .project-detail-page .case-story-chapter {
    scroll-margin-top: 90px;
  }
}
@media (max-width: 600px) {
  .project-detail-page .case-header h1 {
    font-size: clamp(32px, 8.4vw, 48px);
  }
  .project-detail-page .case-story-editorial {
    padding: 52px 0 58px;
  }
  .project-detail-page .case-story-chapter h2 {
    font-size: clamp(26px, 7vw, 34px);
  }
  .project-detail-page .case-story-chapter p {
    font-size: 15px;
    line-height: 1.82;
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-detail-page .case-chapter-nav a {
    transition: none !important;
  }
}

/* Portfolio and case-study usability on phones and small tablets. */
@media (max-width: 760px) {
  .portfolio-page .portfolio-intro {
    padding: 122px 0 46px;
  }
  .portfolio-page .portfolio-intro h1 {
    font-size: clamp(33px, 8.3vw, 52px);
    line-height: 1.13;
    letter-spacing: -0.055em;
  }
  .portfolio-page .portfolio-lead {
    font-size: 15px;
    line-height: 1.72;
  }
  .portfolio-page .portfolio-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .portfolio-page .portfolio-card {
    min-width: 0;
    overflow: hidden;
  }
  .portfolio-page .portfolio-card h3 {
    font-size: clamp(21px, 5.9vw, 27px);
  }
  .portfolio-page .portfolio-card-body {
    padding: 22px;
  }
  .project-detail-page .case-header {
    padding: 115px 0 30px;
  }
  .project-detail-page .case-header h1 {
    font-size: clamp(31px, 7.8vw, 47px);
    overflow-wrap: break-word;
    letter-spacing: -0.047em;
  }
  .project-detail-page .case-gallery-section {
    padding: 18px 0 56px;
  }
  .project-detail-page .case-gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .project-detail-page .case-gallery .case-image-button,
  .project-detail-page .case-gallery .case-image-button:first-child {
    grid-column: auto;
    aspect-ratio: 4/3;
    border-radius: 13px;
  }
  .project-detail-page .case-story-layout {
    min-width: 0;
  }
  .project-detail-page .case-story-main,
  .project-detail-page .case-story-chapter {
    min-width: 0;
  }
  .project-detail-page .case-story-chapter p {
    overflow-wrap: anywhere;
  }
  .case-lightbox {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .case-lightbox-inner {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 2px;
    padding: 65px 6px max(16px, env(safe-area-inset-bottom));
  }
  .case-lightbox figure img {
    max-height: calc(100dvh - 145px);
    max-width: 100%;
  }
  .case-lightbox-close {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }
  .case-lightbox button {
    min-width: 44px;
    min-height: 44px;
  }
  .project-detail-page .case-like-button {
    min-height: 48px;
  }
}
@media (max-width: 390px) {
  .portfolio-page .portfolio-intro h1 {
    font-size: clamp(31px, 8.4vw, 37px);
  }
  .portfolio-page .portfolio-card-body {
    padding: 19px;
  }
  .project-detail-page .case-header h1 {
    font-size: clamp(30px, 8vw, 36px);
  }
  .case-lightbox-inner {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    padding-inline: 3px;
  }
}

/* Project testimonials: prominent quote with restrained right-side portrait. */
.project-detail-page .case-testimonial-section {
  background: #121212;
  padding: clamp(48px, 6vw, 90px) 0;
}
.project-detail-page .case-testimonial-section .container {
  max-width: 1100px;
}
.project-detail-page .case-testimonial-card {
  position: relative;
  background: linear-gradient(135deg, #1e1e1e, #171717);
  border: 1px solid rgba(195, 245, 0, 0.2);
  border-radius: 23px;
  padding: clamp(22px, 3.5vw, 43px);
  overflow: hidden;
}
.project-detail-page .case-testimonial-index {
  display: block;
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  line-height: 1.5;
  margin: 0 0 clamp(18px, 3vw, 35px);
}
.project-detail-page .case-testimonial-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 250px);
  gap: clamp(20px, 3vw, 42px);
  align-items: center;
}
.project-detail-page .case-testimonial-text {
  min-width: 0;
}
.project-detail-page .case-testimonial-title {
  font:
    700 clamp(25px, 3.1vw, 39px) / 1.18 'Space Grotesk',
    Inter,
    sans-serif;
  letter-spacing: -0.045em;
  margin: 0 0 23px;
  color: var(--text);
}
.project-detail-page .case-testimonial-quote {
  border: 0;
  padding: 0;
  margin: 0;
  color: #e2e2e2;
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.9;
  white-space: pre-line;
  max-width: 64ch;
  font-style: normal;
  overflow-wrap: anywhere;
}
.project-detail-page .case-testimonial-figure {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 250px;
  justify-self: end;
}
.project-detail-page .case-testimonial-portrait {
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
  border: 1px solid rgba(195, 245, 0, 0.25);
  border-radius: 15px;
  background: #252525;
}
.project-detail-page .case-testimonial-portrait .case-image-button {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
  grid-column: auto;
  outline-offset: -3px;
}
.project-detail-page .case-testimonial-portrait .case-image-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 25%;
  transition: transform 0.35s ease;
}
.project-detail-page .case-testimonial-caption {
  min-height: 24px;
  margin: 11px 0 0;
  text-align: center;
  color: #adadad;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.03em;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.project-detail-page .case-testimonial-inline-author {
  display: block;
  margin-top: 20px;
  color: var(--lime);
  font-size: 12px;
  font-style: normal;
}
.project-detail-page .case-testimonial-extras {
  padding-top: 0;
}
@media (max-width: 800px) {
  .project-detail-page .case-testimonial-layout {
    grid-template-columns: minmax(0, 1fr) minmax(130px, 190px);
    gap: 20px;
  }
  .project-detail-page .case-testimonial-figure {
    max-width: 190px;
  }
}
@media (max-width: 610px) {
  .project-detail-page .case-testimonial-card {
    padding: 23px 19px;
    border-radius: 17px;
  }
  .project-detail-page .case-testimonial-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 25px;
  }
  .project-detail-page .case-testimonial-index {
    margin-bottom: 18px;
    font-size: 10px;
  }
  .project-detail-page .case-testimonial-title {
    margin-bottom: 14px;
    font-size: 27px;
  }
  .project-detail-page .case-testimonial-quote {
    font-size: 15px;
    line-height: 1.82;
  }
  .project-detail-page .case-testimonial-figure {
    align-self: flex-end;
    width: min(50%, 185px);
    max-width: 185px;
  }
  .project-detail-page .case-testimonial-portrait {
    border-radius: 12px;
  }
  .project-detail-page .case-testimonial-caption {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-detail-page .case-testimonial-portrait img {
    transition: none !important;
  }
}

/* Reliable fixed-ratio testimonial portrait. Aspect-ratio containers with %
   heights can collapse the nested gallery button on some browser engines. */
.project-detail-page .case-testimonial-portrait {
  position: relative;
  min-height: 0;
  aspect-ratio: 4/5;
  isolation: isolate;
}
.project-detail-page .case-testimonial-portrait > .case-image-button {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.project-detail-page .case-testimonial-portrait > .case-image-button > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: 50% 25%;
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Testimonial portrait final layout: an independent image column (not a gallery).
   Both SSR and JS hydration use this exact structure to avoid zero-width figures. */
.project-detail-page .case-testimonial-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: center;
  gap: clamp(20px, 3vw, 42px);
}
.project-detail-page .case-testimonial-text {
  min-width: 0;
}
.project-detail-page .case-testimonial-figure {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-self: end;
  width: 240px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
.project-detail-page .case-testimonial-portrait {
  display: block;
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 4/5;
  border: 1px solid rgba(195, 245, 0, 0.28);
  border-radius: 15px;
  background: #282828;
  overflow: hidden;
}
.project-detail-page .case-testimonial-portrait > .case-testimonial-photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: 50% 25%;
  border: 0;
  border-radius: 0;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: none;
}
.project-detail-page .case-testimonial-portrait > .case-testimonial-photo[hidden] {
  display: none !important;
}
.project-detail-page .case-testimonial-photo-error {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 220px;
  font-size: 12px;
  color: #bdbdbd;
  text-align: center;
  padding: 16px;
}
.project-detail-page .case-testimonial-photo-error[hidden] {
  display: none !important;
}
.project-detail-page .case-testimonial-caption {
  display: block;
  width: 100%;
  color: #dedede;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}
@media (max-width: 800px) {
  .project-detail-page .case-testimonial-layout {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 190px);
  }
  .project-detail-page .case-testimonial-figure {
    width: 190px;
  }
}
@media (max-width: 610px) {
  .project-detail-page .case-testimonial-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 25px;
  }
  .project-detail-page .case-testimonial-figure {
    width: min(55%, 185px);
    max-width: 185px;
    align-self: flex-end;
  }
  .project-detail-page .case-testimonial-caption {
    font-size: 11px;
  }
}

/* The quote is chapter 04 in the sticky editorial navigation, but retains
   its distinctive full-width testimonial card instead of a plain text chapter. */
.project-detail-page #case-testimonial {
  scroll-margin-top: clamp(90px, 12vh, 130px);
}
.project-detail-page .case-chapter-nav a[href='#case-testimonial'] {
  font-weight: 700;
}
@media (max-width: 610px) {
  .project-detail-page #case-testimonial {
    scroll-margin-top: 90px;
  }
}

/* Pages CMS - chapter-only image layout controls.
   No inherited framed image-card UI is used for inteira/grade2/grade3. */
.project-detail-page .case-gallery.case-chapter-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(12px, 2.5vw, 26px);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}
.project-detail-page .case-gallery.case-chapter-gallery[data-width='ampla'] {
  width: min(calc(100vw - 32px), 1400px);
  max-width: none;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.project-detail-page .case-gallery.case-chapter-gallery[data-width='tela'] {
  width: calc(100vw - 2 * clamp(12px, 3vw, 48px));
  max-width: none;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.project-detail-page .case-gallery.case-chapter-gallery[data-layout='grade2'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.project-detail-page .case-gallery.case-chapter-gallery[data-layout='grade3'] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
/* Reset the browser button/anchor and show the uploaded image at its full ratio. */
.project-detail-page .case-chapter-gallery .case-artwork-open {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 0;
  margin: 0;
  border: 0;
  outline-offset: 4px;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  background: transparent;
  appearance: none;
  cursor: zoom-in;
  text-decoration: none;
  color: inherit;
  line-height: 0;
}
.project-detail-page .case-chapter-gallery .case-artwork-open img {
  display: block;
  position: static;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: none;
  transform: none;
  transition: none;
}
.project-detail-page .case-chapter-gallery .case-artwork-open:hover img {
  transform: none;
  filter: none;
}
.project-detail-page .case-chapter-gallery .case-artwork-open:focus-visible {
  outline: 3px solid var(--lime);
}
/* Cards are the only chapter option that deliberately crops the photos. */
.project-detail-page .case-gallery.case-chapter-gallery[data-layout='cards'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.project-detail-page .case-gallery.case-chapter-gallery[data-layout='cards'] .case-image-button,
.project-detail-page
  .case-gallery.case-chapter-gallery[data-layout='cards']
  .case-image-button:first-child {
  grid-column: auto;
  aspect-ratio: 4/3;
}
@media (max-width: 760px) {
  .project-detail-page .case-gallery.case-chapter-gallery[data-layout='grade3'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 610px) {
  .project-detail-page .case-gallery.case-chapter-gallery[data-layout='grade2'],
  .project-detail-page .case-gallery.case-chapter-gallery[data-layout='grade3'],
  .project-detail-page .case-gallery.case-chapter-gallery[data-layout='cards'] {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Main project gallery — default for every existing and future CMS project.
   Show each artwork whole, at its own aspect ratio, without card framing.
   Scoped to the MAIN gallery so optional chapter "cards" and testimonials
   keep their separately editable presentation. */
.project-detail-page #case-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 3vw, 32px);
  width: 100%;
  min-width: 0;
}
.project-detail-page #case-gallery .case-artwork-open {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  aspect-ratio: auto;
  overflow: visible;
  cursor: zoom-in;
  line-height: 0;
  appearance: none;
  text-decoration: none;
  color: inherit;
}
.project-detail-page #case-gallery .case-artwork-open img {
  position: static;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  filter: none;
  transition: none;
}
.project-detail-page #case-gallery .case-artwork-open:hover img {
  transform: none;
  filter: none;
}
.project-detail-page #case-gallery .case-artwork-open:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 4px;
}
@media (max-width: 610px) {
  .project-detail-page #case-gallery {
    gap: clamp(12px, 4vw, 22px);
  }
}

/* Main gallery layout is independently editable per project in Pages CMS.
   Additional chapters and testimonial styles are not affected. */
.project-detail-page #case-gallery[data-width='ampla'] {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 32px), 1400px);
  max-width: none;
}
.project-detail-page #case-gallery[data-width='tela'] {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100vw - 2 * clamp(12px, 3vw, 48px));
  max-width: none;
}
.project-detail-page #case-gallery[data-layout='grade2'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.project-detail-page #case-gallery[data-layout='grade3'] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
/* Cards is the ONLY main gallery mode allowed to crop the artwork. */
.project-detail-page #case-gallery[data-layout='cards'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.project-detail-page #case-gallery[data-layout='cards'] .case-image-button,
.project-detail-page #case-gallery[data-layout='cards'] .case-image-button:first-child,
.project-detail-page #case-gallery[data-layout='cards'] .case-image-button:only-child {
  display: block;
  grid-column: auto;
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #202020;
  box-shadow: none;
  overflow: hidden;
  position: relative;
}
.project-detail-page #case-gallery[data-layout='cards'] .case-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 760px) {
  .project-detail-page #case-gallery[data-layout='grade3'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 610px) {
  .project-detail-page #case-gallery[data-layout='grade2'],
  .project-detail-page #case-gallery[data-layout='grade3'],
  .project-detail-page #case-gallery[data-layout='cards'] {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-detail-page #case-gallery[data-layout='cards'] .case-image-button,
  .project-detail-page #case-gallery[data-layout='cards'] .case-image-button:first-child {
    aspect-ratio: 4/3;
  }
}
