/* FORUM+ case study. The layout (sidebar, slides, grid) is shared: case.css and
   case.js. This file holds each slide's backdrop (.stage) and the pieces on it:
   images cut from 2x exports of the Figma file and Kevin's original animations. */

:root {
  /* the site's palette, from its Color check page */
  --sage: #dce1c8;
  --cream: #ebe1d2;
  --yellow: #f0cd64;
  --sky: #7daad7;
  --orange: #f09150;
  --navy: #142d78;
  --pad: clamp(20px, 5vw, 64px);
}

img,
video {
  -webkit-user-drag: none;
}

/* ── Stages ─────────────────────────────────────────────── */

.stage {
  position: relative;
  overflow: hidden;
  padding: var(--pad);
}

.stage-sage { background: var(--sage); }
.stage-black { background: #030003; } /* the export's own black, so the cuts blend in */
.stage-cream { background: var(--cream); }
.stage-yellow { background: var(--yellow); }
.stage-blue { background: var(--sky); }
.stage-orange { background: var(--orange); }
.stage-navy { background: var(--navy); }

/* ── Screens hanging off the bottom edge ────────────────── */

.shot > .stage.hero {
  justify-content: flex-end;
  padding-bottom: 0;
  perspective: 1400px;
}

.hero-screen {
  width: 88%;
  margin: 0 auto;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(40, 50, 20, 0.28), 0 6px 18px rgba(40, 50, 20, 0.14);
  transform-origin: 50% 0;
}

/* the homepage: the screen keeps the slide's height (the top 1920 × 1350 of the
   page); the whole page in it (down to 2560, with its shadow) runs on below the
   slide's edge and rises into view as the page scrolls */
.home-screen {
  aspect-ratio: 1920 / 1350;
  min-height: 0; /* or the ratio box grows to fit the taller page */
  overflow: visible;
  border-radius: 0;
  box-shadow: none;
}

.home-page {
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(40, 50, 20, 0.28), 0 6px 18px rgba(40, 50, 20, 0.14);
  will-change: transform;
}

.hero-screen img,
.hero-screen video {
  display: block;
  width: 100%;
  height: auto;
}

#article .hero-screen {
  box-shadow: 0 30px 90px rgba(80, 55, 20, 0.26), 0 6px 18px rgba(80, 55, 20, 0.14);
}

#pages .hero-screen {
  box-shadow: 0 30px 90px rgba(10, 40, 90, 0.3), 0 6px 18px rgba(10, 40, 90, 0.16);
}

.hero-screen video { aspect-ratio: 1580 / 1000; }
#pages .hero-screen video { aspect-ratio: 1580 / 1120; }

/* ── Wordmark and tagline ───────────────────────────────── */

#tags {
  align-items: center;
  padding-block: clamp(70px, 12vw, 170px);
}

/* the wordmark, and the tagline's two lines as masks over it, in one cell; each
   line takes its colour from --c (the script picks a new pair) */
.tags {
  display: grid;
  width: min(100%, 880px);
}

.tags > * {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
}

.tag-line {
  background: var(--c);
  -webkit-mask: var(--mask) 0 0 / 100% 100% no-repeat;
  mask: var(--mask) 0 0 / 100% 100% no-repeat;
}

/* ── Covers ─────────────────────────────────────────────── */

.shelf {
  padding-inline: 0;
  padding-block: clamp(56px, 8vw, 100px);
}

.shelf-row {
  --h: clamp(200px, 19vw, 280px); /* cover height */
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  width: max-content;
  will-change: transform;
}

.shelf-row + .shelf-row {
  margin-top: clamp(18px, 2.4vw, 34px);
}

/* Shadows are baked into the images, with room around the cover: 0.1 of its
   height above, 0.2 at the sides and 0.32 below, taken back here. */
.shelf-row img {
  height: calc(var(--h) * 1.42);
  width: auto;
  margin: calc(var(--h) * -0.1) calc(var(--h) * -0.2) calc(var(--h) * -0.32);
}

/* ── Mobile menu and panel, side by side ────────────────── */

.shot-square {
  width: 100%;
  aspect-ratio: 1 / 1;
}

#mobile,
#panel {
  align-items: center;
}

.phone {
  display: block;
  width: 50%; /* of the padded stage: about 88% of the slide's height */
  height: auto;
  aspect-ratio: 750 / 1624;
  border-radius: clamp(8px, 1.1vw, 14px);
  box-shadow: 0 30px 70px rgba(120, 50, 0, 0.32), 0 6px 16px rgba(120, 50, 0, 0.18);
}

.panel {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1600 / 1084;
  border-radius: 5px;
  box-shadow: 0 30px 70px rgba(0, 0, 20, 0.45), 0 6px 16px rgba(0, 0, 20, 0.3);
}

/* ── Small screens ──────────────────────────────────────── */

@media (max-width: 699px) {
  .hero-screen { width: 94%; }
  .shelf-row { --h: 190px; }
}
