/* Shared editorial grid. Each section sets spans within the same page margins. */
:root {
  --studio-grid: repeat(var(--studio-columns), minmax(0, 1fr));
  --studio-rule-gap: clamp(18px, 2.5vw, 38px);
  --studio-measure: 1640px;
}

main > .section:not(.measure) {
  padding-block: var(--studio-section-space);
  padding-inline: max(var(--studio-edge), calc((100% - var(--studio-measure)) / 2));
}

.intro,
.section > .heading,
.services,
.approach,
.explore-grid,
.contact,
.footer-brand-row,
.footer-bottom,
.site-footer .footer-main,
.site-footer .footer-meta,
.project-case-intro,
.project-story,
.project-gallery-grid,
.prose section {
  display: grid;
  grid-template-columns: var(--studio-grid);
  column-gap: var(--studio-grid-gap);
}

.section h2 {
  margin: 0;
  font-family: var(--studio-sans);
  font-size: var(--type-section);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.055em;
  text-wrap: balance;
}

html[lang="zh-CN"] .section h2 {
  line-height: 1.2;
  letter-spacing: 0;
}

.section h3 {
  font-family: var(--studio-sans);
  font-size: var(--type-subheading);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.022em;
}

.section > .eyebrow {
  margin: 0 0 clamp(18px, 2.8vw, 42px);
}

.section .eyebrow,
.service-image-note,
.approach .photo-label,
.concept-info span,
.project-tile-tags,
.project-gallery-grid figcaption {
  font-size: var(--type-meta);
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.45;
}

.section p {
  font-size: var(--type-body);
  line-height: 1.65;
}

.section > .heading {
  align-items: end;
  margin-bottom: clamp(34px, 5vw, 80px);
  row-gap: var(--studio-rule-gap);
}

.section > .heading h2 {
  grid-column: 1 / span 8;
}

.section > .heading p {
  grid-column: 10 / -1;
  max-inline-size: 34ch;
  margin: 0;
  color: var(--studio-muted);
  text-wrap: pretty;
}

/* Keep the existing cinematic scene positions and transitions. */
.cinema-intro h1,
.cinema-panel h2,
.slider-heading h2 {
  font-family: var(--studio-sans);
  font-weight: 500;
  line-height: .99;
  letter-spacing: -.06em;
  text-wrap: balance;
}

.cinema-intro h1,
html[lang="zh-CN"] .cinema-intro h1 {
  max-inline-size: 17ch;
  margin: clamp(18px, 3vw, 44px) auto 0;
  font-size: var(--type-display);
}

.cinema-intro h1 span {
  white-space: normal;
}

.cinema-intro h1 span + span,
html[lang="zh-CN"] .cinema-intro h1 span + span {
  margin-top: .18em;
  font-size: .79em;
}

.cinema-panel h2 {
  max-inline-size: 21ch;
  margin: clamp(18px, 3vw, 42px) auto 0;
  font-size: clamp(1.95rem, 5.35vw, 5.9rem);
}

html[lang="zh-CN"] :is(.cinema-intro h1, .cinema-panel h2, .slider-heading h2) {
  line-height: 1.18;
  letter-spacing: -.025em;
}

html[lang="zh-CN"] .cinema-intro h1,
html[lang="zh-CN"] .cinema-panel h2 {
  max-inline-size: 15em;
}

.cinema-panel p,
.hero-subtitle {
  max-inline-size: min(100%, 57ch);
  margin: clamp(16px, 2.35vw, 34px) auto 0;
  font-size: clamp(.9rem, 1.35vw, 1.2rem);
  line-height: 1.56;
  text-wrap: balance;
}

.cinema-intro .eyebrow,
.cinema-panel .eyebrow,
.slider-heading .eyebrow {
  font-size: var(--type-meta);
  font-weight: 600;
  letter-spacing: .16em;
}

.slider-heading {
  padding-inline: var(--studio-edge);
}

.slider-heading h2 {
  margin-top: .4em;
  font-size: clamp(2.05rem, 4.6vw, 4.65rem);
}

.cinema-footer {
  inset-inline: var(--studio-edge);
}

html:not(.cinema-ready) .cinema-intro {
  opacity: 1;
  transform: none;
}

/* About has a wide title and two independently readable text columns. */
.intro {
  align-items: start;
  row-gap: var(--studio-rule-gap);
}

.intro > .eyebrow {
  grid-column: 1 / span 2;
  margin-top: .45em;
}

.intro > .reveal {
  grid-column: 3 / -1;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  column-gap: var(--studio-grid-gap);
  row-gap: clamp(24px, 4vw, 66px);
}

