/* Page-only launch cleanup for the Serene Flow case study. */
:root {
  --serene-cream: #efddbd;
}

/* The hero image uses its natural ratio within the page's max-width grid. */
.hero {
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  line-height: 0;
  background: transparent;
}

.hero img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  object-fit: initial;
  object-position: left top;
}

.intro,
.intro::before {
  background: #fff !important;
}

.intro {
  border: 0 !important;
}

/* Match the project intro scale, weight, and colour used on ChopChop. */
.intro .meta {
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .08em;
  color: #6b6861;
}

.intro .meta strong {
  font-weight: 700;
  color: #252522;
}

.intro .copy h1 {
  max-width: 720px;
  margin: 0 0 12px;
  font-size: clamp(24px, 2.35vw, 34px);
  line-height: 1.24;
  font-weight: 500;
  letter-spacing: -.035em;
}

.intro .copy p:last-child {
  max-width: 760px;
  margin: 0;
  color: #5e5b56;
  font-size: 13px;
  line-height: 1.7;
}

/* The website mockup stays centered and still; sections 02 onward use reveal motion. */
.centered .laptop {
  display: flex;
  justify-content: center;
  margin-inline: auto;
}

.centered .laptop img {
  width: 100%;
  transform: translate3d(var(--arc-x, 0px), 0, 0) rotateY(var(--arc-yaw, 0deg));
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform;
}

/* Section 01 uses the deep green and sand palette. */
#section-01.centered {
  background: #003d3b;
  color: var(--sand);
  padding-top: clamp(34px, 5vw, 64px);
  padding-bottom: clamp(24px, 4vw, 56px);
}

#section-01 p,
#section-01 .eyebrow {
  color: var(--sand);
}

#section-01 > p:not(.eyebrow) {
  margin-bottom: 22px;
}

#section-01 .laptop {
  width: min(50%, 1050px);
}

/* Text panels share one quiet cream treatment. */
#section-02.chapter,
#section-03 .chapter {
  align-items: stretch;
}

#section-02.chapter {
  padding: 0;
  margin: 0;
  gap: 0;
  background: #fff;
}

.sections-02-03,
#section-03.palette-row {
  background: #fff;
}

#section-03.palette-row {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
  background: #fff !important;
}

#section-03 .chapter {
  padding: 0;
  margin: 0;
  gap: 0;
}

#section-02 .chapter-copy,
#section-03 .chapter-copy,
.process-table {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: none;
  padding: clamp(22px, 3vw, 44px);
  background: var(--serene-cream);
}

#section-02 .chapter-copy p:last-child,
#section-03 .chapter-copy p:last-child {
  margin-bottom: 0;
}

#section-02 .chapter-copy,
#section-03 .chapter-copy {
  height: clamp(280px, 32vw, 440px);
}

@media (min-width: 761px) {
  #section-02.chapter,
  #section-03 .chapter {
    height: clamp(280px, 32vw, 440px);
  }

  #section-02 .chapter-image,
  #section-03 .chapter-image {
    height: 100%;
    min-height: 0;
  }
}

#section-02 .chapter-copy p:last-child,
#section-03 .chapter-copy p:last-child,
.process-table .process-copy {
  line-height: 1.55;
}

/* Sections 06 and 07 become one continuous teal image area. */
.serene-image-panel {
  background: var(--teal);
  color: var(--sand);
}

.full-page {
  color: var(--sand);
}

.full-page .wrap {
  text-align: center;
}

.full-page img {
  display: block;
  width: min(100%, 780px);
  margin-inline: auto;
}

.mobile-section:not(.serene-image-panel) .wrap {
  text-align: center;
}

.mobile-section.project-bleed:not(.serene-image-panel) > .wrap {
  padding-top: 40px;
  padding-bottom: 40px;
  text-align: center;
}

.mobile-image-frame {
  margin: 0;
}

.mobile-section.serene-image-panel {
  padding: 0;
}

.mobile-section.serene-image-panel .wrap {
  padding-bottom: 0;
}

.applications.serene-image-panel {
  padding: 0;
  background: #003131;
}

.applications.serene-image-panel .applications-grid {
  column-gap: 14px;
  row-gap: 42px;
  background: #003131;
}

.applications.serene-image-panel .applications-grid figure {
  background: transparent;
}

.applications.serene-image-panel .applications-grid figure:not(.wide) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(22px, 3vw, 42px);
}

.applications.serene-image-panel .applications-grid figure:not(.wide) img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Section 08: the two process images sit together to the left of the text panel. */
.sketches {
  padding: clamp(58px, 7vw, 96px) 0;
  background: linear-gradient(90deg, var(--sand) 0 42%, #fff 42% 100%);
}

.process-layout {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  align-items: stretch;
  gap: clamp(20px, 4vw, 56px);
}

.process-table {
  order: 0;
}

.process-layout .sketch-grid {
  order: 1;
}

.process-layout .sketch-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  max-width: none;
  margin: 0;
  padding: clamp(14px, 2vw, 28px);
  background: #fff;
}

.process-layout .sketch-grid img {
  height: auto;
  max-height: 560px;
  object-fit: contain;
}

.process-table .section-heading {
  margin-bottom: 16px;
}

.process-table .process-copy {
  margin: 0;
}

/* White page close, matching the other project pages. */
.serene-thanks,
.footer {
  background: #fff;
}

.serene-thanks {
  padding: clamp(48px, 7vw, 88px) var(--gutter) 18px;
  text-align: left;
}

.serene-thanks h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -.04em;
}

/* Content remains visible without JavaScript. JS opts into the reveal state. */
.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

.sereneflow-reveal-ready .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms ease-out, transform 700ms ease-out;
}

.sereneflow-reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 700ms ease-out, transform 700ms ease-out;
}

.sereneflow-reveal-ready .full-page img.reveal:not(.is-visible),
.sereneflow-reveal-ready .full-page img.reveal.is-visible {
  transition-duration: 400ms;
}

@media (max-width: 760px) {
  .hero {
    width: 100%;
  }

  .hero img {
    width: 100%;
  }

  .intro {
    position: relative;
    z-index: 2;
    width: auto;
    margin: 0;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 34px 0 38px;
    background: #fff;
  }

  .intro::before {
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
  }

  .intro .meta {
    display: block;
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: .08em;
  }

  .intro .copy h1 {
    font-size: 26px;
    line-height: 1.25;
  }

  #section-02.chapter {
    padding-top: 0;
  }

  #section-02 .chapter-copy,
  #section-03 .chapter-copy,
  .process-table {
    padding: 20px 12px;
  }

  #section-02 .chapter-copy,
  #section-03 .chapter-copy {
    height: auto;
  }

  .process-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sketches {
    background: #fff;
  }

  .process-table {
    order: 0;
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    background: #fff;
  }

  .process-layout .sketch-grid {
    order: 1;
    max-width: none;
    padding: 0;
  }

  .process-layout .sketch-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  .process-layout .sketch-grid img {
    max-height: none;
  }

  .applications.serene-image-panel .applications-grid {
    column-gap: 7px;
    row-gap: 21px;
  }

  .applications.serene-image-panel .applications-grid figure:not(.wide) {
    padding-block: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .centered .laptop img {
    transform: none !important;
    will-change: auto;
  }

  .sereneflow-reveal-ready .reveal,
  .sereneflow-reveal-ready .reveal:not(.is-visible),
  .sereneflow-reveal-ready .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
