* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
  color: #111111;
  font-family: Arial, Helvetica, sans-serif;
}

/* ---- Band of links (same on every page) ---- */

.band {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: #111111;
  font-size: 15px;
}

.band a,
.band .soon {
  margin: 0;
  padding: 16px 18px;
  border: 0;
  border-left: 1px solid #444444;
  background: none;
  color: #ffffff;
  font: inherit;
  text-decoration: none;
  transition: background 0.25s, color 0.25s;
}

.band .home {
  border-left: 0;
  font-weight: bold;
}

.band a:hover {
  background: #ffffff;
  color: #111111;
}

.band .current {
  background: #3a3a3a;
}

.band .soon {
  cursor: default;
}

/* Cells whose text swaps on hover: "Home page" and "Coming soon" */

.band .swap {
  display: inline-grid;
}

.band .swap span {
  grid-area: 1 / 1;
  text-align: center;
  transition: opacity 0.25s;
}

.band .swap .msg {
  opacity: 0;
  font-style: italic;
}

.band .swap:hover,
.band .swap:focus-visible,
.band .swap.show {
  background: #ffffff;
  color: #111111;
}

.band .swap:hover .label,
.band .swap:focus-visible .label,
.band .swap.show .label {
  opacity: 0;
}

.band .swap:hover .msg,
.band .swap:focus-visible .msg,
.band .swap.show .msg {
  opacity: 1;
}

/* ---- Home page: the torn-page clip ---- */

.home-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.clip {
  display: block;
  width: min(640px, calc(100vw - 32px), calc(100vh - 140px));
  width: min(640px, calc(100vw - 32px), calc(100dvh - 140px));
  height: auto;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  cursor: pointer;
}

/* Newer browsers: fit the clip exactly to the space left under the band */
@supports (width: 1cqw) {
  .page-home {
    height: 100vh;
    height: 100dvh;
  }

  .home-page {
    container-type: size;
    min-height: 200px;
  }

  .clip {
    width: min(640px, 100cqw, 100cqh);
  }
}

/* ---- Song page ---- */

/* Narrow screens (phones, upright tablets): words, then video, then buttons */

.song-page {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.words {
  max-width: 640px;
  text-align: center;
}

.words h1 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.2;
}

.words p {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.45;
  color: #222222;
}

.words p:last-child {
  margin-bottom: 0;
}

.song {
  display: block;
  width: min(100%, 888px, calc((100vh - 24px) * 1.337));
  width: min(100%, 888px, calc((100dvh - 24px) * 1.337));
  height: auto;
  aspect-ratio: 888 / 664;
  background: #000000;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 20px;
}

.actions button {
  padding: 11px 18px;
  border: 0;
  background: #111111;
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.actions button:hover {
  background: #444444;
}

.actions a {
  color: #444444;
  font-size: 14px;
}

/* Wide screens (PC, Mac, tablet held sideways): words on the left, video on the right */

@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .song-page {
    grid-template-columns: 300px auto;
    grid-template-areas:
      "words   video"
      "actions video";
    justify-content: center;
    justify-items: start;
    align-content: center;
    column-gap: 40px;
    row-gap: 22px;
    padding: 24px;
  }

  .words {
    grid-area: words;
    align-self: end;
    text-align: left;
  }

  .actions {
    grid-area: actions;
    align-self: start;
    flex-direction: column;
    align-items: flex-start;
  }

  .song {
    grid-area: video;
    align-self: center;
    width: min(888px, calc(100vw - 388px), calc((100vh - 150px) * 1.337));
    width: min(888px, calc(100vw - 388px), calc((100dvh - 150px) * 1.337));
  }

  /* Newer browsers: fit the video exactly to the space left under the band */
  @supports (width: 1cqw) {
    .page-song {
      height: 100vh;
      height: 100dvh;
    }

    .song-page {
      container-type: size;
      min-height: 340px;
    }

    .song {
      width: min(888px, calc(100cqw - 340px), calc(100cqh * 1.337));
    }
  }
}

/* ---- Case study page ---- */

/* Narrow screens (phones, upright tablets): words first, then the clip */

.case-page {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  gap: 18px;
  padding: 16px;
}

.case-words {
  max-width: 640px;
  text-align: center;
}

.case-words h1 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.25;
}

.case-words p {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: #444444;
}

.case-clip {
  display: block;
  width: min(100%, 1024px, calc(100vh - 24px));
  width: min(100%, 1024px, calc(100dvh - 24px));
  height: auto;
  aspect-ratio: 1 / 1;
  background: #ffffff;
}

/* Wide screens (PC, Mac, tablet held sideways): words on the left, clip on the right */

@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .case-page {
    grid-template-columns: 320px auto;
    justify-content: center;
    align-items: center;
    align-content: center;
    column-gap: 48px;
    padding: 24px;
  }

  .case-words {
    text-align: left;
  }

  .case-words h1 {
    font-size: 34px;
  }

  .case-clip {
    width: min(1024px, calc(100vw - 416px), calc(100vh - 110px));
    width: min(1024px, calc(100vw - 416px), calc(100dvh - 110px));
  }
}

/* ---- Introduction page ---- */

/* Narrow screens (phones, upright tablets): words first, then the book */

.intro-page {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  gap: 22px;
  padding: 20px 16px 28px;
}

.intro-words {
  max-width: 560px;
}

.intro-words p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.5;
  color: #222222;
}

.intro-words p:last-child {
  margin-bottom: 0;
}

.lyric {
  margin: 0 0 20px;
  padding: 2px 0 2px 16px;
  border-left: 4px solid #111111;
}

.intro-words .lyric p {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.4;
  font-style: italic;
  color: #111111;
}

.lyric footer {
  font-size: 15px;
  color: #444444;
}

.lyric a {
  color: #111111;
}

.book {
  position: relative;
  width: min(100%, 520px);
  margin: 0;
  container-type: inline-size;
}

.book img {
  display: block;
  width: 100%;
  height: auto;
}

/* The words sit on the blank right-hand page of the drawing */

.book-words {
  position: absolute;
  left: 53%;
  top: 24%;
  width: 32%;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  text-align: center;
  font-size: 15px;
  font-size: 3.6cqw;
  line-height: 1.25;
  color: #111111;
}

.book-words strong {
  font-size: 1.25em;
}

.book-words span {
  font-style: italic;
  color: #444444;
}

/* Wide screens (PC, Mac, tablet held sideways): words on the left, book on the right */

@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .intro-page {
    grid-template-columns: minmax(0, 520px) minmax(0, 520px);
    justify-content: center;
    align-items: center;
    align-content: center;
    column-gap: 48px;
    padding: 28px 24px;
  }

  .book {
    width: 100%;
  }
}