.intro h2 {
  grid-column: 1 / -1;
  max-inline-size: 22ch;
}

html[lang="zh-CN"] .intro h2 {
  max-inline-size: 20ch;
}

.intro p {
  grid-column: 1 / span 4;
  margin: 0;
}

.intro p + p {
  grid-column: 6 / span 5;
}

.intro .textlink {
  grid-column: 1 / -1;
  justify-self: start;
}

/* The existing five service tabs and one media panel use the same grid. */
.services {
  align-items: start;
  row-gap: var(--studio-rule-gap);
}

#service-tabs {
  grid-column: 1 / span 4;
  top: var(--studio-header-height, 82px);
}

.service-view {
  grid-column: 6 / -1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-radius: 0;
}

.service-view img {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  opacity: 1;
}

.service-caption {
  position: static;
  padding: clamp(21px, 3vw, 42px);
  min-height: 0;
}

.service-caption h3 {
  margin: 0 0 .45em;
}

.service-caption p {
  color: var(--studio-on-dark-muted);
}

.service-button .name {
  min-width: 0;
  font-size: clamp(.98rem, 1.6vw, 1.28rem);
  overflow-wrap: break-word;
}

/* Align the existing process photo and disclosure list to separate spans. */
.approach {
  align-items: stretch;
  row-gap: clamp(30px, 6vw, 78px);
}

.approach-photo {
  grid-column: 1 / span 6;
  height: auto;
  min-height: clamp(460px, 49vw, 720px);
}

.approach-photo img {
  object-position: 44% center;
}

.approach-photo .photo-label {
  bottom: var(--studio-rule-gap);
  left: var(--studio-rule-gap);
  max-inline-size: calc(100% - 2 * var(--studio-rule-gap));
}

.approach > div:last-child {
  grid-column: 8 / -1;
  align-self: center;
  padding: clamp(25px, 3vw, 44px) 0;
  min-width: 0;
}

.approach h2 {
  font-size: clamp(2.35rem, 4.35vw, 4.65rem);
  text-wrap: initial;
}

.approach .eyebrow {
  margin-bottom: 22px;
}

.approach h2 + p {
  margin: 20px 0 clamp(27px, 4vw, 48px);
  max-inline-size: 38ch;
  text-wrap: pretty;
}

.approach details {
  padding-block: 16px;
}

.approach details p {
  margin: 12px 0 6px;
  font-size: .98em;
}

.approach summary {
  min-height: 32px;
  align-items: center;
}

/* Keep the atlas and its reserved text slots intact. */
#portfolio .heading {
  margin-bottom: clamp(28px, 4vw, 58px);
}

#portfolio .heading h2 {
  grid-column: 1 / span 7;
}

#portfolio .heading p {
  grid-column: 9 / -1;
  max-inline-size: 45ch;
}

/* The two existing Media items use complementary frame ratios and spans. */
.explore-grid {
  align-items: start;
  row-gap: clamp(35px, 7vw, 80px);
}

.concept:first-child {
  grid-column: 1 / span 7;
}

.concept:nth-child(2) {
  grid-column: 9 / -1;
  margin-top: clamp(54px, 10vw, 160px);
}

.concept img,
.concept:nth-child(2) img {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

.concept:nth-child(2) img {
  aspect-ratio: 4 / 5;
  object-position: 56% center;
}

.concept-info {
  align-items: start;
  flex-wrap: wrap;
  padding-block: 15px;
}

.concept-info span {
  color: var(--studio-muted);
}

#media .note {
  max-inline-size: 58ch;
  margin-block: 24px 0;
  font-size: var(--type-meta);
  color: var(--studio-muted);
}

/* Leave the online enquiry controls and feedback in their existing order. */
.contact {
  align-items: start;
  row-gap: clamp(32px, 6vw, 72px);
}

.contact > div:first-child {
  grid-column: 1 / span 6;
}

.contact h2 {
  font-size: clamp(2.6rem, 5.5vw, 6rem);
}

.contact h2 + p {
  max-inline-size: 43ch;
  margin-block: 24px 0;
  text-wrap: pretty;
}

.contact form {
  grid-column: 8 / -1;
  align-self: start;
  min-width: 0;
  margin: 0;
  padding-top: 0;
}

/* Use both original footer markups within the shared gutters. */
footer {
  padding-inline: var(--studio-edge);
}

.footer-brand-row,
.footer-bottom,
.site-footer .footer-main,
.site-footer .footer-meta {
  max-inline-size: var(--studio-measure);
  margin-inline: auto;
  row-gap: 20px;
}

