/* Step 1: Basic Grid Setup - No animations yet */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --gutter: 2rem;
}

@media (max-width: 600px) {
  :root {
    --gutter: 1rem;
  }
}

body {
  margin: 0;
  font-family: 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', Helvetica, Arial, sans-serif, system-ui;
  background: #000;
  color: #fff;
}

.content-wrap {
  background: #000;
  overflow: clip;
}

/* Header */
header {
  min-height: 100vh;
  display: grid;
  align-content: center;
  max-width: calc(100% - (2 * var(--gutter)));
  padding-left: 48px;
  text-align: left;
}

h2 {
  padding-top: 12px;
}

a {
  color:white;
}

.fluid {
  font-size: clamp(4rem, 12vw, 12rem);
  line-height: 0.6;
  margin: 0;
}

h2.fluid {
  font-size: clamp(0.5rem, 2vw, 1.5rem);
  padding-top: 48px;
}

/* Section setup - Sticky spacer trick */
main section:first-of-type {
  min-height: 240vh; /* Extra height for scroll space */
}

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

main section:last-of-type {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

/* Grid Layout - 5 columns x 3 rows */
.grid {
  --offset: 0;
  --container-width: 1600px;
  --gap: clamp(10px, 7.35vw, 80px);

  width: var(--container-width);
  max-width: calc(100% - (2 * var(--gutter)));
  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) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
    --offset: -1;
  }
  
  .grid > .layer:nth-of-type(1) {
    display: none;
  }
}

/* Layers using subgrid */
.grid > .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 */
.grid > .layer:nth-of-type(1) div:nth-of-type(odd) {
  grid-column: 1;
}

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

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

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

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

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

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

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

.scaler {
  z-index: 2;
  width: 100%;
  height: 100%;
  position: relative;

  img {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    object-fit: cover;
    border-radius: 1rem;
    width: 100%;
    height: 100%;
  }
}