/* Waterfall Festival project page. Black, white and cyan only: all other color comes from the work. */

.waterfall-page {
  --case-accent: #00ddee;
  --case-bg-deep: #000;
  --ink: #fff;
  --paper: #000;
  --gutter: clamp(16px, 3vw, 56px);
  background: #000;
  color: #fff;
  overflow-x: clip;
}

.wf-main {
  transition: opacity .45s ease, transform .55s cubic-bezier(.2, .8, .2, 1);
}

.waterfall-page.is-closing .wf-main {
  opacity: 0;
  transform: scale(.985);
}

.waterfall-page.is-closing .case-study-close {
  opacity: 0;
}

.wf-section {
  padding: clamp(72px, 10vw, 150px) var(--gutter) 0;
}

.wf-kicker {
  color: #00ddee;
  display: block;
  font-size: clamp(11px, .9vw, 13px);
  margin-bottom: clamp(10px, 1.4vw, 18px);
  text-transform: uppercase;
}

.waterfall-page h2 {
  font-size: clamp(28px, 4.6vw, 76px);
  font-weight: 700;
  line-height: 1.04;
  margin: 0;
}

.waterfall-page p {
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 300;
  line-height: 1.55;
  margin: 0;
}

.waterfall-page figure {
  margin: 0;
}

.waterfall-page figure img {
  display: block;
  height: auto;
  width: 100%;
}

.waterfall-page figcaption {
  font-size: clamp(11px, .85vw, 13px);
  font-weight: 600;
  margin-top: 10px;
}

.waterfall-page figcaption span {
  display: block;
  font-weight: 300;
  margin-top: 2px;
}

.wf-kit-head {
  margin-bottom: clamp(28px, 4vw, 64px);
  max-width: 980px;
}

.wf-kit-head p {
  margin-top: 1em;
  max-width: 62ch;
}

/* ---- Hero ---- */

.wf-hero {
  background: #000;
  height: 100dvh;
  min-height: 480px;
  overflow: hidden;
  position: relative;
}

.wf-hero-art,
.wf-hero-canvas {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: 50% 30%;
  position: absolute;
  width: 100%;
}

