.scroll-grid-section {
  background: transparent;
  color: #fff;
  overflow: clip;
}

.scroll-grid-section-header {
  min-height: 35vh;
  display: grid;
  align-content: center;
  max-width: calc(100% - 4rem);
  text-align: left;
  margin: 0 auto;
  justify-content: center;
}

.scroll-grid-section-header a {
  color: white;
}

.scroll-grid-section-fluid {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.5rem, 10vw, 10rem);
  font-weight: 600;
  line-height: 1;
  margin: 0;
  color: var(--cashmere);
}

.scroll-grid-section-header h1.scroll-grid-section-fluid {
  font-size: clamp(0.5rem, 2vw, 1.5rem);
  padding-top: 48px;
}

.scroll-grid-section .main-section {
  min-height: 240vh; /* Extra height for scroll space */
}

.scroll-grid-section .content {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  place-items: center;
  align-content: center;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.scroll-grid-section .grid-container {
  --offset: 0;
  --container-width: 1600px;
  --gap: clamp(10px, 7.35vw, 80px);

  width: var(--container-width);
  max-width: calc(100% - 4rem);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: var(--gap);
  margin: 0 auto;
  align-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}

@media (max-width: 600px) {
  .scroll-grid-section-header {
    text-align: center;
    max-width: 100%;
    padding: 0 1.5rem;
  }

  .scroll-grid-section-fluid {
    line-height: 1.1;
  }

  .scroll-grid-section .grid-container {
    grid-template-columns: repeat(3, 1fr);
    --offset: -1;
    max-width: calc(100% - 2rem);
  }
  
  .scroll-grid-section .grid-container > .layer:nth-of-type(1) {
    display: none;
  }
}

/* Layers using subgrid */
.scroll-grid-section .grid-container > .layer {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
}

/* Layer 1: Outer edges - odd on left column, even on right column */
.scroll-grid-section .grid-container > .layer:nth-of-type(1) div:nth-of-type(odd) {
  grid-column: 1;
}

.scroll-grid-section .grid-container > .layer:nth-of-type(1) div:nth-of-type(even) {
  grid-column: -2;
}

/* Layer 2: Inner columns */
.scroll-grid-section .grid-container > .layer:nth-of-type(2) div:nth-of-type(odd) {
  grid-column: calc(2 + var(--offset));
}

.scroll-grid-section .grid-container > .layer:nth-of-type(2) div:nth-of-type(even) {
  grid-column: calc(-3 - var(--offset));
}

/* Layer 3: Center column top and bottom */
.scroll-grid-section .grid-container > .layer:nth-of-type(3) div:first-of-type {
  grid-column: calc(3 + var(--offset));
  grid-row: 1;
}

.scroll-grid-section .grid-container > .layer:nth-of-type(3) div:last-of-type {
  grid-column: calc(3 + var(--offset));
  grid-row: -1;
}

.scroll-grid-section .grid-container img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 1rem;
}

.scroll-grid-section .grid-container .scaler {
  position: relative;
  grid-area: 2 / calc(3 + var(--offset));
}

.scroll-grid-section .scaler {
  z-index: 2;
  width: 100%;
  height: 100%;
  position: relative;
}

.scroll-grid-section .scaler img {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  object-fit: cover;
  border-radius: 1rem;
  width: 100%;
  height: 100%;
  max-width: none;
}