.footer-brand-row .footer-brand {
  grid-column: 1 / span 9;
  justify-self: start;
  min-width: 0;
}

.footer-brand-row > .textlink {
  grid-column: 10 / -1;
  justify-self: end;
}

.footer-logo {
  width: clamp(60px, 12.5vw, 194px);
}

.footer-wordmark {
  font-family: var(--studio-sans);
  font-size: clamp(1.35rem, 4.6vw, 4.8rem);
}

.footer-bottom > :first-child,
.site-footer .footer-meta > :first-child {
  grid-column: 1 / span 7;
}

.footer-bottom > :last-child,
.site-footer .footer-meta > :last-child {
  grid-column: 9 / -1;
  justify-self: end;
}

.site-footer .measure {
  width: 100%;
}

.site-footer .footer-main > div {
  grid-column: 1 / span 5;
}

.site-footer .footer-main nav {
  grid-column: 6 / span 5;
  grid-row: auto;
  justify-content: start;
}

.site-footer .footer-main > .line-link {
  grid-column: 11 / -1;
  justify-self: end;
}

/* Case routes retain their original full image proportions and sequence. */
.measure.project-case,
.measure.prose {
  width: min(calc(100% - 2 * var(--studio-edge)), var(--studio-measure));
  max-width: none;
}

.project-case {
  padding-block: clamp(45px, 7vw, 108px) var(--studio-section-space);
}