.wf-hero::after {
  background: linear-gradient(to bottom, transparent 45%, #000);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.wf-hero-copy {
  bottom: clamp(16px, 3dvh, 36px);
  left: var(--gutter);
  pointer-events: none;
  position: absolute;
  right: var(--gutter);
  z-index: 1;
}

.wf-hero-copy .wf-kicker {
  color: #fff;
}

.wf-hero h1 {
  font-size: clamp(38px, 11.4vw, 220px);
  font-weight: 800;
  line-height: .92;
  margin: 0;
}

.wf-hero h1 span {
  display: block;
  font-weight: 200;
}

/* ---- Intro ---- */

.wf-intro {
  display: grid;
  gap: clamp(28px, 4vw, 64px) clamp(32px, 6vw, 110px);
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.wf-intro-copy {
  display: grid;
  gap: 1em;
  max-width: 60ch;
}

.wf-scope {
  border-top: 1px solid #fff;
  display: grid;
  gap: 0 clamp(16px, 2vw, 32px);
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 16px 0 0;
}

.wf-scope strong {
  display: block;
  font-size: clamp(15px, 1.5vw, 24px);
  font-weight: 600;
  margin-bottom: 6px;
}

.wf-scope span {
  display: block;
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 300;
  line-height: 1.45;
}

/* ---- The line: a mock Instagram grid ---- */

.wf-line {
  align-items: start;
  display: grid;
  gap: clamp(32px, 5vw, 90px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr);
}

.wf-line .wf-kit-head {
  margin-bottom: 0;
  position: sticky;
  top: clamp(24px, 12dvh, 120px);
}

.wf-nights {
  display: grid;
  gap: clamp(20px, 2.4vw, 40px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.wf-night {
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wf-night > img {
  aspect-ratio: 3 / 4;
  display: block;
  height: auto;
  object-fit: cover;
  transition: opacity .3s ease;
  width: 100%;
}

/* The center post. Its media is always a full 9:16, clipped to the grid's 3:4 at rest.
   Opening it removes the clip and grows it; waterfall.js sets --grow and --shift to fit the screen. */
.wf-tile {
  appearance: none;
  aspect-ratio: 3 / 4;
  background: none;
  border: 0;
  cursor: pointer;
  display: block;
  min-width: 0;
  outline: none;
  padding: 0;
  position: relative;
  transition: z-index 0s .4s;
  width: 100%;
  z-index: 1;
}

.wf-tile-media {
  --grow: 1;
  --shift: 0px;
  aspect-ratio: 9 / 16;
  background: #000;
  clip-path: inset(12.5% 0);
  display: block;
  left: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%) translateY(var(--shift)) scale(var(--grow));
  transition: clip-path .4s cubic-bezier(.2, .8, .2, 1), transform .4s cubic-bezier(.2, .8, .2, 1), opacity .3s ease;
  width: 100%;
}

.wf-tile-media img,
.wf-tile-media video {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.wf-tile-media video {
  opacity: 0;
  transition: opacity .25s ease;
}

.wf-tile.is-playing video {
  opacity: 1;
}

/* The reel mark Instagram puts on a video post. */
.wf-tile:has(video) .wf-tile-media::after {
  border-bottom: 6px solid transparent;
  border-left: 10px solid #fff;
  border-top: 6px solid transparent;
  content: "";
  position: absolute;
  right: 10px;
  top: calc(12.5% + 10px);
  transition: opacity .2s ease;
}

.wf-tile.is-open .wf-tile-media::after {
  opacity: 0;
}

/* With a mouse only the post itself reacts. The grown reel would otherwise
   sit over the next rows and stop their posts from opening. */
@media (hover: hover) {
  .wf-tile-media {
    pointer-events: none;
  }
}

.wf-tile.is-open {
  transition-delay: 0s;
  z-index: 5;
}

.wf-tile.is-open .wf-tile-media {
  clip-path: inset(0);
}

.wf-tile:focus-visible .wf-tile-media {
  outline: 1px solid #00ddee;
  outline-offset: -1px;
}

/* Sits inside the post's own rectangle: on a mouse, the reel that grows past it
   doesn't take the pointer, so a button out there couldn't be reached. */
.wf-tile-sound {
  align-items: center;
  background: #00ddee;
  border-radius: 999px;
  bottom: 12px;
  color: #000;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  left: 50%;
  line-height: 1;
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity .2s ease;
  white-space: nowrap;
  z-index: 2;
}

.wf-tile-sound svg {
  display: block;
  height: 16px;
  width: 16px;
}

.wf-tile.is-open .wf-tile-sound {
  opacity: 1;
  pointer-events: auto;
}

.wf-nights:has(.is-open) .wf-night > img,
.wf-nights:has(.is-open) .wf-tile:not(.is-open) .wf-tile-media {
  opacity: .25;
}

.waterfall-page .wf-nights p {
  font-size: clamp(12px, 1vw, 15px);
  margin-top: 10px;
}

.wf-nights strong {
  font-weight: 700;
  margin-right: .5em;
}

/* ---- How the images are made ---- */

.wf-steps {
  border-top: 1px solid #fff;
  display: grid;
  gap: clamp(16px, 2vw, 32px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0 0 clamp(24px, 3vw, 48px);
  padding: 16px 0 0;
}

.wf-steps span {
  color: #00ddee;
  display: block;
  font-size: clamp(11px, .9vw, 13px);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.wf-steps strong {
  display: block;
  font-size: clamp(16px, 1.7vw, 28px);
  font-weight: 600;
  margin-bottom: 6px;
}

.waterfall-page .wf-steps p {
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.45;
  max-width: 38ch;
}

.wf-layers {
  display: grid;
  gap: clamp(20px, 2.4vw, 40px) clamp(12px, 2vw, 32px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wf-layer-set {
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.waterfall-page .wf-layer-set img {
  aspect-ratio: 2 / 3;
  height: auto;
  object-fit: cover;
  width: 100%;
}

/* ---- Social ---- */

/* A sample of the formats, not a gallery: the width follows the screen height, so the
   whole mosaic and its heading fit on one screen. */
.wf-package {
  display: grid;
  gap: 28px;
  max-width: min(100%, 130vh);
}

.wf-package-row {
  align-items: flex-start;
  display: flex;
  gap: 20px;
}

.wf-package-group {
  display: contents;
}

.wf-package figure {
  flex: var(--ar) 1 0;
  margin: 0;
  min-width: 0;
}

.waterfall-page .wf-package img {
  aspect-ratio: var(--ar);
  display: block;
  height: auto;
  width: 100%;
}

.wf-package figcaption {
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  margin-top: 8px;
}

/* ---- Print, out on the island ---- */

.wf-field {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.waterfall-page .wf-field img {
  aspect-ratio: 3 / 4;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

/* ---- Close ---- */

.wf-final {
  padding-bottom: clamp(56px, 8vw, 110px);
}

.wf-final h2 {
  font-size: clamp(24px, 3.4vw, 52px);
  max-width: none;
}

.wf-button {
  background: #00ddee;
  border-radius: 999px;
  color: #000;
  display: inline-block;
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 600;
  margin-top: clamp(24px, 3vw, 44px);
  padding: 16px 28px;
  text-decoration: none;
  transition: background .2s ease;
}

.wf-button:hover,
.wf-button:focus-visible {
  background: #fff;
}

.wf-more {
  color: #fff;
  display: block;
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 300;
  margin-top: 24px;
  width: fit-content;
}

.wf-more:hover,
.wf-more:focus-visible {
  color: #00ddee;
}

/* ---- Phones and portrait tablets ---- */

@media (max-width: 820px) {
  .wf-hero h1 {
    font-size: clamp(38px, 14.6vw, 120px);
  }

  .wf-intro {
    grid-template-columns: minmax(0, 1fr);
  }

  .wf-scope {
    grid-template-columns: minmax(0, 1fr);
  }

  .wf-scope li {
    border-bottom: 1px solid #fff;
    padding: 14px 0;
  }

  .wf-scope li:first-child {
    padding-top: 0;
  }

  .wf-line {
    display: block;
  }

  .wf-line .wf-kit-head {
    margin-bottom: 32px;
    position: static;
  }

  /* Edge to edge, the way the grid sits on a phone. */
  .wf-nights {
    margin-inline: calc(var(--gutter) * -1);
  }

  .waterfall-page .wf-nights p {
    padding-inline: var(--gutter);
  }

  .wf-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .wf-layers {
    grid-template-columns: minmax(0, 1fr);
  }

  .wf-package-row {
    display: grid;
    gap: 20px;
  }

  .wf-package-group {
    align-items: flex-start;
    display: flex;
    gap: 10px;
  }

  .wf-package figcaption {
    font-size: 10px;
  }

  .wf-field {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .wf-hero-canvas {
    display: none;
  }

  .wf-tile,
  .wf-tile-media {
    transition: none;
  }
}
