/*
 * Cache-safe layout corrections for the Photo-to-3D case study.
 * The proportions follow the responsive rules already proven on the Hermes case study.
 */

:root {
  --max: 1240px;
}

.hero {
  padding-top: clamp(72px, 7vw, 96px);
}

.hero-grid {
  grid-template-columns: minmax(470px, 0.9fr) minmax(540px, 1.1fr);
  gap: clamp(36px, 4.5vw, 64px);
}

.hero-copy,
.hero-media,
.qa-copy,
.qa-media {
  min-width: 0;
}

h1 {
  max-width: 660px;
  font-size: clamp(3.5rem, 5.2vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}

.hero-media img {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

.section {
  padding: clamp(76px, 7vw, 104px) 0;
}

.section-heading {
  max-width: 900px;
  margin-bottom: clamp(36px, 4vw, 48px);
}

.section-heading.compact {
  max-width: 780px;
}

.section-heading h2,
.skill-grid h2,
.qa-copy h2,
.closing h2 {
  font-size: clamp(2.5rem, 3.7vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}

.input-grid img {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

.pipeline article {
  min-height: 220px;
}

.pipeline h3 {
  margin-top: 48px;
}

.skill-section {
  padding-top: clamp(84px, 8vw, 112px);
  padding-bottom: clamp(84px, 8vw, 112px);
}

.skill-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(400px, 0.95fr);
  gap: clamp(48px, 7vw, 88px);
}

.demo-heading {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: clamp(36px, 5vw, 64px);
}

.qa-grid {
  grid-template-columns: minmax(460px, 0.9fr) minmax(560px, 1.1fr);
  gap: clamp(44px, 5vw, 68px);
}

.qa-copy h2 {
  font-size: clamp(2.5rem, 3.3vw, 3.65rem);
}

.qa-media img {
  height: auto;
  object-fit: contain;
}

.limit-grid article {
  min-height: 210px;
}

.limit-grid h3 {
  margin-top: 40px;
}

html[lang="zh-Hant"] h1 {
  font-size: clamp(3.25rem, 4.7vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

html[lang="zh-Hant"] .section-heading h2,
html[lang="zh-Hant"] .skill-grid h2,
html[lang="zh-Hant"] .qa-copy h2,
html[lang="zh-Hant"] .closing h2 {
  font-size: clamp(2.4rem, 3.35vw, 3.6rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
}

@media (max-width: 1120px) {
  .hero-grid,
  .skill-grid,
  .qa-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .skill-grid > div:first-child,
  .qa-copy {
    max-width: 780px;
  }

  .hero-media,
  .qa-media {
    max-width: 860px;
  }

  .qa-copy {
    position: static;
  }

  .pipeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .pipeline article {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .pipeline article:nth-child(2n) {
    border-right: 0;
  }

  .pipeline article:last-child {
    grid-column: 1 / -1;
    min-height: 180px;
    border-right: 0;
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: clamp(2.8rem, 12vw, 4rem);
    line-height: 0.98;
  }

  html[lang="zh-Hant"] h1 {
    font-size: clamp(2.65rem, 11vw, 3.6rem);
    line-height: 1.12;
  }

  .section-heading h2,
  .skill-grid h2,
  .qa-copy h2,
  .closing h2,
  html[lang="zh-Hant"] .section-heading h2,
  html[lang="zh-Hant"] .skill-grid h2,
  html[lang="zh-Hant"] .qa-copy h2,
  html[lang="zh-Hant"] .closing h2 {
    font-size: clamp(2.15rem, 9vw, 3rem);
  }

  .section {
    padding: 70px 0;
  }

  .input-grid {
    gap: 14px;
  }

  .pipeline {
    grid-template-columns: 1fr;
  }

  .pipeline article,
  .pipeline article:nth-child(2n),
  .pipeline article:last-child {
    grid-column: auto;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pipeline article:last-child {
    border-bottom: 0;
  }

  .pipeline h3 {
    margin-top: 32px;
  }

  .skill-section {
    padding-top: 70px;
    padding-bottom: 70px;
  }

  .demo-heading {
    grid-template-columns: 1fr;
  }
}