.project-case h1,
.prose h1 {
  margin-block: 0;
  font-family: var(--studio-sans);
  font-size: var(--type-display);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.06em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

html[lang="zh-CN"] :is(.project-case h1, .prose h1) {
  line-height: 1.2;
  letter-spacing: 0;
}

.project-case-intro {
  align-items: end;
  row-gap: 24px;
  margin-block: clamp(28px, 6vw, 88px) clamp(24px, 4vw, 56px);
}

.project-case-intro > div {
  grid-column: 1 / span 8;
  min-width: 0;
}

.project-case-intro .project-case-summary {
  grid-column: 9 / -1;
  margin: 0 0 .16em;
  max-inline-size: 37ch;
  color: var(--studio-muted);
}

.project-case-intro .project-tile-tags {
  margin-bottom: 16px;
  font-size: var(--type-meta);
}

.project-story {
  row-gap: clamp(27px, 4vw, 64px);
}

.project-story section {
  grid-column: span 4;
  padding-top: 17px;
}

.project-story h2,
.prose section h2 {
  margin-bottom: .48em;
  font-size: var(--type-subheading);
  letter-spacing: -.025em;
  line-height: 1.2;
  text-wrap: initial;
}

.project-story p,
.prose section p {
  max-inline-size: 58ch;
  color: var(--studio-muted);
}

.project-gallery > h2 {
  margin-bottom: clamp(20px, 3.3vw, 48px);
  font-size: clamp(1.95rem, 4vw, 4rem);
}

.project-gallery-grid {
  row-gap: clamp(24px, 4vw, 52px);
}

.project-gallery-grid figure {
  grid-column: span 6;
  min-width: 0;
}

.project-gallery-grid figcaption {
  max-inline-size: 62ch;
  margin-top: 12px;
  color: var(--studio-muted);
  letter-spacing: .045em;
}

.prose {
  padding-block: clamp(54px, 8vw, 118px) var(--studio-section-space);
}

.prose h1 {
  max-inline-size: 16ch;
  margin-bottom: clamp(32px, 6vw, 88px);
}

.prose section {
  max-width: none;
  margin-top: var(--studio-rule-gap);
  padding-top: var(--studio-rule-gap);
  border-top: 1px solid var(--studio-line);
}

.prose section h2 {
  grid-column: 1 / span 3;
}

.prose section p {
  grid-column: 5 / span 7;
  margin: 0;
  overflow-wrap: break-word;
}

@media (max-width: 1150px) {
  .section > .heading h2 { grid-column: 1 / span 5; }
  .section > .heading p { grid-column: 6 / -1; }
  .intro > .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
  .intro > .reveal { grid-column: 1 / -1; grid-template-columns: var(--studio-grid); }
  .intro p { grid-column: 1 / span 4; }
  .intro p + p { grid-column: 5 / -1; }
  #service-tabs { grid-column: 1 / span 3; }
  .service-view { grid-column: 4 / -1; }
  .approach-photo { grid-column: 1 / span 4; }
  .approach > div:last-child { grid-column: 5 / -1; }
  #portfolio .heading h2 { grid-column: 1 / span 4; }
  #portfolio .heading p { grid-column: 5 / -1; }
  .concept:first-child { grid-column: 1 / span 4; }
  .concept:nth-child(2) { grid-column: 6 / -1; }
  .contact > div:first-child { grid-column: 1 / span 4; }
  .contact form { grid-column: 5 / -1; }
  .footer-brand-row .footer-brand { grid-column: 1 / span 5; }
  .footer-brand-row > .textlink { grid-column: 6 / -1; }
  .footer-bottom > :first-child, .site-footer .footer-meta > :first-child { grid-column: 1 / span 4; }
  .footer-bottom > :last-child, .site-footer .footer-meta > :last-child { grid-column: 5 / -1; }
  .site-footer .footer-main > div { grid-column: 1 / span 6; }
  .site-footer .footer-main nav { grid-column: 1 / -1; grid-row: 2; }
  .site-footer .footer-main > .line-link { grid-column: 7 / -1; grid-row: 1; }
  .project-case-intro > div { grid-column: 1 / span 5; }
  .project-case-intro .project-case-summary { grid-column: 6 / -1; }
  .project-gallery-grid figure { grid-column: span 4; }
  .prose section h2 { grid-column: 1 / span 2; }
  .prose section p { grid-column: 3 / -1; }
}

@media (max-width: 760px) {
  .section > .heading h2, .section > .heading p, #portfolio .heading h2, #portfolio .heading p,
  .intro p, .intro p + p, #service-tabs, .service-view, .approach-photo, .approach > div:last-child,
  .contact > div:first-child, .contact form,
  .footer-brand-row .footer-brand, .footer-brand-row > .textlink,
  .site-footer .footer-main > div, .site-footer .footer-main nav, .site-footer .footer-main > .line-link,
  .project-case-intro > div, .project-case-intro .project-case-summary, .prose section h2, .prose section p {
    grid-column: 1 / -1;
  }

  .intro h2 { max-inline-size: 15ch; }
  .intro p { max-inline-size: 54ch; }
  .approach .eyebrow { margin-bottom: 16px; }
  .cinema-intro h1, html[lang="zh-CN"] .cinema-intro h1 { font-size: clamp(2.25rem, 8.6vw, 4.8rem); }
  .cinema-intro h1 { max-inline-size: 17ch; }
  .cinema-panel h2 { font-size: clamp(1.85rem, 7.25vw, 3.9rem); }
  .slider-heading h2 { font-size: clamp(1.9rem, 6.6vw, 3.1rem); }
  .service-view img { aspect-ratio: 16 / 11; }
  .service-caption { padding: 20px; }
  .approach-photo { min-height: 0; aspect-ratio: 4 / 3; }
  .approach > div:last-child { padding: 0; }
  .approach h2 { font-size: var(--type-section); }
  .concept:first-child { grid-column: 1 / -1; }
  .concept:nth-child(2) { grid-column: 2 / -1; margin-top: 0; }
  .concept:nth-child(2) img { aspect-ratio: 5 / 4; }
  .concept-info { padding-block: 12px; }
  .footer-brand-row > .textlink, .site-footer .footer-main > .line-link { justify-self: start; }
  .footer-wordmark { font-size: clamp(1.33rem, 6vw, 2.6rem); }
  .footer-bottom > :first-child, .site-footer .footer-meta > :first-child { grid-column: 1 / span 2; }
  .footer-bottom > :last-child, .site-footer .footer-meta > :last-child { grid-column: 3 / -1; }
  .site-footer .footer-main nav { grid-row: auto; }
  .site-footer .footer-main > .line-link { grid-row: auto; }
}

@media (max-width: 540px) {
  .project-case h1, .prose h1 { font-size: clamp(2.35rem, 11.5vw, 4rem); }
  .project-story section, .project-gallery-grid figure { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .cinema-intro h1 { font-size: 2rem; }
  .cinema-panel h2 { font-size: 1.73rem; }
  .concept:nth-child(2),
  .footer-bottom > :is(:first-child, :last-child),
  .site-footer .footer-meta > :is(:first-child, :last-child) { grid-column: 1 / -1; }
  .footer-bottom > span:last-child,
  .site-footer .footer-meta > :last-child { text-align: start; justify-self: start; }
  .service-button { gap: 12px; }
}

@media (max-height: 650px) and (min-width: 761px) {
  .cinema-intro h1, html[lang="zh-CN"] .cinema-intro h1,
  .cinema-panel h2 { font-size: min(12vh, 6vw); }
  .slider-heading h2 { font-size: min(7vh, 4.6vw); }
}

@media (prefers-reduced-motion: reduce) {
  .cinema-intro, .cinema-panel, .cinema-slider { padding-inline: var(--studio-edge); }
}
